@uniformdev/cli 19.10.0 → 19.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +88 -79
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -21,33 +21,34 @@ async function createArraySyncEngineDataSource({
|
|
|
21
21
|
selectDisplayName: selectDisplayName12 = selectIdentifier12,
|
|
22
22
|
onSyncComplete
|
|
23
23
|
}) {
|
|
24
|
-
const objectIndex = objects.reduce(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
|
|
31
|
-
if (result[identifier]) {
|
|
32
|
-
throw new Error(`Identifier ${identifier} was not unique.`);
|
|
24
|
+
const objectIndex = objects.reduce(
|
|
25
|
+
(result, current) => {
|
|
26
|
+
const rawIdentifiers = selectIdentifier12(current);
|
|
27
|
+
const identifiers = Array.isArray(rawIdentifiers) ? rawIdentifiers : [rawIdentifiers];
|
|
28
|
+
const existingResult = identifiers.find((id) => result[id]);
|
|
29
|
+
if (existingResult) {
|
|
30
|
+
throw new Error(`Identifier(s) ${identifiers} was not unique.`);
|
|
33
31
|
}
|
|
34
32
|
const displayName = selectDisplayName12(current);
|
|
35
|
-
result[
|
|
36
|
-
id:
|
|
33
|
+
result[identifiers[0]] = {
|
|
34
|
+
id: identifiers,
|
|
37
35
|
object: current,
|
|
38
|
-
providerId:
|
|
36
|
+
providerId: identifiers[0],
|
|
39
37
|
displayName: Array.isArray(displayName) ? displayName[0] : displayName
|
|
40
38
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
identifiers.slice(1).forEach((id) => result[id] = identifiers[0]);
|
|
40
|
+
return result;
|
|
41
|
+
},
|
|
42
|
+
{}
|
|
43
|
+
);
|
|
44
44
|
async function* getObjects() {
|
|
45
45
|
for (const item of Object.values(objectIndex)) {
|
|
46
|
-
|
|
46
|
+
if (typeof item === "object")
|
|
47
|
+
yield item;
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
function extractCurrent() {
|
|
50
|
-
return Object.entries(objectIndex).sort((a, b) => a[0].localeCompare(b[0])).map((entry) => entry[1].object);
|
|
51
|
+
return Object.entries(objectIndex).filter((entry) => typeof entry[1] === "object").sort((a, b) => a[0].localeCompare(b[0])).map((entry) => entry[1].object);
|
|
51
52
|
}
|
|
52
53
|
return {
|
|
53
54
|
objects: getObjects(),
|
|
@@ -57,7 +58,7 @@ async function createArraySyncEngineDataSource({
|
|
|
57
58
|
writeObject: async (objectToWrite) => {
|
|
58
59
|
const id = selectIdentifier12(objectToWrite.object);
|
|
59
60
|
if (Array.isArray(id)) {
|
|
60
|
-
|
|
61
|
+
objectIndex[id[0]] = objectToWrite;
|
|
61
62
|
} else {
|
|
62
63
|
objectIndex[id] = objectToWrite;
|
|
63
64
|
}
|
|
@@ -68,7 +69,7 @@ async function createArraySyncEngineDataSource({
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
// src/sync/fileSyncEngineDataSource.ts
|
|
71
|
-
import
|
|
72
|
+
import ansicolors from "ansi-colors";
|
|
72
73
|
import { existsSync, mkdirSync } from "fs";
|
|
73
74
|
import { readdir, unlink } from "fs/promises";
|
|
74
75
|
import { extname as extname2, join } from "path";
|
|
@@ -218,6 +219,7 @@ async function* paginateAsync(fetchPage, options) {
|
|
|
218
219
|
}
|
|
219
220
|
|
|
220
221
|
// src/sync/fileSyncEngineDataSource.ts
|
|
222
|
+
var { red } = ansicolors;
|
|
221
223
|
async function createFileSyncEngineDataSource({
|
|
222
224
|
directory,
|
|
223
225
|
format = "yaml",
|
|
@@ -243,15 +245,16 @@ async function createFileSyncEngineDataSource({
|
|
|
243
245
|
const fullFilename = join(directory, filename);
|
|
244
246
|
try {
|
|
245
247
|
const contents = await readFileToObject(fullFilename);
|
|
248
|
+
const displayName = selectDisplayName12(contents);
|
|
246
249
|
const object = {
|
|
247
250
|
id: selectIdentifier12(contents),
|
|
248
|
-
displayName:
|
|
251
|
+
displayName: Array.isArray(displayName) ? displayName[0] : displayName,
|
|
249
252
|
providerId: fullFilename,
|
|
250
253
|
object: omit(contents, ["$schema"])
|
|
251
254
|
};
|
|
252
255
|
yield object;
|
|
253
256
|
} catch (e) {
|
|
254
|
-
console.error(
|
|
257
|
+
console.error(red(`Failed to read ${fullFilename}, data is likely invalid.
|
|
255
258
|
${e == null ? void 0 : e.message}`));
|
|
256
259
|
throw e;
|
|
257
260
|
}
|
|
@@ -302,7 +305,7 @@ async function syncEngine({
|
|
|
302
305
|
return isEqualWith(
|
|
303
306
|
source2.object,
|
|
304
307
|
target2.object,
|
|
305
|
-
(_a, _b, key) => key === "created" || key === "modified" ? true : void 0
|
|
308
|
+
(_a, _b, key) => key === "created" || key === "modified" || key === "updated" ? true : void 0
|
|
306
309
|
);
|
|
307
310
|
},
|
|
308
311
|
mode,
|
|
@@ -348,7 +351,7 @@ async function syncEngine({
|
|
|
348
351
|
sourceHasItems = true;
|
|
349
352
|
const ids = Array.isArray(sourceObject.id) ? sourceObject.id : [sourceObject.id];
|
|
350
353
|
const targetObject = targetItems.get(ids[0]);
|
|
351
|
-
const invalidTargetObjects = ids.map((i) => targetItems.get(i)).filter((o) => o !== targetObject);
|
|
354
|
+
const invalidTargetObjects = ids.map((i) => targetItems.get(i)).filter((o) => (o == null ? void 0 : o.object) !== (targetObject == null ? void 0 : targetObject.object));
|
|
352
355
|
if (targetObject && invalidTargetObjects.length == 0) {
|
|
353
356
|
if (!compareContents(sourceObject, targetObject)) {
|
|
354
357
|
if (mode === "createOrUpdate" || mode === "mirror") {
|
|
@@ -392,12 +395,10 @@ async function syncEngine({
|
|
|
392
395
|
});
|
|
393
396
|
};
|
|
394
397
|
if (invalidTargetObjects.length > 0) {
|
|
395
|
-
[...invalidTargetObjects, targetObject].forEach(
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
}
|
|
400
|
-
);
|
|
398
|
+
[...invalidTargetObjects, targetObject].forEach((o) => {
|
|
399
|
+
var _a2;
|
|
400
|
+
(_a2 = Array.isArray(o == null ? void 0 : o.id) ? o == null ? void 0 : o.id : [o == null ? void 0 : o.id]) == null ? void 0 : _a2.forEach((i) => i && targetItems.delete(i));
|
|
401
|
+
});
|
|
401
402
|
const deletes = invalidTargetObjects.filter((io) => typeof io !== "undefined").map(async (io) => {
|
|
402
403
|
await processDelete(io);
|
|
403
404
|
});
|
|
@@ -437,36 +438,37 @@ ${innerError}`
|
|
|
437
438
|
};
|
|
438
439
|
|
|
439
440
|
// src/sync/syncEngineConsoleLogger.ts
|
|
440
|
-
import
|
|
441
|
+
import ansicolors2 from "ansi-colors";
|
|
442
|
+
var { gray, green, red: red2, white, yellow } = ansicolors2;
|
|
441
443
|
function createSyncEngineConsoleLogger(options) {
|
|
442
444
|
const { diffMode = "off", indent, prefix } = options ?? {};
|
|
443
445
|
return function syncEngineConsoleLogger({ action, displayName, whatIf, diff }) {
|
|
444
446
|
let actionTag = "";
|
|
445
447
|
switch (action) {
|
|
446
448
|
case "create":
|
|
447
|
-
actionTag =
|
|
449
|
+
actionTag = green("[A]");
|
|
448
450
|
break;
|
|
449
451
|
case "update":
|
|
450
|
-
actionTag =
|
|
452
|
+
actionTag = white("[U]");
|
|
451
453
|
break;
|
|
452
454
|
case "delete":
|
|
453
|
-
actionTag =
|
|
455
|
+
actionTag = yellow("[D]");
|
|
454
456
|
break;
|
|
455
457
|
}
|
|
456
458
|
let diffString = "";
|
|
457
459
|
if (diffMode === "on" || diffMode === "update" && action === "update") {
|
|
458
460
|
diffString = "\n" + diff.map((change) => {
|
|
459
461
|
if (change.added) {
|
|
460
|
-
return
|
|
462
|
+
return green(change.value);
|
|
461
463
|
}
|
|
462
464
|
if (change.removed) {
|
|
463
|
-
return
|
|
465
|
+
return red2(change.value);
|
|
464
466
|
}
|
|
465
467
|
return change.value;
|
|
466
468
|
}).join("");
|
|
467
469
|
}
|
|
468
470
|
console.log(
|
|
469
|
-
`${indent ?? ""}${whatIf ?
|
|
471
|
+
`${indent ?? ""}${whatIf ? gray("[WHATIF]") : ""}${actionTag}${prefix ?? ""} ${displayName}${diffString}`
|
|
470
472
|
);
|
|
471
473
|
};
|
|
472
474
|
}
|
|
@@ -930,7 +932,7 @@ var CompositionListModule = {
|
|
|
930
932
|
state: convertCompositionState(state),
|
|
931
933
|
skipPatternResolution: !resolvePatterns,
|
|
932
934
|
withComponentIDs: componentIDs,
|
|
933
|
-
|
|
935
|
+
skipOverridesResolution: !resolveOverrides
|
|
934
936
|
});
|
|
935
937
|
emitWithFormat(res.compositions, format, filename);
|
|
936
938
|
}
|
|
@@ -958,7 +960,6 @@ function createComponentInstanceEngineDataSource({
|
|
|
958
960
|
offset,
|
|
959
961
|
state: stateId,
|
|
960
962
|
skipPatternResolution: true,
|
|
961
|
-
skipParameterResolution: true,
|
|
962
963
|
skipOverridesResolution: true,
|
|
963
964
|
withComponentIDs: true
|
|
964
965
|
})).compositions,
|
|
@@ -2149,9 +2150,10 @@ import yargs7 from "yargs";
|
|
|
2149
2150
|
|
|
2150
2151
|
// src/commands/context/commands/manifest/get.ts
|
|
2151
2152
|
import { ApiClientError, UncachedManifestClient } from "@uniformdev/context/api";
|
|
2152
|
-
import
|
|
2153
|
+
import ansicolors3 from "ansi-colors";
|
|
2153
2154
|
import { writeFile } from "fs";
|
|
2154
2155
|
import { exit } from "process";
|
|
2156
|
+
var { gray: gray2, green: green2, red: red3 } = ansicolors3;
|
|
2155
2157
|
var ManifestGetModule = {
|
|
2156
2158
|
command: "get [output]",
|
|
2157
2159
|
aliases: ["dl", "download"],
|
|
@@ -2190,7 +2192,7 @@ var ManifestGetModule = {
|
|
|
2190
2192
|
`, error);
|
|
2191
2193
|
exit(1);
|
|
2192
2194
|
}
|
|
2193
|
-
console.log(
|
|
2195
|
+
console.log(green2(`\u2705 ${output} has been updated from ${apiHost}`));
|
|
2194
2196
|
});
|
|
2195
2197
|
} else {
|
|
2196
2198
|
console.log(text);
|
|
@@ -2205,8 +2207,8 @@ var ManifestGetModule = {
|
|
|
2205
2207
|
} else {
|
|
2206
2208
|
message = e.toString();
|
|
2207
2209
|
}
|
|
2208
|
-
console.error(
|
|
2209
|
-
console.error(
|
|
2210
|
+
console.error(red3(`\u26A0 Error fetching Context manifest`));
|
|
2211
|
+
console.error(gray2(` \u2757 ${message}`));
|
|
2210
2212
|
exit(1);
|
|
2211
2213
|
}
|
|
2212
2214
|
}
|
|
@@ -2214,8 +2216,9 @@ var ManifestGetModule = {
|
|
|
2214
2216
|
|
|
2215
2217
|
// src/commands/context/commands/manifest/publish.ts
|
|
2216
2218
|
import { ApiClientError as ApiClientError2, UncachedManifestClient as UncachedManifestClient2 } from "@uniformdev/context/api";
|
|
2217
|
-
import
|
|
2219
|
+
import ansicolors4 from "ansi-colors";
|
|
2218
2220
|
import { exit as exit2 } from "process";
|
|
2221
|
+
var { gray: gray3, red: red4 } = ansicolors4;
|
|
2219
2222
|
var ManifestPublishModule = {
|
|
2220
2223
|
command: "publish",
|
|
2221
2224
|
describe: "Publish the Uniform Context manifest for a project",
|
|
@@ -2240,8 +2243,8 @@ var ManifestPublishModule = {
|
|
|
2240
2243
|
} else {
|
|
2241
2244
|
message = e.toString();
|
|
2242
2245
|
}
|
|
2243
|
-
console.error(
|
|
2244
|
-
console.error(
|
|
2246
|
+
console.error(red4(`\u26A0 Error publishing Context manifest`));
|
|
2247
|
+
console.error(gray3(` \u2757 ${message}`));
|
|
2245
2248
|
exit2(1);
|
|
2246
2249
|
}
|
|
2247
2250
|
}
|
|
@@ -3098,7 +3101,7 @@ import { PostHog } from "posthog-node";
|
|
|
3098
3101
|
// package.json
|
|
3099
3102
|
var package_default = {
|
|
3100
3103
|
name: "@uniformdev/cli",
|
|
3101
|
-
version: "19.
|
|
3104
|
+
version: "19.12.0",
|
|
3102
3105
|
description: "Uniform command line interface tool",
|
|
3103
3106
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
3104
3107
|
main: "./cli.js",
|
|
@@ -3118,7 +3121,7 @@ var package_default = {
|
|
|
3118
3121
|
"@uniformdev/context": "workspace:*",
|
|
3119
3122
|
"@uniformdev/project-map": "workspace:*",
|
|
3120
3123
|
"@uniformdev/redirect": "workspace:*",
|
|
3121
|
-
|
|
3124
|
+
"ansi-colors": "^4.1.3",
|
|
3122
3125
|
diff: "^5.0.0",
|
|
3123
3126
|
dotenv: "^16.0.3",
|
|
3124
3127
|
execa: "5.1.1",
|
|
@@ -3126,14 +3129,14 @@ var package_default = {
|
|
|
3126
3129
|
graphql: "16.6.0",
|
|
3127
3130
|
"graphql-request": "6.0.0",
|
|
3128
3131
|
"https-proxy-agent": "^5.0.1",
|
|
3129
|
-
inquirer: "9.2.
|
|
3132
|
+
inquirer: "9.2.3",
|
|
3130
3133
|
"isomorphic-git": "1.21.0",
|
|
3131
3134
|
"isomorphic-unfetch": "^3.1.0",
|
|
3132
3135
|
"js-yaml": "^4.1.0",
|
|
3133
3136
|
jsonwebtoken: "9.0.0",
|
|
3134
3137
|
"lodash.isequalwith": "^4.4.0",
|
|
3135
3138
|
open: "9.1.0",
|
|
3136
|
-
ora: "6.3.
|
|
3139
|
+
ora: "6.3.1",
|
|
3137
3140
|
"posthog-node": "3.1.1",
|
|
3138
3141
|
slugify: "1.6.6",
|
|
3139
3142
|
yargs: "^17.6.2",
|
|
@@ -3145,7 +3148,7 @@ var package_default = {
|
|
|
3145
3148
|
"@types/js-yaml": "4.0.5",
|
|
3146
3149
|
"@types/jsonwebtoken": "9.0.2",
|
|
3147
3150
|
"@types/lodash.isequalwith": "4.4.7",
|
|
3148
|
-
"@types/node": "18.16.
|
|
3151
|
+
"@types/node": "18.16.13",
|
|
3149
3152
|
"@types/yargs": "17.0.24"
|
|
3150
3153
|
},
|
|
3151
3154
|
bin: {
|
|
@@ -3317,12 +3320,12 @@ var getLimitsSchema = z.object({
|
|
|
3317
3320
|
})
|
|
3318
3321
|
});
|
|
3319
3322
|
var createClient = (baseUrl, authToken) => {
|
|
3320
|
-
const request2 = async (path4, opts) => {
|
|
3323
|
+
const request2 = async (path4, opts, allowedNon2xxStatusCodes = []) => {
|
|
3321
3324
|
const res = await fetch(makeUrl(baseUrl, path4), {
|
|
3322
3325
|
...opts,
|
|
3323
3326
|
headers: { Authorization: `Bearer ${authToken}` }
|
|
3324
3327
|
});
|
|
3325
|
-
if (res.ok) {
|
|
3328
|
+
if (res.ok || allowedNon2xxStatusCodes.includes(res.status)) {
|
|
3326
3329
|
return res;
|
|
3327
3330
|
} else {
|
|
3328
3331
|
throw new Error(
|
|
@@ -3330,8 +3333,8 @@ var createClient = (baseUrl, authToken) => {
|
|
|
3330
3333
|
);
|
|
3331
3334
|
}
|
|
3332
3335
|
};
|
|
3333
|
-
const requestJson = async (path4, opts, schema2) => {
|
|
3334
|
-
const res = await request2(path4, opts);
|
|
3336
|
+
const requestJson = async (path4, opts, schema2, allowedNon2xxStatusCodes = []) => {
|
|
3337
|
+
const res = await request2(path4, opts, allowedNon2xxStatusCodes);
|
|
3335
3338
|
const data = await res.json();
|
|
3336
3339
|
const parseResult = schema2.safeParse(data);
|
|
3337
3340
|
if (parseResult.success) {
|
|
@@ -3359,11 +3362,16 @@ var createClient = (baseUrl, authToken) => {
|
|
|
3359
3362
|
const { limits } = await requestJson(
|
|
3360
3363
|
`/api/v1/limits?teamId=${teamId}`,
|
|
3361
3364
|
{ method: "POST" },
|
|
3362
|
-
getLimitsSchema
|
|
3365
|
+
getLimitsSchema,
|
|
3366
|
+
// HTTP 402 Payment Required means that SOME limit has been exceeded.
|
|
3367
|
+
// We still want to check if there is some project type that is below limit.
|
|
3368
|
+
[402]
|
|
3363
3369
|
);
|
|
3364
3370
|
const projectTypeBelowLimit = limits.projects.find((project) => project.used < project.limit);
|
|
3365
3371
|
if (!projectTypeBelowLimit) {
|
|
3366
|
-
throw new Error(
|
|
3372
|
+
throw new Error(
|
|
3373
|
+
"Usage exceeded: cannot create more projects. Please upgrade your plan or delete one of existing projects."
|
|
3374
|
+
);
|
|
3367
3375
|
}
|
|
3368
3376
|
const result = await requestJson(
|
|
3369
3377
|
"/api/v1/project",
|
|
@@ -3674,7 +3682,7 @@ var query = gql`
|
|
|
3674
3682
|
info: identities_by_pk(subject: $subject) {
|
|
3675
3683
|
name
|
|
3676
3684
|
email_address
|
|
3677
|
-
teams: organizations_identities {
|
|
3685
|
+
teams: organizations_identities(order_by: { organization: { name: asc } }) {
|
|
3678
3686
|
team: organization {
|
|
3679
3687
|
name
|
|
3680
3688
|
id
|
|
@@ -4127,7 +4135,7 @@ import yargs13 from "yargs";
|
|
|
4127
4135
|
import yargs12 from "yargs";
|
|
4128
4136
|
|
|
4129
4137
|
// src/commands/optimize/manifest/download.ts
|
|
4130
|
-
import
|
|
4138
|
+
import ansicolors5 from "ansi-colors";
|
|
4131
4139
|
import { writeFile as writeFile2 } from "fs";
|
|
4132
4140
|
import fetch2 from "isomorphic-unfetch";
|
|
4133
4141
|
import { exit as exit3 } from "process";
|
|
@@ -4136,6 +4144,7 @@ import { exit as exit3 } from "process";
|
|
|
4136
4144
|
var UniformBaseUrl = "https://uniform.app";
|
|
4137
4145
|
|
|
4138
4146
|
// src/commands/optimize/manifest/download.ts
|
|
4147
|
+
var { gray: gray4, green: green3, red: red5, yellow: yellow2 } = ansicolors5;
|
|
4139
4148
|
var module = {
|
|
4140
4149
|
command: "download [output]",
|
|
4141
4150
|
describe: "Download intent manifest",
|
|
@@ -4167,12 +4176,12 @@ var module = {
|
|
|
4167
4176
|
);
|
|
4168
4177
|
if (isLegacyApiKey) {
|
|
4169
4178
|
console.error(
|
|
4170
|
-
|
|
4179
|
+
yellow2(
|
|
4171
4180
|
"WARNING: you appear to be using a deprecated type of API key. Keys like this will stop working soon; please create new keys on uniform.app."
|
|
4172
4181
|
)
|
|
4173
4182
|
);
|
|
4174
4183
|
} else if (!project) {
|
|
4175
|
-
console.error(
|
|
4184
|
+
console.error(red5("You must specify the project ID"));
|
|
4176
4185
|
exit3(1);
|
|
4177
4186
|
}
|
|
4178
4187
|
const baseUrl = resolveBaseUrl();
|
|
@@ -4198,16 +4207,16 @@ var module = {
|
|
|
4198
4207
|
throw `${fetchResponse.status} ${fetchResponse.statusText}, content ${await fetchResponse.text()}`;
|
|
4199
4208
|
}
|
|
4200
4209
|
} catch (e) {
|
|
4201
|
-
console.error(
|
|
4202
|
-
console.error(
|
|
4210
|
+
console.error(red5(`\u26A0 Error fetching intent manifest ${manifestUrl}`));
|
|
4211
|
+
console.error(gray4(` \u2757 ${e}`));
|
|
4203
4212
|
exit3(1);
|
|
4204
4213
|
}
|
|
4205
4214
|
let json;
|
|
4206
4215
|
try {
|
|
4207
4216
|
json = await fetchResponse.json();
|
|
4208
4217
|
} catch (e) {
|
|
4209
|
-
console.error(
|
|
4210
|
-
console.error(
|
|
4218
|
+
console.error(red5(`\u26A0 Error parsing intent manifest ${manifestUrl}`));
|
|
4219
|
+
console.error(gray4(` \u2757 ${e}`));
|
|
4211
4220
|
console.error(`Response: ${await fetchResponse.text()}`);
|
|
4212
4221
|
exit3(1);
|
|
4213
4222
|
}
|
|
@@ -4219,7 +4228,7 @@ var module = {
|
|
|
4219
4228
|
`, error);
|
|
4220
4229
|
exit3(1);
|
|
4221
4230
|
}
|
|
4222
|
-
console.log(
|
|
4231
|
+
console.log(green3(`\u2705 ${output} has been updated from ${manifestUrl}`));
|
|
4223
4232
|
});
|
|
4224
4233
|
} else {
|
|
4225
4234
|
console.log(text);
|
|
@@ -4907,18 +4916,18 @@ function writeContextPackage3(filename, packageContents) {
|
|
|
4907
4916
|
}
|
|
4908
4917
|
|
|
4909
4918
|
// src/commands/redirect/commands/RedirectDefinition/_util.ts
|
|
4910
|
-
var selectIdentifier11 = (source) => source.
|
|
4919
|
+
var selectIdentifier11 = (source) => source.id;
|
|
4911
4920
|
var selectFilename2 = (source) => {
|
|
4912
|
-
const index = source.
|
|
4913
|
-
return cleanFileName(source.
|
|
4921
|
+
const index = source.sourceUrl.lastIndexOf("/");
|
|
4922
|
+
return cleanFileName(source.sourceUrl.substring(index + 1)) + `_${source.id}`;
|
|
4914
4923
|
};
|
|
4915
4924
|
var selectDisplayName11 = (source) => {
|
|
4916
|
-
let pathName = source.
|
|
4925
|
+
let pathName = source.sourceUrl;
|
|
4917
4926
|
if (pathName.length > 30) {
|
|
4918
|
-
const slashIndex = source.
|
|
4927
|
+
const slashIndex = source.sourceUrl.indexOf("/", source.sourceUrl.length - 30);
|
|
4919
4928
|
pathName = "..." + pathName.substring(slashIndex);
|
|
4920
4929
|
}
|
|
4921
|
-
return `${pathName} (id: ${source.
|
|
4930
|
+
return `${pathName} (id: ${source.id})`;
|
|
4922
4931
|
};
|
|
4923
4932
|
|
|
4924
4933
|
// src/commands/redirect/RedirectEngineDataSource.ts
|
|
@@ -4929,10 +4938,10 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
4929
4938
|
const { redirects } = await client.getRedirects();
|
|
4930
4939
|
for await (const def of redirects) {
|
|
4931
4940
|
const result = {
|
|
4932
|
-
id: selectIdentifier11(def),
|
|
4933
|
-
displayName: selectDisplayName11(def),
|
|
4934
|
-
providerId: selectIdentifier11(def),
|
|
4935
|
-
object: def
|
|
4941
|
+
id: selectIdentifier11(def.redirect),
|
|
4942
|
+
displayName: selectDisplayName11(def.redirect),
|
|
4943
|
+
providerId: selectIdentifier11(def.redirect),
|
|
4944
|
+
object: def.redirect
|
|
4936
4945
|
};
|
|
4937
4946
|
yield result;
|
|
4938
4947
|
}
|
|
@@ -4943,7 +4952,7 @@ function createRedirectDefinitionEngineDataSource({
|
|
|
4943
4952
|
await client.deleteRedirect(providerId);
|
|
4944
4953
|
},
|
|
4945
4954
|
writeObject: async (object) => {
|
|
4946
|
-
await client.upsertRedirect(object.object
|
|
4955
|
+
await client.upsertRedirect(object.object);
|
|
4947
4956
|
}
|
|
4948
4957
|
};
|
|
4949
4958
|
}
|
|
@@ -4998,7 +5007,7 @@ var RedirectDefinitionPullModule = {
|
|
|
4998
5007
|
if (isPackage) {
|
|
4999
5008
|
const packageContents = readContextPackage3(directory, false);
|
|
5000
5009
|
target = await createArraySyncEngineDataSource({
|
|
5001
|
-
objects: packageContents ?? [],
|
|
5010
|
+
objects: packageContents.redirects ?? [],
|
|
5002
5011
|
selectIdentifier: selectIdentifier11,
|
|
5003
5012
|
selectDisplayName: selectDisplayName11,
|
|
5004
5013
|
onSyncComplete: async (_, synced) => {
|
|
@@ -5068,7 +5077,7 @@ var RedirectDefinitionPushModule = {
|
|
|
5068
5077
|
if (isPackage) {
|
|
5069
5078
|
const packageContents = readContextPackage3(directory, true);
|
|
5070
5079
|
source = await createArraySyncEngineDataSource({
|
|
5071
|
-
objects: packageContents ?? [],
|
|
5080
|
+
objects: packageContents.redirects ?? [],
|
|
5072
5081
|
selectIdentifier: selectIdentifier11,
|
|
5073
5082
|
selectDisplayName: selectDisplayName11
|
|
5074
5083
|
});
|
|
@@ -5121,7 +5130,7 @@ var RedirectDefinitionUpdateModule = {
|
|
|
5121
5130
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5122
5131
|
const client = new UncachedRedirectClient6({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5123
5132
|
const file = readFileToObject(filename);
|
|
5124
|
-
await client.upsertRedirect(file
|
|
5133
|
+
await client.upsertRedirect(file);
|
|
5125
5134
|
}
|
|
5126
5135
|
};
|
|
5127
5136
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/cli",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.12.0",
|
|
4
4
|
"description": "Uniform command line interface tool",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./cli.js",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"format": "prettier --write \"src/**/*.{js,ts,tsx}\""
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@uniformdev/canvas": "19.
|
|
20
|
-
"@uniformdev/context": "19.
|
|
21
|
-
"@uniformdev/project-map": "19.
|
|
22
|
-
"@uniformdev/redirect": "19.
|
|
23
|
-
"
|
|
19
|
+
"@uniformdev/canvas": "19.12.0",
|
|
20
|
+
"@uniformdev/context": "19.12.0",
|
|
21
|
+
"@uniformdev/project-map": "19.12.0",
|
|
22
|
+
"@uniformdev/redirect": "19.12.0",
|
|
23
|
+
"ansi-colors": "^4.1.3",
|
|
24
24
|
"diff": "^5.0.0",
|
|
25
25
|
"dotenv": "^16.0.3",
|
|
26
26
|
"execa": "5.1.1",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"graphql": "16.6.0",
|
|
29
29
|
"graphql-request": "6.0.0",
|
|
30
30
|
"https-proxy-agent": "^5.0.1",
|
|
31
|
-
"inquirer": "9.2.
|
|
31
|
+
"inquirer": "9.2.3",
|
|
32
32
|
"isomorphic-git": "1.21.0",
|
|
33
33
|
"isomorphic-unfetch": "^3.1.0",
|
|
34
34
|
"js-yaml": "^4.1.0",
|
|
35
35
|
"jsonwebtoken": "9.0.0",
|
|
36
36
|
"lodash.isequalwith": "^4.4.0",
|
|
37
37
|
"open": "9.1.0",
|
|
38
|
-
"ora": "6.3.
|
|
38
|
+
"ora": "6.3.1",
|
|
39
39
|
"posthog-node": "3.1.1",
|
|
40
40
|
"slugify": "1.6.6",
|
|
41
41
|
"yargs": "^17.6.2",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@types/js-yaml": "4.0.5",
|
|
48
48
|
"@types/jsonwebtoken": "9.0.2",
|
|
49
49
|
"@types/lodash.isequalwith": "4.4.7",
|
|
50
|
-
"@types/node": "18.16.
|
|
50
|
+
"@types/node": "18.16.13",
|
|
51
51
|
"@types/yargs": "17.0.24"
|
|
52
52
|
},
|
|
53
53
|
"bin": {
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "ca508c44f1b274e3e47d90717a98036256ae8379"
|
|
63
63
|
}
|