@sentio/cli 3.5.0-rc.2 → 3.5.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/lib/index.js +9 -4
- package/package.json +1 -1
- package/src/commands/project.ts +10 -4
package/lib/index.js
CHANGED
|
@@ -151775,7 +151775,7 @@ function formatOutput(data) {
|
|
|
151775
151775
|
for (const project2 of [...projects].sort((left, right) => (left.slug ?? "").localeCompare(right.slug ?? ""))) {
|
|
151776
151776
|
const owner2 = getOwnerName(project2) ?? "<owner>";
|
|
151777
151777
|
const slug2 = project2.slug ?? "<slug>";
|
|
151778
|
-
const attrs =
|
|
151778
|
+
const attrs = formatProjectListAttrs(project2);
|
|
151779
151779
|
const updatedAt = formatTimestamp2(project2.updatedAt);
|
|
151780
151780
|
lines3.push(`- ${owner2}/${slug2}${attrs ? ` [${attrs}]` : ""}${updatedAt ? ` updated ${updatedAt}` : ""}`);
|
|
151781
151781
|
}
|
|
@@ -151787,7 +151787,7 @@ function formatOutput(data) {
|
|
|
151787
151787
|
lines2.push(`${group.owner} (${group.projects.length})`);
|
|
151788
151788
|
for (const project2 of group.projects) {
|
|
151789
151789
|
const slug2 = project2.slug ?? "<slug>";
|
|
151790
|
-
const attrs =
|
|
151790
|
+
const attrs = formatProjectListAttrs(project2);
|
|
151791
151791
|
const updatedAt = formatTimestamp2(project2.updatedAt);
|
|
151792
151792
|
lines2.push(`- ${slug2}${attrs ? ` [${attrs}]` : ""}${updatedAt ? ` updated ${updatedAt}` : ""}`);
|
|
151793
151793
|
}
|
|
@@ -151827,6 +151827,10 @@ function formatOutput(data) {
|
|
|
151827
151827
|
}
|
|
151828
151828
|
return lines.join("\n");
|
|
151829
151829
|
}
|
|
151830
|
+
function formatProjectListAttrs(project) {
|
|
151831
|
+
const attrs = [project.type === "SENTIO" ? void 0 : project.type, project.visibility].filter(Boolean);
|
|
151832
|
+
return attrs.join(", ");
|
|
151833
|
+
}
|
|
151830
151834
|
function normalizeProjectList(data) {
|
|
151831
151835
|
if (Array.isArray(data)) {
|
|
151832
151836
|
return data;
|
|
@@ -151911,7 +151915,8 @@ async function getProjectsByOwner(ownerName, context) {
|
|
|
151911
151915
|
const organizationResponse = await fetchApiJson("/api/v1/organizations", context, { orgIdOrName: ownerName });
|
|
151912
151916
|
const organization = organizationResponse.organizations?.find((entry) => entry.name === ownerName);
|
|
151913
151917
|
if (organization) {
|
|
151914
|
-
|
|
151918
|
+
const data = await fetchApiJson("/api/v1/projects", context, { owner: ownerName });
|
|
151919
|
+
return normalizeProjectList(data);
|
|
151915
151920
|
}
|
|
151916
151921
|
} catch {
|
|
151917
151922
|
}
|
|
@@ -151920,7 +151925,7 @@ async function getProjectsByOwner(ownerName, context) {
|
|
|
151920
151925
|
userName: ownerName
|
|
151921
151926
|
});
|
|
151922
151927
|
if (userInfo.id) {
|
|
151923
|
-
const data = await fetchApiJson("/api/v1/projects", context, {
|
|
151928
|
+
const data = await fetchApiJson("/api/v1/projects", context, { owner: ownerName });
|
|
151924
151929
|
return normalizeProjectList(data);
|
|
151925
151930
|
}
|
|
151926
151931
|
} catch {
|
package/package.json
CHANGED
package/src/commands/project.ts
CHANGED
|
@@ -327,7 +327,7 @@ function formatOutput(data: unknown) {
|
|
|
327
327
|
for (const project of [...projects].sort((left, right) => (left.slug ?? '').localeCompare(right.slug ?? ''))) {
|
|
328
328
|
const owner = getOwnerName(project) ?? '<owner>'
|
|
329
329
|
const slug = project.slug ?? '<slug>'
|
|
330
|
-
const attrs =
|
|
330
|
+
const attrs = formatProjectListAttrs(project)
|
|
331
331
|
const updatedAt = formatTimestamp(project.updatedAt)
|
|
332
332
|
lines.push(`- ${owner}/${slug}${attrs ? ` [${attrs}]` : ''}${updatedAt ? ` updated ${updatedAt}` : ''}`)
|
|
333
333
|
}
|
|
@@ -340,7 +340,7 @@ function formatOutput(data: unknown) {
|
|
|
340
340
|
lines.push(`${group.owner} (${group.projects.length})`)
|
|
341
341
|
for (const project of group.projects) {
|
|
342
342
|
const slug = project.slug ?? '<slug>'
|
|
343
|
-
const attrs =
|
|
343
|
+
const attrs = formatProjectListAttrs(project)
|
|
344
344
|
const updatedAt = formatTimestamp(project.updatedAt)
|
|
345
345
|
lines.push(`- ${slug}${attrs ? ` [${attrs}]` : ''}${updatedAt ? ` updated ${updatedAt}` : ''}`)
|
|
346
346
|
}
|
|
@@ -383,6 +383,11 @@ function formatOutput(data: unknown) {
|
|
|
383
383
|
return lines.join('\n')
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
+
function formatProjectListAttrs(project: ProjectSummary) {
|
|
387
|
+
const attrs = [project.type === 'SENTIO' ? undefined : project.type, project.visibility].filter(Boolean)
|
|
388
|
+
return attrs.join(', ')
|
|
389
|
+
}
|
|
390
|
+
|
|
386
391
|
function normalizeProjectList(data: unknown): ProjectSummary[] {
|
|
387
392
|
if (Array.isArray(data)) {
|
|
388
393
|
return data as ProjectSummary[]
|
|
@@ -486,7 +491,8 @@ async function getProjectsByOwner(ownerName: string, context: ReturnType<typeof
|
|
|
486
491
|
}>('/api/v1/organizations', context, { orgIdOrName: ownerName })
|
|
487
492
|
const organization = organizationResponse.organizations?.find((entry) => entry.name === ownerName)
|
|
488
493
|
if (organization) {
|
|
489
|
-
|
|
494
|
+
const data = await fetchApiJson<unknown>('/api/v1/projects', context, { owner: ownerName })
|
|
495
|
+
return normalizeProjectList(data)
|
|
490
496
|
}
|
|
491
497
|
} catch {}
|
|
492
498
|
try {
|
|
@@ -494,7 +500,7 @@ async function getProjectsByOwner(ownerName: string, context: ReturnType<typeof
|
|
|
494
500
|
userName: ownerName
|
|
495
501
|
})
|
|
496
502
|
if (userInfo.id) {
|
|
497
|
-
const data = await fetchApiJson<unknown>('/api/v1/projects', context, {
|
|
503
|
+
const data = await fetchApiJson<unknown>('/api/v1/projects', context, { owner: ownerName })
|
|
498
504
|
return normalizeProjectList(data)
|
|
499
505
|
}
|
|
500
506
|
} catch {}
|