@uniformdev/cli 20.50.2-alpha.149 → 20.50.2-alpha.180
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/dist/{chunk-7P2U2VCH.mjs → chunk-YUQPI3H4.mjs} +42 -56
- package/dist/defaultConfig.mjs +1 -1
- package/dist/index.mjs +720 -903
- package/package.json +30 -30
package/dist/index.mjs
CHANGED
|
@@ -4,13 +4,11 @@ import {
|
|
|
4
4
|
__require,
|
|
5
5
|
applyDefaultSyncConfiguration,
|
|
6
6
|
emitWithFormat,
|
|
7
|
-
exitOnCliError,
|
|
8
7
|
getDirectoryOrFilename,
|
|
9
8
|
getEntityBatchSize,
|
|
10
9
|
getEntityOption,
|
|
11
10
|
isPaginatedSyncEntity,
|
|
12
11
|
isPathAPackageFile,
|
|
13
|
-
maskApiKey,
|
|
14
12
|
nodeFetchProxy,
|
|
15
13
|
package_default,
|
|
16
14
|
paginateAsync,
|
|
@@ -23,11 +21,11 @@ import {
|
|
|
23
21
|
withFormatOptions,
|
|
24
22
|
withProjectOptions,
|
|
25
23
|
withTeamOptions
|
|
26
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-YUQPI3H4.mjs";
|
|
27
25
|
|
|
28
26
|
// src/index.ts
|
|
29
27
|
import * as dotenv from "dotenv";
|
|
30
|
-
import
|
|
28
|
+
import yargs42 from "yargs";
|
|
31
29
|
import { hideBin } from "yargs/helpers";
|
|
32
30
|
|
|
33
31
|
// src/commands/ai/index.ts
|
|
@@ -144,7 +142,7 @@ var getLimitsSchema = z.object({
|
|
|
144
142
|
})
|
|
145
143
|
});
|
|
146
144
|
var createClient = (baseUrl, authToken) => {
|
|
147
|
-
const
|
|
145
|
+
const request2 = async (path8, opts, allowedNon2xxStatusCodes = []) => {
|
|
148
146
|
const res = await fetch(makeUrl(baseUrl, path8), {
|
|
149
147
|
...opts,
|
|
150
148
|
headers: { Authorization: `Bearer ${authToken}`, "User-Agent": CLI_USER_AGENT }
|
|
@@ -158,7 +156,7 @@ var createClient = (baseUrl, authToken) => {
|
|
|
158
156
|
}
|
|
159
157
|
};
|
|
160
158
|
const requestJson = async (path8, opts, schema, allowedNon2xxStatusCodes = []) => {
|
|
161
|
-
const res = await
|
|
159
|
+
const res = await request2(path8, opts, allowedNon2xxStatusCodes);
|
|
162
160
|
const data = await res.json();
|
|
163
161
|
const parseResult = schema.safeParse(data);
|
|
164
162
|
if (parseResult.success) {
|
|
@@ -262,7 +260,7 @@ var createClient = (baseUrl, authToken) => {
|
|
|
262
260
|
},
|
|
263
261
|
installIntegration: async ({ projectId, type }) => {
|
|
264
262
|
try {
|
|
265
|
-
await
|
|
263
|
+
await request2("/api/v1/integration-installations", {
|
|
266
264
|
method: "PUT",
|
|
267
265
|
body: JSON.stringify({ projectId, type })
|
|
268
266
|
});
|
|
@@ -497,7 +495,7 @@ var makeSpinner = () => {
|
|
|
497
495
|
const spin = async (text) => {
|
|
498
496
|
const spinner = ora(text).start();
|
|
499
497
|
spinners.push(spinner);
|
|
500
|
-
const minWait = new Promise((
|
|
498
|
+
const minWait = new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
501
499
|
return async () => {
|
|
502
500
|
await minWait;
|
|
503
501
|
spinner.stop();
|
|
@@ -630,6 +628,9 @@ export default uniformConfig({
|
|
|
630
628
|
`;
|
|
631
629
|
|
|
632
630
|
// src/sync/fileSyncEngineDataSource.ts
|
|
631
|
+
function isErrorWithCode(error, code) {
|
|
632
|
+
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
633
|
+
}
|
|
633
634
|
async function createFileSyncEngineDataSource({
|
|
634
635
|
directory,
|
|
635
636
|
format = "yaml",
|
|
@@ -690,7 +691,7 @@ ${e?.message}`));
|
|
|
690
691
|
}
|
|
691
692
|
await unlink(providerId);
|
|
692
693
|
},
|
|
693
|
-
writeObject: async (object4) => {
|
|
694
|
+
writeObject: async (object4, existingObject) => {
|
|
694
695
|
const filename = selectFilename3 ? join(directory, `${selectFilename3(object4.object)}.${format}`) : getFullFilename(object4.id);
|
|
695
696
|
let contents = object4.object;
|
|
696
697
|
if (selectSchemaUrl2) {
|
|
@@ -703,6 +704,18 @@ ${e?.message}`));
|
|
|
703
704
|
console.log(`Writing file ${filename}`);
|
|
704
705
|
}
|
|
705
706
|
emitWithFormat(contents, format, filename);
|
|
707
|
+
if (existingObject?.providerId && existingObject.providerId !== filename) {
|
|
708
|
+
if (verbose) {
|
|
709
|
+
console.log(`Deleting file ${existingObject.providerId}`);
|
|
710
|
+
}
|
|
711
|
+
try {
|
|
712
|
+
await unlink(existingObject.providerId);
|
|
713
|
+
} catch (error) {
|
|
714
|
+
if (!isErrorWithCode(error, "ENOENT")) {
|
|
715
|
+
throw error;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
706
719
|
}
|
|
707
720
|
};
|
|
708
721
|
}
|
|
@@ -726,6 +739,7 @@ function writeUniformPackage(filename, packageContents) {
|
|
|
726
739
|
// src/sync/syncEngine.ts
|
|
727
740
|
import { diffJson, diffLines } from "diff";
|
|
728
741
|
import mitt from "mitt";
|
|
742
|
+
import PQueue from "p-queue";
|
|
729
743
|
|
|
730
744
|
// src/sync/serializedDequal.ts
|
|
731
745
|
var has = Object.prototype.hasOwnProperty;
|
|
@@ -792,7 +806,8 @@ async function syncEngine({
|
|
|
792
806
|
onBeforeProcessObject,
|
|
793
807
|
onBeforeCompareObjects,
|
|
794
808
|
onBeforeWriteObject,
|
|
795
|
-
onError
|
|
809
|
+
onError,
|
|
810
|
+
actionConcurrency
|
|
796
811
|
//verbose = false,
|
|
797
812
|
}) {
|
|
798
813
|
const status = new ReactiveStatusUpdate((status2) => syncEngineEvents.emit("statusUpdate", status2));
|
|
@@ -841,43 +856,46 @@ async function syncEngine({
|
|
|
841
856
|
const ids = Array.isArray(sourceObject.id) ? sourceObject.id : [sourceObject.id];
|
|
842
857
|
const targetObject = targetItems.get(ids[0]);
|
|
843
858
|
status.compared++;
|
|
844
|
-
const invalidTargetObjects = ids.map((i) => targetItems.get(i)).filter(
|
|
859
|
+
const invalidTargetObjects = ids.map((i) => targetItems.get(i)).filter(
|
|
860
|
+
(invalidTargetObject) => typeof invalidTargetObject !== "undefined" && invalidTargetObject.object !== targetObject?.object
|
|
861
|
+
);
|
|
862
|
+
const targetIds = Array.isArray(targetObject?.id) ? targetObject.id : [targetObject?.id];
|
|
863
|
+
const processedIds = new Set([...ids, ...targetIds].filter((id) => typeof id === "string"));
|
|
864
|
+
const processUpdate = async (sourceObject2, targetObject2) => {
|
|
865
|
+
try {
|
|
866
|
+
if (!whatIf) {
|
|
867
|
+
const finalSourceObject = onBeforeWriteObject ? await onBeforeWriteObject(sourceObject2, targetObject2) : sourceObject2;
|
|
868
|
+
await target.writeObject(finalSourceObject, targetObject2);
|
|
869
|
+
status.changesApplied++;
|
|
870
|
+
}
|
|
871
|
+
} catch (e) {
|
|
872
|
+
if (onError) {
|
|
873
|
+
onError(e, sourceObject2);
|
|
874
|
+
} else {
|
|
875
|
+
throw new SyncEngineError(e, sourceObject2);
|
|
876
|
+
}
|
|
877
|
+
} finally {
|
|
878
|
+
log2({
|
|
879
|
+
action: "update",
|
|
880
|
+
id: ids[0],
|
|
881
|
+
providerId: sourceObject2.providerId,
|
|
882
|
+
displayName: sourceObject2.displayName ?? sourceObject2.providerId,
|
|
883
|
+
whatIf,
|
|
884
|
+
diff: () => diffJson(targetObject2.object, sourceObject2.object)
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
};
|
|
845
888
|
if (targetObject && invalidTargetObjects.length === 0) {
|
|
846
889
|
sourceObject = onBeforeCompareObjects ? await onBeforeCompareObjects(sourceObject, targetObject) : sourceObject;
|
|
847
890
|
const compareResult = compareContents(sourceObject, targetObject);
|
|
848
891
|
if (!compareResult) {
|
|
849
892
|
if (mode === "createOrUpdate" || mode === "mirror") {
|
|
850
893
|
status.changeCount++;
|
|
851
|
-
|
|
852
|
-
try {
|
|
853
|
-
if (!whatIf) {
|
|
854
|
-
const finalSourceObject = onBeforeWriteObject ? await onBeforeWriteObject(sourceObject2, targetObject2) : sourceObject2;
|
|
855
|
-
await target.writeObject(finalSourceObject, targetObject2);
|
|
856
|
-
status.changesApplied++;
|
|
857
|
-
}
|
|
858
|
-
} catch (e) {
|
|
859
|
-
if (onError) {
|
|
860
|
-
onError(e, sourceObject2);
|
|
861
|
-
} else {
|
|
862
|
-
throw new SyncEngineError(e, sourceObject2);
|
|
863
|
-
}
|
|
864
|
-
} finally {
|
|
865
|
-
log2({
|
|
866
|
-
action: "update",
|
|
867
|
-
id: ids[0],
|
|
868
|
-
providerId: sourceObject2.providerId,
|
|
869
|
-
displayName: sourceObject2.displayName ?? sourceObject2.providerId,
|
|
870
|
-
whatIf,
|
|
871
|
-
diff: () => diffJson(targetObject2.object, sourceObject2.object)
|
|
872
|
-
});
|
|
873
|
-
}
|
|
874
|
-
};
|
|
875
|
-
actions.push(() => process2(sourceObject, targetObject));
|
|
894
|
+
actions.push(() => processUpdate(sourceObject, targetObject));
|
|
876
895
|
}
|
|
877
896
|
}
|
|
878
|
-
|
|
897
|
+
processedIds.forEach((i) => targetItems.delete(i));
|
|
879
898
|
} else {
|
|
880
|
-
status.changeCount++;
|
|
881
899
|
const processUpsert = async (sourceObject2, id) => {
|
|
882
900
|
try {
|
|
883
901
|
if (!whatIf) {
|
|
@@ -903,38 +921,73 @@ async function syncEngine({
|
|
|
903
921
|
}
|
|
904
922
|
};
|
|
905
923
|
if (invalidTargetObjects.length > 0) {
|
|
924
|
+
if (mode === "createOrUpdate" && !targetObject && invalidTargetObjects.length === 1) {
|
|
925
|
+
const matchedTargetObject = invalidTargetObjects[0];
|
|
926
|
+
sourceObject = onBeforeCompareObjects ? await onBeforeCompareObjects(sourceObject, matchedTargetObject) : sourceObject;
|
|
927
|
+
const compareResult = compareContents(sourceObject, matchedTargetObject);
|
|
928
|
+
if (!compareResult) {
|
|
929
|
+
status.changeCount++;
|
|
930
|
+
actions.push(() => processUpdate(sourceObject, matchedTargetObject));
|
|
931
|
+
}
|
|
932
|
+
(Array.isArray(matchedTargetObject.id) ? matchedTargetObject.id : [matchedTargetObject.id]).forEach(
|
|
933
|
+
(i) => targetItems.delete(i)
|
|
934
|
+
);
|
|
935
|
+
continue;
|
|
936
|
+
}
|
|
937
|
+
if (mode !== "mirror") {
|
|
938
|
+
continue;
|
|
939
|
+
}
|
|
940
|
+
status.changeCount++;
|
|
906
941
|
[...invalidTargetObjects, targetObject].forEach((o) => {
|
|
907
942
|
(Array.isArray(o?.id) ? o?.id : [o?.id])?.forEach((i) => i && targetItems.delete(i));
|
|
908
943
|
});
|
|
909
|
-
const deletes = invalidTargetObjects.
|
|
944
|
+
const deletes = invalidTargetObjects.map(
|
|
945
|
+
(invalidTargetObject) => () => processDelete(invalidTargetObject)
|
|
946
|
+
);
|
|
910
947
|
if (targetObject) {
|
|
911
948
|
deletes.push(() => processDelete(targetObject));
|
|
912
949
|
}
|
|
913
|
-
actions.push(
|
|
914
|
-
(
|
|
915
|
-
|
|
950
|
+
actions.push(async () => {
|
|
951
|
+
for (const deleteFn of deletes) {
|
|
952
|
+
await deleteFn();
|
|
953
|
+
}
|
|
954
|
+
await processUpsert(sourceObject, ids[0]);
|
|
955
|
+
});
|
|
916
956
|
} else {
|
|
957
|
+
status.changeCount++;
|
|
917
958
|
actions.push(() => processUpsert(sourceObject, ids[0]));
|
|
918
959
|
}
|
|
919
960
|
}
|
|
920
961
|
}
|
|
921
|
-
|
|
922
|
-
status.compared += targetItems.size;
|
|
962
|
+
const orphanTargetObjects = new Set(targetItems.values());
|
|
923
963
|
if (mode === "mirror") {
|
|
924
|
-
|
|
964
|
+
status.changeCount += orphanTargetObjects.size;
|
|
965
|
+
status.compared += orphanTargetObjects.size;
|
|
966
|
+
if (!sourceHasItems && !allowEmptySource && orphanTargetObjects.size > 0) {
|
|
925
967
|
throw new Error(
|
|
926
968
|
`Sync source (${source.name}) is empty and mode is mirror. This would cause deletion of everything in the target (${target.name}), and most likely indicates an error in source definition.`
|
|
927
969
|
);
|
|
928
970
|
}
|
|
929
971
|
const deletes = [];
|
|
930
|
-
|
|
972
|
+
orphanTargetObjects.forEach((object4) => {
|
|
931
973
|
deletes.push(() => processDelete(object4));
|
|
932
974
|
});
|
|
933
|
-
await
|
|
975
|
+
await runSyncActions(deletes, actionConcurrency);
|
|
934
976
|
}
|
|
935
|
-
await
|
|
977
|
+
await runSyncActions(actions, actionConcurrency);
|
|
936
978
|
await Promise.all([source.onSyncComplete?.(false), target.onSyncComplete?.(true)]);
|
|
937
979
|
}
|
|
980
|
+
var runSyncActions = async (actions, actionConcurrency) => {
|
|
981
|
+
if (actions.length === 0) {
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
if (typeof actionConcurrency === "undefined") {
|
|
985
|
+
await Promise.all(actions.map((action) => action()));
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
|
+
const queue = new PQueue({ concurrency: actionConcurrency });
|
|
989
|
+
await queue.addAll(actions);
|
|
990
|
+
};
|
|
938
991
|
var SyncEngineError = class _SyncEngineError extends Error {
|
|
939
992
|
constructor(innerError, sourceObject) {
|
|
940
993
|
super(
|
|
@@ -1050,69 +1103,36 @@ async function chooseTeam(user, prompt, telemetry) {
|
|
|
1050
1103
|
|
|
1051
1104
|
// src/auth/user-info.ts
|
|
1052
1105
|
import { ProjectClient } from "@uniformdev/canvas";
|
|
1106
|
+
import { gql, request } from "graphql-request";
|
|
1053
1107
|
import * as z2 from "zod";
|
|
1054
|
-
var
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
id: z2.string().min(1),
|
|
1060
|
-
name: z2.string(),
|
|
1061
|
-
email_address: z2.string().optional(),
|
|
1062
|
-
picture: z2.string().optional(),
|
|
1063
|
-
emailHash: z2.string().optional(),
|
|
1064
|
-
teams: z2.array(memberProfileTeamSchema).optional()
|
|
1065
|
-
});
|
|
1066
|
-
function buildAuthHeaders(auth) {
|
|
1067
|
-
if (auth.apiKey) {
|
|
1068
|
-
return { "x-api-key": auth.apiKey };
|
|
1069
|
-
}
|
|
1070
|
-
if (auth.bearerToken) {
|
|
1071
|
-
return { Authorization: `Bearer ${auth.bearerToken}` };
|
|
1072
|
-
}
|
|
1073
|
-
throw new Error("Either apiKey or bearerToken is required.");
|
|
1074
|
-
}
|
|
1075
|
-
async function fetchMemberProfile({
|
|
1076
|
-
baseUrl,
|
|
1077
|
-
apiKey,
|
|
1078
|
-
bearerToken,
|
|
1079
|
-
withTeams,
|
|
1080
|
-
fetch: customFetch = fetch
|
|
1081
|
-
}) {
|
|
1082
|
-
const url = new URL(makeUrl(baseUrl, "/api/v1/member-profile"));
|
|
1083
|
-
if (withTeams) {
|
|
1084
|
-
url.searchParams.set("withTeams", "true");
|
|
1085
|
-
}
|
|
1086
|
-
const res = await customFetch(url, {
|
|
1087
|
-
headers: {
|
|
1088
|
-
...buildAuthHeaders({ apiKey, bearerToken }),
|
|
1089
|
-
"User-Agent": CLI_USER_AGENT
|
|
1108
|
+
var identityQuery = gql`
|
|
1109
|
+
query GetUserIdentity($subject: String!) {
|
|
1110
|
+
info: identities_by_pk(subject: $subject) {
|
|
1111
|
+
name
|
|
1112
|
+
email_address
|
|
1090
1113
|
}
|
|
1091
|
-
});
|
|
1092
|
-
if (!res.ok) {
|
|
1093
|
-
const body = await res.text();
|
|
1094
|
-
throw new Error(
|
|
1095
|
-
`Failed to fetch member profile: ${res.status} ${res.statusText}${body ? `
|
|
1096
|
-
${body}` : ""}`
|
|
1097
|
-
);
|
|
1098
|
-
}
|
|
1099
|
-
const data = await res.json();
|
|
1100
|
-
const parsed = memberProfileSchema.safeParse(data);
|
|
1101
|
-
if (!parsed.success) {
|
|
1102
|
-
throw new Error(`Invalid member profile response: ${parsed.error.message}`);
|
|
1103
1114
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1115
|
+
`;
|
|
1116
|
+
var identitySchema = z2.object({
|
|
1117
|
+
info: z2.object({
|
|
1118
|
+
name: z2.string().min(1),
|
|
1119
|
+
email_address: z2.string().min(1).nullable()
|
|
1120
|
+
})
|
|
1121
|
+
});
|
|
1122
|
+
var getUserInfo = async (baseUrl, authToken, subject) => {
|
|
1107
1123
|
try {
|
|
1124
|
+
const headers = { Authorization: `Bearer ${authToken}`, "User-Agent": CLI_USER_AGENT };
|
|
1108
1125
|
const projectClient = new ProjectClient({ apiHost: baseUrl, bearerToken: authToken });
|
|
1109
|
-
const [
|
|
1110
|
-
|
|
1126
|
+
const [identityRes, projectsRes] = await Promise.all([
|
|
1127
|
+
request(makeUrl(baseUrl, "/v1/graphql"), identityQuery, { subject }, headers),
|
|
1111
1128
|
projectClient.getProjects()
|
|
1112
1129
|
]);
|
|
1130
|
+
const identityParsed = identitySchema.safeParse(identityRes);
|
|
1131
|
+
if (!identityParsed.success) {
|
|
1132
|
+
throw new Error(`Invalid identity response: ${identityParsed.error.message}`);
|
|
1133
|
+
}
|
|
1113
1134
|
return {
|
|
1114
|
-
|
|
1115
|
-
email_address: profile.email_address,
|
|
1135
|
+
...identityParsed.data.info,
|
|
1116
1136
|
teams: projectsRes.teams
|
|
1117
1137
|
};
|
|
1118
1138
|
} catch (err) {
|
|
@@ -1130,10 +1150,10 @@ async function fetchUserAndEnsureFirstTeamExists({
|
|
|
1130
1150
|
}) {
|
|
1131
1151
|
const uniformClient = createClient(baseUrl, authToken);
|
|
1132
1152
|
const done = await spin("Fetching user information...");
|
|
1133
|
-
let user = await getUserInfo(baseUrl, authToken);
|
|
1153
|
+
let user = await getUserInfo(baseUrl, authToken, decoded.sub);
|
|
1134
1154
|
if (user.teams.length < 1) {
|
|
1135
1155
|
await uniformClient.createTeam(`${user.name}'s team`);
|
|
1136
|
-
user = await getUserInfo(baseUrl, authToken);
|
|
1156
|
+
user = await getUserInfo(baseUrl, authToken, decoded.sub);
|
|
1137
1157
|
}
|
|
1138
1158
|
await done();
|
|
1139
1159
|
telemetry.login(decoded.sub, user);
|
|
@@ -1184,7 +1204,7 @@ var Telemetry = class {
|
|
|
1184
1204
|
});
|
|
1185
1205
|
}
|
|
1186
1206
|
shutdown() {
|
|
1187
|
-
this.send("exited", { exitCode: process.exitCode });
|
|
1207
|
+
this.send("exited", { exitCode: process.exitCode ?? void 0 });
|
|
1188
1208
|
return this.posthog?.shutdown();
|
|
1189
1209
|
}
|
|
1190
1210
|
};
|
|
@@ -1338,8 +1358,8 @@ function getExistingServers(config2) {
|
|
|
1338
1358
|
var InstallMcpCommand = {
|
|
1339
1359
|
command: "install",
|
|
1340
1360
|
describe: "Install Uniform MCP server configuration (use --team, --project, and --apiKey for non-interactive mode)",
|
|
1341
|
-
builder: (
|
|
1342
|
-
|
|
1361
|
+
builder: (yargs43) => withConfiguration(
|
|
1362
|
+
yargs43.option("agent", {
|
|
1343
1363
|
alias: "a",
|
|
1344
1364
|
describe: "Specify agent type (cursor, claude, copilot, other)",
|
|
1345
1365
|
type: "string",
|
|
@@ -1539,7 +1559,7 @@ Selected agent: ${agentType}`));
|
|
|
1539
1559
|
var McpCommand = {
|
|
1540
1560
|
command: "mcp <command>",
|
|
1541
1561
|
describe: "Uniform MCP server management commands",
|
|
1542
|
-
builder: (
|
|
1562
|
+
builder: (yargs43) => yargs43.command(InstallMcpCommand).demandCommand(),
|
|
1543
1563
|
handler: () => {
|
|
1544
1564
|
yargs.showHelp();
|
|
1545
1565
|
}
|
|
@@ -2014,8 +2034,8 @@ ${gray2("Rules source:")} https://github.com/uniformdev/ai-rules`);
|
|
|
2014
2034
|
var InstallRulesCommand = {
|
|
2015
2035
|
command: "install",
|
|
2016
2036
|
describe: "Install Uniform AI rules for your development assistant",
|
|
2017
|
-
builder: (
|
|
2018
|
-
|
|
2037
|
+
builder: (yargs43) => withConfiguration(
|
|
2038
|
+
yargs43.option("agent", {
|
|
2019
2039
|
alias: "a",
|
|
2020
2040
|
describe: "Specify agent type (cursor, claude, copilot, other)",
|
|
2021
2041
|
type: "string",
|
|
@@ -2053,7 +2073,7 @@ import { blue as blue4, bold as bold2, gray as gray3, green as green5, red as re
|
|
|
2053
2073
|
var ListRulesCommand = {
|
|
2054
2074
|
command: "list",
|
|
2055
2075
|
describe: "List available Uniform AI rules",
|
|
2056
|
-
builder: (
|
|
2076
|
+
builder: (yargs43) => withConfiguration(yargs43),
|
|
2057
2077
|
handler: async function() {
|
|
2058
2078
|
const { stopAllSpinners, spin } = makeSpinner();
|
|
2059
2079
|
try {
|
|
@@ -2082,7 +2102,7 @@ var ListRulesCommand = {
|
|
|
2082
2102
|
var RulesCommand = {
|
|
2083
2103
|
command: "rules <command>",
|
|
2084
2104
|
describe: "Uniform AI rules management commands",
|
|
2085
|
-
builder: (
|
|
2105
|
+
builder: (yargs43) => yargs43.command(InstallRulesCommand).command(ListRulesCommand).demandCommand(),
|
|
2086
2106
|
handler: () => {
|
|
2087
2107
|
yargs2.showHelp();
|
|
2088
2108
|
}
|
|
@@ -2092,282 +2112,17 @@ var RulesCommand = {
|
|
|
2092
2112
|
var AiCommand = {
|
|
2093
2113
|
command: "ai <command>",
|
|
2094
2114
|
describe: "Uniform AI development assistant commands",
|
|
2095
|
-
builder: (
|
|
2115
|
+
builder: (yargs43) => yargs43.command(RulesCommand).command(McpCommand).demandCommand(),
|
|
2096
2116
|
handler: () => {
|
|
2097
2117
|
yargs3.showHelp();
|
|
2098
2118
|
}
|
|
2099
2119
|
};
|
|
2100
2120
|
|
|
2101
|
-
// src/commands/automation/index.ts
|
|
2102
|
-
import yargs4 from "yargs";
|
|
2103
|
-
|
|
2104
|
-
// src/commands/automation/delete.ts
|
|
2105
|
-
import { AutomationsClient } from "@uniformdev/automations-sdk/api";
|
|
2106
|
-
|
|
2107
|
-
// src/commands/automation/resolveAutomationPublicId.ts
|
|
2108
|
-
import { existsSync as existsSync4 } from "fs";
|
|
2109
|
-
import { basename, extname as extname2, resolve as resolve2 } from "path";
|
|
2110
|
-
function resolveAutomationPublicId(identifier) {
|
|
2111
|
-
const absPath = resolve2(identifier);
|
|
2112
|
-
if (existsSync4(absPath)) {
|
|
2113
|
-
return basename(absPath, extname2(absPath));
|
|
2114
|
-
}
|
|
2115
|
-
return identifier;
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
// src/commands/automation/delete.ts
|
|
2119
|
-
var AutomationDeleteModule = {
|
|
2120
|
-
command: "delete <identifier>",
|
|
2121
|
-
describe: "Deletes an automation from a project.",
|
|
2122
|
-
builder: (yargs44) => withConfiguration(
|
|
2123
|
-
withApiOptions(
|
|
2124
|
-
withProjectOptions(
|
|
2125
|
-
yargs44.positional("identifier", {
|
|
2126
|
-
demandOption: true,
|
|
2127
|
-
type: "string",
|
|
2128
|
-
describe: "Automation public ID, or path to a local automation source file (same as deploy)."
|
|
2129
|
-
})
|
|
2130
|
-
)
|
|
2131
|
-
)
|
|
2132
|
-
),
|
|
2133
|
-
handler: async ({ apiHost, apiKey, proxy, identifier, project: projectId }) => {
|
|
2134
|
-
const fetch2 = nodeFetchProxy(proxy);
|
|
2135
|
-
const client = new AutomationsClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
2136
|
-
const publicId = resolveAutomationPublicId(identifier);
|
|
2137
|
-
try {
|
|
2138
|
-
await client.remove(publicId);
|
|
2139
|
-
console.log(`\u{1F5D1}\uFE0F Deleted automation "${publicId}".`);
|
|
2140
|
-
} catch (error) {
|
|
2141
|
-
exitOnCliError(error);
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
};
|
|
2145
|
-
|
|
2146
|
-
// src/commands/automation/deploy.ts
|
|
2147
|
-
import { AutomationsClient as AutomationsClient2, formatAutomationWebhookUrl } from "@uniformdev/automations-sdk/api";
|
|
2148
|
-
|
|
2149
|
-
// src/commands/automation/bundleAutomationForDeploy.ts
|
|
2150
|
-
import { mkdtempSync, readFileSync as readFileSync2, rmSync } from "fs";
|
|
2151
|
-
import { tmpdir } from "os";
|
|
2152
|
-
import { basename as basename2, join as join6, resolve as resolve3 } from "path";
|
|
2153
|
-
import { pathToFileURL } from "url";
|
|
2154
|
-
|
|
2155
|
-
// src/commands/bundleWorkerCode.ts
|
|
2156
|
-
import esbuild from "esbuild";
|
|
2157
|
-
import path5 from "path";
|
|
2158
|
-
var INJECTED_ENV_PREFIX = "UNIFORM_ENV_";
|
|
2159
|
-
function buildInjectedEnvDefine() {
|
|
2160
|
-
const define = {
|
|
2161
|
-
// ensures that if no env vars are injected, that process.env is still defined so var access hits an object that exists
|
|
2162
|
-
"process.env": "{}"
|
|
2163
|
-
};
|
|
2164
|
-
for (const [key, value] of Object.entries(process.env)) {
|
|
2165
|
-
if (key.startsWith(INJECTED_ENV_PREFIX) && value !== void 0) {
|
|
2166
|
-
define[`process.env.${key}`] = JSON.stringify(value);
|
|
2167
|
-
}
|
|
2168
|
-
}
|
|
2169
|
-
return define;
|
|
2170
|
-
}
|
|
2171
|
-
function workerBundleBuildOptions(entryFile) {
|
|
2172
|
-
return {
|
|
2173
|
-
entryPoints: [entryFile],
|
|
2174
|
-
bundle: true,
|
|
2175
|
-
format: "esm",
|
|
2176
|
-
target: "es2021",
|
|
2177
|
-
platform: "browser",
|
|
2178
|
-
minify: true,
|
|
2179
|
-
external: [],
|
|
2180
|
-
splitting: false,
|
|
2181
|
-
sourcemap: false,
|
|
2182
|
-
define: buildInjectedEnvDefine()
|
|
2183
|
-
};
|
|
2184
|
-
}
|
|
2185
|
-
async function bundleWorkerCodeToFile(entryFile, outfile) {
|
|
2186
|
-
await esbuild.build({
|
|
2187
|
-
...workerBundleBuildOptions(entryFile),
|
|
2188
|
-
outfile,
|
|
2189
|
-
logLevel: "silent"
|
|
2190
|
-
});
|
|
2191
|
-
}
|
|
2192
|
-
async function bundleWorkerCode(entryFile) {
|
|
2193
|
-
const result = await esbuild.build({
|
|
2194
|
-
...workerBundleBuildOptions(entryFile),
|
|
2195
|
-
write: false
|
|
2196
|
-
});
|
|
2197
|
-
const outputFiles = result.outputFiles;
|
|
2198
|
-
if (!outputFiles || outputFiles.length === 0) {
|
|
2199
|
-
throw new Error(`No output generated for ${entryFile}`);
|
|
2200
|
-
}
|
|
2201
|
-
const outputFile = outputFiles[0];
|
|
2202
|
-
const builtCode = outputFile.text;
|
|
2203
|
-
console.log(
|
|
2204
|
-
`\u2139\uFE0F ${path5.basename(entryFile)} was prepared with esbuild. Size: ${Math.round(
|
|
2205
|
-
builtCode.length / 1024
|
|
2206
|
-
)}kb (use --skipBundle to disable)`
|
|
2207
|
-
);
|
|
2208
|
-
return builtCode;
|
|
2209
|
-
}
|
|
2210
|
-
|
|
2211
|
-
// src/commands/automation/toInputJsonSchema.ts
|
|
2212
|
-
import * as z3 from "zod";
|
|
2213
|
-
function isZodSchema(value) {
|
|
2214
|
-
return typeof value === "object" && value !== null && "_zod" in value;
|
|
2215
|
-
}
|
|
2216
|
-
function isStandardSchema(value) {
|
|
2217
|
-
return typeof value === "object" && value !== null && "~standard" in value;
|
|
2218
|
-
}
|
|
2219
|
-
function toInputJsonSchema(inputSchema) {
|
|
2220
|
-
if (inputSchema === void 0 || inputSchema === null) {
|
|
2221
|
-
throw new Error("An AI-tool automation must declare an `inputSchema` in its metadata.");
|
|
2222
|
-
}
|
|
2223
|
-
if (isZodSchema(inputSchema)) {
|
|
2224
|
-
return z3.toJSONSchema(inputSchema);
|
|
2225
|
-
}
|
|
2226
|
-
if (isStandardSchema(inputSchema)) {
|
|
2227
|
-
throw new Error(
|
|
2228
|
-
"`inputSchema` is a Standard Schema but not a zod schema. Deploy-time conversion to JSON Schema currently supports zod only \u2014 provide a zod schema or a JSON Schema object."
|
|
2229
|
-
);
|
|
2230
|
-
}
|
|
2231
|
-
if (typeof inputSchema === "object") {
|
|
2232
|
-
return inputSchema;
|
|
2233
|
-
}
|
|
2234
|
-
throw new Error("`inputSchema` must be a zod schema or a JSON Schema object.");
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2237
|
-
// src/commands/automation/bundleAutomationForDeploy.ts
|
|
2238
|
-
async function readAutomationMetadataFromBundle(bundlePath, publicId) {
|
|
2239
|
-
const automationModule = await import(pathToFileURL(bundlePath).href);
|
|
2240
|
-
const automation = automationModule.default;
|
|
2241
|
-
if (!automation?.metadata) {
|
|
2242
|
-
throw new Error("Default export must be the return value of defineAutomation");
|
|
2243
|
-
}
|
|
2244
|
-
const metadata = automation.metadata;
|
|
2245
|
-
const trigger = metadata.trigger?.type === "aiTool" ? { type: "aiTool", inputSchema: toInputJsonSchema(metadata.inputSchema) } : metadata.trigger;
|
|
2246
|
-
return {
|
|
2247
|
-
publicId,
|
|
2248
|
-
name: metadata.name,
|
|
2249
|
-
description: metadata.description,
|
|
2250
|
-
trigger,
|
|
2251
|
-
compatibilityDate: metadata.compatibilityDate,
|
|
2252
|
-
permissions: metadata.permissions
|
|
2253
|
-
};
|
|
2254
|
-
}
|
|
2255
|
-
async function bundleAutomationForDeploy(entryFile) {
|
|
2256
|
-
const absEntry = resolve3(entryFile);
|
|
2257
|
-
const publicId = resolveAutomationPublicId(absEntry);
|
|
2258
|
-
const workDir = mkdtempSync(join6(tmpdir(), "uniform-automation-deploy-"));
|
|
2259
|
-
const bundlePath = join6(workDir, "automation.mjs");
|
|
2260
|
-
try {
|
|
2261
|
-
await bundleWorkerCodeToFile(absEntry, bundlePath);
|
|
2262
|
-
const metadata = await readAutomationMetadataFromBundle(bundlePath, publicId);
|
|
2263
|
-
const code = readFileSync2(bundlePath, "utf8");
|
|
2264
|
-
console.log(
|
|
2265
|
-
`\u2139\uFE0F ${basename2(absEntry)} was prepared with esbuild. Size: ${Math.round(code.length / 1024)}kb`
|
|
2266
|
-
);
|
|
2267
|
-
return {
|
|
2268
|
-
metadata,
|
|
2269
|
-
code,
|
|
2270
|
-
cleanup: () => rmSync(workDir, { recursive: true, force: true })
|
|
2271
|
-
};
|
|
2272
|
-
} catch (error) {
|
|
2273
|
-
rmSync(workDir, { recursive: true, force: true });
|
|
2274
|
-
throw error;
|
|
2275
|
-
}
|
|
2276
|
-
}
|
|
2277
|
-
|
|
2278
|
-
// src/commands/automation/deploy.ts
|
|
2279
|
-
var AutomationDeployModule = {
|
|
2280
|
-
command: "deploy <filename>",
|
|
2281
|
-
describe: "Deploys an automation to a project.",
|
|
2282
|
-
builder: (yargs44) => withConfiguration(
|
|
2283
|
-
withApiOptions(
|
|
2284
|
-
withProjectOptions(
|
|
2285
|
-
yargs44.positional("filename", {
|
|
2286
|
-
demandOption: true,
|
|
2287
|
-
describe: "Automation code file to deploy. The module must default-export the return value of defineAutomation."
|
|
2288
|
-
}).option("compatibilityDate", {
|
|
2289
|
-
type: "string",
|
|
2290
|
-
describe: "Overrides the compatibility date in metadata. Format: YYYY-MM-DD."
|
|
2291
|
-
})
|
|
2292
|
-
)
|
|
2293
|
-
)
|
|
2294
|
-
),
|
|
2295
|
-
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId, compatibilityDate }) => {
|
|
2296
|
-
const fetch2 = nodeFetchProxy(proxy);
|
|
2297
|
-
const client = new AutomationsClient2({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
2298
|
-
let cleanup;
|
|
2299
|
-
try {
|
|
2300
|
-
const bundled = await bundleAutomationForDeploy(filename);
|
|
2301
|
-
cleanup = bundled.cleanup;
|
|
2302
|
-
await client.deploy({
|
|
2303
|
-
...bundled.metadata,
|
|
2304
|
-
code: bundled.code,
|
|
2305
|
-
compatibilityDate: compatibilityDate ?? bundled.metadata.compatibilityDate
|
|
2306
|
-
});
|
|
2307
|
-
console.log(
|
|
2308
|
-
`\u2705 Deployed automation "${bundled.metadata.publicId}" (${bundled.metadata.trigger.type}).`
|
|
2309
|
-
);
|
|
2310
|
-
if (bundled.metadata.trigger.type === "incomingWebhook") {
|
|
2311
|
-
console.log(
|
|
2312
|
-
`Webhook URL: ${formatAutomationWebhookUrl(apiHost, projectId, bundled.metadata.publicId)}`
|
|
2313
|
-
);
|
|
2314
|
-
}
|
|
2315
|
-
} catch (error) {
|
|
2316
|
-
exitOnCliError(error);
|
|
2317
|
-
} finally {
|
|
2318
|
-
cleanup?.();
|
|
2319
|
-
}
|
|
2320
|
-
}
|
|
2321
|
-
};
|
|
2322
|
-
|
|
2323
|
-
// src/commands/automation/list.ts
|
|
2324
|
-
import { AutomationsClient as AutomationsClient3 } from "@uniformdev/automations-sdk/api";
|
|
2325
|
-
var AutomationListModule = {
|
|
2326
|
-
command: "list",
|
|
2327
|
-
aliases: ["ls"],
|
|
2328
|
-
describe: "Lists the automations in a project.",
|
|
2329
|
-
builder: (yargs44) => withConfiguration(withApiOptions(withProjectOptions(yargs44))),
|
|
2330
|
-
handler: async ({ apiHost, apiKey, proxy, project: projectId }) => {
|
|
2331
|
-
const fetch2 = nodeFetchProxy(proxy);
|
|
2332
|
-
const client = new AutomationsClient3({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
2333
|
-
try {
|
|
2334
|
-
const { automations } = await client.list();
|
|
2335
|
-
if (!automations.length) {
|
|
2336
|
-
console.log("No automations found in this project.");
|
|
2337
|
-
return;
|
|
2338
|
-
}
|
|
2339
|
-
console.table(
|
|
2340
|
-
automations.map((automation) => ({
|
|
2341
|
-
publicId: automation.publicId,
|
|
2342
|
-
name: automation.name,
|
|
2343
|
-
trigger: automation.trigger.type,
|
|
2344
|
-
enabled: automation.enabled,
|
|
2345
|
-
lastDeployedAt: automation.lastDeployedAt,
|
|
2346
|
-
lastDeployedBy: automation.lastDeployedBy
|
|
2347
|
-
}))
|
|
2348
|
-
);
|
|
2349
|
-
} catch (error) {
|
|
2350
|
-
exitOnCliError(error);
|
|
2351
|
-
}
|
|
2352
|
-
}
|
|
2353
|
-
};
|
|
2354
|
-
|
|
2355
|
-
// src/commands/automation/index.ts
|
|
2356
|
-
var AutomationCommand = {
|
|
2357
|
-
command: "automation <command>",
|
|
2358
|
-
aliases: ["automations"],
|
|
2359
|
-
describe: "Commands for managing Uniform Automations",
|
|
2360
|
-
builder: (yargs44) => yargs44.command(AutomationDeployModule).command(AutomationDeleteModule).command(AutomationListModule).demandCommand(),
|
|
2361
|
-
handler: () => {
|
|
2362
|
-
yargs4.showHelp();
|
|
2363
|
-
}
|
|
2364
|
-
};
|
|
2365
|
-
|
|
2366
2121
|
// src/commands/canvas/index.ts
|
|
2367
|
-
import
|
|
2122
|
+
import yargs21 from "yargs";
|
|
2368
2123
|
|
|
2369
2124
|
// src/commands/canvas/commands/asset.ts
|
|
2370
|
-
import
|
|
2125
|
+
import yargs4 from "yargs";
|
|
2371
2126
|
|
|
2372
2127
|
// src/commands/canvas/commands/asset/_util.ts
|
|
2373
2128
|
import { UncachedAssetClient } from "@uniformdev/assets";
|
|
@@ -2396,12 +2151,12 @@ function getFileClient(options) {
|
|
|
2396
2151
|
var AssetGetModule = {
|
|
2397
2152
|
command: "get <id>",
|
|
2398
2153
|
describe: "Get an asset",
|
|
2399
|
-
builder: (
|
|
2154
|
+
builder: (yargs43) => withConfiguration(
|
|
2400
2155
|
withDebugOptions(
|
|
2401
2156
|
withFormatOptions(
|
|
2402
2157
|
withApiOptions(
|
|
2403
2158
|
withProjectOptions(
|
|
2404
|
-
|
|
2159
|
+
yargs43.positional("id", { demandOption: true, describe: "Asset ID to fetch" })
|
|
2405
2160
|
)
|
|
2406
2161
|
)
|
|
2407
2162
|
)
|
|
@@ -2422,7 +2177,7 @@ var AssetGetModule = {
|
|
|
2422
2177
|
var AssetListModule = {
|
|
2423
2178
|
command: "list",
|
|
2424
2179
|
describe: "List assets",
|
|
2425
|
-
builder: (
|
|
2180
|
+
builder: (yargs43) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs43))))),
|
|
2426
2181
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
2427
2182
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
2428
2183
|
const client = getAssetClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -2433,10 +2188,10 @@ var AssetListModule = {
|
|
|
2433
2188
|
|
|
2434
2189
|
// src/files/deleteDownloadedFileByUrl.ts
|
|
2435
2190
|
import fsj from "fs-jetpack";
|
|
2436
|
-
import { join as
|
|
2191
|
+
import { join as join7 } from "path";
|
|
2437
2192
|
|
|
2438
2193
|
// src/files/urlToFileName.ts
|
|
2439
|
-
import { join as
|
|
2194
|
+
import { join as join6 } from "path";
|
|
2440
2195
|
import { dirname } from "path";
|
|
2441
2196
|
var FILES_DIRECTORY_NAME = "files";
|
|
2442
2197
|
var getFilesDirectory = (directory) => {
|
|
@@ -2445,7 +2200,7 @@ var getFilesDirectory = (directory) => {
|
|
|
2445
2200
|
// If we are syncing to a directory, we want to write all files into a
|
|
2446
2201
|
// top-lvl folder. That way any entities that contain files will sync to the
|
|
2447
2202
|
// same directory, so there is no duplication
|
|
2448
|
-
|
|
2203
|
+
join6(directory, "..")
|
|
2449
2204
|
);
|
|
2450
2205
|
};
|
|
2451
2206
|
var urlToHash = (url) => {
|
|
@@ -2481,7 +2236,7 @@ var hashToPartialPathname = (hash) => {
|
|
|
2481
2236
|
var deleteDownloadedFileByUrl = async (url, options) => {
|
|
2482
2237
|
const writeDirectory = getFilesDirectory(options.directory);
|
|
2483
2238
|
const fileName = urlToFileName(url);
|
|
2484
|
-
const fileToDelete =
|
|
2239
|
+
const fileToDelete = join7(writeDirectory, FILES_DIRECTORY_NAME, fileName);
|
|
2485
2240
|
try {
|
|
2486
2241
|
await fsj.removeAsync(fileToDelete);
|
|
2487
2242
|
} catch {
|
|
@@ -2500,20 +2255,64 @@ import {
|
|
|
2500
2255
|
} from "@uniformdev/canvas";
|
|
2501
2256
|
import { isRichTextNodeType, isRichTextValue, walkRichTextTree } from "@uniformdev/richtext";
|
|
2502
2257
|
import fsj4 from "fs-jetpack";
|
|
2503
|
-
import
|
|
2504
|
-
import { join as
|
|
2258
|
+
import PQueue3 from "p-queue";
|
|
2259
|
+
import { join as join10 } from "path";
|
|
2505
2260
|
|
|
2506
2261
|
// src/files/downloadFile.ts
|
|
2262
|
+
import { createWriteStream } from "fs";
|
|
2507
2263
|
import fsj2 from "fs-jetpack";
|
|
2508
|
-
import { join as
|
|
2264
|
+
import { dirname as dirname2, join as join8 } from "path";
|
|
2265
|
+
import { Readable } from "stream";
|
|
2266
|
+
import { pipeline } from "stream/promises";
|
|
2267
|
+
var downloadedFilePathCacheByDirectory = /* @__PURE__ */ new Map();
|
|
2268
|
+
var tempDownloadFileCounter = 0;
|
|
2269
|
+
var getTempDownloadFilePath = (filePath) => {
|
|
2270
|
+
tempDownloadFileCounter += 1;
|
|
2271
|
+
return `${filePath}.${process.pid}.${Date.now()}.${tempDownloadFileCounter}.download`;
|
|
2272
|
+
};
|
|
2273
|
+
var getDownloadedFilePathCache = (filesDirectory) => {
|
|
2274
|
+
const cached = downloadedFilePathCacheByDirectory.get(filesDirectory);
|
|
2275
|
+
if (cached) {
|
|
2276
|
+
return cached;
|
|
2277
|
+
}
|
|
2278
|
+
const cache = fsj2.cwd(filesDirectory).findAsync({ files: true, directories: false }).then((paths) => new Set(paths)).catch(() => /* @__PURE__ */ new Set());
|
|
2279
|
+
downloadedFilePathCacheByDirectory.set(filesDirectory, cache);
|
|
2280
|
+
return cache;
|
|
2281
|
+
};
|
|
2282
|
+
var filePathMatchesSourceId = (filePath, sourceId) => filePath === sourceId || filePath.startsWith(`${sourceId}.`);
|
|
2283
|
+
var hasFilePathMatchingSourceId = (filePaths, sourceId) => {
|
|
2284
|
+
for (const filePath of filePaths) {
|
|
2285
|
+
if (filePathMatchesSourceId(filePath, sourceId)) {
|
|
2286
|
+
return true;
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
return false;
|
|
2290
|
+
};
|
|
2291
|
+
var writeResponseBodyToFile = async (response, filePath) => {
|
|
2292
|
+
if (!response.body) {
|
|
2293
|
+
throw new Error("Response does not contain a body");
|
|
2294
|
+
}
|
|
2295
|
+
const tempFilePath = getTempDownloadFilePath(filePath);
|
|
2296
|
+
await fsj2.dirAsync(dirname2(filePath));
|
|
2297
|
+
try {
|
|
2298
|
+
const responseBody = response.body;
|
|
2299
|
+
await pipeline(Readable.fromWeb(responseBody), createWriteStream(tempFilePath));
|
|
2300
|
+
await fsj2.moveAsync(tempFilePath, filePath, { overwrite: true });
|
|
2301
|
+
} catch (error) {
|
|
2302
|
+
await fsj2.removeAsync(tempFilePath).catch(() => void 0);
|
|
2303
|
+
throw error;
|
|
2304
|
+
}
|
|
2305
|
+
};
|
|
2509
2306
|
var downloadFile = async ({
|
|
2510
2307
|
fileClient,
|
|
2511
2308
|
fileUrl,
|
|
2512
2309
|
directory
|
|
2513
2310
|
}) => {
|
|
2514
2311
|
const writeDirectory = getFilesDirectory(directory);
|
|
2312
|
+
const filesDirectory = join8(writeDirectory, FILES_DIRECTORY_NAME);
|
|
2515
2313
|
const fileName = urlToFileName(fileUrl.toString());
|
|
2516
|
-
const
|
|
2314
|
+
const filePath = join8(filesDirectory, fileName);
|
|
2315
|
+
const fileAlreadyExists = await fsj2.existsAsync(filePath);
|
|
2517
2316
|
if (fileAlreadyExists) {
|
|
2518
2317
|
return { url: fileUrl };
|
|
2519
2318
|
}
|
|
@@ -2523,11 +2322,10 @@ var downloadFile = async ({
|
|
|
2523
2322
|
return null;
|
|
2524
2323
|
}
|
|
2525
2324
|
if (file.sourceId) {
|
|
2325
|
+
const sourceId = file.sourceId;
|
|
2526
2326
|
try {
|
|
2527
|
-
const
|
|
2528
|
-
|
|
2529
|
-
});
|
|
2530
|
-
if (hashAlreadyExists.length > 0) {
|
|
2327
|
+
const downloadedFilePaths = await getDownloadedFilePathCache(filesDirectory);
|
|
2328
|
+
if (hasFilePathMatchingSourceId(downloadedFilePaths, sourceId)) {
|
|
2531
2329
|
return { id: file.id, url: fileUrl };
|
|
2532
2330
|
}
|
|
2533
2331
|
} catch {
|
|
@@ -2538,8 +2336,12 @@ var downloadFile = async ({
|
|
|
2538
2336
|
if (!response.ok) {
|
|
2539
2337
|
return null;
|
|
2540
2338
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2339
|
+
await writeResponseBodyToFile(response, filePath);
|
|
2340
|
+
const downloadedFilePathCache = downloadedFilePathCacheByDirectory.get(filesDirectory);
|
|
2341
|
+
if (downloadedFilePathCache) {
|
|
2342
|
+
const downloadedFilePaths = await downloadedFilePathCache;
|
|
2343
|
+
downloadedFilePaths.add(fileName);
|
|
2344
|
+
}
|
|
2543
2345
|
return { id: file.id, url: fileUrl };
|
|
2544
2346
|
};
|
|
2545
2347
|
|
|
@@ -2551,10 +2353,10 @@ import { createReadStream } from "fs";
|
|
|
2551
2353
|
import fsj3 from "fs-jetpack";
|
|
2552
2354
|
import { imageSizeFromFile } from "image-size/fromFile";
|
|
2553
2355
|
import normalizeNewline from "normalize-newline";
|
|
2554
|
-
import
|
|
2555
|
-
import { join as
|
|
2356
|
+
import PQueue2 from "p-queue";
|
|
2357
|
+
import { join as join9 } from "path";
|
|
2556
2358
|
var uploadQueueByKey = /* @__PURE__ */ new Map();
|
|
2557
|
-
var fileUploadQueue = new
|
|
2359
|
+
var fileUploadQueue = new PQueue2({ concurrency: 10 });
|
|
2558
2360
|
var uploadFile = async ({
|
|
2559
2361
|
fileClient,
|
|
2560
2362
|
fileUrl,
|
|
@@ -2579,7 +2381,7 @@ var uploadFile = async ({
|
|
|
2579
2381
|
return { id: file.id, url: file.url };
|
|
2580
2382
|
}
|
|
2581
2383
|
const localFileName = urlToFileName(fileUrl);
|
|
2582
|
-
const expectedFilePath =
|
|
2384
|
+
const expectedFilePath = join9(writeDirectory, FILES_DIRECTORY_NAME, localFileName);
|
|
2583
2385
|
const fileInspect = await fsj3.inspectAsync(expectedFilePath);
|
|
2584
2386
|
if (fileInspect?.type !== "file") {
|
|
2585
2387
|
console.warn(
|
|
@@ -2658,7 +2460,7 @@ var uploadFile = async ({
|
|
|
2658
2460
|
}
|
|
2659
2461
|
const file2 = await fileClient.get({ id });
|
|
2660
2462
|
if (!file2 || file2.state !== FILE_READY_STATE || !file2.url) {
|
|
2661
|
-
await new Promise((
|
|
2463
|
+
await new Promise((resolve2) => setTimeout(resolve2, 1e3));
|
|
2662
2464
|
return checkForFile();
|
|
2663
2465
|
}
|
|
2664
2466
|
return file2.url;
|
|
@@ -2734,9 +2536,9 @@ var walkFileUrlsForCompositionOrEntry = ({
|
|
|
2734
2536
|
};
|
|
2735
2537
|
|
|
2736
2538
|
// src/files/files.ts
|
|
2737
|
-
var fileDownloadQueue = new
|
|
2738
|
-
var fileUploadQueue2 = new
|
|
2739
|
-
var fileUrlReplacementQueue = new
|
|
2539
|
+
var fileDownloadQueue = new PQueue3({ concurrency: 10 });
|
|
2540
|
+
var fileUploadQueue2 = new PQueue3({ concurrency: 10 });
|
|
2541
|
+
var fileUrlReplacementQueue = new PQueue3({ concurrency: 10 });
|
|
2740
2542
|
var downloadFileForAsset = async ({
|
|
2741
2543
|
asset,
|
|
2742
2544
|
directory,
|
|
@@ -2904,7 +2706,7 @@ var replaceRemoteUrlsWithLocalReferences = async ({
|
|
|
2904
2706
|
try {
|
|
2905
2707
|
const localFileName = urlToFileName(fileUrl);
|
|
2906
2708
|
const fileExistsLocally = await fsj4.existsAsync(
|
|
2907
|
-
|
|
2709
|
+
join10(writeDirectory, FILES_DIRECTORY_NAME, localFileName)
|
|
2908
2710
|
);
|
|
2909
2711
|
if (fileExistsLocally) {
|
|
2910
2712
|
return;
|
|
@@ -2987,8 +2789,8 @@ function prepCompositionForDisk(composition) {
|
|
|
2987
2789
|
delete prepped.state;
|
|
2988
2790
|
return prepped;
|
|
2989
2791
|
}
|
|
2990
|
-
function withStateOptions(
|
|
2991
|
-
return
|
|
2792
|
+
function withStateOptions(yargs43, defaultState = "preview") {
|
|
2793
|
+
return yargs43.option("state", {
|
|
2992
2794
|
type: "string",
|
|
2993
2795
|
describe: `State to fetch.`,
|
|
2994
2796
|
choices: ["preview", "published"],
|
|
@@ -3063,16 +2865,17 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
3063
2865
|
}
|
|
3064
2866
|
|
|
3065
2867
|
// src/commands/canvas/commands/asset/pull.ts
|
|
2868
|
+
var ASSET_PULL_ACTION_CONCURRENCY = 10;
|
|
3066
2869
|
var AssetPullModule = {
|
|
3067
2870
|
command: "pull <directory>",
|
|
3068
2871
|
describe: "Pulls all assets to local files in a directory",
|
|
3069
|
-
builder: (
|
|
2872
|
+
builder: (yargs43) => withConfiguration(
|
|
3070
2873
|
withApiOptions(
|
|
3071
2874
|
withDebugOptions(
|
|
3072
2875
|
withProjectOptions(
|
|
3073
2876
|
withDiffOptions(
|
|
3074
2877
|
withBatchSizeOptions(
|
|
3075
|
-
|
|
2878
|
+
yargs43.positional("directory", {
|
|
3076
2879
|
describe: "Directory to save the assets to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
3077
2880
|
type: "string"
|
|
3078
2881
|
}).option("format", {
|
|
@@ -3161,6 +2964,7 @@ var AssetPullModule = {
|
|
|
3161
2964
|
target,
|
|
3162
2965
|
mode,
|
|
3163
2966
|
whatIf,
|
|
2967
|
+
actionConcurrency: ASSET_PULL_ACTION_CONCURRENCY,
|
|
3164
2968
|
allowEmptySource: allowEmptySource ?? true,
|
|
3165
2969
|
log: createSyncEngineConsoleLogger({ diffMode }),
|
|
3166
2970
|
onBeforeCompareObjects: async (sourceObject) => {
|
|
@@ -3188,16 +2992,17 @@ var AssetPullModule = {
|
|
|
3188
2992
|
};
|
|
3189
2993
|
|
|
3190
2994
|
// src/commands/canvas/commands/asset/push.ts
|
|
2995
|
+
var ASSET_PUSH_ACTION_CONCURRENCY = 10;
|
|
3191
2996
|
var AssetPushModule = {
|
|
3192
2997
|
command: "push <directory>",
|
|
3193
2998
|
describe: "Pushes all assets from files in a directory to Uniform",
|
|
3194
|
-
builder: (
|
|
2999
|
+
builder: (yargs43) => withConfiguration(
|
|
3195
3000
|
withApiOptions(
|
|
3196
3001
|
withDebugOptions(
|
|
3197
3002
|
withProjectOptions(
|
|
3198
3003
|
withDiffOptions(
|
|
3199
3004
|
withBatchSizeOptions(
|
|
3200
|
-
|
|
3005
|
+
yargs43.positional("directory", {
|
|
3201
3006
|
describe: "Directory to read the assets from. If a filename is used, a package will be read instead.",
|
|
3202
3007
|
type: "string"
|
|
3203
3008
|
}).option("mode", {
|
|
@@ -3263,6 +3068,7 @@ var AssetPushModule = {
|
|
|
3263
3068
|
target,
|
|
3264
3069
|
mode,
|
|
3265
3070
|
whatIf,
|
|
3071
|
+
actionConcurrency: ASSET_PUSH_ACTION_CONCURRENCY,
|
|
3266
3072
|
allowEmptySource,
|
|
3267
3073
|
log: createSyncEngineConsoleLogger({ diffMode }),
|
|
3268
3074
|
onBeforeCompareObjects: async (sourceObject, targetObject) => {
|
|
@@ -3328,10 +3134,10 @@ var AssetRemoveModule = {
|
|
|
3328
3134
|
command: "remove <id>",
|
|
3329
3135
|
aliases: ["delete", "rm"],
|
|
3330
3136
|
describe: "Delete an asset",
|
|
3331
|
-
builder: (
|
|
3137
|
+
builder: (yargs43) => withConfiguration(
|
|
3332
3138
|
withDebugOptions(
|
|
3333
3139
|
withApiOptions(
|
|
3334
|
-
withProjectOptions(
|
|
3140
|
+
withProjectOptions(yargs43.positional("id", { demandOption: true, describe: "Asset ID to delete" }))
|
|
3335
3141
|
)
|
|
3336
3142
|
)
|
|
3337
3143
|
),
|
|
@@ -3352,11 +3158,11 @@ var AssetUpdateModule = {
|
|
|
3352
3158
|
command: "update <filename>",
|
|
3353
3159
|
aliases: ["put"],
|
|
3354
3160
|
describe: "Insert or update an asset",
|
|
3355
|
-
builder: (
|
|
3161
|
+
builder: (yargs43) => withConfiguration(
|
|
3356
3162
|
withDebugOptions(
|
|
3357
3163
|
withApiOptions(
|
|
3358
3164
|
withProjectOptions(
|
|
3359
|
-
|
|
3165
|
+
yargs43.positional("filename", { demandOption: true, describe: "Asset file to put" })
|
|
3360
3166
|
)
|
|
3361
3167
|
)
|
|
3362
3168
|
)
|
|
@@ -3382,14 +3188,14 @@ var AssetUpdateModule = {
|
|
|
3382
3188
|
var AssetModule = {
|
|
3383
3189
|
command: "asset <command>",
|
|
3384
3190
|
describe: "Commands for Assets",
|
|
3385
|
-
builder: (
|
|
3191
|
+
builder: (yargs43) => yargs43.command(AssetGetModule).command(AssetListModule).command(AssetRemoveModule).command(AssetUpdateModule).command(AssetPullModule).command(AssetPushModule).demandCommand(),
|
|
3386
3192
|
handler: () => {
|
|
3387
|
-
|
|
3193
|
+
yargs4.help();
|
|
3388
3194
|
}
|
|
3389
3195
|
};
|
|
3390
3196
|
|
|
3391
3197
|
// src/commands/canvas/commands/category.ts
|
|
3392
|
-
import
|
|
3198
|
+
import yargs5 from "yargs";
|
|
3393
3199
|
|
|
3394
3200
|
// src/commands/canvas/commands/category/_util.ts
|
|
3395
3201
|
import { UncachedCategoryClient } from "@uniformdev/canvas";
|
|
@@ -3403,12 +3209,12 @@ function getCategoryClient(options) {
|
|
|
3403
3209
|
var CategoryGetModule = {
|
|
3404
3210
|
command: "get <id>",
|
|
3405
3211
|
describe: "Fetch a category",
|
|
3406
|
-
builder: (
|
|
3212
|
+
builder: (yargs43) => withConfiguration(
|
|
3407
3213
|
withFormatOptions(
|
|
3408
3214
|
withDebugOptions(
|
|
3409
3215
|
withApiOptions(
|
|
3410
3216
|
withProjectOptions(
|
|
3411
|
-
|
|
3217
|
+
yargs43.positional("id", { demandOption: true, describe: "Category UUID to fetch" })
|
|
3412
3218
|
)
|
|
3413
3219
|
)
|
|
3414
3220
|
)
|
|
@@ -3433,8 +3239,8 @@ var CategoryListModule = {
|
|
|
3433
3239
|
command: "list",
|
|
3434
3240
|
describe: "List categories",
|
|
3435
3241
|
aliases: ["ls"],
|
|
3436
|
-
builder: (
|
|
3437
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
3242
|
+
builder: (yargs43) => withConfiguration(
|
|
3243
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs43.options({})))))
|
|
3438
3244
|
),
|
|
3439
3245
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
3440
3246
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -3476,12 +3282,12 @@ function createCategoriesEngineDataSource({
|
|
|
3476
3282
|
var CategoryPullModule = {
|
|
3477
3283
|
command: "pull <directory>",
|
|
3478
3284
|
describe: "Pulls all categories to local files in a directory",
|
|
3479
|
-
builder: (
|
|
3285
|
+
builder: (yargs43) => withConfiguration(
|
|
3480
3286
|
withApiOptions(
|
|
3481
3287
|
withProjectOptions(
|
|
3482
3288
|
withDiffOptions(
|
|
3483
3289
|
withDebugOptions(
|
|
3484
|
-
|
|
3290
|
+
yargs43.positional("directory", {
|
|
3485
3291
|
describe: "Directory to save the categories to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
3486
3292
|
type: "string"
|
|
3487
3293
|
}).option("format", {
|
|
@@ -3556,12 +3362,12 @@ var CategoryPullModule = {
|
|
|
3556
3362
|
var CategoryPushModule = {
|
|
3557
3363
|
command: "push <directory>",
|
|
3558
3364
|
describe: "Pushes all categories from files in a directory to Uniform Canvas",
|
|
3559
|
-
builder: (
|
|
3365
|
+
builder: (yargs43) => withConfiguration(
|
|
3560
3366
|
withApiOptions(
|
|
3561
3367
|
withDebugOptions(
|
|
3562
3368
|
withProjectOptions(
|
|
3563
3369
|
withDiffOptions(
|
|
3564
|
-
|
|
3370
|
+
yargs43.positional("directory", {
|
|
3565
3371
|
describe: "Directory to read the categories from. If a filename is used, a package will be read instead.",
|
|
3566
3372
|
type: "string"
|
|
3567
3373
|
}).option("mode", {
|
|
@@ -3625,11 +3431,11 @@ var CategoryRemoveModule = {
|
|
|
3625
3431
|
command: "remove <id>",
|
|
3626
3432
|
aliases: ["delete", "rm"],
|
|
3627
3433
|
describe: "Delete a category",
|
|
3628
|
-
builder: (
|
|
3434
|
+
builder: (yargs43) => withConfiguration(
|
|
3629
3435
|
withApiOptions(
|
|
3630
3436
|
withDebugOptions(
|
|
3631
3437
|
withProjectOptions(
|
|
3632
|
-
|
|
3438
|
+
yargs43.positional("id", { demandOption: true, describe: "Category UUID to delete" })
|
|
3633
3439
|
)
|
|
3634
3440
|
)
|
|
3635
3441
|
)
|
|
@@ -3650,11 +3456,11 @@ var CategoryUpdateModule = {
|
|
|
3650
3456
|
command: "update <filename>",
|
|
3651
3457
|
aliases: ["put"],
|
|
3652
3458
|
describe: "Insert or update a category",
|
|
3653
|
-
builder: (
|
|
3459
|
+
builder: (yargs43) => withConfiguration(
|
|
3654
3460
|
withApiOptions(
|
|
3655
3461
|
withDebugOptions(
|
|
3656
3462
|
withProjectOptions(
|
|
3657
|
-
|
|
3463
|
+
yargs43.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
3658
3464
|
)
|
|
3659
3465
|
)
|
|
3660
3466
|
)
|
|
@@ -3676,14 +3482,14 @@ var CategoryModule = {
|
|
|
3676
3482
|
command: "category <command>",
|
|
3677
3483
|
aliases: ["cat"],
|
|
3678
3484
|
describe: "Commands for Canvas categories",
|
|
3679
|
-
builder: (
|
|
3485
|
+
builder: (yargs43) => yargs43.command(CategoryPullModule).command(CategoryPushModule).command(CategoryGetModule).command(CategoryRemoveModule).command(CategoryListModule).command(CategoryUpdateModule).demandCommand(),
|
|
3680
3486
|
handler: () => {
|
|
3681
|
-
|
|
3487
|
+
yargs5.help();
|
|
3682
3488
|
}
|
|
3683
3489
|
};
|
|
3684
3490
|
|
|
3685
3491
|
// src/commands/canvas/commands/component.ts
|
|
3686
|
-
import
|
|
3492
|
+
import yargs6 from "yargs";
|
|
3687
3493
|
|
|
3688
3494
|
// src/commands/canvas/commands/component/_util.ts
|
|
3689
3495
|
import { UncachedCanvasClient } from "@uniformdev/canvas";
|
|
@@ -3698,12 +3504,12 @@ function getCanvasClient(options) {
|
|
|
3698
3504
|
var ComponentGetModule = {
|
|
3699
3505
|
command: "get <id>",
|
|
3700
3506
|
describe: "Fetch a component definition",
|
|
3701
|
-
builder: (
|
|
3507
|
+
builder: (yargs43) => withConfiguration(
|
|
3702
3508
|
withFormatOptions(
|
|
3703
3509
|
withDebugOptions(
|
|
3704
3510
|
withApiOptions(
|
|
3705
3511
|
withProjectOptions(
|
|
3706
|
-
|
|
3512
|
+
yargs43.positional("id", {
|
|
3707
3513
|
demandOption: true,
|
|
3708
3514
|
describe: "Component definition public ID to fetch"
|
|
3709
3515
|
})
|
|
@@ -3737,12 +3543,12 @@ var ComponentListModule = {
|
|
|
3737
3543
|
command: "list",
|
|
3738
3544
|
describe: "List component definitions",
|
|
3739
3545
|
aliases: ["ls"],
|
|
3740
|
-
builder: (
|
|
3546
|
+
builder: (yargs43) => withConfiguration(
|
|
3741
3547
|
withFormatOptions(
|
|
3742
3548
|
withDebugOptions(
|
|
3743
3549
|
withApiOptions(
|
|
3744
3550
|
withProjectOptions(
|
|
3745
|
-
|
|
3551
|
+
yargs43.options({
|
|
3746
3552
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
3747
3553
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 }
|
|
3748
3554
|
})
|
|
@@ -3813,13 +3619,13 @@ function createComponentDefinitionEngineDataSource({
|
|
|
3813
3619
|
var ComponentPullModule = {
|
|
3814
3620
|
command: "pull <directory>",
|
|
3815
3621
|
describe: "Pulls all component definitions to local files in a directory",
|
|
3816
|
-
builder: (
|
|
3622
|
+
builder: (yargs43) => withConfiguration(
|
|
3817
3623
|
withApiOptions(
|
|
3818
3624
|
withDebugOptions(
|
|
3819
3625
|
withProjectOptions(
|
|
3820
3626
|
withDiffOptions(
|
|
3821
3627
|
withBatchSizeOptions(
|
|
3822
|
-
|
|
3628
|
+
yargs43.positional("directory", {
|
|
3823
3629
|
describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
3824
3630
|
type: "string"
|
|
3825
3631
|
}).option("format", {
|
|
@@ -3902,13 +3708,13 @@ var ComponentPullModule = {
|
|
|
3902
3708
|
var ComponentPushModule = {
|
|
3903
3709
|
command: "push <directory>",
|
|
3904
3710
|
describe: "Pushes all component definitions from files in a directory to Uniform Canvas",
|
|
3905
|
-
builder: (
|
|
3711
|
+
builder: (yargs43) => withConfiguration(
|
|
3906
3712
|
withApiOptions(
|
|
3907
3713
|
withDebugOptions(
|
|
3908
3714
|
withProjectOptions(
|
|
3909
3715
|
withDiffOptions(
|
|
3910
3716
|
withBatchSizeOptions(
|
|
3911
|
-
|
|
3717
|
+
yargs43.positional("directory", {
|
|
3912
3718
|
describe: "Directory to read the component definitions from. If a filename is used, a package will be read instead.",
|
|
3913
3719
|
type: "string"
|
|
3914
3720
|
}).option("mode", {
|
|
@@ -3980,11 +3786,11 @@ var ComponentRemoveModule = {
|
|
|
3980
3786
|
command: "remove <id>",
|
|
3981
3787
|
aliases: ["delete", "rm"],
|
|
3982
3788
|
describe: "Delete a component definition",
|
|
3983
|
-
builder: (
|
|
3789
|
+
builder: (yargs43) => withConfiguration(
|
|
3984
3790
|
withDebugOptions(
|
|
3985
3791
|
withApiOptions(
|
|
3986
3792
|
withProjectOptions(
|
|
3987
|
-
|
|
3793
|
+
yargs43.positional("id", {
|
|
3988
3794
|
demandOption: true,
|
|
3989
3795
|
describe: "Component definition public ID to delete"
|
|
3990
3796
|
})
|
|
@@ -4008,11 +3814,11 @@ var ComponentUpdateModule = {
|
|
|
4008
3814
|
command: "update <filename>",
|
|
4009
3815
|
aliases: ["put"],
|
|
4010
3816
|
describe: "Insert or update a component definition",
|
|
4011
|
-
builder: (
|
|
3817
|
+
builder: (yargs43) => withConfiguration(
|
|
4012
3818
|
withApiOptions(
|
|
4013
3819
|
withDebugOptions(
|
|
4014
3820
|
withProjectOptions(
|
|
4015
|
-
|
|
3821
|
+
yargs43.positional("filename", { demandOption: true, describe: "Component definition file to put" })
|
|
4016
3822
|
)
|
|
4017
3823
|
)
|
|
4018
3824
|
)
|
|
@@ -4034,14 +3840,14 @@ var ComponentModule = {
|
|
|
4034
3840
|
command: "component <command>",
|
|
4035
3841
|
aliases: ["def"],
|
|
4036
3842
|
describe: "Commands for Canvas component definitions",
|
|
4037
|
-
builder: (
|
|
3843
|
+
builder: (yargs43) => yargs43.command(ComponentPullModule).command(ComponentPushModule).command(ComponentGetModule).command(ComponentRemoveModule).command(ComponentListModule).command(ComponentUpdateModule).demandCommand(),
|
|
4038
3844
|
handler: () => {
|
|
4039
|
-
|
|
3845
|
+
yargs6.help();
|
|
4040
3846
|
}
|
|
4041
3847
|
};
|
|
4042
3848
|
|
|
4043
3849
|
// src/commands/canvas/commands/componentPattern.ts
|
|
4044
|
-
import
|
|
3850
|
+
import yargs7 from "yargs";
|
|
4045
3851
|
|
|
4046
3852
|
// src/commands/canvas/util/entityTypeValidation.ts
|
|
4047
3853
|
import { CANVAS_DRAFT_STATE as CANVAS_DRAFT_STATE2 } from "@uniformdev/canvas";
|
|
@@ -4196,13 +4002,13 @@ function createCompositionGetHandler(expectedType) {
|
|
|
4196
4002
|
var CompositionGetModule = {
|
|
4197
4003
|
command: "get <id>",
|
|
4198
4004
|
describe: "Fetch a composition",
|
|
4199
|
-
builder: (
|
|
4005
|
+
builder: (yargs43) => withFormatOptions(
|
|
4200
4006
|
withConfiguration(
|
|
4201
4007
|
withApiOptions(
|
|
4202
4008
|
withProjectOptions(
|
|
4203
4009
|
withStateOptions(
|
|
4204
4010
|
withDebugOptions(
|
|
4205
|
-
|
|
4011
|
+
yargs43.positional("id", {
|
|
4206
4012
|
demandOption: true,
|
|
4207
4013
|
describe: "Composition public ID to fetch"
|
|
4208
4014
|
}).option({
|
|
@@ -4258,13 +4064,13 @@ var CompositionListModule = {
|
|
|
4258
4064
|
command: "list",
|
|
4259
4065
|
describe: "List compositions",
|
|
4260
4066
|
aliases: ["ls"],
|
|
4261
|
-
builder: (
|
|
4067
|
+
builder: (yargs43) => withFormatOptions(
|
|
4262
4068
|
withConfiguration(
|
|
4263
4069
|
withApiOptions(
|
|
4264
4070
|
withProjectOptions(
|
|
4265
4071
|
withDebugOptions(
|
|
4266
4072
|
withStateOptions(
|
|
4267
|
-
|
|
4073
|
+
yargs43.options({
|
|
4268
4074
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4269
4075
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
4270
4076
|
search: { describe: "Search query", type: "string", default: "" },
|
|
@@ -4345,13 +4151,13 @@ var CompositionListModule = {
|
|
|
4345
4151
|
var ComponentPatternListModule = {
|
|
4346
4152
|
...CompositionListModule,
|
|
4347
4153
|
describe: "List component patterns",
|
|
4348
|
-
builder: (
|
|
4154
|
+
builder: (yargs43) => withFormatOptions(
|
|
4349
4155
|
withConfiguration(
|
|
4350
4156
|
withApiOptions(
|
|
4351
4157
|
withDebugOptions(
|
|
4352
4158
|
withProjectOptions(
|
|
4353
4159
|
withStateOptions(
|
|
4354
|
-
|
|
4160
|
+
yargs43.options({
|
|
4355
4161
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
4356
4162
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
4357
4163
|
resolvePatterns: {
|
|
@@ -4475,13 +4281,13 @@ function createComponentInstanceEngineDataSource({
|
|
|
4475
4281
|
var CompositionPublishModule = {
|
|
4476
4282
|
command: "publish [ids]",
|
|
4477
4283
|
describe: "Publishes composition(s)",
|
|
4478
|
-
builder: (
|
|
4284
|
+
builder: (yargs43) => withConfiguration(
|
|
4479
4285
|
withApiOptions(
|
|
4480
4286
|
withProjectOptions(
|
|
4481
4287
|
withDebugOptions(
|
|
4482
4288
|
withDiffOptions(
|
|
4483
4289
|
withBatchSizeOptions(
|
|
4484
|
-
|
|
4290
|
+
yargs43.positional("ids", {
|
|
4485
4291
|
describe: "Publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4486
4292
|
type: "string"
|
|
4487
4293
|
}).option("all", {
|
|
@@ -4579,13 +4385,13 @@ var CompositionPublishModule = {
|
|
|
4579
4385
|
var ComponentPatternPublishModule = {
|
|
4580
4386
|
...CompositionPublishModule,
|
|
4581
4387
|
describe: "Publishes component pattern(s)",
|
|
4582
|
-
builder: (
|
|
4388
|
+
builder: (yargs43) => withConfiguration(
|
|
4583
4389
|
withApiOptions(
|
|
4584
4390
|
withDebugOptions(
|
|
4585
4391
|
withProjectOptions(
|
|
4586
4392
|
withDiffOptions(
|
|
4587
4393
|
withBatchSizeOptions(
|
|
4588
|
-
|
|
4394
|
+
yargs43.positional("ids", {
|
|
4589
4395
|
describe: "Publishes component pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
4590
4396
|
type: "string"
|
|
4591
4397
|
}).option("all", {
|
|
@@ -4627,14 +4433,14 @@ function componentInstancePullModuleFactory(type, entityType) {
|
|
|
4627
4433
|
return {
|
|
4628
4434
|
command: "pull <directory>",
|
|
4629
4435
|
describe: "Pulls all compositions to local files in a directory",
|
|
4630
|
-
builder: (
|
|
4436
|
+
builder: (yargs43) => withConfiguration(
|
|
4631
4437
|
withApiOptions(
|
|
4632
4438
|
withProjectOptions(
|
|
4633
4439
|
withStateOptions(
|
|
4634
4440
|
withDebugOptions(
|
|
4635
4441
|
withDiffOptions(
|
|
4636
4442
|
withBatchSizeOptions(
|
|
4637
|
-
|
|
4443
|
+
yargs43.positional("directory", {
|
|
4638
4444
|
describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
4639
4445
|
type: "string"
|
|
4640
4446
|
}).option("format", {
|
|
@@ -4753,13 +4559,13 @@ function componentInstancePullModuleFactory(type, entityType) {
|
|
|
4753
4559
|
var ComponentPatternPullModule = {
|
|
4754
4560
|
...componentInstancePullModuleFactory("componentPatterns", "componentPattern"),
|
|
4755
4561
|
describe: "Pulls all component patterns to local files in a directory",
|
|
4756
|
-
builder: (
|
|
4562
|
+
builder: (yargs43) => withConfiguration(
|
|
4757
4563
|
withApiOptions(
|
|
4758
4564
|
withProjectOptions(
|
|
4759
4565
|
withDebugOptions(
|
|
4760
4566
|
withStateOptions(
|
|
4761
4567
|
withDiffOptions(
|
|
4762
|
-
|
|
4568
|
+
yargs43.positional("directory", {
|
|
4763
4569
|
describe: "Directory to save the component definitions to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
4764
4570
|
type: "string"
|
|
4765
4571
|
}).option("format", {
|
|
@@ -4833,14 +4639,14 @@ function componentInstancePushModuleFactory(type, entityType) {
|
|
|
4833
4639
|
return {
|
|
4834
4640
|
command: "push <directory>",
|
|
4835
4641
|
describe: "Pushes all compositions from files in a directory to Uniform Canvas",
|
|
4836
|
-
builder: (
|
|
4642
|
+
builder: (yargs43) => withConfiguration(
|
|
4837
4643
|
withApiOptions(
|
|
4838
4644
|
withProjectOptions(
|
|
4839
4645
|
withStateOptions(
|
|
4840
4646
|
withDebugOptions(
|
|
4841
4647
|
withDiffOptions(
|
|
4842
4648
|
withBatchSizeOptions(
|
|
4843
|
-
|
|
4649
|
+
yargs43.positional("directory", {
|
|
4844
4650
|
describe: "Directory to read the compositions/patterns from. If a filename is used, a package will be read instead.",
|
|
4845
4651
|
type: "string"
|
|
4846
4652
|
}).option("mode", {
|
|
@@ -4958,13 +4764,13 @@ function componentInstancePushModuleFactory(type, entityType) {
|
|
|
4958
4764
|
var ComponentPatternPushModule = {
|
|
4959
4765
|
...componentInstancePushModuleFactory("componentPatterns", "componentPattern"),
|
|
4960
4766
|
describe: "Pushes all component patterns from files in a directory to Uniform Canvas",
|
|
4961
|
-
builder: (
|
|
4767
|
+
builder: (yargs43) => withConfiguration(
|
|
4962
4768
|
withApiOptions(
|
|
4963
4769
|
withProjectOptions(
|
|
4964
4770
|
withStateOptions(
|
|
4965
4771
|
withDiffOptions(
|
|
4966
4772
|
withDebugOptions(
|
|
4967
|
-
|
|
4773
|
+
yargs43.positional("directory", {
|
|
4968
4774
|
describe: "Directory to read the compositions/component patterns from. If a filename is used, a package will be read instead.",
|
|
4969
4775
|
type: "string"
|
|
4970
4776
|
}).option("mode", {
|
|
@@ -5029,11 +4835,11 @@ var CompositionRemoveModule = {
|
|
|
5029
4835
|
command: "remove <id>",
|
|
5030
4836
|
aliases: ["delete", "rm"],
|
|
5031
4837
|
describe: "Delete a composition",
|
|
5032
|
-
builder: (
|
|
4838
|
+
builder: (yargs43) => withConfiguration(
|
|
5033
4839
|
withApiOptions(
|
|
5034
4840
|
withDebugOptions(
|
|
5035
4841
|
withProjectOptions(
|
|
5036
|
-
|
|
4842
|
+
yargs43.positional("id", {
|
|
5037
4843
|
demandOption: true,
|
|
5038
4844
|
describe: "Composition public ID to delete"
|
|
5039
4845
|
})
|
|
@@ -5060,12 +4866,12 @@ import { diffJson as diffJson2 } from "diff";
|
|
|
5060
4866
|
var CompositionUnpublishModule = {
|
|
5061
4867
|
command: "unpublish [ids]",
|
|
5062
4868
|
describe: "Unpublish a composition(s)",
|
|
5063
|
-
builder: (
|
|
4869
|
+
builder: (yargs43) => withConfiguration(
|
|
5064
4870
|
withApiOptions(
|
|
5065
4871
|
withDebugOptions(
|
|
5066
4872
|
withProjectOptions(
|
|
5067
4873
|
withBatchSizeOptions(
|
|
5068
|
-
|
|
4874
|
+
yargs43.positional("ids", {
|
|
5069
4875
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
5070
4876
|
type: "string"
|
|
5071
4877
|
}).option("all", {
|
|
@@ -5181,11 +4987,11 @@ var CompositionUnpublishModule = {
|
|
|
5181
4987
|
var ComponentPatternUnpublishModule = {
|
|
5182
4988
|
command: "unpublish [ids]",
|
|
5183
4989
|
describe: "Unpublish a component pattern(s)",
|
|
5184
|
-
builder: (
|
|
4990
|
+
builder: (yargs43) => withConfiguration(
|
|
5185
4991
|
withApiOptions(
|
|
5186
4992
|
withDebugOptions(
|
|
5187
4993
|
withProjectOptions(
|
|
5188
|
-
|
|
4994
|
+
yargs43.positional("ids", {
|
|
5189
4995
|
describe: "Un-publishes composition(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
5190
4996
|
type: "string"
|
|
5191
4997
|
}).option("all", {
|
|
@@ -5253,12 +5059,12 @@ var CompositionUpdateModule = {
|
|
|
5253
5059
|
command: "update <filename>",
|
|
5254
5060
|
aliases: ["put"],
|
|
5255
5061
|
describe: "Insert or update a composition",
|
|
5256
|
-
builder: (
|
|
5062
|
+
builder: (yargs43) => withConfiguration(
|
|
5257
5063
|
withApiOptions(
|
|
5258
5064
|
withProjectOptions(
|
|
5259
5065
|
withDebugOptions(
|
|
5260
5066
|
withStateOptions(
|
|
5261
|
-
|
|
5067
|
+
yargs43.positional("filename", {
|
|
5262
5068
|
demandOption: true,
|
|
5263
5069
|
describe: "Composition/pattern file to put"
|
|
5264
5070
|
})
|
|
@@ -5281,26 +5087,26 @@ var ComponentPatternUpdateModule = {
|
|
|
5281
5087
|
var ComponentPatternModule = {
|
|
5282
5088
|
command: "component-pattern <command>",
|
|
5283
5089
|
describe: "Commands for Canvas component patterns",
|
|
5284
|
-
builder: (
|
|
5090
|
+
builder: (yargs43) => yargs43.command(ComponentPatternPullModule).command(ComponentPatternPushModule).command(ComponentPatternGetModule).command(ComponentPatternRemoveModule).command(ComponentPatternListModule).command(ComponentPatternUpdateModule).command(ComponentPatternPublishModule).command(ComponentPatternUnpublishModule).demandCommand(),
|
|
5285
5091
|
handler: () => {
|
|
5286
|
-
|
|
5092
|
+
yargs7.help();
|
|
5287
5093
|
}
|
|
5288
5094
|
};
|
|
5289
5095
|
|
|
5290
5096
|
// src/commands/canvas/commands/composition.ts
|
|
5291
|
-
import
|
|
5097
|
+
import yargs8 from "yargs";
|
|
5292
5098
|
var CompositionModule = {
|
|
5293
5099
|
command: "composition <command>",
|
|
5294
5100
|
describe: "Commands for Canvas compositions",
|
|
5295
5101
|
aliases: ["comp"],
|
|
5296
|
-
builder: (
|
|
5102
|
+
builder: (yargs43) => yargs43.command(CompositionPullModule).command(CompositionPushModule).command(CompositionGetModule).command(CompositionRemoveModule).command(CompositionListModule).command(CompositionUpdateModule).command(CompositionPublishModule).command(CompositionUnpublishModule).demandCommand(),
|
|
5297
5103
|
handler: () => {
|
|
5298
|
-
|
|
5104
|
+
yargs8.help();
|
|
5299
5105
|
}
|
|
5300
5106
|
};
|
|
5301
5107
|
|
|
5302
5108
|
// src/commands/canvas/commands/compositionPattern.ts
|
|
5303
|
-
import
|
|
5109
|
+
import yargs9 from "yargs";
|
|
5304
5110
|
|
|
5305
5111
|
// src/commands/canvas/commands/compositionPattern/get.ts
|
|
5306
5112
|
var CompositionPatternGetModule = {
|
|
@@ -5313,13 +5119,13 @@ var CompositionPatternGetModule = {
|
|
|
5313
5119
|
var CompositionPatternListModule = {
|
|
5314
5120
|
...CompositionListModule,
|
|
5315
5121
|
describe: "List composition patterns",
|
|
5316
|
-
builder: (
|
|
5122
|
+
builder: (yargs43) => withFormatOptions(
|
|
5317
5123
|
withConfiguration(
|
|
5318
5124
|
withApiOptions(
|
|
5319
5125
|
withDebugOptions(
|
|
5320
5126
|
withProjectOptions(
|
|
5321
5127
|
withStateOptions(
|
|
5322
|
-
|
|
5128
|
+
yargs43.options({
|
|
5323
5129
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
5324
5130
|
limit: { describe: "Number of rows to fetch", type: "number", default: 20 },
|
|
5325
5131
|
resolvePatterns: {
|
|
@@ -5363,13 +5169,13 @@ var CompositionPatternListModule = {
|
|
|
5363
5169
|
var CompositionPatternPublishModule = {
|
|
5364
5170
|
...CompositionPublishModule,
|
|
5365
5171
|
describe: "Publishes composition pattern(s)",
|
|
5366
|
-
builder: (
|
|
5172
|
+
builder: (yargs43) => withConfiguration(
|
|
5367
5173
|
withApiOptions(
|
|
5368
5174
|
withDebugOptions(
|
|
5369
5175
|
withProjectOptions(
|
|
5370
5176
|
withDiffOptions(
|
|
5371
5177
|
withBatchSizeOptions(
|
|
5372
|
-
|
|
5178
|
+
yargs43.positional("ids", {
|
|
5373
5179
|
describe: "Publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
5374
5180
|
type: "string"
|
|
5375
5181
|
}).option("all", {
|
|
@@ -5410,13 +5216,13 @@ var CompositionPatternPublishModule = {
|
|
|
5410
5216
|
var CompositionPatternPullModule = {
|
|
5411
5217
|
...componentInstancePullModuleFactory("compositionPatterns", "compositionPattern"),
|
|
5412
5218
|
describe: "Pulls all composition patterns to local files in a directory",
|
|
5413
|
-
builder: (
|
|
5219
|
+
builder: (yargs43) => withConfiguration(
|
|
5414
5220
|
withApiOptions(
|
|
5415
5221
|
withDebugOptions(
|
|
5416
5222
|
withProjectOptions(
|
|
5417
5223
|
withStateOptions(
|
|
5418
5224
|
withDiffOptions(
|
|
5419
|
-
|
|
5225
|
+
yargs43.positional("directory", {
|
|
5420
5226
|
describe: "Directory to save the composition patterns to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
5421
5227
|
type: "string"
|
|
5422
5228
|
}).option("format", {
|
|
@@ -5454,13 +5260,13 @@ var CompositionPatternPullModule = {
|
|
|
5454
5260
|
var CompositionPatternPushModule = {
|
|
5455
5261
|
...componentInstancePushModuleFactory("compositionPatterns", "compositionPattern"),
|
|
5456
5262
|
describe: "Pushes all composition patterns from files in a directory to Uniform Canvas",
|
|
5457
|
-
builder: (
|
|
5263
|
+
builder: (yargs43) => withConfiguration(
|
|
5458
5264
|
withApiOptions(
|
|
5459
5265
|
withDebugOptions(
|
|
5460
5266
|
withProjectOptions(
|
|
5461
5267
|
withStateOptions(
|
|
5462
5268
|
withDiffOptions(
|
|
5463
|
-
|
|
5269
|
+
yargs43.positional("directory", {
|
|
5464
5270
|
describe: "Directory to read the compositions patterns from. If a filename is used, a package will be read instead.",
|
|
5465
5271
|
type: "string"
|
|
5466
5272
|
}).option("mode", {
|
|
@@ -5500,11 +5306,11 @@ var CompositionPatternRemoveModule = {
|
|
|
5500
5306
|
var CompositionPatternUnpublishModule = {
|
|
5501
5307
|
command: "unpublish [ids]",
|
|
5502
5308
|
describe: "Unpublish a composition pattern(s)",
|
|
5503
|
-
builder: (
|
|
5309
|
+
builder: (yargs43) => withConfiguration(
|
|
5504
5310
|
withApiOptions(
|
|
5505
5311
|
withDebugOptions(
|
|
5506
5312
|
withProjectOptions(
|
|
5507
|
-
|
|
5313
|
+
yargs43.positional("ids", {
|
|
5508
5314
|
describe: "Un-publishes composition pattern(s) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
5509
5315
|
type: "string"
|
|
5510
5316
|
}).option("all", {
|
|
@@ -5541,14 +5347,14 @@ var CompositionPatternUpdateModule = {
|
|
|
5541
5347
|
var CompositionPatternModule = {
|
|
5542
5348
|
command: "composition-pattern <command>",
|
|
5543
5349
|
describe: "Commands for Canvas composition patterns",
|
|
5544
|
-
builder: (
|
|
5350
|
+
builder: (yargs43) => yargs43.command(CompositionPatternPullModule).command(CompositionPatternPushModule).command(CompositionPatternGetModule).command(CompositionPatternRemoveModule).command(CompositionPatternListModule).command(CompositionPatternUpdateModule).command(CompositionPatternPublishModule).command(CompositionPatternUnpublishModule).demandCommand(),
|
|
5545
5351
|
handler: () => {
|
|
5546
|
-
|
|
5352
|
+
yargs9.help();
|
|
5547
5353
|
}
|
|
5548
5354
|
};
|
|
5549
5355
|
|
|
5550
5356
|
// src/commands/canvas/commands/contentType.ts
|
|
5551
|
-
import
|
|
5357
|
+
import yargs10 from "yargs";
|
|
5552
5358
|
|
|
5553
5359
|
// src/commands/canvas/commands/contentType/_util.ts
|
|
5554
5360
|
import { ContentClient } from "@uniformdev/canvas";
|
|
@@ -5562,12 +5368,12 @@ function getContentClient(options) {
|
|
|
5562
5368
|
var ContentTypeGetModule = {
|
|
5563
5369
|
command: "get <id>",
|
|
5564
5370
|
describe: "Get a content type",
|
|
5565
|
-
builder: (
|
|
5371
|
+
builder: (yargs43) => withConfiguration(
|
|
5566
5372
|
withDebugOptions(
|
|
5567
5373
|
withFormatOptions(
|
|
5568
5374
|
withApiOptions(
|
|
5569
5375
|
withProjectOptions(
|
|
5570
|
-
|
|
5376
|
+
yargs43.positional("id", {
|
|
5571
5377
|
demandOption: true,
|
|
5572
5378
|
describe: "Content type public ID to fetch"
|
|
5573
5379
|
})
|
|
@@ -5592,7 +5398,7 @@ var ContentTypeGetModule = {
|
|
|
5592
5398
|
var ContentTypeListModule = {
|
|
5593
5399
|
command: "list",
|
|
5594
5400
|
describe: "List content types",
|
|
5595
|
-
builder: (
|
|
5401
|
+
builder: (yargs43) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs43))))),
|
|
5596
5402
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
5597
5403
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
5598
5404
|
const client = getContentClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -5638,13 +5444,13 @@ function createContentTypeEngineDataSource({
|
|
|
5638
5444
|
var ContentTypePullModule = {
|
|
5639
5445
|
command: "pull <directory>",
|
|
5640
5446
|
describe: "Pulls all content types to local files in a directory",
|
|
5641
|
-
builder: (
|
|
5447
|
+
builder: (yargs43) => withConfiguration(
|
|
5642
5448
|
withApiOptions(
|
|
5643
5449
|
withDebugOptions(
|
|
5644
5450
|
withProjectOptions(
|
|
5645
5451
|
withDiffOptions(
|
|
5646
5452
|
withBatchSizeOptions(
|
|
5647
|
-
|
|
5453
|
+
yargs43.positional("directory", {
|
|
5648
5454
|
describe: "Directory to save the content types to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
5649
5455
|
type: "string"
|
|
5650
5456
|
}).option("format", {
|
|
@@ -5731,13 +5537,13 @@ var ContentTypePullModule = {
|
|
|
5731
5537
|
var ContentTypePushModule = {
|
|
5732
5538
|
command: "push <directory>",
|
|
5733
5539
|
describe: "Pushes all content types from files in a directory to Uniform",
|
|
5734
|
-
builder: (
|
|
5540
|
+
builder: (yargs43) => withConfiguration(
|
|
5735
5541
|
withApiOptions(
|
|
5736
5542
|
withDebugOptions(
|
|
5737
5543
|
withProjectOptions(
|
|
5738
5544
|
withDiffOptions(
|
|
5739
5545
|
withBatchSizeOptions(
|
|
5740
|
-
|
|
5546
|
+
yargs43.positional("directory", {
|
|
5741
5547
|
describe: "Directory to read the content types from. If a filename is used, a package will be read instead.",
|
|
5742
5548
|
type: "string"
|
|
5743
5549
|
}).option("what-if", {
|
|
@@ -5818,11 +5624,11 @@ var ContentTypeRemoveModule = {
|
|
|
5818
5624
|
command: "remove <id>",
|
|
5819
5625
|
aliases: ["delete", "rm"],
|
|
5820
5626
|
describe: "Delete a content type",
|
|
5821
|
-
builder: (
|
|
5627
|
+
builder: (yargs43) => withConfiguration(
|
|
5822
5628
|
withDebugOptions(
|
|
5823
5629
|
withApiOptions(
|
|
5824
5630
|
withProjectOptions(
|
|
5825
|
-
|
|
5631
|
+
yargs43.positional("id", { demandOption: true, describe: "Content type public ID to delete" })
|
|
5826
5632
|
)
|
|
5827
5633
|
)
|
|
5828
5634
|
)
|
|
@@ -5843,11 +5649,11 @@ var ContentTypeUpdateModule = {
|
|
|
5843
5649
|
command: "update <filename>",
|
|
5844
5650
|
aliases: ["put"],
|
|
5845
5651
|
describe: "Insert or update a content type",
|
|
5846
|
-
builder: (
|
|
5652
|
+
builder: (yargs43) => withConfiguration(
|
|
5847
5653
|
withDebugOptions(
|
|
5848
5654
|
withApiOptions(
|
|
5849
5655
|
withProjectOptions(
|
|
5850
|
-
|
|
5656
|
+
yargs43.positional("filename", { demandOption: true, describe: "Content type file to put" })
|
|
5851
5657
|
)
|
|
5852
5658
|
)
|
|
5853
5659
|
)
|
|
@@ -5869,14 +5675,14 @@ var ContentTypeModule = {
|
|
|
5869
5675
|
command: "contenttype <command>",
|
|
5870
5676
|
aliases: ["ct"],
|
|
5871
5677
|
describe: "Commands for Content Types",
|
|
5872
|
-
builder: (
|
|
5678
|
+
builder: (yargs43) => yargs43.command(ContentTypeGetModule).command(ContentTypeListModule).command(ContentTypeRemoveModule).command(ContentTypeUpdateModule).command(ContentTypePullModule).command(ContentTypePushModule).demandCommand(),
|
|
5873
5679
|
handler: () => {
|
|
5874
|
-
|
|
5680
|
+
yargs10.help();
|
|
5875
5681
|
}
|
|
5876
5682
|
};
|
|
5877
5683
|
|
|
5878
5684
|
// src/commands/canvas/commands/dataSource.ts
|
|
5879
|
-
import
|
|
5685
|
+
import yargs11 from "yargs";
|
|
5880
5686
|
|
|
5881
5687
|
// src/commands/canvas/commands/dataSource/_util.ts
|
|
5882
5688
|
import { DataSourceClient } from "@uniformdev/canvas";
|
|
@@ -5888,11 +5694,11 @@ function getDataSourceClient(options) {
|
|
|
5888
5694
|
var DataSourceGetModule = {
|
|
5889
5695
|
command: "get <id>",
|
|
5890
5696
|
describe: "Get a data source by ID and writes to stdout. Please note this may contain secret data, use discretion.",
|
|
5891
|
-
builder: (
|
|
5697
|
+
builder: (yargs43) => withConfiguration(
|
|
5892
5698
|
withApiOptions(
|
|
5893
5699
|
withDebugOptions(
|
|
5894
5700
|
withProjectOptions(
|
|
5895
|
-
|
|
5701
|
+
yargs43.positional("id", { demandOption: true, describe: "Data source public ID to fetch" })
|
|
5896
5702
|
)
|
|
5897
5703
|
)
|
|
5898
5704
|
)
|
|
@@ -5910,11 +5716,11 @@ var DataSourceRemoveModule = {
|
|
|
5910
5716
|
command: "remove <id>",
|
|
5911
5717
|
aliases: ["delete", "rm"],
|
|
5912
5718
|
describe: "Delete a data source",
|
|
5913
|
-
builder: (
|
|
5719
|
+
builder: (yargs43) => withConfiguration(
|
|
5914
5720
|
withDebugOptions(
|
|
5915
5721
|
withApiOptions(
|
|
5916
5722
|
withProjectOptions(
|
|
5917
|
-
|
|
5723
|
+
yargs43.positional("id", { demandOption: true, describe: "Data source public ID to delete" })
|
|
5918
5724
|
)
|
|
5919
5725
|
)
|
|
5920
5726
|
)
|
|
@@ -5935,11 +5741,11 @@ var DataSourceUpdateModule = {
|
|
|
5935
5741
|
command: "update <dataSource>",
|
|
5936
5742
|
aliases: ["put"],
|
|
5937
5743
|
describe: "Insert or update a data source",
|
|
5938
|
-
builder: (
|
|
5744
|
+
builder: (yargs43) => withConfiguration(
|
|
5939
5745
|
withApiOptions(
|
|
5940
5746
|
withDebugOptions(
|
|
5941
5747
|
withProjectOptions(
|
|
5942
|
-
|
|
5748
|
+
yargs43.positional("dataSource", { demandOption: true, describe: "Data source JSON to put" }).option("integrationType", {
|
|
5943
5749
|
describe: "Integration type that exposes the connector type for this data source (as defined in integration manifest).",
|
|
5944
5750
|
type: "string",
|
|
5945
5751
|
demandOption: true
|
|
@@ -5974,14 +5780,14 @@ var DataSourceModule = {
|
|
|
5974
5780
|
command: "datasource <command>",
|
|
5975
5781
|
aliases: ["ds"],
|
|
5976
5782
|
describe: "Commands for Data Source definitions",
|
|
5977
|
-
builder: (
|
|
5783
|
+
builder: (yargs43) => yargs43.command(DataSourceGetModule).command(DataSourceRemoveModule).command(DataSourceUpdateModule).demandCommand(),
|
|
5978
5784
|
handler: () => {
|
|
5979
|
-
|
|
5785
|
+
yargs11.help();
|
|
5980
5786
|
}
|
|
5981
5787
|
};
|
|
5982
5788
|
|
|
5983
5789
|
// src/commands/canvas/commands/dataType.ts
|
|
5984
|
-
import
|
|
5790
|
+
import yargs12 from "yargs";
|
|
5985
5791
|
|
|
5986
5792
|
// src/commands/canvas/commands/dataType/_util.ts
|
|
5987
5793
|
import { DataTypeClient } from "@uniformdev/canvas";
|
|
@@ -5996,12 +5802,12 @@ var DataTypeGetModule = {
|
|
|
5996
5802
|
command: "get <id>",
|
|
5997
5803
|
describe: "Get a data type",
|
|
5998
5804
|
aliases: ["ls"],
|
|
5999
|
-
builder: (
|
|
5805
|
+
builder: (yargs43) => withConfiguration(
|
|
6000
5806
|
withFormatOptions(
|
|
6001
5807
|
withDebugOptions(
|
|
6002
5808
|
withApiOptions(
|
|
6003
5809
|
withProjectOptions(
|
|
6004
|
-
|
|
5810
|
+
yargs43.positional("id", { demandOption: true, describe: "Data type public ID to fetch" })
|
|
6005
5811
|
)
|
|
6006
5812
|
)
|
|
6007
5813
|
)
|
|
@@ -6024,7 +5830,7 @@ var DataTypeListModule = {
|
|
|
6024
5830
|
command: "list",
|
|
6025
5831
|
describe: "List data types",
|
|
6026
5832
|
aliases: ["ls"],
|
|
6027
|
-
builder: (
|
|
5833
|
+
builder: (yargs43) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs43))))),
|
|
6028
5834
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
6029
5835
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
6030
5836
|
const client = getDataTypeClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -6067,12 +5873,12 @@ function createDataTypeEngineDataSource({
|
|
|
6067
5873
|
var DataTypePullModule = {
|
|
6068
5874
|
command: "pull <directory>",
|
|
6069
5875
|
describe: "Pulls all data types to local files in a directory",
|
|
6070
|
-
builder: (
|
|
5876
|
+
builder: (yargs43) => withConfiguration(
|
|
6071
5877
|
withApiOptions(
|
|
6072
5878
|
withDebugOptions(
|
|
6073
5879
|
withProjectOptions(
|
|
6074
5880
|
withDiffOptions(
|
|
6075
|
-
|
|
5881
|
+
yargs43.positional("directory", {
|
|
6076
5882
|
describe: "Directory to save the data types to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
6077
5883
|
type: "string"
|
|
6078
5884
|
}).option("format", {
|
|
@@ -6152,12 +5958,12 @@ var DataTypePullModule = {
|
|
|
6152
5958
|
var DataTypePushModule = {
|
|
6153
5959
|
command: "push <directory>",
|
|
6154
5960
|
describe: "Pushes all data types from files in a directory to Uniform",
|
|
6155
|
-
builder: (
|
|
5961
|
+
builder: (yargs43) => withConfiguration(
|
|
6156
5962
|
withApiOptions(
|
|
6157
5963
|
withDebugOptions(
|
|
6158
5964
|
withProjectOptions(
|
|
6159
5965
|
withDiffOptions(
|
|
6160
|
-
|
|
5966
|
+
yargs43.positional("directory", {
|
|
6161
5967
|
describe: "Directory to read the data types from. If a filename is used, a package will be read instead.",
|
|
6162
5968
|
type: "string"
|
|
6163
5969
|
}).option("mode", {
|
|
@@ -6226,11 +6032,11 @@ var DataTypeRemoveModule = {
|
|
|
6226
6032
|
command: "remove <id>",
|
|
6227
6033
|
aliases: ["delete", "rm"],
|
|
6228
6034
|
describe: "Delete a data type",
|
|
6229
|
-
builder: (
|
|
6035
|
+
builder: (yargs43) => withConfiguration(
|
|
6230
6036
|
withDebugOptions(
|
|
6231
6037
|
withApiOptions(
|
|
6232
6038
|
withProjectOptions(
|
|
6233
|
-
|
|
6039
|
+
yargs43.positional("id", { demandOption: true, describe: "Data type public ID to delete" })
|
|
6234
6040
|
)
|
|
6235
6041
|
)
|
|
6236
6042
|
)
|
|
@@ -6251,11 +6057,11 @@ var DataTypeUpdateModule = {
|
|
|
6251
6057
|
command: "update <filename>",
|
|
6252
6058
|
aliases: ["put"],
|
|
6253
6059
|
describe: "Insert or update a data type",
|
|
6254
|
-
builder: (
|
|
6060
|
+
builder: (yargs43) => withConfiguration(
|
|
6255
6061
|
withDebugOptions(
|
|
6256
6062
|
withApiOptions(
|
|
6257
6063
|
withProjectOptions(
|
|
6258
|
-
|
|
6064
|
+
yargs43.positional("filename", { demandOption: true, describe: "Data type file to put" })
|
|
6259
6065
|
)
|
|
6260
6066
|
)
|
|
6261
6067
|
)
|
|
@@ -6277,14 +6083,14 @@ var DataTypeModule = {
|
|
|
6277
6083
|
command: "datatype <command>",
|
|
6278
6084
|
aliases: ["dt"],
|
|
6279
6085
|
describe: "Commands for Data Type definitions",
|
|
6280
|
-
builder: (
|
|
6086
|
+
builder: (yargs43) => yargs43.command(DataTypeGetModule).command(DataTypePullModule).command(DataTypePushModule).command(DataTypeRemoveModule).command(DataTypeListModule).command(DataTypeUpdateModule).demandCommand(),
|
|
6281
6087
|
handler: () => {
|
|
6282
|
-
|
|
6088
|
+
yargs12.help();
|
|
6283
6089
|
}
|
|
6284
6090
|
};
|
|
6285
6091
|
|
|
6286
6092
|
// src/commands/canvas/commands/entry.ts
|
|
6287
|
-
import
|
|
6093
|
+
import yargs13 from "yargs";
|
|
6288
6094
|
|
|
6289
6095
|
// src/commands/canvas/commands/entry/get.ts
|
|
6290
6096
|
function createEntryGetHandler(expectedType) {
|
|
@@ -6338,13 +6144,13 @@ function createEntryGetHandler(expectedType) {
|
|
|
6338
6144
|
var EntryGetModule = {
|
|
6339
6145
|
command: "get <id>",
|
|
6340
6146
|
describe: "Get an entry",
|
|
6341
|
-
builder: (
|
|
6147
|
+
builder: (yargs43) => withConfiguration(
|
|
6342
6148
|
withDebugOptions(
|
|
6343
6149
|
withFormatOptions(
|
|
6344
6150
|
withApiOptions(
|
|
6345
6151
|
withProjectOptions(
|
|
6346
6152
|
withStateOptions(
|
|
6347
|
-
|
|
6153
|
+
yargs43.positional("id", { demandOption: true, describe: "Entry public ID to fetch" }).option({
|
|
6348
6154
|
resolveData: {
|
|
6349
6155
|
type: "boolean",
|
|
6350
6156
|
default: false,
|
|
@@ -6382,13 +6188,13 @@ var LEGACY_DEFAULT_LIMIT = 1e3;
|
|
|
6382
6188
|
var EntryListModule = {
|
|
6383
6189
|
command: "list",
|
|
6384
6190
|
describe: "List entries",
|
|
6385
|
-
builder: (
|
|
6191
|
+
builder: (yargs43) => withConfiguration(
|
|
6386
6192
|
withDebugOptions(
|
|
6387
6193
|
withFormatOptions(
|
|
6388
6194
|
withApiOptions(
|
|
6389
6195
|
withProjectOptions(
|
|
6390
6196
|
withStateOptions(
|
|
6391
|
-
|
|
6197
|
+
yargs43.options({
|
|
6392
6198
|
offset: { describe: "Number of rows to skip before fetching", type: "number", default: 0 },
|
|
6393
6199
|
limit: {
|
|
6394
6200
|
describe: "Number of rows to fetch",
|
|
@@ -6525,13 +6331,13 @@ function createEntryEngineDataSource({
|
|
|
6525
6331
|
var EntryPublishModule = {
|
|
6526
6332
|
command: "publish [ids]",
|
|
6527
6333
|
describe: "Publishes entry(ies)",
|
|
6528
|
-
builder: (
|
|
6334
|
+
builder: (yargs43) => withConfiguration(
|
|
6529
6335
|
withDebugOptions(
|
|
6530
6336
|
withDiffOptions(
|
|
6531
6337
|
withApiOptions(
|
|
6532
6338
|
withProjectOptions(
|
|
6533
6339
|
withBatchSizeOptions(
|
|
6534
|
-
|
|
6340
|
+
yargs43.positional("ids", {
|
|
6535
6341
|
describe: "Publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
6536
6342
|
type: "string"
|
|
6537
6343
|
}).option("all", {
|
|
@@ -6611,14 +6417,14 @@ var EntryPublishModule = {
|
|
|
6611
6417
|
var EntryPullModule = {
|
|
6612
6418
|
command: "pull <directory>",
|
|
6613
6419
|
describe: "Pulls all entries to local files in a directory",
|
|
6614
|
-
builder: (
|
|
6420
|
+
builder: (yargs43) => withConfiguration(
|
|
6615
6421
|
withDebugOptions(
|
|
6616
6422
|
withApiOptions(
|
|
6617
6423
|
withProjectOptions(
|
|
6618
6424
|
withStateOptions(
|
|
6619
6425
|
withDiffOptions(
|
|
6620
6426
|
withBatchSizeOptions(
|
|
6621
|
-
|
|
6427
|
+
yargs43.positional("directory", {
|
|
6622
6428
|
describe: "Directory to save the entries to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
6623
6429
|
type: "string"
|
|
6624
6430
|
}).option("format", {
|
|
@@ -6727,14 +6533,14 @@ var EntryPullModule = {
|
|
|
6727
6533
|
var EntryPushModule = {
|
|
6728
6534
|
command: "push <directory>",
|
|
6729
6535
|
describe: "Pushes all entries from files in a directory to Uniform",
|
|
6730
|
-
builder: (
|
|
6536
|
+
builder: (yargs43) => withConfiguration(
|
|
6731
6537
|
withDebugOptions(
|
|
6732
6538
|
withApiOptions(
|
|
6733
6539
|
withProjectOptions(
|
|
6734
6540
|
withStateOptions(
|
|
6735
6541
|
withDiffOptions(
|
|
6736
6542
|
withBatchSizeOptions(
|
|
6737
|
-
|
|
6543
|
+
yargs43.positional("directory", {
|
|
6738
6544
|
describe: "Directory to read the entries from. If a filename is used, a package will be read instead.",
|
|
6739
6545
|
type: "string"
|
|
6740
6546
|
}).option("mode", {
|
|
@@ -6873,11 +6679,11 @@ var EntryRemoveModule = {
|
|
|
6873
6679
|
command: "remove <id>",
|
|
6874
6680
|
aliases: ["delete", "rm"],
|
|
6875
6681
|
describe: "Delete an entry",
|
|
6876
|
-
builder: (
|
|
6682
|
+
builder: (yargs43) => withConfiguration(
|
|
6877
6683
|
withDebugOptions(
|
|
6878
6684
|
withApiOptions(
|
|
6879
6685
|
withProjectOptions(
|
|
6880
|
-
|
|
6686
|
+
yargs43.positional("id", { demandOption: true, describe: "Entry public ID to delete" })
|
|
6881
6687
|
)
|
|
6882
6688
|
)
|
|
6883
6689
|
)
|
|
@@ -6891,12 +6697,12 @@ import { diffJson as diffJson3 } from "diff";
|
|
|
6891
6697
|
var EntryUnpublishModule = {
|
|
6892
6698
|
command: "unpublish [ids]",
|
|
6893
6699
|
describe: "Unpublish an entry(ies)",
|
|
6894
|
-
builder: (
|
|
6700
|
+
builder: (yargs43) => withConfiguration(
|
|
6895
6701
|
withDebugOptions(
|
|
6896
6702
|
withApiOptions(
|
|
6897
6703
|
withProjectOptions(
|
|
6898
6704
|
withBatchSizeOptions(
|
|
6899
|
-
|
|
6705
|
+
yargs43.positional("ids", {
|
|
6900
6706
|
describe: "Un-publishes entry(ies) by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
6901
6707
|
type: "string"
|
|
6902
6708
|
}).option("all", {
|
|
@@ -7030,12 +6836,12 @@ var EntryUpdateModule = {
|
|
|
7030
6836
|
command: "update <filename>",
|
|
7031
6837
|
aliases: ["put"],
|
|
7032
6838
|
describe: "Insert or update an entry",
|
|
7033
|
-
builder: (
|
|
6839
|
+
builder: (yargs43) => withConfiguration(
|
|
7034
6840
|
withDebugOptions(
|
|
7035
6841
|
withApiOptions(
|
|
7036
6842
|
withProjectOptions(
|
|
7037
6843
|
withStateOptions(
|
|
7038
|
-
|
|
6844
|
+
yargs43.positional("filename", { demandOption: true, describe: "Entry file to put" })
|
|
7039
6845
|
)
|
|
7040
6846
|
)
|
|
7041
6847
|
)
|
|
@@ -7048,26 +6854,26 @@ var EntryUpdateModule = {
|
|
|
7048
6854
|
var EntryModule = {
|
|
7049
6855
|
command: "entry <command>",
|
|
7050
6856
|
describe: "Commands for Entries",
|
|
7051
|
-
builder: (
|
|
6857
|
+
builder: (yargs43) => yargs43.command(EntryGetModule).command(EntryListModule).command(EntryRemoveModule).command(EntryUpdateModule).command(EntryPullModule).command(EntryPushModule).command(EntryPublishModule).command(EntryUnpublishModule).demandCommand(),
|
|
7052
6858
|
handler: () => {
|
|
7053
|
-
|
|
6859
|
+
yargs13.help();
|
|
7054
6860
|
}
|
|
7055
6861
|
};
|
|
7056
6862
|
|
|
7057
6863
|
// src/commands/canvas/commands/entryPattern.ts
|
|
7058
|
-
import
|
|
6864
|
+
import yargs14 from "yargs";
|
|
7059
6865
|
|
|
7060
6866
|
// src/commands/canvas/commands/entryPattern/get.ts
|
|
7061
6867
|
var EntryPatternGetModule = {
|
|
7062
6868
|
command: "get <id>",
|
|
7063
6869
|
describe: "Get an entry pattern",
|
|
7064
|
-
builder: (
|
|
6870
|
+
builder: (yargs43) => withConfiguration(
|
|
7065
6871
|
withDebugOptions(
|
|
7066
6872
|
withFormatOptions(
|
|
7067
6873
|
withApiOptions(
|
|
7068
6874
|
withProjectOptions(
|
|
7069
6875
|
withStateOptions(
|
|
7070
|
-
|
|
6876
|
+
yargs43.positional("id", { demandOption: true, describe: "Entry pattern public ID to fetch" }).option({
|
|
7071
6877
|
resolveData: {
|
|
7072
6878
|
type: "boolean",
|
|
7073
6879
|
default: false,
|
|
@@ -7103,13 +6909,13 @@ var EntryPatternGetModule = {
|
|
|
7103
6909
|
var EntryPatternListModule = {
|
|
7104
6910
|
command: "list",
|
|
7105
6911
|
describe: "List entry patterns",
|
|
7106
|
-
builder: (
|
|
6912
|
+
builder: (yargs43) => withConfiguration(
|
|
7107
6913
|
withDebugOptions(
|
|
7108
6914
|
withFormatOptions(
|
|
7109
6915
|
withApiOptions(
|
|
7110
6916
|
withProjectOptions(
|
|
7111
6917
|
withStateOptions(
|
|
7112
|
-
|
|
6918
|
+
yargs43.option({
|
|
7113
6919
|
withComponentIDs: {
|
|
7114
6920
|
type: "boolean",
|
|
7115
6921
|
default: false,
|
|
@@ -7155,13 +6961,13 @@ var EntryPatternListModule = {
|
|
|
7155
6961
|
var EntryPatternPublishModule = {
|
|
7156
6962
|
command: "publish [ids]",
|
|
7157
6963
|
describe: "Publishes entry pattern(s)",
|
|
7158
|
-
builder: (
|
|
6964
|
+
builder: (yargs43) => withConfiguration(
|
|
7159
6965
|
withDebugOptions(
|
|
7160
6966
|
withApiOptions(
|
|
7161
6967
|
withProjectOptions(
|
|
7162
6968
|
withDiffOptions(
|
|
7163
6969
|
withBatchSizeOptions(
|
|
7164
|
-
|
|
6970
|
+
yargs43.positional("ids", {
|
|
7165
6971
|
describe: "Publishes entry pattern(s) by ID. Comma-separate multiple IDs. Use --all to publish all instead.",
|
|
7166
6972
|
type: "string"
|
|
7167
6973
|
}).option("all", {
|
|
@@ -7241,14 +7047,14 @@ var EntryPatternPublishModule = {
|
|
|
7241
7047
|
var EntryPatternPullModule = {
|
|
7242
7048
|
command: "pull <directory>",
|
|
7243
7049
|
describe: "Pulls all entry patterns to local files in a directory",
|
|
7244
|
-
builder: (
|
|
7050
|
+
builder: (yargs43) => withConfiguration(
|
|
7245
7051
|
withApiOptions(
|
|
7246
7052
|
withDebugOptions(
|
|
7247
7053
|
withProjectOptions(
|
|
7248
7054
|
withStateOptions(
|
|
7249
7055
|
withDiffOptions(
|
|
7250
7056
|
withBatchSizeOptions(
|
|
7251
|
-
|
|
7057
|
+
yargs43.positional("directory", {
|
|
7252
7058
|
describe: "Directory to save the entries to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
7253
7059
|
type: "string"
|
|
7254
7060
|
}).option("format", {
|
|
@@ -7357,14 +7163,14 @@ var EntryPatternPullModule = {
|
|
|
7357
7163
|
var EntryPatternPushModule = {
|
|
7358
7164
|
command: "push <directory>",
|
|
7359
7165
|
describe: "Pushes all entry patterns from files in a directory to Uniform",
|
|
7360
|
-
builder: (
|
|
7166
|
+
builder: (yargs43) => withConfiguration(
|
|
7361
7167
|
withDebugOptions(
|
|
7362
7168
|
withApiOptions(
|
|
7363
7169
|
withProjectOptions(
|
|
7364
7170
|
withStateOptions(
|
|
7365
7171
|
withDiffOptions(
|
|
7366
7172
|
withBatchSizeOptions(
|
|
7367
|
-
|
|
7173
|
+
yargs43.positional("directory", {
|
|
7368
7174
|
describe: "Directory to read the entry patterns from. If a filename is used, a package will be read instead.",
|
|
7369
7175
|
type: "string"
|
|
7370
7176
|
}).option("what-if", {
|
|
@@ -7477,11 +7283,11 @@ var EntryPatternRemoveModule = {
|
|
|
7477
7283
|
command: "remove <id>",
|
|
7478
7284
|
aliases: ["delete", "rm"],
|
|
7479
7285
|
describe: "Delete an entry pattern",
|
|
7480
|
-
builder: (
|
|
7286
|
+
builder: (yargs43) => withConfiguration(
|
|
7481
7287
|
withDebugOptions(
|
|
7482
7288
|
withApiOptions(
|
|
7483
7289
|
withProjectOptions(
|
|
7484
|
-
|
|
7290
|
+
yargs43.positional("id", { demandOption: true, describe: "Entry pattern public ID to delete" })
|
|
7485
7291
|
)
|
|
7486
7292
|
)
|
|
7487
7293
|
)
|
|
@@ -7495,12 +7301,12 @@ import { diffJson as diffJson4 } from "diff";
|
|
|
7495
7301
|
var EntryPatternUnpublishModule = {
|
|
7496
7302
|
command: "unpublish [ids]",
|
|
7497
7303
|
describe: "Unpublish entry pattern(s)",
|
|
7498
|
-
builder: (
|
|
7304
|
+
builder: (yargs43) => withConfiguration(
|
|
7499
7305
|
withDebugOptions(
|
|
7500
7306
|
withApiOptions(
|
|
7501
7307
|
withProjectOptions(
|
|
7502
7308
|
withBatchSizeOptions(
|
|
7503
|
-
|
|
7309
|
+
yargs43.positional("ids", {
|
|
7504
7310
|
describe: "Un-publishes entry patterns by ID. Comma-separate multiple IDs. Use --all to un-publish all instead.",
|
|
7505
7311
|
type: "string"
|
|
7506
7312
|
}).option("all", {
|
|
@@ -7599,12 +7405,12 @@ var EntryPatternUpdateModule = {
|
|
|
7599
7405
|
command: "update <filename>",
|
|
7600
7406
|
aliases: ["put"],
|
|
7601
7407
|
describe: "Insert or update an entry pattern",
|
|
7602
|
-
builder: (
|
|
7408
|
+
builder: (yargs43) => withConfiguration(
|
|
7603
7409
|
withDebugOptions(
|
|
7604
7410
|
withApiOptions(
|
|
7605
7411
|
withProjectOptions(
|
|
7606
7412
|
withStateOptions(
|
|
7607
|
-
|
|
7413
|
+
yargs43.positional("filename", { demandOption: true, describe: "Entry pattern file to put" })
|
|
7608
7414
|
)
|
|
7609
7415
|
)
|
|
7610
7416
|
)
|
|
@@ -7617,14 +7423,14 @@ var EntryPatternUpdateModule = {
|
|
|
7617
7423
|
var EntryPatternModule = {
|
|
7618
7424
|
command: "entry-pattern <command>",
|
|
7619
7425
|
describe: "Commands for Entry patterns",
|
|
7620
|
-
builder: (
|
|
7426
|
+
builder: (yargs43) => yargs43.command(EntryPatternGetModule).command(EntryPatternListModule).command(EntryPatternRemoveModule).command(EntryPatternUpdateModule).command(EntryPatternPullModule).command(EntryPatternPushModule).command(EntryPatternPublishModule).command(EntryPatternUnpublishModule).demandCommand(),
|
|
7621
7427
|
handler: () => {
|
|
7622
|
-
|
|
7428
|
+
yargs14.help();
|
|
7623
7429
|
}
|
|
7624
7430
|
};
|
|
7625
7431
|
|
|
7626
7432
|
// src/commands/canvas/commands/label.ts
|
|
7627
|
-
import
|
|
7433
|
+
import yargs15 from "yargs";
|
|
7628
7434
|
|
|
7629
7435
|
// src/commands/canvas/labelsEngineDataSource.ts
|
|
7630
7436
|
function normalizeLabelForSync(label) {
|
|
@@ -7675,13 +7481,13 @@ function getLabelClient(options) {
|
|
|
7675
7481
|
var LabelPullModule = {
|
|
7676
7482
|
command: "pull <directory>",
|
|
7677
7483
|
describe: "Pulls all labels to local files in a directory",
|
|
7678
|
-
builder: (
|
|
7484
|
+
builder: (yargs43) => withConfiguration(
|
|
7679
7485
|
withDebugOptions(
|
|
7680
7486
|
withApiOptions(
|
|
7681
7487
|
withProjectOptions(
|
|
7682
7488
|
withDiffOptions(
|
|
7683
7489
|
withBatchSizeOptions(
|
|
7684
|
-
|
|
7490
|
+
yargs43.positional("directory", {
|
|
7685
7491
|
describe: "Directory to save the labels to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
7686
7492
|
type: "string"
|
|
7687
7493
|
}).option("format", {
|
|
@@ -7770,13 +7576,13 @@ var __INTERNAL_MISSING_PARENT_LABEL_ERROR = "Parent label with public ID";
|
|
|
7770
7576
|
var LabelPushModule = {
|
|
7771
7577
|
command: "push <directory>",
|
|
7772
7578
|
describe: "Pushes all labels from files in a directory to Uniform",
|
|
7773
|
-
builder: (
|
|
7579
|
+
builder: (yargs43) => withConfiguration(
|
|
7774
7580
|
withDebugOptions(
|
|
7775
7581
|
withApiOptions(
|
|
7776
7582
|
withProjectOptions(
|
|
7777
7583
|
withDiffOptions(
|
|
7778
7584
|
withBatchSizeOptions(
|
|
7779
|
-
|
|
7585
|
+
yargs43.positional("directory", {
|
|
7780
7586
|
describe: "Directory to read the labels from. If a filename is used, a package will be read instead.",
|
|
7781
7587
|
type: "string"
|
|
7782
7588
|
}).option("mode", {
|
|
@@ -7874,14 +7680,14 @@ var LabelPushModule = {
|
|
|
7874
7680
|
var LabelModule = {
|
|
7875
7681
|
command: "label <command>",
|
|
7876
7682
|
describe: "Commands for label definitions",
|
|
7877
|
-
builder: (
|
|
7683
|
+
builder: (yargs43) => yargs43.command(LabelPullModule).command(LabelPushModule),
|
|
7878
7684
|
handler: () => {
|
|
7879
|
-
|
|
7685
|
+
yargs15.help();
|
|
7880
7686
|
}
|
|
7881
7687
|
};
|
|
7882
7688
|
|
|
7883
7689
|
// src/commands/canvas/commands/locale.ts
|
|
7884
|
-
import
|
|
7690
|
+
import yargs16 from "yargs";
|
|
7885
7691
|
|
|
7886
7692
|
// src/commands/canvas/localesEngineDataSource.ts
|
|
7887
7693
|
function createLocaleEngineDataSource({
|
|
@@ -7923,12 +7729,12 @@ function getLocaleClient(options) {
|
|
|
7923
7729
|
var LocalePullModule = {
|
|
7924
7730
|
command: "pull <directory>",
|
|
7925
7731
|
describe: "Pulls all locales to local files in a directory",
|
|
7926
|
-
builder: (
|
|
7732
|
+
builder: (yargs43) => withConfiguration(
|
|
7927
7733
|
withDebugOptions(
|
|
7928
7734
|
withApiOptions(
|
|
7929
7735
|
withProjectOptions(
|
|
7930
7736
|
withDiffOptions(
|
|
7931
|
-
|
|
7737
|
+
yargs43.positional("directory", {
|
|
7932
7738
|
describe: "Directory to save the locales to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
7933
7739
|
type: "string"
|
|
7934
7740
|
}).option("format", {
|
|
@@ -8008,12 +7814,12 @@ var LocalePullModule = {
|
|
|
8008
7814
|
var LocalePushModule = {
|
|
8009
7815
|
command: "push <directory>",
|
|
8010
7816
|
describe: "Pushes all locales from files in a directory to Uniform",
|
|
8011
|
-
builder: (
|
|
7817
|
+
builder: (yargs43) => withConfiguration(
|
|
8012
7818
|
withDebugOptions(
|
|
8013
7819
|
withApiOptions(
|
|
8014
7820
|
withProjectOptions(
|
|
8015
7821
|
withDiffOptions(
|
|
8016
|
-
|
|
7822
|
+
yargs43.positional("directory", {
|
|
8017
7823
|
describe: "Directory to read the locales from. If a filename is used, a package will be read instead.",
|
|
8018
7824
|
type: "string"
|
|
8019
7825
|
}).option("mode", {
|
|
@@ -8081,14 +7887,14 @@ var LocalePushModule = {
|
|
|
8081
7887
|
var LocaleModule = {
|
|
8082
7888
|
command: "locale <command>",
|
|
8083
7889
|
describe: "Commands for locale definitions",
|
|
8084
|
-
builder: (
|
|
7890
|
+
builder: (yargs43) => yargs43.command(LocalePullModule).command(LocalePushModule),
|
|
8085
7891
|
handler: () => {
|
|
8086
|
-
|
|
7892
|
+
yargs16.help();
|
|
8087
7893
|
}
|
|
8088
7894
|
};
|
|
8089
7895
|
|
|
8090
7896
|
// src/commands/canvas/commands/previewUrl.ts
|
|
8091
|
-
import
|
|
7897
|
+
import yargs17 from "yargs";
|
|
8092
7898
|
|
|
8093
7899
|
// src/commands/canvas/commands/previewUrl/_util.ts
|
|
8094
7900
|
import { PreviewClient } from "@uniformdev/canvas";
|
|
@@ -8102,12 +7908,12 @@ function getPreviewClient(options) {
|
|
|
8102
7908
|
var PreviewUrlGetModule = {
|
|
8103
7909
|
command: "get <id>",
|
|
8104
7910
|
describe: "Fetch a preview URL",
|
|
8105
|
-
builder: (
|
|
7911
|
+
builder: (yargs43) => withConfiguration(
|
|
8106
7912
|
withFormatOptions(
|
|
8107
7913
|
withDebugOptions(
|
|
8108
7914
|
withApiOptions(
|
|
8109
7915
|
withProjectOptions(
|
|
8110
|
-
|
|
7916
|
+
yargs43.positional("id", { demandOption: true, describe: "Preview URL UUID to fetch" })
|
|
8111
7917
|
)
|
|
8112
7918
|
)
|
|
8113
7919
|
)
|
|
@@ -8131,8 +7937,8 @@ var PreviewUrlListModule = {
|
|
|
8131
7937
|
command: "list",
|
|
8132
7938
|
describe: "List preview URLs",
|
|
8133
7939
|
aliases: ["ls"],
|
|
8134
|
-
builder: (
|
|
8135
|
-
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(
|
|
7940
|
+
builder: (yargs43) => withConfiguration(
|
|
7941
|
+
withFormatOptions(withApiOptions(withDebugOptions(withProjectOptions(yargs43.options({})))))
|
|
8136
7942
|
),
|
|
8137
7943
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
8138
7944
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -8174,12 +7980,12 @@ function createPreviewUrlEngineDataSource({
|
|
|
8174
7980
|
var PreviewUrlPullModule = {
|
|
8175
7981
|
command: "pull <directory>",
|
|
8176
7982
|
describe: "Pulls all preview urls to local files in a directory",
|
|
8177
|
-
builder: (
|
|
7983
|
+
builder: (yargs43) => withConfiguration(
|
|
8178
7984
|
withApiOptions(
|
|
8179
7985
|
withProjectOptions(
|
|
8180
7986
|
withDebugOptions(
|
|
8181
7987
|
withDiffOptions(
|
|
8182
|
-
|
|
7988
|
+
yargs43.positional("directory", {
|
|
8183
7989
|
describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
8184
7990
|
type: "string"
|
|
8185
7991
|
}).option("format", {
|
|
@@ -8254,12 +8060,12 @@ var PreviewUrlPullModule = {
|
|
|
8254
8060
|
var PreviewUrlPushModule = {
|
|
8255
8061
|
command: "push <directory>",
|
|
8256
8062
|
describe: "Pushes all preview urls from files in a directory to Uniform Canvas",
|
|
8257
|
-
builder: (
|
|
8063
|
+
builder: (yargs43) => withConfiguration(
|
|
8258
8064
|
withApiOptions(
|
|
8259
8065
|
withProjectOptions(
|
|
8260
8066
|
withDiffOptions(
|
|
8261
8067
|
withDebugOptions(
|
|
8262
|
-
|
|
8068
|
+
yargs43.positional("directory", {
|
|
8263
8069
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
8264
8070
|
type: "string"
|
|
8265
8071
|
}).option("mode", {
|
|
@@ -8323,11 +8129,11 @@ var PreviewUrlRemoveModule = {
|
|
|
8323
8129
|
command: "remove <id>",
|
|
8324
8130
|
aliases: ["delete", "rm"],
|
|
8325
8131
|
describe: "Delete a preview URL",
|
|
8326
|
-
builder: (
|
|
8132
|
+
builder: (yargs43) => withConfiguration(
|
|
8327
8133
|
withApiOptions(
|
|
8328
8134
|
withDebugOptions(
|
|
8329
8135
|
withProjectOptions(
|
|
8330
|
-
|
|
8136
|
+
yargs43.positional("id", { demandOption: true, describe: "Preview URL UUID to delete" })
|
|
8331
8137
|
)
|
|
8332
8138
|
)
|
|
8333
8139
|
)
|
|
@@ -8348,11 +8154,11 @@ var PreviewUrlUpdateModule = {
|
|
|
8348
8154
|
command: "update <filename>",
|
|
8349
8155
|
aliases: ["put"],
|
|
8350
8156
|
describe: "Insert or update a preview URL",
|
|
8351
|
-
builder: (
|
|
8157
|
+
builder: (yargs43) => withConfiguration(
|
|
8352
8158
|
withDebugOptions(
|
|
8353
8159
|
withApiOptions(
|
|
8354
8160
|
withProjectOptions(
|
|
8355
|
-
|
|
8161
|
+
yargs43.positional("filename", { demandOption: true, describe: "Category file to put" })
|
|
8356
8162
|
)
|
|
8357
8163
|
)
|
|
8358
8164
|
)
|
|
@@ -8374,25 +8180,25 @@ var PreviewUrlModule = {
|
|
|
8374
8180
|
command: "preview-url <command>",
|
|
8375
8181
|
aliases: ["pu"],
|
|
8376
8182
|
describe: "Commands for Canvas preview urls",
|
|
8377
|
-
builder: (
|
|
8183
|
+
builder: (yargs43) => yargs43.command(PreviewUrlPullModule).command(PreviewUrlPushModule).command(PreviewUrlGetModule).command(PreviewUrlRemoveModule).command(PreviewUrlListModule).command(PreviewUrlUpdateModule).demandCommand(),
|
|
8378
8184
|
handler: () => {
|
|
8379
|
-
|
|
8185
|
+
yargs17.help();
|
|
8380
8186
|
}
|
|
8381
8187
|
};
|
|
8382
8188
|
|
|
8383
8189
|
// src/commands/canvas/commands/previewViewport.ts
|
|
8384
|
-
import
|
|
8190
|
+
import yargs18 from "yargs";
|
|
8385
8191
|
|
|
8386
8192
|
// src/commands/canvas/commands/previewViewport/get.ts
|
|
8387
8193
|
var PreviewViewportGetModule = {
|
|
8388
8194
|
command: "get <id>",
|
|
8389
8195
|
describe: "Fetch a preview viewport",
|
|
8390
|
-
builder: (
|
|
8196
|
+
builder: (yargs43) => withConfiguration(
|
|
8391
8197
|
withFormatOptions(
|
|
8392
8198
|
withDebugOptions(
|
|
8393
8199
|
withApiOptions(
|
|
8394
8200
|
withProjectOptions(
|
|
8395
|
-
|
|
8201
|
+
yargs43.positional("id", { demandOption: true, describe: "Preview viewport UUID to fetch" })
|
|
8396
8202
|
)
|
|
8397
8203
|
)
|
|
8398
8204
|
)
|
|
@@ -8416,8 +8222,8 @@ var PreviewViewportListModule = {
|
|
|
8416
8222
|
command: "list",
|
|
8417
8223
|
describe: "List preview viewports",
|
|
8418
8224
|
aliases: ["ls"],
|
|
8419
|
-
builder: (
|
|
8420
|
-
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(
|
|
8225
|
+
builder: (yargs43) => withConfiguration(
|
|
8226
|
+
withFormatOptions(withDebugOptions(withApiOptions(withProjectOptions(yargs43.options({})))))
|
|
8421
8227
|
),
|
|
8422
8228
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
8423
8229
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
@@ -8463,12 +8269,12 @@ function createPreviewViewportEngineDataSource({
|
|
|
8463
8269
|
var PreviewViewportPullModule = {
|
|
8464
8270
|
command: "pull <directory>",
|
|
8465
8271
|
describe: "Pulls all preview viewports to local files in a directory",
|
|
8466
|
-
builder: (
|
|
8272
|
+
builder: (yargs43) => withConfiguration(
|
|
8467
8273
|
withApiOptions(
|
|
8468
8274
|
withProjectOptions(
|
|
8469
8275
|
withDebugOptions(
|
|
8470
8276
|
withDiffOptions(
|
|
8471
|
-
|
|
8277
|
+
yargs43.positional("directory", {
|
|
8472
8278
|
describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
8473
8279
|
type: "string"
|
|
8474
8280
|
}).option("format", {
|
|
@@ -8543,12 +8349,12 @@ var PreviewViewportPullModule = {
|
|
|
8543
8349
|
var PreviewViewportPushModule = {
|
|
8544
8350
|
command: "push <directory>",
|
|
8545
8351
|
describe: "Pushes all preview viewports from files in a directory to Uniform Canvas",
|
|
8546
|
-
builder: (
|
|
8352
|
+
builder: (yargs43) => withConfiguration(
|
|
8547
8353
|
withApiOptions(
|
|
8548
8354
|
withProjectOptions(
|
|
8549
8355
|
withDiffOptions(
|
|
8550
8356
|
withDebugOptions(
|
|
8551
|
-
|
|
8357
|
+
yargs43.positional("directory", {
|
|
8552
8358
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
8553
8359
|
type: "string"
|
|
8554
8360
|
}).option("mode", {
|
|
@@ -8612,11 +8418,11 @@ var PreviewViewportRemoveModule = {
|
|
|
8612
8418
|
command: "remove <id>",
|
|
8613
8419
|
aliases: ["delete", "rm"],
|
|
8614
8420
|
describe: "Delete a preview viewport",
|
|
8615
|
-
builder: (
|
|
8421
|
+
builder: (yargs43) => withConfiguration(
|
|
8616
8422
|
withApiOptions(
|
|
8617
8423
|
withDebugOptions(
|
|
8618
8424
|
withProjectOptions(
|
|
8619
|
-
|
|
8425
|
+
yargs43.positional("id", { demandOption: true, describe: "Preview viewport UUID to delete" })
|
|
8620
8426
|
)
|
|
8621
8427
|
)
|
|
8622
8428
|
)
|
|
@@ -8637,11 +8443,11 @@ var PreviewViewportUpdateModule = {
|
|
|
8637
8443
|
command: "update <filename>",
|
|
8638
8444
|
aliases: ["put"],
|
|
8639
8445
|
describe: "Insert or update a preview viewport",
|
|
8640
|
-
builder: (
|
|
8446
|
+
builder: (yargs43) => withConfiguration(
|
|
8641
8447
|
withDebugOptions(
|
|
8642
8448
|
withApiOptions(
|
|
8643
8449
|
withProjectOptions(
|
|
8644
|
-
|
|
8450
|
+
yargs43.positional("filename", { demandOption: true, describe: "Preview viewport file to put" })
|
|
8645
8451
|
)
|
|
8646
8452
|
)
|
|
8647
8453
|
)
|
|
@@ -8663,14 +8469,14 @@ var PreviewViewportModule = {
|
|
|
8663
8469
|
command: "preview-viewport <command>",
|
|
8664
8470
|
aliases: ["pv"],
|
|
8665
8471
|
describe: "Commands for Canvas preview viewports",
|
|
8666
|
-
builder: (
|
|
8472
|
+
builder: (yargs43) => yargs43.command(PreviewViewportPullModule).command(PreviewViewportPushModule).command(PreviewViewportGetModule).command(PreviewViewportRemoveModule).command(PreviewViewportListModule).command(PreviewViewportUpdateModule).demandCommand(),
|
|
8667
8473
|
handler: () => {
|
|
8668
|
-
|
|
8474
|
+
yargs18.help();
|
|
8669
8475
|
}
|
|
8670
8476
|
};
|
|
8671
8477
|
|
|
8672
8478
|
// src/commands/canvas/commands/prompts.ts
|
|
8673
|
-
import
|
|
8479
|
+
import yargs19 from "yargs";
|
|
8674
8480
|
|
|
8675
8481
|
// src/commands/canvas/commands/prompts/_util.ts
|
|
8676
8482
|
import { PromptClient } from "@uniformdev/canvas";
|
|
@@ -8682,12 +8488,12 @@ var getPromptClient = (options) => new PromptClient({ ...options, bypassCache: t
|
|
|
8682
8488
|
var PromptGetModule = {
|
|
8683
8489
|
command: "get <id>",
|
|
8684
8490
|
describe: "Get a prompt",
|
|
8685
|
-
builder: (
|
|
8491
|
+
builder: (yargs43) => withConfiguration(
|
|
8686
8492
|
withDebugOptions(
|
|
8687
8493
|
withFormatOptions(
|
|
8688
8494
|
withApiOptions(
|
|
8689
8495
|
withProjectOptions(
|
|
8690
|
-
|
|
8496
|
+
yargs43.positional("id", { demandOption: true, describe: "Prompt ID to fetch" })
|
|
8691
8497
|
)
|
|
8692
8498
|
)
|
|
8693
8499
|
)
|
|
@@ -8708,7 +8514,7 @@ var PromptGetModule = {
|
|
|
8708
8514
|
var PromptListModule = {
|
|
8709
8515
|
command: "list",
|
|
8710
8516
|
describe: "List prompts",
|
|
8711
|
-
builder: (
|
|
8517
|
+
builder: (yargs43) => withConfiguration(withDebugOptions(withFormatOptions(withApiOptions(withProjectOptions(yargs43))))),
|
|
8712
8518
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
8713
8519
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
8714
8520
|
const client = getPromptClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -8749,13 +8555,13 @@ function createPromptEngineDataSource({
|
|
|
8749
8555
|
var PromptPullModule = {
|
|
8750
8556
|
command: "pull <directory>",
|
|
8751
8557
|
describe: "Pulls all prompts to local files in a directory",
|
|
8752
|
-
builder: (
|
|
8558
|
+
builder: (yargs43) => withConfiguration(
|
|
8753
8559
|
withDebugOptions(
|
|
8754
8560
|
withApiOptions(
|
|
8755
8561
|
withProjectOptions(
|
|
8756
8562
|
withStateOptions(
|
|
8757
8563
|
withDiffOptions(
|
|
8758
|
-
|
|
8564
|
+
yargs43.positional("directory", {
|
|
8759
8565
|
describe: "Directory to save the prompts to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
8760
8566
|
type: "string"
|
|
8761
8567
|
}).option("format", {
|
|
@@ -8836,12 +8642,12 @@ var PromptPullModule = {
|
|
|
8836
8642
|
var PromptPushModule = {
|
|
8837
8643
|
command: "push <directory>",
|
|
8838
8644
|
describe: "Pushes all prompts from files in a directory to Uniform",
|
|
8839
|
-
builder: (
|
|
8645
|
+
builder: (yargs43) => withConfiguration(
|
|
8840
8646
|
withApiOptions(
|
|
8841
8647
|
withProjectOptions(
|
|
8842
8648
|
withStateOptions(
|
|
8843
8649
|
withDiffOptions(
|
|
8844
|
-
|
|
8650
|
+
yargs43.positional("directory", {
|
|
8845
8651
|
describe: "Directory to read the prompts from. If a filename is used, a package will be read instead.",
|
|
8846
8652
|
type: "string"
|
|
8847
8653
|
}).option("mode", {
|
|
@@ -8910,10 +8716,10 @@ var PromptRemoveModule = {
|
|
|
8910
8716
|
command: "remove <id>",
|
|
8911
8717
|
aliases: ["delete", "rm"],
|
|
8912
8718
|
describe: "Delete a prompt",
|
|
8913
|
-
builder: (
|
|
8719
|
+
builder: (yargs43) => withConfiguration(
|
|
8914
8720
|
withDebugOptions(
|
|
8915
8721
|
withApiOptions(
|
|
8916
|
-
withProjectOptions(
|
|
8722
|
+
withProjectOptions(yargs43.positional("id", { demandOption: true, describe: "Prompt ID to delete" }))
|
|
8917
8723
|
)
|
|
8918
8724
|
)
|
|
8919
8725
|
),
|
|
@@ -8933,11 +8739,11 @@ var PromptUpdateModule = {
|
|
|
8933
8739
|
command: "update <filename>",
|
|
8934
8740
|
aliases: ["put"],
|
|
8935
8741
|
describe: "Insert or update a prompt",
|
|
8936
|
-
builder: (
|
|
8742
|
+
builder: (yargs43) => withConfiguration(
|
|
8937
8743
|
withDebugOptions(
|
|
8938
8744
|
withApiOptions(
|
|
8939
8745
|
withProjectOptions(
|
|
8940
|
-
|
|
8746
|
+
yargs43.positional("filename", { demandOption: true, describe: "Prompt file to put" })
|
|
8941
8747
|
)
|
|
8942
8748
|
)
|
|
8943
8749
|
)
|
|
@@ -8959,14 +8765,14 @@ var PromptModule = {
|
|
|
8959
8765
|
command: "prompt <command>",
|
|
8960
8766
|
aliases: ["dt"],
|
|
8961
8767
|
describe: "Commands for AI Prompt definitions",
|
|
8962
|
-
builder: (
|
|
8768
|
+
builder: (yargs43) => yargs43.command(PromptGetModule).command(PromptListModule).command(PromptPullModule).command(PromptPushModule).command(PromptRemoveModule).command(PromptUpdateModule).demandCommand(),
|
|
8963
8769
|
handler: () => {
|
|
8964
|
-
|
|
8770
|
+
yargs19.help();
|
|
8965
8771
|
}
|
|
8966
8772
|
};
|
|
8967
8773
|
|
|
8968
8774
|
// src/commands/canvas/commands/workflow.ts
|
|
8969
|
-
import
|
|
8775
|
+
import yargs20 from "yargs";
|
|
8970
8776
|
|
|
8971
8777
|
// src/commands/canvas/commands/workflow/_util.ts
|
|
8972
8778
|
import { WorkflowClient } from "@uniformdev/canvas";
|
|
@@ -9013,13 +8819,13 @@ function createWorkflowEngineDataSource({
|
|
|
9013
8819
|
var WorkflowPullModule = {
|
|
9014
8820
|
command: "pull <directory>",
|
|
9015
8821
|
describe: "Pulls all workflows to local files in a directory",
|
|
9016
|
-
builder: (
|
|
8822
|
+
builder: (yargs43) => withConfiguration(
|
|
9017
8823
|
withApiOptions(
|
|
9018
8824
|
withDebugOptions(
|
|
9019
8825
|
withProjectOptions(
|
|
9020
8826
|
withDiffOptions(
|
|
9021
8827
|
withBatchSizeOptions(
|
|
9022
|
-
|
|
8828
|
+
yargs43.positional("directory", {
|
|
9023
8829
|
describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
9024
8830
|
type: "string"
|
|
9025
8831
|
}).option("format", {
|
|
@@ -9101,13 +8907,13 @@ var WorkflowPullModule = {
|
|
|
9101
8907
|
var WorkflowPushModule = {
|
|
9102
8908
|
command: "push <directory>",
|
|
9103
8909
|
describe: "Pushes all workflows from files in a directory to Uniform Canvas",
|
|
9104
|
-
builder: (
|
|
8910
|
+
builder: (yargs43) => withConfiguration(
|
|
9105
8911
|
withDebugOptions(
|
|
9106
8912
|
withApiOptions(
|
|
9107
8913
|
withProjectOptions(
|
|
9108
8914
|
withDiffOptions(
|
|
9109
8915
|
withBatchSizeOptions(
|
|
9110
|
-
|
|
8916
|
+
yargs43.positional("directory", {
|
|
9111
8917
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
9112
8918
|
type: "string"
|
|
9113
8919
|
}).option("mode", {
|
|
@@ -9178,9 +8984,9 @@ var WorkflowModule = {
|
|
|
9178
8984
|
command: "workflow <command>",
|
|
9179
8985
|
aliases: ["wf"],
|
|
9180
8986
|
describe: "Commands for Canvas workflows",
|
|
9181
|
-
builder: (
|
|
8987
|
+
builder: (yargs43) => yargs43.command(WorkflowPullModule).command(WorkflowPushModule).demandCommand(),
|
|
9182
8988
|
handler: () => {
|
|
9183
|
-
|
|
8989
|
+
yargs20.help();
|
|
9184
8990
|
}
|
|
9185
8991
|
};
|
|
9186
8992
|
|
|
@@ -9189,17 +8995,17 @@ var CanvasCommand = {
|
|
|
9189
8995
|
command: "canvas <command>",
|
|
9190
8996
|
aliases: ["cv", "pm", "presentation"],
|
|
9191
8997
|
describe: "Uniform Canvas commands",
|
|
9192
|
-
builder: (
|
|
8998
|
+
builder: (yargs43) => yargs43.command(CompositionModule).command(ComponentModule).command(DataTypeModule).command(DataSourceModule).command(CategoryModule).command(ComponentPatternModule).command(CompositionPatternModule).command(ContentTypeModule).command(EntryModule).command(EntryPatternModule).command(PromptModule).command(AssetModule).command(LabelModule).command(LocaleModule).command(WorkflowModule).command(PreviewUrlModule).command(PreviewViewportModule).demandCommand(),
|
|
9193
8999
|
handler: () => {
|
|
9194
|
-
|
|
9000
|
+
yargs21.showHelp();
|
|
9195
9001
|
}
|
|
9196
9002
|
};
|
|
9197
9003
|
|
|
9198
9004
|
// src/commands/context/index.ts
|
|
9199
|
-
import
|
|
9005
|
+
import yargs28 from "yargs";
|
|
9200
9006
|
|
|
9201
9007
|
// src/commands/context/commands/aggregate.ts
|
|
9202
|
-
import
|
|
9008
|
+
import yargs22 from "yargs";
|
|
9203
9009
|
|
|
9204
9010
|
// src/commands/context/commands/aggregate/_util.ts
|
|
9205
9011
|
import { AggregateClient } from "@uniformdev/context/api";
|
|
@@ -9211,11 +9017,11 @@ var getAggregateClient = (options) => new AggregateClient({ ...options, bypassCa
|
|
|
9211
9017
|
var AggregateGetModule = {
|
|
9212
9018
|
command: "get <id>",
|
|
9213
9019
|
describe: "Fetch an aggregate",
|
|
9214
|
-
builder: (
|
|
9020
|
+
builder: (yargs43) => withConfiguration(
|
|
9215
9021
|
withFormatOptions(
|
|
9216
9022
|
withApiOptions(
|
|
9217
9023
|
withProjectOptions(
|
|
9218
|
-
|
|
9024
|
+
yargs43.positional("id", { demandOption: true, describe: "Aggregate public ID to fetch" })
|
|
9219
9025
|
)
|
|
9220
9026
|
)
|
|
9221
9027
|
)
|
|
@@ -9238,7 +9044,7 @@ var AggregateListModule = {
|
|
|
9238
9044
|
command: "list",
|
|
9239
9045
|
describe: "List aggregates",
|
|
9240
9046
|
aliases: ["ls"],
|
|
9241
|
-
builder: (
|
|
9047
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
9242
9048
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9243
9049
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9244
9050
|
const client = getAggregateClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -9301,12 +9107,12 @@ function writeContextPackage(filename, packageContents) {
|
|
|
9301
9107
|
var AggregatePullModule = {
|
|
9302
9108
|
command: "pull <directory>",
|
|
9303
9109
|
describe: "Pulls all aggregates to local files in a directory",
|
|
9304
|
-
builder: (
|
|
9110
|
+
builder: (yargs43) => withConfiguration(
|
|
9305
9111
|
withApiOptions(
|
|
9306
9112
|
withDebugOptions(
|
|
9307
9113
|
withProjectOptions(
|
|
9308
9114
|
withDiffOptions(
|
|
9309
|
-
|
|
9115
|
+
yargs43.positional("directory", {
|
|
9310
9116
|
describe: "Directory to save the aggregates to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
9311
9117
|
type: "string"
|
|
9312
9118
|
}).option("format", {
|
|
@@ -9381,12 +9187,12 @@ var AggregatePullModule = {
|
|
|
9381
9187
|
var AggregatePushModule = {
|
|
9382
9188
|
command: "push <directory>",
|
|
9383
9189
|
describe: "Pushes all aggregates from files in a directory or package to Uniform",
|
|
9384
|
-
builder: (
|
|
9190
|
+
builder: (yargs43) => withConfiguration(
|
|
9385
9191
|
withApiOptions(
|
|
9386
9192
|
withProjectOptions(
|
|
9387
9193
|
withDiffOptions(
|
|
9388
9194
|
withDebugOptions(
|
|
9389
|
-
|
|
9195
|
+
yargs43.positional("directory", {
|
|
9390
9196
|
describe: "Directory to read the aggregates from. If a filename is used, a package will be read instead.",
|
|
9391
9197
|
type: "string"
|
|
9392
9198
|
}).option("mode", {
|
|
@@ -9451,10 +9257,10 @@ var AggregateRemoveModule = {
|
|
|
9451
9257
|
command: "remove <id>",
|
|
9452
9258
|
aliases: ["delete", "rm"],
|
|
9453
9259
|
describe: "Delete an aggregate",
|
|
9454
|
-
builder: (
|
|
9260
|
+
builder: (yargs43) => withConfiguration(
|
|
9455
9261
|
withApiOptions(
|
|
9456
9262
|
withProjectOptions(
|
|
9457
|
-
|
|
9263
|
+
yargs43.positional("id", { demandOption: true, describe: "Aggregate public ID to delete" })
|
|
9458
9264
|
)
|
|
9459
9265
|
)
|
|
9460
9266
|
),
|
|
@@ -9470,10 +9276,10 @@ var AggregateUpdateModule = {
|
|
|
9470
9276
|
command: "update <filename>",
|
|
9471
9277
|
aliases: ["put"],
|
|
9472
9278
|
describe: "Insert or update an aggregate",
|
|
9473
|
-
builder: (
|
|
9279
|
+
builder: (yargs43) => withConfiguration(
|
|
9474
9280
|
withApiOptions(
|
|
9475
9281
|
withProjectOptions(
|
|
9476
|
-
|
|
9282
|
+
yargs43.positional("filename", { demandOption: true, describe: "Aggregate file to put" })
|
|
9477
9283
|
)
|
|
9478
9284
|
)
|
|
9479
9285
|
),
|
|
@@ -9490,14 +9296,14 @@ var AggregateModule = {
|
|
|
9490
9296
|
command: "aggregate <command>",
|
|
9491
9297
|
aliases: ["agg", "intent", "audience"],
|
|
9492
9298
|
describe: "Commands for Context aggregates (intents, audiences)",
|
|
9493
|
-
builder: (
|
|
9299
|
+
builder: (yargs43) => yargs43.command(AggregatePullModule).command(AggregatePushModule).command(AggregateGetModule).command(AggregateRemoveModule).command(AggregateListModule).command(AggregateUpdateModule).demandCommand(),
|
|
9494
9300
|
handler: () => {
|
|
9495
|
-
|
|
9301
|
+
yargs22.help();
|
|
9496
9302
|
}
|
|
9497
9303
|
};
|
|
9498
9304
|
|
|
9499
9305
|
// src/commands/context/commands/enrichment.ts
|
|
9500
|
-
import
|
|
9306
|
+
import yargs23 from "yargs";
|
|
9501
9307
|
|
|
9502
9308
|
// src/commands/context/commands/enrichment/_util.ts
|
|
9503
9309
|
import { UncachedEnrichmentClient } from "@uniformdev/context/api";
|
|
@@ -9511,11 +9317,11 @@ function getEnrichmentClient(options) {
|
|
|
9511
9317
|
var EnrichmentGetModule = {
|
|
9512
9318
|
command: "get <id>",
|
|
9513
9319
|
describe: "Fetch an enrichment category and its values",
|
|
9514
|
-
builder: (
|
|
9320
|
+
builder: (yargs43) => withFormatOptions(
|
|
9515
9321
|
withConfiguration(
|
|
9516
9322
|
withApiOptions(
|
|
9517
9323
|
withProjectOptions(
|
|
9518
|
-
|
|
9324
|
+
yargs43.positional("id", { demandOption: true, describe: "Enrichment category public ID to fetch" })
|
|
9519
9325
|
)
|
|
9520
9326
|
)
|
|
9521
9327
|
)
|
|
@@ -9538,7 +9344,7 @@ var EnrichmentListModule = {
|
|
|
9538
9344
|
command: "list",
|
|
9539
9345
|
describe: "List enrichments",
|
|
9540
9346
|
aliases: ["ls"],
|
|
9541
|
-
builder: (
|
|
9347
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
9542
9348
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
9543
9349
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9544
9350
|
const client = getEnrichmentClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -9633,12 +9439,12 @@ var createEnrichmentValueEngineDataSource = ({
|
|
|
9633
9439
|
var EnrichmentPullModule = {
|
|
9634
9440
|
command: "pull <directory>",
|
|
9635
9441
|
describe: "Pulls all enrichments to local files in a directory",
|
|
9636
|
-
builder: (
|
|
9442
|
+
builder: (yargs43) => withConfiguration(
|
|
9637
9443
|
withDebugOptions(
|
|
9638
9444
|
withApiOptions(
|
|
9639
9445
|
withProjectOptions(
|
|
9640
9446
|
withDiffOptions(
|
|
9641
|
-
|
|
9447
|
+
yargs43.positional("directory", {
|
|
9642
9448
|
describe: "Directory to save the enrichments to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
9643
9449
|
type: "string"
|
|
9644
9450
|
}).option("format", {
|
|
@@ -9713,11 +9519,11 @@ var EnrichmentPullModule = {
|
|
|
9713
9519
|
var EnrichmentPushModule = {
|
|
9714
9520
|
command: "push <directory>",
|
|
9715
9521
|
describe: "Pushes all enrichments from files in a directory or package to Uniform",
|
|
9716
|
-
builder: (
|
|
9522
|
+
builder: (yargs43) => withConfiguration(
|
|
9717
9523
|
withApiOptions(
|
|
9718
9524
|
withProjectOptions(
|
|
9719
9525
|
withDiffOptions(
|
|
9720
|
-
|
|
9526
|
+
yargs43.positional("directory", {
|
|
9721
9527
|
describe: "Directory to read the enrichments from. If a filename is used, a package will be read instead.",
|
|
9722
9528
|
type: "string"
|
|
9723
9529
|
}).option("mode", {
|
|
@@ -9780,10 +9586,10 @@ var EnrichmentRemoveModule = {
|
|
|
9780
9586
|
command: "remove <id>",
|
|
9781
9587
|
aliases: ["delete", "rm"],
|
|
9782
9588
|
describe: "Delete an enrichment category and its values",
|
|
9783
|
-
builder: (
|
|
9589
|
+
builder: (yargs43) => withConfiguration(
|
|
9784
9590
|
withApiOptions(
|
|
9785
9591
|
withProjectOptions(
|
|
9786
|
-
|
|
9592
|
+
yargs43.positional("id", { demandOption: true, describe: "Enrichment category public ID to delete" })
|
|
9787
9593
|
)
|
|
9788
9594
|
)
|
|
9789
9595
|
),
|
|
@@ -9799,14 +9605,14 @@ var EnrichmentModule = {
|
|
|
9799
9605
|
command: "enrichment <command>",
|
|
9800
9606
|
aliases: ["enr"],
|
|
9801
9607
|
describe: "Commands for Context enrichments",
|
|
9802
|
-
builder: (
|
|
9608
|
+
builder: (yargs43) => yargs43.command(EnrichmentPullModule).command(EnrichmentPushModule).command(EnrichmentGetModule).command(EnrichmentRemoveModule).command(EnrichmentListModule).demandCommand(),
|
|
9803
9609
|
handler: () => {
|
|
9804
|
-
|
|
9610
|
+
yargs23.help();
|
|
9805
9611
|
}
|
|
9806
9612
|
};
|
|
9807
9613
|
|
|
9808
9614
|
// src/commands/context/commands/manifest.ts
|
|
9809
|
-
import
|
|
9615
|
+
import yargs24 from "yargs";
|
|
9810
9616
|
|
|
9811
9617
|
// src/commands/context/commands/manifest/get.ts
|
|
9812
9618
|
import { ApiClientError as ApiClientError5, UncachedManifestClient } from "@uniformdev/context/api";
|
|
@@ -9817,10 +9623,10 @@ var ManifestGetModule = {
|
|
|
9817
9623
|
command: "get [output]",
|
|
9818
9624
|
aliases: ["dl", "download"],
|
|
9819
9625
|
describe: "Download the Uniform Context manifest for a project",
|
|
9820
|
-
builder: (
|
|
9626
|
+
builder: (yargs43) => withConfiguration(
|
|
9821
9627
|
withApiOptions(
|
|
9822
9628
|
withProjectOptions(
|
|
9823
|
-
|
|
9629
|
+
yargs43.option("preview", {
|
|
9824
9630
|
describe: "If set, fetches the unpublished preview manifest (The API key must have permission)",
|
|
9825
9631
|
default: false,
|
|
9826
9632
|
type: "boolean",
|
|
@@ -9882,7 +9688,7 @@ import { exit as exit2 } from "process";
|
|
|
9882
9688
|
var ManifestPublishModule = {
|
|
9883
9689
|
command: "publish",
|
|
9884
9690
|
describe: "Publish the Uniform Context manifest for a project",
|
|
9885
|
-
builder: (
|
|
9691
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withProjectOptions(yargs43))),
|
|
9886
9692
|
handler: async ({ apiKey, apiHost, proxy, project }) => {
|
|
9887
9693
|
const fetch2 = nodeFetchProxy(proxy);
|
|
9888
9694
|
try {
|
|
@@ -9915,25 +9721,25 @@ var ManifestModule = {
|
|
|
9915
9721
|
command: "manifest <command>",
|
|
9916
9722
|
describe: "Commands for context manifests",
|
|
9917
9723
|
aliases: ["man"],
|
|
9918
|
-
builder: (
|
|
9724
|
+
builder: (yargs43) => yargs43.command(ManifestGetModule).command(ManifestPublishModule).demandCommand(),
|
|
9919
9725
|
handler: () => {
|
|
9920
|
-
|
|
9726
|
+
yargs24.help();
|
|
9921
9727
|
}
|
|
9922
9728
|
};
|
|
9923
9729
|
|
|
9924
9730
|
// src/commands/context/commands/quirk.ts
|
|
9925
|
-
import
|
|
9731
|
+
import yargs25 from "yargs";
|
|
9926
9732
|
|
|
9927
9733
|
// src/commands/context/commands/quirk/get.ts
|
|
9928
9734
|
import { UncachedQuirkClient } from "@uniformdev/context/api";
|
|
9929
9735
|
var QuirkGetModule = {
|
|
9930
9736
|
command: "get <id>",
|
|
9931
9737
|
describe: "Fetch a quirk",
|
|
9932
|
-
builder: (
|
|
9738
|
+
builder: (yargs43) => withConfiguration(
|
|
9933
9739
|
withFormatOptions(
|
|
9934
9740
|
withApiOptions(
|
|
9935
9741
|
withProjectOptions(
|
|
9936
|
-
|
|
9742
|
+
yargs43.positional("id", { demandOption: true, describe: "Quirk public ID to fetch" })
|
|
9937
9743
|
)
|
|
9938
9744
|
)
|
|
9939
9745
|
)
|
|
@@ -9957,11 +9763,11 @@ var QuirkListModule = {
|
|
|
9957
9763
|
command: "list",
|
|
9958
9764
|
describe: "List quirks",
|
|
9959
9765
|
aliases: ["ls"],
|
|
9960
|
-
builder: (
|
|
9766
|
+
builder: (yargs43) => withConfiguration(
|
|
9961
9767
|
withFormatOptions(
|
|
9962
9768
|
withApiOptions(
|
|
9963
9769
|
withProjectOptions(
|
|
9964
|
-
|
|
9770
|
+
yargs43.option("withIntegrations", {
|
|
9965
9771
|
alias: ["i"],
|
|
9966
9772
|
describe: "Whether to include meta-quirks created by integrations in the list. Defaults to false.",
|
|
9967
9773
|
type: "boolean"
|
|
@@ -10019,12 +9825,12 @@ function createQuirkEngineDataSource({
|
|
|
10019
9825
|
var QuirkPullModule = {
|
|
10020
9826
|
command: "pull <directory>",
|
|
10021
9827
|
describe: "Pulls all quirks to local files in a directory",
|
|
10022
|
-
builder: (
|
|
9828
|
+
builder: (yargs43) => withConfiguration(
|
|
10023
9829
|
withDebugOptions(
|
|
10024
9830
|
withApiOptions(
|
|
10025
9831
|
withProjectOptions(
|
|
10026
9832
|
withDiffOptions(
|
|
10027
|
-
|
|
9833
|
+
yargs43.positional("directory", {
|
|
10028
9834
|
describe: "Directory to save the quirks to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
10029
9835
|
type: "string"
|
|
10030
9836
|
}).option("format", {
|
|
@@ -10100,12 +9906,12 @@ import { UncachedQuirkClient as UncachedQuirkClient4 } from "@uniformdev/context
|
|
|
10100
9906
|
var QuirkPushModule = {
|
|
10101
9907
|
command: "push <directory>",
|
|
10102
9908
|
describe: "Pushes all quirks from files in a directory or package to Uniform",
|
|
10103
|
-
builder: (
|
|
9909
|
+
builder: (yargs43) => withConfiguration(
|
|
10104
9910
|
withDebugOptions(
|
|
10105
9911
|
withApiOptions(
|
|
10106
9912
|
withProjectOptions(
|
|
10107
9913
|
withDiffOptions(
|
|
10108
|
-
|
|
9914
|
+
yargs43.positional("directory", {
|
|
10109
9915
|
describe: "Directory to read the quirks from. If a filename is used, a package will be read instead.",
|
|
10110
9916
|
type: "string"
|
|
10111
9917
|
}).option("mode", {
|
|
@@ -10170,10 +9976,10 @@ var QuirkRemoveModule = {
|
|
|
10170
9976
|
command: "remove <id>",
|
|
10171
9977
|
aliases: ["delete", "rm"],
|
|
10172
9978
|
describe: "Delete a quirk",
|
|
10173
|
-
builder: (
|
|
9979
|
+
builder: (yargs43) => withConfiguration(
|
|
10174
9980
|
withApiOptions(
|
|
10175
9981
|
withProjectOptions(
|
|
10176
|
-
|
|
9982
|
+
yargs43.positional("id", { demandOption: true, describe: "Quirk public ID to delete" })
|
|
10177
9983
|
)
|
|
10178
9984
|
)
|
|
10179
9985
|
),
|
|
@@ -10190,10 +9996,10 @@ var QuirkUpdateModule = {
|
|
|
10190
9996
|
command: "update <filename>",
|
|
10191
9997
|
aliases: ["put"],
|
|
10192
9998
|
describe: "Insert or update a quirk",
|
|
10193
|
-
builder: (
|
|
9999
|
+
builder: (yargs43) => withConfiguration(
|
|
10194
10000
|
withApiOptions(
|
|
10195
10001
|
withProjectOptions(
|
|
10196
|
-
|
|
10002
|
+
yargs43.positional("filename", { demandOption: true, describe: "Quirk file to put" })
|
|
10197
10003
|
)
|
|
10198
10004
|
)
|
|
10199
10005
|
),
|
|
@@ -10210,25 +10016,25 @@ var QuirkModule = {
|
|
|
10210
10016
|
command: "quirk <command>",
|
|
10211
10017
|
aliases: ["qk"],
|
|
10212
10018
|
describe: "Commands for Context quirks",
|
|
10213
|
-
builder: (
|
|
10019
|
+
builder: (yargs43) => yargs43.command(QuirkPullModule).command(QuirkPushModule).command(QuirkGetModule).command(QuirkRemoveModule).command(QuirkListModule).command(QuirkUpdateModule).demandCommand(),
|
|
10214
10020
|
handler: () => {
|
|
10215
|
-
|
|
10021
|
+
yargs25.help();
|
|
10216
10022
|
}
|
|
10217
10023
|
};
|
|
10218
10024
|
|
|
10219
10025
|
// src/commands/context/commands/signal.ts
|
|
10220
|
-
import
|
|
10026
|
+
import yargs26 from "yargs";
|
|
10221
10027
|
|
|
10222
10028
|
// src/commands/context/commands/signal/get.ts
|
|
10223
10029
|
import { UncachedSignalClient } from "@uniformdev/context/api";
|
|
10224
10030
|
var SignalGetModule = {
|
|
10225
10031
|
command: "get <id>",
|
|
10226
10032
|
describe: "Fetch a signal",
|
|
10227
|
-
builder: (
|
|
10033
|
+
builder: (yargs43) => withConfiguration(
|
|
10228
10034
|
withFormatOptions(
|
|
10229
10035
|
withApiOptions(
|
|
10230
10036
|
withProjectOptions(
|
|
10231
|
-
|
|
10037
|
+
yargs43.positional("id", { demandOption: true, describe: "Signal public ID to fetch" })
|
|
10232
10038
|
)
|
|
10233
10039
|
)
|
|
10234
10040
|
)
|
|
@@ -10252,7 +10058,7 @@ var SignalListModule = {
|
|
|
10252
10058
|
command: "list",
|
|
10253
10059
|
describe: "List signals",
|
|
10254
10060
|
aliases: ["ls"],
|
|
10255
|
-
builder: (
|
|
10061
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
10256
10062
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
10257
10063
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10258
10064
|
const client = new UncachedSignalClient2({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -10302,12 +10108,12 @@ function createSignalEngineDataSource({
|
|
|
10302
10108
|
var SignalPullModule = {
|
|
10303
10109
|
command: "pull <directory>",
|
|
10304
10110
|
describe: "Pulls all signals to local files in a directory",
|
|
10305
|
-
builder: (
|
|
10111
|
+
builder: (yargs43) => withConfiguration(
|
|
10306
10112
|
withDebugOptions(
|
|
10307
10113
|
withApiOptions(
|
|
10308
10114
|
withProjectOptions(
|
|
10309
10115
|
withDiffOptions(
|
|
10310
|
-
|
|
10116
|
+
yargs43.positional("directory", {
|
|
10311
10117
|
describe: "Directory to save the signals to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
10312
10118
|
type: "string"
|
|
10313
10119
|
}).option("format", {
|
|
@@ -10383,12 +10189,12 @@ import { UncachedSignalClient as UncachedSignalClient4 } from "@uniformdev/conte
|
|
|
10383
10189
|
var SignalPushModule = {
|
|
10384
10190
|
command: "push <directory>",
|
|
10385
10191
|
describe: "Pushes all signals from files in a directory or package to Uniform",
|
|
10386
|
-
builder: (
|
|
10192
|
+
builder: (yargs43) => withConfiguration(
|
|
10387
10193
|
withDebugOptions(
|
|
10388
10194
|
withApiOptions(
|
|
10389
10195
|
withProjectOptions(
|
|
10390
10196
|
withDiffOptions(
|
|
10391
|
-
|
|
10197
|
+
yargs43.positional("directory", {
|
|
10392
10198
|
describe: "Directory to read the signals from. If a filename is used, a package will be read instead.",
|
|
10393
10199
|
type: "string"
|
|
10394
10200
|
}).option("mode", {
|
|
@@ -10453,10 +10259,10 @@ var SignalRemoveModule = {
|
|
|
10453
10259
|
command: "remove <id>",
|
|
10454
10260
|
aliases: ["delete", "rm"],
|
|
10455
10261
|
describe: "Delete a signal",
|
|
10456
|
-
builder: (
|
|
10262
|
+
builder: (yargs43) => withConfiguration(
|
|
10457
10263
|
withApiOptions(
|
|
10458
10264
|
withProjectOptions(
|
|
10459
|
-
|
|
10265
|
+
yargs43.positional("id", { demandOption: true, describe: "Signal public ID to delete" })
|
|
10460
10266
|
)
|
|
10461
10267
|
)
|
|
10462
10268
|
),
|
|
@@ -10473,10 +10279,10 @@ var SignalUpdateModule = {
|
|
|
10473
10279
|
command: "update <filename>",
|
|
10474
10280
|
aliases: ["put"],
|
|
10475
10281
|
describe: "Insert or update a signal",
|
|
10476
|
-
builder: (
|
|
10282
|
+
builder: (yargs43) => withConfiguration(
|
|
10477
10283
|
withApiOptions(
|
|
10478
10284
|
withProjectOptions(
|
|
10479
|
-
|
|
10285
|
+
yargs43.positional("filename", { demandOption: true, describe: "Signal file to put" })
|
|
10480
10286
|
)
|
|
10481
10287
|
)
|
|
10482
10288
|
),
|
|
@@ -10493,25 +10299,25 @@ var SignalModule = {
|
|
|
10493
10299
|
command: "signal <command>",
|
|
10494
10300
|
aliases: ["sig"],
|
|
10495
10301
|
describe: "Commands for Context signals",
|
|
10496
|
-
builder: (
|
|
10302
|
+
builder: (yargs43) => yargs43.command(SignalPullModule).command(SignalPushModule).command(SignalGetModule).command(SignalRemoveModule).command(SignalListModule).command(SignalUpdateModule).demandCommand(),
|
|
10497
10303
|
handler: () => {
|
|
10498
|
-
|
|
10304
|
+
yargs26.help();
|
|
10499
10305
|
}
|
|
10500
10306
|
};
|
|
10501
10307
|
|
|
10502
10308
|
// src/commands/context/commands/test.ts
|
|
10503
|
-
import
|
|
10309
|
+
import yargs27 from "yargs";
|
|
10504
10310
|
|
|
10505
10311
|
// src/commands/context/commands/test/get.ts
|
|
10506
10312
|
import { UncachedTestClient } from "@uniformdev/context/api";
|
|
10507
10313
|
var TestGetModule = {
|
|
10508
10314
|
command: "get <id>",
|
|
10509
10315
|
describe: "Fetch a test",
|
|
10510
|
-
builder: (
|
|
10316
|
+
builder: (yargs43) => withConfiguration(
|
|
10511
10317
|
withFormatOptions(
|
|
10512
10318
|
withApiOptions(
|
|
10513
10319
|
withProjectOptions(
|
|
10514
|
-
|
|
10320
|
+
yargs43.positional("id", { demandOption: true, describe: "Test public ID to fetch" })
|
|
10515
10321
|
)
|
|
10516
10322
|
)
|
|
10517
10323
|
)
|
|
@@ -10535,7 +10341,7 @@ var TestListModule = {
|
|
|
10535
10341
|
command: "list",
|
|
10536
10342
|
describe: "List tests",
|
|
10537
10343
|
aliases: ["ls"],
|
|
10538
|
-
builder: (
|
|
10344
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
10539
10345
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
10540
10346
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10541
10347
|
const client = new UncachedTestClient2({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -10585,12 +10391,12 @@ function createTestEngineDataSource({
|
|
|
10585
10391
|
var TestPullModule = {
|
|
10586
10392
|
command: "pull <directory>",
|
|
10587
10393
|
describe: "Pulls all tests to local files in a directory",
|
|
10588
|
-
builder: (
|
|
10394
|
+
builder: (yargs43) => withConfiguration(
|
|
10589
10395
|
withDebugOptions(
|
|
10590
10396
|
withApiOptions(
|
|
10591
10397
|
withProjectOptions(
|
|
10592
10398
|
withDiffOptions(
|
|
10593
|
-
|
|
10399
|
+
yargs43.positional("directory", {
|
|
10594
10400
|
describe: "Directory to save the tests to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
10595
10401
|
type: "string"
|
|
10596
10402
|
}).option("format", {
|
|
@@ -10666,12 +10472,12 @@ import { UncachedTestClient as UncachedTestClient4 } from "@uniformdev/context/a
|
|
|
10666
10472
|
var TestPushModule = {
|
|
10667
10473
|
command: "push <directory>",
|
|
10668
10474
|
describe: "Pushes all tests from files in a directory or package to Uniform",
|
|
10669
|
-
builder: (
|
|
10475
|
+
builder: (yargs43) => withConfiguration(
|
|
10670
10476
|
withDebugOptions(
|
|
10671
10477
|
withApiOptions(
|
|
10672
10478
|
withProjectOptions(
|
|
10673
10479
|
withDiffOptions(
|
|
10674
|
-
|
|
10480
|
+
yargs43.positional("directory", {
|
|
10675
10481
|
describe: "Directory to read the tests from. If a filename is used, a package will be read instead.",
|
|
10676
10482
|
type: "string"
|
|
10677
10483
|
}).option("mode", {
|
|
@@ -10736,10 +10542,10 @@ var TestRemoveModule = {
|
|
|
10736
10542
|
command: "remove <id>",
|
|
10737
10543
|
aliases: ["delete", "rm"],
|
|
10738
10544
|
describe: "Delete a test",
|
|
10739
|
-
builder: (
|
|
10545
|
+
builder: (yargs43) => withConfiguration(
|
|
10740
10546
|
withApiOptions(
|
|
10741
10547
|
withProjectOptions(
|
|
10742
|
-
|
|
10548
|
+
yargs43.positional("id", { demandOption: true, describe: "Test public ID to delete" })
|
|
10743
10549
|
)
|
|
10744
10550
|
)
|
|
10745
10551
|
),
|
|
@@ -10756,9 +10562,9 @@ var TestUpdateModule = {
|
|
|
10756
10562
|
command: "update <filename>",
|
|
10757
10563
|
aliases: ["put"],
|
|
10758
10564
|
describe: "Insert or update a test",
|
|
10759
|
-
builder: (
|
|
10565
|
+
builder: (yargs43) => withConfiguration(
|
|
10760
10566
|
withApiOptions(
|
|
10761
|
-
withProjectOptions(
|
|
10567
|
+
withProjectOptions(yargs43.positional("filename", { demandOption: true, describe: "Test file to put" }))
|
|
10762
10568
|
)
|
|
10763
10569
|
),
|
|
10764
10570
|
handler: async ({ apiHost, apiKey, proxy, filename, project: projectId }) => {
|
|
@@ -10773,9 +10579,9 @@ var TestUpdateModule = {
|
|
|
10773
10579
|
var TestModule = {
|
|
10774
10580
|
command: "test <command>",
|
|
10775
10581
|
describe: "Commands for Context A/B tests",
|
|
10776
|
-
builder: (
|
|
10582
|
+
builder: (yargs43) => yargs43.command(TestPullModule).command(TestPushModule).command(TestGetModule).command(TestRemoveModule).command(TestListModule).command(TestUpdateModule).demandCommand(),
|
|
10777
10583
|
handler: () => {
|
|
10778
|
-
|
|
10584
|
+
yargs27.help();
|
|
10779
10585
|
}
|
|
10780
10586
|
};
|
|
10781
10587
|
|
|
@@ -10784,23 +10590,56 @@ var ContextCommand = {
|
|
|
10784
10590
|
command: "context <command>",
|
|
10785
10591
|
aliases: ["ctx"],
|
|
10786
10592
|
describe: "Uniform Context commands",
|
|
10787
|
-
builder: (
|
|
10593
|
+
builder: (yargs43) => yargs43.command(ManifestModule).command(SignalModule).command(EnrichmentModule).command(AggregateModule).command(QuirkModule).command(TestModule).demandCommand(),
|
|
10788
10594
|
handler: () => {
|
|
10789
|
-
|
|
10595
|
+
yargs28.showHelp();
|
|
10790
10596
|
}
|
|
10791
10597
|
};
|
|
10792
10598
|
|
|
10793
10599
|
// src/commands/integration/index.ts
|
|
10794
|
-
import
|
|
10600
|
+
import yargs33 from "yargs";
|
|
10795
10601
|
|
|
10796
10602
|
// src/commands/integration/commands/definition.ts
|
|
10797
|
-
import
|
|
10603
|
+
import yargs32 from "yargs";
|
|
10798
10604
|
|
|
10799
10605
|
// src/commands/integration/commands/definition/dataResourceEditor/dataResourceEditor.ts
|
|
10800
|
-
import
|
|
10606
|
+
import yargs29 from "yargs";
|
|
10801
10607
|
|
|
10802
10608
|
// src/commands/integration/commands/definition/dataResourceEditor/deploy.ts
|
|
10803
|
-
import { readFileSync as
|
|
10609
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
10610
|
+
|
|
10611
|
+
// src/commands/integration/commands/definition/bundleWorkerCode.ts
|
|
10612
|
+
import esbuild from "esbuild";
|
|
10613
|
+
import path5 from "path";
|
|
10614
|
+
async function bundleWorkerCode(entryFile) {
|
|
10615
|
+
const result = await esbuild.build({
|
|
10616
|
+
entryPoints: [entryFile],
|
|
10617
|
+
bundle: true,
|
|
10618
|
+
// Don't write to disk, build to memory
|
|
10619
|
+
write: false,
|
|
10620
|
+
format: "esm",
|
|
10621
|
+
target: "es2021",
|
|
10622
|
+
platform: "browser",
|
|
10623
|
+
minify: true,
|
|
10624
|
+
// Force inlining of all dependencies
|
|
10625
|
+
external: [],
|
|
10626
|
+
// Ensure single file output
|
|
10627
|
+
splitting: false,
|
|
10628
|
+
sourcemap: false
|
|
10629
|
+
});
|
|
10630
|
+
const outputFiles = result.outputFiles;
|
|
10631
|
+
if (!outputFiles || outputFiles.length === 0) {
|
|
10632
|
+
throw new Error(`No output generated for ${entryFile}`);
|
|
10633
|
+
}
|
|
10634
|
+
const outputFile = outputFiles[0];
|
|
10635
|
+
const builtCode = outputFile.text;
|
|
10636
|
+
console.log(
|
|
10637
|
+
`\u2139\uFE0F ${path5.basename(entryFile)} was prepared with esbuild. Size: ${Math.round(
|
|
10638
|
+
builtCode.length / 1024
|
|
10639
|
+
)}kb (use --skipBundle to disable)`
|
|
10640
|
+
);
|
|
10641
|
+
return builtCode;
|
|
10642
|
+
}
|
|
10804
10643
|
|
|
10805
10644
|
// src/commands/integration/commands/definition/edgehancer/EdgehancerClient.ts
|
|
10806
10645
|
import { createLimitPolicy as createLimitPolicy2 } from "@uniformdev/canvas";
|
|
@@ -10835,8 +10674,8 @@ var EdgehancerClient = class extends ApiClient {
|
|
|
10835
10674
|
};
|
|
10836
10675
|
|
|
10837
10676
|
// src/commands/integration/commands/definition/dataResourceEditor/util.ts
|
|
10838
|
-
function withDataResourceEditorIdOptions(
|
|
10839
|
-
return
|
|
10677
|
+
function withDataResourceEditorIdOptions(yargs43) {
|
|
10678
|
+
return yargs43.option("connectorType", {
|
|
10840
10679
|
describe: "Integration data connector type to attach the data resource editor to, as defined in the integration manifest file.",
|
|
10841
10680
|
demandOption: true,
|
|
10842
10681
|
type: "string"
|
|
@@ -10856,11 +10695,11 @@ function withDataResourceEditorIdOptions(yargs44) {
|
|
|
10856
10695
|
var IntegrationDataResourceEditorDeployModule = {
|
|
10857
10696
|
command: "deploy <filename>",
|
|
10858
10697
|
describe: "Deploys a custom AI data resource editor hook to run when AI edits data resources of a specific archetype. The API key used must have team admin permissions.",
|
|
10859
|
-
builder: (
|
|
10698
|
+
builder: (yargs43) => withConfiguration(
|
|
10860
10699
|
withApiOptions(
|
|
10861
10700
|
withTeamOptions(
|
|
10862
10701
|
withDataResourceEditorIdOptions(
|
|
10863
|
-
|
|
10702
|
+
yargs43.positional("filename", {
|
|
10864
10703
|
demandOption: true,
|
|
10865
10704
|
describe: "ESM code file to run for the target data resource editor hook. Refer to the documentation for expected types."
|
|
10866
10705
|
}).option("compatibilityDate", {
|
|
@@ -10891,7 +10730,7 @@ var IntegrationDataResourceEditorDeployModule = {
|
|
|
10891
10730
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
10892
10731
|
let code;
|
|
10893
10732
|
if (skipBundle) {
|
|
10894
|
-
code =
|
|
10733
|
+
code = readFileSync2(filename, "utf8");
|
|
10895
10734
|
} else {
|
|
10896
10735
|
code = await bundleWorkerCode(filename);
|
|
10897
10736
|
}
|
|
@@ -10903,7 +10742,7 @@ var IntegrationDataResourceEditorDeployModule = {
|
|
|
10903
10742
|
var IntegrationDataResourceEditorRemoveModule = {
|
|
10904
10743
|
command: "remove",
|
|
10905
10744
|
describe: "Removes a custom AI data resource editor hook from a data resource archetype. The API key used must have team admin permissions.",
|
|
10906
|
-
builder: (
|
|
10745
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withTeamOptions(withDataResourceEditorIdOptions(yargs43)))),
|
|
10907
10746
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, connectorType, archetype, hook }) => {
|
|
10908
10747
|
const fetch2 = nodeFetchProxy(proxy);
|
|
10909
10748
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -10915,21 +10754,21 @@ var IntegrationDataResourceEditorRemoveModule = {
|
|
|
10915
10754
|
var IntegrationDataResourceEditorModule = {
|
|
10916
10755
|
command: "dataResourceEditor <command>",
|
|
10917
10756
|
describe: "Commands for managing custom AI data resource editors at the team level.",
|
|
10918
|
-
builder: (
|
|
10757
|
+
builder: (yargs43) => yargs43.command(IntegrationDataResourceEditorDeployModule).command(IntegrationDataResourceEditorRemoveModule).demandCommand(),
|
|
10919
10758
|
handler: () => {
|
|
10920
|
-
|
|
10759
|
+
yargs29.help();
|
|
10921
10760
|
}
|
|
10922
10761
|
};
|
|
10923
10762
|
|
|
10924
10763
|
// src/commands/integration/commands/definition/edgehancer/edgehancer.ts
|
|
10925
|
-
import
|
|
10764
|
+
import yargs30 from "yargs";
|
|
10926
10765
|
|
|
10927
10766
|
// src/commands/integration/commands/definition/edgehancer/deploy.ts
|
|
10928
|
-
import { readFileSync as
|
|
10767
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
10929
10768
|
|
|
10930
10769
|
// src/commands/integration/commands/definition/edgehancer/util.ts
|
|
10931
|
-
function withEdgehancerIdOptions(
|
|
10932
|
-
return
|
|
10770
|
+
function withEdgehancerIdOptions(yargs43) {
|
|
10771
|
+
return yargs43.option("connectorType", {
|
|
10933
10772
|
describe: "Integration data connector type to edgehance, as defined in the integration manifest file.",
|
|
10934
10773
|
demandOption: true,
|
|
10935
10774
|
type: "string"
|
|
@@ -10949,11 +10788,11 @@ function withEdgehancerIdOptions(yargs44) {
|
|
|
10949
10788
|
var IntegrationEdgehancerDeployModule = {
|
|
10950
10789
|
command: "deploy <filename>",
|
|
10951
10790
|
describe: "Deploys a custom edgehancer hook to run when a data resource of a specific archetype is fetched. The API key used must have team admin permissions.",
|
|
10952
|
-
builder: (
|
|
10791
|
+
builder: (yargs43) => withConfiguration(
|
|
10953
10792
|
withApiOptions(
|
|
10954
10793
|
withTeamOptions(
|
|
10955
10794
|
withEdgehancerIdOptions(
|
|
10956
|
-
|
|
10795
|
+
yargs43.positional("filename", {
|
|
10957
10796
|
demandOption: true,
|
|
10958
10797
|
describe: "ESM code file to run for the target edgehancer hook. Refer to the documentation for expected types."
|
|
10959
10798
|
}).option("compatibilityDate", {
|
|
@@ -10984,7 +10823,7 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
10984
10823
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
10985
10824
|
let code;
|
|
10986
10825
|
if (skipBundle) {
|
|
10987
|
-
code =
|
|
10826
|
+
code = readFileSync3(filename, "utf8");
|
|
10988
10827
|
} else {
|
|
10989
10828
|
code = await bundleWorkerCode(filename);
|
|
10990
10829
|
}
|
|
@@ -10996,7 +10835,7 @@ var IntegrationEdgehancerDeployModule = {
|
|
|
10996
10835
|
var IntegrationEdgehancerRemoveModule = {
|
|
10997
10836
|
command: "remove",
|
|
10998
10837
|
describe: "Deletes a custom edgehancer hook from a data connector archetype. The API key used must have team admin permissions.",
|
|
10999
|
-
builder: (
|
|
10838
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withTeamOptions(withEdgehancerIdOptions(yargs43)))),
|
|
11000
10839
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, archetype, connectorType, hook }) => {
|
|
11001
10840
|
const fetch2 = nodeFetchProxy(proxy);
|
|
11002
10841
|
const client = new EdgehancerClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -11008,22 +10847,22 @@ var IntegrationEdgehancerRemoveModule = {
|
|
|
11008
10847
|
var IntegrationEdgehancerModule = {
|
|
11009
10848
|
command: "edgehancer <command>",
|
|
11010
10849
|
describe: "Commands for managing custom integration edgehancers at the team level.",
|
|
11011
|
-
builder: (
|
|
10850
|
+
builder: (yargs43) => yargs43.command(IntegrationEdgehancerDeployModule).command(IntegrationEdgehancerRemoveModule).demandCommand(),
|
|
11012
10851
|
handler: () => {
|
|
11013
|
-
|
|
10852
|
+
yargs30.help();
|
|
11014
10853
|
}
|
|
11015
10854
|
};
|
|
11016
10855
|
|
|
11017
10856
|
// src/commands/integration/commands/definition/propertyEditor/propertyEditor.ts
|
|
11018
|
-
import
|
|
10857
|
+
import yargs31 from "yargs";
|
|
11019
10858
|
|
|
11020
10859
|
// src/commands/integration/commands/definition/propertyEditor/deploy.ts
|
|
11021
10860
|
import { IntegrationPropertyEditorsClient } from "@uniformdev/canvas";
|
|
11022
|
-
import { readFileSync as
|
|
10861
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
11023
10862
|
|
|
11024
10863
|
// src/commands/integration/commands/definition/propertyEditor/util.ts
|
|
11025
|
-
function withPropertyEditorIdOptions(
|
|
11026
|
-
return
|
|
10864
|
+
function withPropertyEditorIdOptions(yargs43) {
|
|
10865
|
+
return yargs43.option("propertyType", {
|
|
11027
10866
|
describe: "Property type to attach the editor to.",
|
|
11028
10867
|
demandOption: true,
|
|
11029
10868
|
type: "string"
|
|
@@ -11039,11 +10878,11 @@ function withPropertyEditorIdOptions(yargs44) {
|
|
|
11039
10878
|
var IntegrationPropertyEditorDeployModule = {
|
|
11040
10879
|
command: "deploy <filename>",
|
|
11041
10880
|
describe: "Deploys a custom AI property editor hook to run when a property of a specific type is edited. The API key used must have team admin permissions.",
|
|
11042
|
-
builder: (
|
|
10881
|
+
builder: (yargs43) => withConfiguration(
|
|
11043
10882
|
withApiOptions(
|
|
11044
10883
|
withTeamOptions(
|
|
11045
10884
|
withPropertyEditorIdOptions(
|
|
11046
|
-
|
|
10885
|
+
yargs43.positional("filename", {
|
|
11047
10886
|
demandOption: true,
|
|
11048
10887
|
describe: "ESM code file to run for the target property editor hook. Refer to the documentation for expected types."
|
|
11049
10888
|
}).option("compatibilityDate", {
|
|
@@ -11073,7 +10912,7 @@ var IntegrationPropertyEditorDeployModule = {
|
|
|
11073
10912
|
const client = new IntegrationPropertyEditorsClient({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
11074
10913
|
let code;
|
|
11075
10914
|
if (skipBundle) {
|
|
11076
|
-
code =
|
|
10915
|
+
code = readFileSync4(filename, "utf8");
|
|
11077
10916
|
} else {
|
|
11078
10917
|
code = await bundleWorkerCode(filename);
|
|
11079
10918
|
}
|
|
@@ -11086,7 +10925,7 @@ import { IntegrationPropertyEditorsClient as IntegrationPropertyEditorsClient2 }
|
|
|
11086
10925
|
var IntegrationPropertyEditorRemoveModule = {
|
|
11087
10926
|
command: "remove",
|
|
11088
10927
|
describe: "Deletes a custom AI property editor hook from a property type. The API key used must have team admin permissions.",
|
|
11089
|
-
builder: (
|
|
10928
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withTeamOptions(withPropertyEditorIdOptions(yargs43)))),
|
|
11090
10929
|
handler: async ({ apiHost, apiKey, proxy, team: teamId, propertyType, hook }) => {
|
|
11091
10930
|
const fetch2 = nodeFetchProxy(proxy);
|
|
11092
10931
|
const client = new IntegrationPropertyEditorsClient2({ apiKey, apiHost, fetch: fetch2, teamId });
|
|
@@ -11098,9 +10937,9 @@ var IntegrationPropertyEditorRemoveModule = {
|
|
|
11098
10937
|
var IntegrationPropertyEditorModule = {
|
|
11099
10938
|
command: "propertyEditor <command>",
|
|
11100
10939
|
describe: "Commands for managing custom AI property editors at the team level.",
|
|
11101
|
-
builder: (
|
|
10940
|
+
builder: (yargs43) => yargs43.command(IntegrationPropertyEditorDeployModule).command(IntegrationPropertyEditorRemoveModule).demandCommand(),
|
|
11102
10941
|
handler: () => {
|
|
11103
|
-
|
|
10942
|
+
yargs31.help();
|
|
11104
10943
|
}
|
|
11105
10944
|
};
|
|
11106
10945
|
|
|
@@ -11140,10 +10979,10 @@ var DefinitionClient = class extends ApiClient2 {
|
|
|
11140
10979
|
var IntegrationDefinitionRegisterModule = {
|
|
11141
10980
|
command: "register <filename>",
|
|
11142
10981
|
describe: "Registers a custom integration definition on a team. The API key used must have team admin permissions.",
|
|
11143
|
-
builder: (
|
|
10982
|
+
builder: (yargs43) => withConfiguration(
|
|
11144
10983
|
withApiOptions(
|
|
11145
10984
|
withTeamOptions(
|
|
11146
|
-
|
|
10985
|
+
yargs43.positional("filename", {
|
|
11147
10986
|
demandOption: true,
|
|
11148
10987
|
describe: "Integration definition manifest to register"
|
|
11149
10988
|
})
|
|
@@ -11162,10 +11001,10 @@ var IntegrationDefinitionRegisterModule = {
|
|
|
11162
11001
|
var IntegrationDefinitionRemoveModule = {
|
|
11163
11002
|
command: "remove <type>",
|
|
11164
11003
|
describe: "Deletes a custom integration definition from a team. This will uninstall it on any active projects. Existing usages of the integration may break. The API key used must have team admin permissions.",
|
|
11165
|
-
builder: (
|
|
11004
|
+
builder: (yargs43) => withConfiguration(
|
|
11166
11005
|
withApiOptions(
|
|
11167
11006
|
withTeamOptions(
|
|
11168
|
-
|
|
11007
|
+
yargs43.positional("type", {
|
|
11169
11008
|
demandOption: true,
|
|
11170
11009
|
describe: "Integration type (from its manifest) to remove."
|
|
11171
11010
|
})
|
|
@@ -11183,9 +11022,9 @@ var IntegrationDefinitionRemoveModule = {
|
|
|
11183
11022
|
var IntegrationDefinitionModule = {
|
|
11184
11023
|
command: "definition <command>",
|
|
11185
11024
|
describe: "Commands for managing custom integration definitions at the team level.",
|
|
11186
|
-
builder: (
|
|
11025
|
+
builder: (yargs43) => yargs43.command(IntegrationDefinitionRemoveModule).command(IntegrationDefinitionRegisterModule).command(IntegrationEdgehancerModule).command(IntegrationDataResourceEditorModule).command(IntegrationPropertyEditorModule).demandCommand(),
|
|
11187
11026
|
handler: () => {
|
|
11188
|
-
|
|
11027
|
+
yargs32.help();
|
|
11189
11028
|
}
|
|
11190
11029
|
};
|
|
11191
11030
|
|
|
@@ -11225,10 +11064,10 @@ var InstallClient = class extends ApiClient3 {
|
|
|
11225
11064
|
var IntegrationInstallModule = {
|
|
11226
11065
|
command: "install <type>",
|
|
11227
11066
|
describe: "Installs an integration to a project. The integration may be built-in or custom. Custom integrations must be registered to the parent team first.",
|
|
11228
|
-
builder: (
|
|
11067
|
+
builder: (yargs43) => withConfiguration(
|
|
11229
11068
|
withApiOptions(
|
|
11230
11069
|
withProjectOptions(
|
|
11231
|
-
|
|
11070
|
+
yargs43.positional("type", {
|
|
11232
11071
|
demandOption: true,
|
|
11233
11072
|
describe: "Integration type to install (as defined in its manifest)"
|
|
11234
11073
|
}).option("configuration", {
|
|
@@ -11250,10 +11089,10 @@ var IntegrationInstallModule = {
|
|
|
11250
11089
|
var IntegrationUninstallModule = {
|
|
11251
11090
|
command: "uninstall <type>",
|
|
11252
11091
|
describe: "Uninstalls an integration from a project. Existing usages of the integration may break.",
|
|
11253
|
-
builder: (
|
|
11092
|
+
builder: (yargs43) => withConfiguration(
|
|
11254
11093
|
withApiOptions(
|
|
11255
11094
|
withProjectOptions(
|
|
11256
|
-
|
|
11095
|
+
yargs43.positional("type", {
|
|
11257
11096
|
demandOption: true,
|
|
11258
11097
|
describe: "Integration type to uninstall (as defined in its manifest)"
|
|
11259
11098
|
})
|
|
@@ -11271,9 +11110,9 @@ var IntegrationUninstallModule = {
|
|
|
11271
11110
|
var IntegrationCommand = {
|
|
11272
11111
|
command: "integration <command>",
|
|
11273
11112
|
describe: "Integration management commands",
|
|
11274
|
-
builder: (
|
|
11113
|
+
builder: (yargs43) => yargs43.command(IntegrationDefinitionModule).command(IntegrationInstallModule).command(IntegrationUninstallModule).demandCommand(),
|
|
11275
11114
|
handler: () => {
|
|
11276
|
-
|
|
11115
|
+
yargs33.showHelp();
|
|
11277
11116
|
}
|
|
11278
11117
|
};
|
|
11279
11118
|
|
|
@@ -11521,7 +11360,7 @@ npm run dev
|
|
|
11521
11360
|
|
|
11522
11361
|
// src/commands/new/commands/new-mesh-integration.ts
|
|
11523
11362
|
import { input as input2 } from "@inquirer/prompts";
|
|
11524
|
-
import { existsSync as
|
|
11363
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync3, readdirSync, readFileSync as readFileSync5, writeFileSync as writeFileSync2 } from "fs";
|
|
11525
11364
|
import path7 from "path";
|
|
11526
11365
|
import slugify2 from "slugify";
|
|
11527
11366
|
async function newMeshIntegrationHandler({
|
|
@@ -11570,16 +11409,16 @@ async function newMeshIntegrationHandler({
|
|
|
11570
11409
|
});
|
|
11571
11410
|
let done = await spin("Registering integration to team...");
|
|
11572
11411
|
const pathToManifest = path7.resolve(targetDir, "mesh-manifest.json");
|
|
11573
|
-
if (!
|
|
11412
|
+
if (!existsSync4(pathToManifest)) {
|
|
11574
11413
|
throw new Error("Invalid integration starter cloned: missing `mesh-manifest.json`");
|
|
11575
11414
|
}
|
|
11576
|
-
const manifestContents =
|
|
11415
|
+
const manifestContents = readFileSync5(pathToManifest, "utf-8");
|
|
11577
11416
|
const manifestJson = JSON.parse(manifestContents);
|
|
11578
11417
|
manifestJson.type = typeSlug;
|
|
11579
11418
|
manifestJson.displayName = name;
|
|
11580
11419
|
writeFileSync2(pathToManifest, JSON.stringify(manifestJson, null, 2), "utf-8");
|
|
11581
11420
|
const packageJsonPath = path7.resolve(targetDir, "package.json");
|
|
11582
|
-
const packageJson = JSON.parse(
|
|
11421
|
+
const packageJson = JSON.parse(readFileSync5(packageJsonPath, "utf-8"));
|
|
11583
11422
|
packageJson.name = typeSlug;
|
|
11584
11423
|
writeFileSync2(packageJsonPath, JSON.stringify(packageJson, null, 2), "utf-8");
|
|
11585
11424
|
const fullMeshAppKey = await uniformClient.registerMeshIntegration({ teamId, manifest: manifestJson });
|
|
@@ -11624,12 +11463,12 @@ function validateIntegrationName(integrationName, explicitOutputPath) {
|
|
|
11624
11463
|
throw new Error("Integration name cannot be shorter than 6 characters.");
|
|
11625
11464
|
}
|
|
11626
11465
|
let targetDir = explicitOutputPath ?? process.cwd();
|
|
11627
|
-
if (!
|
|
11466
|
+
if (!existsSync4(targetDir)) {
|
|
11628
11467
|
mkdirSync3(targetDir, { recursive: true });
|
|
11629
11468
|
}
|
|
11630
11469
|
if (readdirSync(targetDir).length > 0) {
|
|
11631
11470
|
targetDir = path7.resolve(targetDir, typeSlug);
|
|
11632
|
-
if (
|
|
11471
|
+
if (existsSync4(targetDir)) {
|
|
11633
11472
|
throw new Error(`${targetDir} directory already exists, choose a different name.`);
|
|
11634
11473
|
}
|
|
11635
11474
|
}
|
|
@@ -11738,14 +11577,14 @@ var NewMeshCmd = {
|
|
|
11738
11577
|
};
|
|
11739
11578
|
|
|
11740
11579
|
// src/commands/policy-documents/index.ts
|
|
11741
|
-
import
|
|
11580
|
+
import yargs34 from "yargs";
|
|
11742
11581
|
|
|
11743
11582
|
// src/commands/policy-documents/commands/list.ts
|
|
11744
11583
|
var PolicyDocumentsListModule = {
|
|
11745
11584
|
command: "list",
|
|
11746
11585
|
describe: "List policy documents for a project",
|
|
11747
11586
|
aliases: ["ls"],
|
|
11748
|
-
builder: (
|
|
11587
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
11749
11588
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId, verbose }) => {
|
|
11750
11589
|
const fetch2 = nodeFetchProxy(proxy, verbose);
|
|
11751
11590
|
const url = new URL(`/api/v1/policy-documents`, apiHost);
|
|
@@ -11830,12 +11669,12 @@ var selectDisplayName13 = (policyDoc) => `Policy document for role ${policyDoc.r
|
|
|
11830
11669
|
var PolicyDocumentsPullModule = {
|
|
11831
11670
|
command: "pull <directory>",
|
|
11832
11671
|
describe: "Pulls all policy documents to local files in a directory",
|
|
11833
|
-
builder: (
|
|
11672
|
+
builder: (yargs43) => withConfiguration(
|
|
11834
11673
|
withApiOptions(
|
|
11835
11674
|
withDebugOptions(
|
|
11836
11675
|
withProjectOptions(
|
|
11837
11676
|
withDiffOptions(
|
|
11838
|
-
|
|
11677
|
+
yargs43.positional("directory", {
|
|
11839
11678
|
describe: "Directory to save to. Each policy document will be saved as a separate file named by role ID.",
|
|
11840
11679
|
type: "string"
|
|
11841
11680
|
}).option("format", {
|
|
@@ -11890,19 +11729,19 @@ var PolicyDocumentsPullModule = {
|
|
|
11890
11729
|
};
|
|
11891
11730
|
|
|
11892
11731
|
// src/commands/policy-documents/commands/push.ts
|
|
11893
|
-
import { existsSync as
|
|
11732
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync4 } from "fs";
|
|
11894
11733
|
import { readdir as readdir2 } from "fs/promises";
|
|
11895
|
-
import { extname as
|
|
11734
|
+
import { extname as extname2, join as join11 } from "path";
|
|
11896
11735
|
async function readLocalPolicyDocuments(directory, format, verbose) {
|
|
11897
11736
|
const files = await readdir2(directory);
|
|
11898
11737
|
const policyDocuments = {};
|
|
11899
11738
|
const errors = [];
|
|
11900
11739
|
for (const filename of files) {
|
|
11901
|
-
const ext =
|
|
11740
|
+
const ext = extname2(filename);
|
|
11902
11741
|
if (ext !== `.${format}` && ext !== ".yaml" && ext !== ".yml" && ext !== ".json") {
|
|
11903
11742
|
continue;
|
|
11904
11743
|
}
|
|
11905
|
-
const filePath =
|
|
11744
|
+
const filePath = join11(directory, filename);
|
|
11906
11745
|
try {
|
|
11907
11746
|
let roleId = filename.replace(ext, "");
|
|
11908
11747
|
const fileContent = readFileToObject(filePath);
|
|
@@ -11969,12 +11808,12 @@ function mergePolicyDocuments(localDocs, remoteDocs, mode) {
|
|
|
11969
11808
|
var PolicyDocumentsPushModule = {
|
|
11970
11809
|
command: "push <directory>",
|
|
11971
11810
|
describe: "Pushes policy documents from local files to Uniform",
|
|
11972
|
-
builder: (
|
|
11811
|
+
builder: (yargs43) => withConfiguration(
|
|
11973
11812
|
withApiOptions(
|
|
11974
11813
|
withDebugOptions(
|
|
11975
11814
|
withProjectOptions(
|
|
11976
11815
|
withDiffOptions(
|
|
11977
|
-
|
|
11816
|
+
yargs43.positional("directory", {
|
|
11978
11817
|
describe: "Directory containing policy document files (one file per role ID).",
|
|
11979
11818
|
type: "string"
|
|
11980
11819
|
}).option("format", {
|
|
@@ -12008,7 +11847,7 @@ var PolicyDocumentsPushModule = {
|
|
|
12008
11847
|
allowEmptySource,
|
|
12009
11848
|
verbose
|
|
12010
11849
|
}) => {
|
|
12011
|
-
if (!
|
|
11850
|
+
if (!existsSync5(directory)) {
|
|
12012
11851
|
if (verbose) {
|
|
12013
11852
|
console.log(`Creating directory ${directory}`);
|
|
12014
11853
|
}
|
|
@@ -12070,17 +11909,17 @@ var PolicyDocumentsCommand = {
|
|
|
12070
11909
|
command: "policy-documents <command>",
|
|
12071
11910
|
aliases: ["policy", "policies"],
|
|
12072
11911
|
describe: "Uniform Policy Documents commands",
|
|
12073
|
-
builder: (
|
|
11912
|
+
builder: (yargs43) => yargs43.command(PolicyDocumentsListModule).command(PolicyDocumentsPullModule).command(PolicyDocumentsPushModule).demandCommand(),
|
|
12074
11913
|
handler: () => {
|
|
12075
|
-
|
|
11914
|
+
yargs34.showHelp();
|
|
12076
11915
|
}
|
|
12077
11916
|
};
|
|
12078
11917
|
|
|
12079
11918
|
// src/commands/project-map/index.ts
|
|
12080
|
-
import
|
|
11919
|
+
import yargs37 from "yargs";
|
|
12081
11920
|
|
|
12082
11921
|
// src/commands/project-map/commands/projectMapDefinition.ts
|
|
12083
|
-
import
|
|
11922
|
+
import yargs35 from "yargs";
|
|
12084
11923
|
|
|
12085
11924
|
// src/commands/project-map/commands/ProjectMapDefinition/_util.ts
|
|
12086
11925
|
import { UncachedProjectMapClient } from "@uniformdev/project-map";
|
|
@@ -12094,11 +11933,11 @@ function getProjectMapClient(options) {
|
|
|
12094
11933
|
var ProjectMapDefinitionGetModule = {
|
|
12095
11934
|
command: "get <id>",
|
|
12096
11935
|
describe: "Fetch a project map",
|
|
12097
|
-
builder: (
|
|
11936
|
+
builder: (yargs43) => withFormatOptions(
|
|
12098
11937
|
withConfiguration(
|
|
12099
11938
|
withApiOptions(
|
|
12100
11939
|
withProjectOptions(
|
|
12101
|
-
|
|
11940
|
+
yargs43.positional("id", { demandOption: true, describe: "ProjectMap UUID to fetch" })
|
|
12102
11941
|
)
|
|
12103
11942
|
)
|
|
12104
11943
|
)
|
|
@@ -12121,7 +11960,7 @@ var ProjectMapDefinitionListModule = {
|
|
|
12121
11960
|
command: "list",
|
|
12122
11961
|
describe: "List of project maps",
|
|
12123
11962
|
aliases: ["ls"],
|
|
12124
|
-
builder: (
|
|
11963
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
12125
11964
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
12126
11965
|
const fetch2 = nodeFetchProxy(proxy);
|
|
12127
11966
|
const client = getProjectMapClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -12175,12 +12014,12 @@ function createProjectMapDefinitionEngineDataSource({
|
|
|
12175
12014
|
var ProjectMapDefinitionPullModule = {
|
|
12176
12015
|
command: "pull <directory>",
|
|
12177
12016
|
describe: "Pulls all project maps to local files in a directory",
|
|
12178
|
-
builder: (
|
|
12017
|
+
builder: (yargs43) => withConfiguration(
|
|
12179
12018
|
withDebugOptions(
|
|
12180
12019
|
withApiOptions(
|
|
12181
12020
|
withProjectOptions(
|
|
12182
12021
|
withDiffOptions(
|
|
12183
|
-
|
|
12022
|
+
yargs43.positional("directory", {
|
|
12184
12023
|
describe: "Directory to save project maps to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
12185
12024
|
type: "string"
|
|
12186
12025
|
}).option("format", {
|
|
@@ -12255,12 +12094,12 @@ var ProjectMapDefinitionPullModule = {
|
|
|
12255
12094
|
var ProjectMapDefinitionPushModule = {
|
|
12256
12095
|
command: "push <directory>",
|
|
12257
12096
|
describe: "Pushes all project maps from files in a directory or package to Uniform",
|
|
12258
|
-
builder: (
|
|
12097
|
+
builder: (yargs43) => withConfiguration(
|
|
12259
12098
|
withDebugOptions(
|
|
12260
12099
|
withApiOptions(
|
|
12261
12100
|
withProjectOptions(
|
|
12262
12101
|
withDiffOptions(
|
|
12263
|
-
|
|
12102
|
+
yargs43.positional("directory", {
|
|
12264
12103
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
12265
12104
|
type: "string"
|
|
12266
12105
|
}).option("mode", {
|
|
@@ -12324,9 +12163,9 @@ var ProjectMapDefinitionRemoveModule = {
|
|
|
12324
12163
|
command: "remove <id>",
|
|
12325
12164
|
aliases: ["delete", "rm"],
|
|
12326
12165
|
describe: "Delete a project map",
|
|
12327
|
-
builder: (
|
|
12166
|
+
builder: (yargs43) => withConfiguration(
|
|
12328
12167
|
withApiOptions(
|
|
12329
|
-
withProjectOptions(
|
|
12168
|
+
withProjectOptions(yargs43.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
12330
12169
|
)
|
|
12331
12170
|
),
|
|
12332
12171
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -12341,10 +12180,10 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
12341
12180
|
command: "update <filename>",
|
|
12342
12181
|
aliases: ["put"],
|
|
12343
12182
|
describe: "Insert or update a project map",
|
|
12344
|
-
builder: (
|
|
12183
|
+
builder: (yargs43) => withConfiguration(
|
|
12345
12184
|
withApiOptions(
|
|
12346
12185
|
withProjectOptions(
|
|
12347
|
-
|
|
12186
|
+
yargs43.positional("filename", { demandOption: true, describe: "Project map file to put" })
|
|
12348
12187
|
)
|
|
12349
12188
|
)
|
|
12350
12189
|
),
|
|
@@ -12360,24 +12199,24 @@ var ProjectMapDefinitionUpdateModule = {
|
|
|
12360
12199
|
var ProjectMapDefinitionModule = {
|
|
12361
12200
|
command: "definition <command>",
|
|
12362
12201
|
describe: "Commands for ProjectMap Definitions",
|
|
12363
|
-
builder: (
|
|
12202
|
+
builder: (yargs43) => yargs43.command(ProjectMapDefinitionPullModule).command(ProjectMapDefinitionPushModule).command(ProjectMapDefinitionGetModule).command(ProjectMapDefinitionRemoveModule).command(ProjectMapDefinitionListModule).command(ProjectMapDefinitionUpdateModule).demandCommand(),
|
|
12364
12203
|
handler: () => {
|
|
12365
|
-
|
|
12204
|
+
yargs35.help();
|
|
12366
12205
|
}
|
|
12367
12206
|
};
|
|
12368
12207
|
|
|
12369
12208
|
// src/commands/project-map/commands/projectMapNode.ts
|
|
12370
|
-
import
|
|
12209
|
+
import yargs36 from "yargs";
|
|
12371
12210
|
|
|
12372
12211
|
// src/commands/project-map/commands/ProjectMapNode/get.ts
|
|
12373
12212
|
var ProjectMapNodeGetModule = {
|
|
12374
12213
|
command: "get <id> <projectMapId>",
|
|
12375
12214
|
describe: "Fetch a project map node",
|
|
12376
|
-
builder: (
|
|
12215
|
+
builder: (yargs43) => withConfiguration(
|
|
12377
12216
|
withFormatOptions(
|
|
12378
12217
|
withApiOptions(
|
|
12379
12218
|
withProjectOptions(
|
|
12380
|
-
|
|
12219
|
+
yargs43.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to fetch" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to fetch from" })
|
|
12381
12220
|
)
|
|
12382
12221
|
)
|
|
12383
12222
|
)
|
|
@@ -12401,12 +12240,12 @@ var ProjectMapNodeListModule = {
|
|
|
12401
12240
|
command: "list <projectMapId>",
|
|
12402
12241
|
describe: "List project map nodes",
|
|
12403
12242
|
aliases: ["ls"],
|
|
12404
|
-
builder: (
|
|
12243
|
+
builder: (yargs43) => withConfiguration(
|
|
12405
12244
|
withFormatOptions(
|
|
12406
12245
|
withApiOptions(
|
|
12407
12246
|
withProjectOptions(
|
|
12408
12247
|
withStateOptions(
|
|
12409
|
-
|
|
12248
|
+
yargs43.positional("projectMapId", {
|
|
12410
12249
|
demandOption: true,
|
|
12411
12250
|
describe: "ProjectMap UUID to fetch from"
|
|
12412
12251
|
})
|
|
@@ -12430,6 +12269,20 @@ var selectIdentifier15 = (source, projectId) => [
|
|
|
12430
12269
|
];
|
|
12431
12270
|
var selectFilename = (source) => cleanFileName(`${source.pathSegment}_${source.id}`);
|
|
12432
12271
|
var selectDisplayName15 = (source) => `${source.name} (pid: ${source.id})`;
|
|
12272
|
+
function alignProjectMapNodeWithTargetIdentifier(sourceObject, targetObject) {
|
|
12273
|
+
if (!targetObject) {
|
|
12274
|
+
return sourceObject;
|
|
12275
|
+
}
|
|
12276
|
+
return {
|
|
12277
|
+
...sourceObject,
|
|
12278
|
+
id: targetObject.id,
|
|
12279
|
+
providerId: targetObject.providerId,
|
|
12280
|
+
object: {
|
|
12281
|
+
...sourceObject.object,
|
|
12282
|
+
id: targetObject.object.id
|
|
12283
|
+
}
|
|
12284
|
+
};
|
|
12285
|
+
}
|
|
12433
12286
|
|
|
12434
12287
|
// src/commands/project-map/ProjectMapNodeEngineDataSource.ts
|
|
12435
12288
|
function createProjectMapNodeEngineDataSource({
|
|
@@ -12484,12 +12337,12 @@ function createProjectMapNodeEngineDataSource({
|
|
|
12484
12337
|
var ProjectMapNodePullModule = {
|
|
12485
12338
|
command: "pull <directory>",
|
|
12486
12339
|
describe: "Pulls all project maps nodes to local files in a directory",
|
|
12487
|
-
builder: (
|
|
12340
|
+
builder: (yargs43) => withConfiguration(
|
|
12488
12341
|
withDebugOptions(
|
|
12489
12342
|
withApiOptions(
|
|
12490
12343
|
withProjectOptions(
|
|
12491
12344
|
withDiffOptions(
|
|
12492
|
-
|
|
12345
|
+
yargs43.positional("directory", {
|
|
12493
12346
|
describe: "Directory to save project maps to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
12494
12347
|
type: "string"
|
|
12495
12348
|
}).option("format", {
|
|
@@ -12571,12 +12424,12 @@ import {
|
|
|
12571
12424
|
var ProjectMapNodePushModule = {
|
|
12572
12425
|
command: "push <directory>",
|
|
12573
12426
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
12574
|
-
builder: (
|
|
12427
|
+
builder: (yargs43) => withConfiguration(
|
|
12575
12428
|
withDebugOptions(
|
|
12576
12429
|
withApiOptions(
|
|
12577
12430
|
withProjectOptions(
|
|
12578
12431
|
withDiffOptions(
|
|
12579
|
-
|
|
12432
|
+
yargs43.positional("directory", {
|
|
12580
12433
|
describe: "Directory to read project maps from. If a filename is used, a package will be read instead.",
|
|
12581
12434
|
type: "string"
|
|
12582
12435
|
}).option("mode", {
|
|
@@ -12646,6 +12499,12 @@ var ProjectMapNodePushModule = {
|
|
|
12646
12499
|
whatIf,
|
|
12647
12500
|
allowEmptySource,
|
|
12648
12501
|
log: createSyncEngineConsoleLogger({ diffMode }),
|
|
12502
|
+
onBeforeCompareObjects: async (sourceObject, targetObject) => {
|
|
12503
|
+
return alignProjectMapNodeWithTargetIdentifier(sourceObject, targetObject);
|
|
12504
|
+
},
|
|
12505
|
+
onBeforeWriteObject: async (sourceObject, targetObject) => {
|
|
12506
|
+
return alignProjectMapNodeWithTargetIdentifier(sourceObject, targetObject);
|
|
12507
|
+
},
|
|
12649
12508
|
onError: (error, object4) => {
|
|
12650
12509
|
if (error.message.includes(__INTERNAL_MISSING_PARENT_NODE_ERROR)) {
|
|
12651
12510
|
nodesFailedDueToMissingParent.add(object4.object);
|
|
@@ -12678,10 +12537,10 @@ var ProjectMapNodeRemoveModule = {
|
|
|
12678
12537
|
command: "remove <id> <projectMapId>",
|
|
12679
12538
|
aliases: ["delete", "rm"],
|
|
12680
12539
|
describe: "Delete a project map node",
|
|
12681
|
-
builder: (
|
|
12540
|
+
builder: (yargs43) => withConfiguration(
|
|
12682
12541
|
withApiOptions(
|
|
12683
12542
|
withProjectOptions(
|
|
12684
|
-
|
|
12543
|
+
yargs43.positional("id", { demandOption: true, describe: "ProjectMap Node UUID to delete" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to delete from" })
|
|
12685
12544
|
)
|
|
12686
12545
|
)
|
|
12687
12546
|
),
|
|
@@ -12697,10 +12556,10 @@ var ProjectMapNodeUpdateModule = {
|
|
|
12697
12556
|
command: "update <filename> <projectMapId>",
|
|
12698
12557
|
aliases: ["put"],
|
|
12699
12558
|
describe: "Insert or update a project map node",
|
|
12700
|
-
builder: (
|
|
12559
|
+
builder: (yargs43) => withConfiguration(
|
|
12701
12560
|
withApiOptions(
|
|
12702
12561
|
withProjectOptions(
|
|
12703
|
-
|
|
12562
|
+
yargs43.positional("filename", { demandOption: true, describe: "ProjectMap node file with nodes data" }).positional("projectMapId", { demandOption: true, describe: "ProjectMap UUID to put into" })
|
|
12704
12563
|
)
|
|
12705
12564
|
)
|
|
12706
12565
|
),
|
|
@@ -12716,9 +12575,9 @@ var ProjectMapNodeUpdateModule = {
|
|
|
12716
12575
|
var ProjectMapNodeModule = {
|
|
12717
12576
|
command: "node <command>",
|
|
12718
12577
|
describe: "Commands for ProjectMap Nodes",
|
|
12719
|
-
builder: (
|
|
12578
|
+
builder: (yargs43) => yargs43.command(ProjectMapNodePullModule).command(ProjectMapNodePushModule).command(ProjectMapNodeGetModule).command(ProjectMapNodeRemoveModule).command(ProjectMapNodeListModule).command(ProjectMapNodeUpdateModule).demandCommand(),
|
|
12720
12579
|
handler: () => {
|
|
12721
|
-
|
|
12580
|
+
yargs36.help();
|
|
12722
12581
|
}
|
|
12723
12582
|
};
|
|
12724
12583
|
|
|
@@ -12727,17 +12586,17 @@ var ProjectMapCommand = {
|
|
|
12727
12586
|
command: "project-map <command>",
|
|
12728
12587
|
aliases: ["prm"],
|
|
12729
12588
|
describe: "Uniform ProjectMap commands",
|
|
12730
|
-
builder: (
|
|
12589
|
+
builder: (yargs43) => yargs43.command(ProjectMapNodeModule).command(ProjectMapDefinitionModule).demandCommand(),
|
|
12731
12590
|
handler: () => {
|
|
12732
|
-
|
|
12591
|
+
yargs37.showHelp();
|
|
12733
12592
|
}
|
|
12734
12593
|
};
|
|
12735
12594
|
|
|
12736
12595
|
// src/commands/redirect/index.ts
|
|
12737
|
-
import
|
|
12596
|
+
import yargs39 from "yargs";
|
|
12738
12597
|
|
|
12739
12598
|
// src/commands/redirect/commands/redirect.ts
|
|
12740
|
-
import
|
|
12599
|
+
import yargs38 from "yargs";
|
|
12741
12600
|
|
|
12742
12601
|
// src/commands/redirect/commands/RedirectDefinition/_util.ts
|
|
12743
12602
|
import { UncachedRedirectClient } from "@uniformdev/redirect";
|
|
@@ -12762,11 +12621,11 @@ function getRedirectClient(options) {
|
|
|
12762
12621
|
var RedirectDefinitionGetModule = {
|
|
12763
12622
|
command: "get <id>",
|
|
12764
12623
|
describe: "Fetch a redirect",
|
|
12765
|
-
builder: (
|
|
12624
|
+
builder: (yargs43) => withConfiguration(
|
|
12766
12625
|
withFormatOptions(
|
|
12767
12626
|
withApiOptions(
|
|
12768
12627
|
withProjectOptions(
|
|
12769
|
-
|
|
12628
|
+
yargs43.positional("id", { demandOption: true, describe: "Redirect UUID to fetch" })
|
|
12770
12629
|
)
|
|
12771
12630
|
)
|
|
12772
12631
|
)
|
|
@@ -12789,7 +12648,7 @@ var RedirectDefinitionListModule = {
|
|
|
12789
12648
|
command: "list",
|
|
12790
12649
|
describe: "List of redirects",
|
|
12791
12650
|
aliases: ["ls"],
|
|
12792
|
-
builder: (
|
|
12651
|
+
builder: (yargs43) => withConfiguration(withFormatOptions(withApiOptions(withProjectOptions(yargs43)))),
|
|
12793
12652
|
handler: async ({ apiHost, apiKey, proxy, format, filename, project: projectId }) => {
|
|
12794
12653
|
const fetch2 = nodeFetchProxy(proxy);
|
|
12795
12654
|
const client = getRedirectClient({ apiKey, apiHost, fetch: fetch2, projectId });
|
|
@@ -12841,12 +12700,12 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
12841
12700
|
var RedirectDefinitionPullModule = {
|
|
12842
12701
|
command: "pull <directory>",
|
|
12843
12702
|
describe: "Pulls all redirects to local files in a directory",
|
|
12844
|
-
builder: (
|
|
12703
|
+
builder: (yargs43) => withConfiguration(
|
|
12845
12704
|
withDebugOptions(
|
|
12846
12705
|
withApiOptions(
|
|
12847
12706
|
withProjectOptions(
|
|
12848
12707
|
withDiffOptions(
|
|
12849
|
-
|
|
12708
|
+
yargs43.positional("directory", {
|
|
12850
12709
|
describe: "Directory to save redirects to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
12851
12710
|
type: "string"
|
|
12852
12711
|
}).option("format", {
|
|
@@ -12922,12 +12781,12 @@ var RedirectDefinitionPullModule = {
|
|
|
12922
12781
|
var RedirectDefinitionPushModule = {
|
|
12923
12782
|
command: "push <directory>",
|
|
12924
12783
|
describe: "Pushes all redirects from files in a directory or package to Uniform",
|
|
12925
|
-
builder: (
|
|
12784
|
+
builder: (yargs43) => withConfiguration(
|
|
12926
12785
|
withDebugOptions(
|
|
12927
12786
|
withApiOptions(
|
|
12928
12787
|
withProjectOptions(
|
|
12929
12788
|
withDiffOptions(
|
|
12930
|
-
|
|
12789
|
+
yargs43.positional("directory", {
|
|
12931
12790
|
describe: "Directory to read redirects from. If a filename is used, a package will be read instead.",
|
|
12932
12791
|
type: "string"
|
|
12933
12792
|
}).option("mode", {
|
|
@@ -12991,9 +12850,9 @@ var RedirectDefinitionRemoveModule = {
|
|
|
12991
12850
|
command: "remove <id>",
|
|
12992
12851
|
aliases: ["delete", "rm"],
|
|
12993
12852
|
describe: "Delete a redirect",
|
|
12994
|
-
builder: (
|
|
12853
|
+
builder: (yargs43) => withConfiguration(
|
|
12995
12854
|
withApiOptions(
|
|
12996
|
-
withProjectOptions(
|
|
12855
|
+
withProjectOptions(yargs43.positional("id", { demandOption: true, describe: " UUID to delete" }))
|
|
12997
12856
|
)
|
|
12998
12857
|
),
|
|
12999
12858
|
handler: async ({ apiHost, apiKey, proxy, id, project: projectId }) => {
|
|
@@ -13008,10 +12867,10 @@ var RedirectDefinitionUpdateModule = {
|
|
|
13008
12867
|
command: "update <filename>",
|
|
13009
12868
|
aliases: ["put"],
|
|
13010
12869
|
describe: "Insert or update a redirect",
|
|
13011
|
-
builder: (
|
|
12870
|
+
builder: (yargs43) => withConfiguration(
|
|
13012
12871
|
withApiOptions(
|
|
13013
12872
|
withProjectOptions(
|
|
13014
|
-
|
|
12873
|
+
yargs43.positional("filename", { demandOption: true, describe: "Redirect file to put" })
|
|
13015
12874
|
)
|
|
13016
12875
|
)
|
|
13017
12876
|
),
|
|
@@ -13027,9 +12886,9 @@ var RedirectDefinitionUpdateModule = {
|
|
|
13027
12886
|
var RedirectDefinitionModule = {
|
|
13028
12887
|
command: "definition <command>",
|
|
13029
12888
|
describe: "Commands for Redirect Definitions",
|
|
13030
|
-
builder: (
|
|
12889
|
+
builder: (yargs43) => yargs43.command(RedirectDefinitionPullModule).command(RedirectDefinitionPushModule).command(RedirectDefinitionGetModule).command(RedirectDefinitionRemoveModule).command(RedirectDefinitionListModule).command(RedirectDefinitionUpdateModule).demandCommand(),
|
|
13031
12890
|
handler: () => {
|
|
13032
|
-
|
|
12891
|
+
yargs38.help();
|
|
13033
12892
|
}
|
|
13034
12893
|
};
|
|
13035
12894
|
|
|
@@ -13038,20 +12897,20 @@ var RedirectCommand = {
|
|
|
13038
12897
|
command: "redirect <command>",
|
|
13039
12898
|
aliases: ["red"],
|
|
13040
12899
|
describe: "Uniform Redirect commands",
|
|
13041
|
-
builder: (
|
|
12900
|
+
builder: (yargs43) => yargs43.command(RedirectDefinitionModule).demandCommand(),
|
|
13042
12901
|
handler: () => {
|
|
13043
|
-
|
|
12902
|
+
yargs39.showHelp();
|
|
13044
12903
|
}
|
|
13045
12904
|
};
|
|
13046
12905
|
|
|
13047
12906
|
// src/commands/sync/index.ts
|
|
13048
|
-
import
|
|
12907
|
+
import yargs40 from "yargs";
|
|
13049
12908
|
|
|
13050
12909
|
// src/webhooksClient.ts
|
|
13051
12910
|
import { ApiClient as ApiClient4 } from "@uniformdev/context/api";
|
|
13052
|
-
import
|
|
12911
|
+
import PQueue4 from "p-queue";
|
|
13053
12912
|
import { Svix } from "svix";
|
|
13054
|
-
import * as
|
|
12913
|
+
import * as z3 from "zod";
|
|
13055
12914
|
var WEBHOOKS_DASHBOARD_BASE_PATH = "/api/v1/svix-dashboard";
|
|
13056
12915
|
var WebhooksClient = class extends ApiClient4 {
|
|
13057
12916
|
constructor(options) {
|
|
@@ -13071,14 +12930,14 @@ var WebhooksClient = class extends ApiClient4 {
|
|
|
13071
12930
|
if (!key) {
|
|
13072
12931
|
throw new Error("Failed to get webhooks token");
|
|
13073
12932
|
}
|
|
13074
|
-
const keySchema =
|
|
13075
|
-
appId:
|
|
13076
|
-
oneTimeToken:
|
|
13077
|
-
region:
|
|
12933
|
+
const keySchema = z3.object({
|
|
12934
|
+
appId: z3.string(),
|
|
12935
|
+
oneTimeToken: z3.string(),
|
|
12936
|
+
region: z3.enum(["us", "eu"])
|
|
13078
12937
|
});
|
|
13079
12938
|
const { appId, oneTimeToken, region } = keySchema.parse(JSON.parse(atob(key)));
|
|
13080
|
-
const tokenSchema =
|
|
13081
|
-
token:
|
|
12939
|
+
const tokenSchema = z3.object({
|
|
12940
|
+
token: z3.string()
|
|
13082
12941
|
});
|
|
13083
12942
|
const tokenResponse = await fetch(`https://api.${region}.svix.com/api/v1/auth/one-time-token`, {
|
|
13084
12943
|
method: "POST",
|
|
@@ -13097,7 +12956,7 @@ var WebhooksClient = class extends ApiClient4 {
|
|
|
13097
12956
|
};
|
|
13098
12957
|
}
|
|
13099
12958
|
async get() {
|
|
13100
|
-
const webhooksAPIQueue = new
|
|
12959
|
+
const webhooksAPIQueue = new PQueue4({ concurrency: 10 });
|
|
13101
12960
|
const { appId, token } = await this.getToken();
|
|
13102
12961
|
const svix = new Svix(token);
|
|
13103
12962
|
const getEndpoints = async ({
|
|
@@ -13239,12 +13098,12 @@ function createWebhookEngineDataSource({
|
|
|
13239
13098
|
var WebhookPullModule = {
|
|
13240
13099
|
command: "pull <directory>",
|
|
13241
13100
|
describe: "Pulls all webhooks to local files in a directory",
|
|
13242
|
-
builder: (
|
|
13101
|
+
builder: (yargs43) => withConfiguration(
|
|
13243
13102
|
withApiOptions(
|
|
13244
13103
|
withDebugOptions(
|
|
13245
13104
|
withProjectOptions(
|
|
13246
13105
|
withDiffOptions(
|
|
13247
|
-
|
|
13106
|
+
yargs43.positional("directory", {
|
|
13248
13107
|
describe: "Directory to save to. If a filename ending in yaml or json is used, a package file will be created instead of files in the directory.",
|
|
13249
13108
|
type: "string"
|
|
13250
13109
|
}).option("format", {
|
|
@@ -13430,7 +13289,7 @@ function numPad(num, spaces = 6) {
|
|
|
13430
13289
|
var SyncPullModule = {
|
|
13431
13290
|
command: "pull",
|
|
13432
13291
|
describe: "Pulls whole project to local files in a directory",
|
|
13433
|
-
builder: (
|
|
13292
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withProjectOptions(withDebugOptions(withDiffOptions(yargs43))))),
|
|
13434
13293
|
handler: async ({ serialization, ...otherParams }) => {
|
|
13435
13294
|
const config2 = serialization;
|
|
13436
13295
|
const enabledEntities = Object.entries({
|
|
@@ -13531,12 +13390,12 @@ var getFormat = (entityType, config2) => {
|
|
|
13531
13390
|
var WebhookPushModule = {
|
|
13532
13391
|
command: "push <directory>",
|
|
13533
13392
|
describe: "Pushes all webhooks from files in a directory to Uniform",
|
|
13534
|
-
builder: (
|
|
13393
|
+
builder: (yargs43) => withConfiguration(
|
|
13535
13394
|
withDebugOptions(
|
|
13536
13395
|
withApiOptions(
|
|
13537
13396
|
withProjectOptions(
|
|
13538
13397
|
withDiffOptions(
|
|
13539
|
-
|
|
13398
|
+
yargs43.positional("directory", {
|
|
13540
13399
|
describe: "Directory to read from. If a filename is used, a package will be read instead.",
|
|
13541
13400
|
type: "string"
|
|
13542
13401
|
}).option("mode", {
|
|
@@ -13600,7 +13459,7 @@ var WebhookPushModule = {
|
|
|
13600
13459
|
var SyncPushModule = {
|
|
13601
13460
|
command: "push",
|
|
13602
13461
|
describe: "Pushes whole project data from files in a directory or package to Uniform",
|
|
13603
|
-
builder: (
|
|
13462
|
+
builder: (yargs43) => withConfiguration(withApiOptions(withProjectOptions(withDiffOptions(withDebugOptions(yargs43))))),
|
|
13604
13463
|
handler: async ({ serialization, ...otherParams }) => {
|
|
13605
13464
|
const config2 = serialization;
|
|
13606
13465
|
const enabledEntities = Object.entries({
|
|
@@ -13822,63 +13681,21 @@ var getFormat2 = (entityType, config2) => {
|
|
|
13822
13681
|
var SyncCommand = {
|
|
13823
13682
|
command: "sync <command>",
|
|
13824
13683
|
describe: "Uniform Sync commands",
|
|
13825
|
-
builder: (
|
|
13684
|
+
builder: (yargs43) => yargs43.command(SyncPullModule).command(SyncPushModule).demandCommand(),
|
|
13826
13685
|
handler: () => {
|
|
13827
|
-
|
|
13686
|
+
yargs40.showHelp();
|
|
13828
13687
|
}
|
|
13829
13688
|
};
|
|
13830
13689
|
|
|
13831
13690
|
// src/commands/webhook/index.ts
|
|
13832
|
-
import
|
|
13691
|
+
import yargs41 from "yargs";
|
|
13833
13692
|
var WebhookCommand = {
|
|
13834
13693
|
command: "webhook <command>",
|
|
13835
13694
|
aliases: ["wh"],
|
|
13836
13695
|
describe: "Commands for webhooks",
|
|
13837
|
-
builder: (
|
|
13696
|
+
builder: (yargs43) => yargs43.command(WebhookPullModule).command(WebhookPushModule).demandCommand(),
|
|
13838
13697
|
handler: () => {
|
|
13839
|
-
|
|
13840
|
-
}
|
|
13841
|
-
};
|
|
13842
|
-
|
|
13843
|
-
// src/commands/whoami/index.ts
|
|
13844
|
-
import { ProjectClient as ProjectClient2 } from "@uniformdev/canvas";
|
|
13845
|
-
var WhoamiCommand = {
|
|
13846
|
-
command: "whoami",
|
|
13847
|
-
describe: "Prints configured identity and connection context.",
|
|
13848
|
-
builder: (yargs44) => withConfiguration(
|
|
13849
|
-
withFormatOptions(withApiOptions(yargs44)).option("project", {
|
|
13850
|
-
describe: "Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
|
|
13851
|
-
default: process.env.UNIFORM_CLI_PROJECT_ID ?? process.env.UNIFORM_PROJECT_ID,
|
|
13852
|
-
type: "string",
|
|
13853
|
-
alias: ["p"]
|
|
13854
|
-
})
|
|
13855
|
-
),
|
|
13856
|
-
handler: async ({ apiHost, edgeApiHost, apiKey, project, proxy, format, filename }) => {
|
|
13857
|
-
const fetch2 = nodeFetchProxy(proxy);
|
|
13858
|
-
try {
|
|
13859
|
-
const [profile, projectInfo] = await Promise.all([
|
|
13860
|
-
fetchMemberProfile({ baseUrl: apiHost, apiKey, fetch: fetch2 }),
|
|
13861
|
-
project ? new ProjectClient2({ apiHost, apiKey, fetch: fetch2 }).get({ projectId: project }) : void 0
|
|
13862
|
-
]);
|
|
13863
|
-
emitWithFormat(
|
|
13864
|
-
{
|
|
13865
|
-
apiHost,
|
|
13866
|
-
edgeApiHost,
|
|
13867
|
-
apiKey: apiKey ? maskApiKey(apiKey) : null,
|
|
13868
|
-
apiKeyName: profile.name,
|
|
13869
|
-
...projectInfo ? {
|
|
13870
|
-
projectId: project,
|
|
13871
|
-
projectName: projectInfo.name,
|
|
13872
|
-
teamId: projectInfo.teamId,
|
|
13873
|
-
teamName: projectInfo.teamName
|
|
13874
|
-
} : {}
|
|
13875
|
-
},
|
|
13876
|
-
format,
|
|
13877
|
-
filename
|
|
13878
|
-
);
|
|
13879
|
-
} catch (error) {
|
|
13880
|
-
exitOnCliError(error);
|
|
13881
|
-
}
|
|
13698
|
+
yargs41.help();
|
|
13882
13699
|
}
|
|
13883
13700
|
};
|
|
13884
13701
|
|
|
@@ -13886,29 +13703,29 @@ var WhoamiCommand = {
|
|
|
13886
13703
|
import { bold as bold3, gray as gray6, green as green7 } from "colorette";
|
|
13887
13704
|
|
|
13888
13705
|
// src/updateCheck.ts
|
|
13889
|
-
import { existsSync as
|
|
13706
|
+
import { existsSync as existsSync6, promises as fs8 } from "fs";
|
|
13890
13707
|
import { get as getHttp } from "http";
|
|
13891
13708
|
import { get as getHttps } from "https";
|
|
13892
|
-
import { tmpdir
|
|
13893
|
-
import { join as
|
|
13709
|
+
import { tmpdir } from "os";
|
|
13710
|
+
import { join as join12 } from "path";
|
|
13894
13711
|
import registryUrl from "registry-url";
|
|
13895
13712
|
import { URL as URL2 } from "url";
|
|
13896
13713
|
var compareVersions = (a, b) => a.localeCompare(b, "en-US", { numeric: true });
|
|
13897
13714
|
var encode = (value) => encodeURIComponent(value).replace(/^%40/, "@");
|
|
13898
13715
|
var getFile = async (details, distTag) => {
|
|
13899
|
-
const rootDir =
|
|
13900
|
-
const subDir =
|
|
13901
|
-
if (!
|
|
13716
|
+
const rootDir = tmpdir();
|
|
13717
|
+
const subDir = join12(rootDir, "update-check");
|
|
13718
|
+
if (!existsSync6(subDir)) {
|
|
13902
13719
|
await fs8.mkdir(subDir);
|
|
13903
13720
|
}
|
|
13904
13721
|
let name = `${details.name}-${distTag}.json`;
|
|
13905
13722
|
if (details.scope) {
|
|
13906
13723
|
name = `${details.scope}-${name}`;
|
|
13907
13724
|
}
|
|
13908
|
-
return
|
|
13725
|
+
return join12(subDir, name);
|
|
13909
13726
|
};
|
|
13910
13727
|
var evaluateCache = async (file, time, interval) => {
|
|
13911
|
-
if (
|
|
13728
|
+
if (existsSync6(file)) {
|
|
13912
13729
|
const content = await fs8.readFile(file, "utf8");
|
|
13913
13730
|
const { lastUpdate, latest } = JSON.parse(content);
|
|
13914
13731
|
const nextCheck = lastUpdate + interval;
|
|
@@ -13931,7 +13748,7 @@ var updateCache = async (file, latest, lastUpdate) => {
|
|
|
13931
13748
|
});
|
|
13932
13749
|
await fs8.writeFile(file, content, "utf8");
|
|
13933
13750
|
};
|
|
13934
|
-
var loadPackage = ({ url, timeout }, authInfo) => new Promise((
|
|
13751
|
+
var loadPackage = ({ url, timeout }, authInfo) => new Promise((resolve2, reject) => {
|
|
13935
13752
|
const options = {
|
|
13936
13753
|
host: url.hostname,
|
|
13937
13754
|
path: url.pathname,
|
|
@@ -13962,7 +13779,7 @@ var loadPackage = ({ url, timeout }, authInfo) => new Promise((resolve4, reject)
|
|
|
13962
13779
|
response.on("end", () => {
|
|
13963
13780
|
try {
|
|
13964
13781
|
const parsedData = JSON.parse(rawData);
|
|
13965
|
-
|
|
13782
|
+
resolve2(parsedData);
|
|
13966
13783
|
} catch (e) {
|
|
13967
13784
|
reject(e);
|
|
13968
13785
|
}
|
|
@@ -14060,7 +13877,7 @@ var checkForUpdateMiddleware = async ({ verbose }) => {
|
|
|
14060
13877
|
|
|
14061
13878
|
// src/middleware/checkLocalDepsVersionsMiddleware.ts
|
|
14062
13879
|
import { magenta, red as red8 } from "colorette";
|
|
14063
|
-
import { join as
|
|
13880
|
+
import { join as join13 } from "path";
|
|
14064
13881
|
var uniformStrictVersions = [
|
|
14065
13882
|
"@uniformdev/canvas",
|
|
14066
13883
|
"@uniformdev/canvas-next",
|
|
@@ -14082,7 +13899,7 @@ var checkLocalDepsVersions = async (args) => {
|
|
|
14082
13899
|
try {
|
|
14083
13900
|
let isOutside = false;
|
|
14084
13901
|
let warning = `${magenta("Warning:")} Installed Uniform packages should be the same version`;
|
|
14085
|
-
const localPackages = await tryReadJSON(
|
|
13902
|
+
const localPackages = await tryReadJSON(join13(process.cwd(), "package.json"));
|
|
14086
13903
|
if (!localPackages) return;
|
|
14087
13904
|
let firstVersion;
|
|
14088
13905
|
const allDependencies = {
|
|
@@ -14113,11 +13930,11 @@ First found was: v${firstVersion}`;
|
|
|
14113
13930
|
|
|
14114
13931
|
// src/index.ts
|
|
14115
13932
|
dotenv.config();
|
|
14116
|
-
var yarggery =
|
|
13933
|
+
var yarggery = yargs42(hideBin(process.argv));
|
|
14117
13934
|
var useDefaultConfig = !process.argv.includes("--config");
|
|
14118
13935
|
var defaultConfig2 = useDefaultConfig ? loadConfig(null) : {};
|
|
14119
13936
|
yarggery.option("verbose", {
|
|
14120
13937
|
describe: "Include verbose logging",
|
|
14121
13938
|
default: false,
|
|
14122
13939
|
type: "boolean"
|
|
14123
|
-
}).scriptName("uniform").config(defaultConfig2).config("config", "Specify a custom Uniform CLI config file", (configPath) => loadConfig(configPath)).command(AiCommand).command(
|
|
13940
|
+
}).scriptName("uniform").config(defaultConfig2).config("config", "Specify a custom Uniform CLI config file", (configPath) => loadConfig(configPath)).command(AiCommand).command(CanvasCommand).command(ContextCommand).command(ProjectMapCommand).command(PolicyDocumentsCommand).command(RedirectCommand).command(WebhookCommand).command(SyncCommand).command(NewCmd).command(NewMeshCmd).command(IntegrationCommand).recommendCommands().demandCommand(1, "").strict().help().middleware([checkForUpdateMiddleware, checkLocalDepsVersions]).parse();
|