@postman-cse/onboarding-repo-sync 0.13.2 → 0.13.3
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/action.cjs +44 -1
- package/dist/cli.cjs +44 -1
- package/dist/index.cjs +44 -1
- package/package.json +1 -1
package/dist/action.cjs
CHANGED
|
@@ -24611,7 +24611,7 @@ var BifrostInternalIntegrationAdapter = class {
|
|
|
24611
24611
|
const existingWorkspaceId = extractDuplicateWorkspaceId(body);
|
|
24612
24612
|
if (existingWorkspaceId && existingWorkspaceId !== workspaceId) {
|
|
24613
24613
|
throw new Error(
|
|
24614
|
-
|
|
24614
|
+
await this.describeWorkspaceLinkConflict(existingWorkspaceId, workspaceId, repoUrl)
|
|
24615
24615
|
);
|
|
24616
24616
|
}
|
|
24617
24617
|
return;
|
|
@@ -24625,6 +24625,49 @@ var BifrostInternalIntegrationAdapter = class {
|
|
|
24625
24625
|
});
|
|
24626
24626
|
}
|
|
24627
24627
|
}
|
|
24628
|
+
/**
|
|
24629
|
+
* Build the failure message for a duplicate-link conflict. Looks the owning
|
|
24630
|
+
* workspace up through the same Bifrost proxy credentials as the connect
|
|
24631
|
+
* attempt, so the outcome doubles as a visibility probe: a 403 means the
|
|
24632
|
+
* workspace exists for someone else (personal visibility or another
|
|
24633
|
+
* sub-team), which is the common org-mode failure shape.
|
|
24634
|
+
*/
|
|
24635
|
+
async describeWorkspaceLinkConflict(existingWorkspaceId, targetWorkspaceId, repoUrl) {
|
|
24636
|
+
const base = `Repository ${repoUrl} is already linked to workspace ${existingWorkspaceId}, so Bifrost refused the link to workspace ${targetWorkspaceId}.`;
|
|
24637
|
+
let lookupStatus = 0;
|
|
24638
|
+
let workspaceName = "";
|
|
24639
|
+
try {
|
|
24640
|
+
const response = await this.fetchImpl(`${this.bifrostBaseUrl}/ws/proxy`, {
|
|
24641
|
+
method: "POST",
|
|
24642
|
+
headers: this.bifrostHeaders(),
|
|
24643
|
+
body: JSON.stringify({
|
|
24644
|
+
service: "workspaces",
|
|
24645
|
+
method: "GET",
|
|
24646
|
+
path: `/workspaces/${existingWorkspaceId}`
|
|
24647
|
+
})
|
|
24648
|
+
});
|
|
24649
|
+
lookupStatus = response.status;
|
|
24650
|
+
if (response.ok) {
|
|
24651
|
+
const parsed = await response.json();
|
|
24652
|
+
if (typeof parsed?.data?.name === "string" && parsed.data.name) {
|
|
24653
|
+
workspaceName = parsed.data.name;
|
|
24654
|
+
} else if (parsed?.error) {
|
|
24655
|
+
lookupStatus = 403;
|
|
24656
|
+
}
|
|
24657
|
+
}
|
|
24658
|
+
} catch {
|
|
24659
|
+
}
|
|
24660
|
+
if (workspaceName) {
|
|
24661
|
+
return `${base} That workspace is "${workspaceName}" (https://go.postman.co/workspace/${existingWorkspaceId}). To reuse it, pass workspace-id: ${existingWorkspaceId} or set the POSTMAN_WORKSPACE_ID repository variable to it. To link this workspace instead, disconnect the repository from "${workspaceName}" in Workspace Settings or delete that workspace (deleting a workspace also removes its repository link record), then re-run.`;
|
|
24662
|
+
}
|
|
24663
|
+
if (lookupStatus === 401 || lookupStatus === 403) {
|
|
24664
|
+
return `${base} That workspace exists but is invisible to the credentials this action runs with. This usually means an org-mode onboarding run created it without workspace-team-id, leaving it with personal visibility that hides it from teammates, other API keys, and the API Catalog; it may also belong to another sub-team. Ask whoever created it (or a team admin) to disconnect the repository from that workspace or delete it (deleting a workspace also removes its repository link record), then re-run.`;
|
|
24665
|
+
}
|
|
24666
|
+
if (lookupStatus === 404) {
|
|
24667
|
+
return `${base} That workspace looks recently deleted; its repository link record is removed with it. Re-run, and contact Postman support if the conflict persists.`;
|
|
24668
|
+
}
|
|
24669
|
+
return `${base} Details for that workspace could not be resolved with these credentials. Disconnect the repository from it or delete that workspace (deleting a workspace also removes its repository link record) and re-run; if it is invisible to you, ask its creator or a team admin.`;
|
|
24670
|
+
}
|
|
24628
24671
|
async createApiKey(name) {
|
|
24629
24672
|
const url = `${this.bifrostBaseUrl}/ws/proxy`;
|
|
24630
24673
|
const headers = this.bifrostHeaders();
|
package/dist/cli.cjs
CHANGED
|
@@ -22714,7 +22714,7 @@ var BifrostInternalIntegrationAdapter = class {
|
|
|
22714
22714
|
const existingWorkspaceId = extractDuplicateWorkspaceId(body);
|
|
22715
22715
|
if (existingWorkspaceId && existingWorkspaceId !== workspaceId) {
|
|
22716
22716
|
throw new Error(
|
|
22717
|
-
|
|
22717
|
+
await this.describeWorkspaceLinkConflict(existingWorkspaceId, workspaceId, repoUrl)
|
|
22718
22718
|
);
|
|
22719
22719
|
}
|
|
22720
22720
|
return;
|
|
@@ -22728,6 +22728,49 @@ var BifrostInternalIntegrationAdapter = class {
|
|
|
22728
22728
|
});
|
|
22729
22729
|
}
|
|
22730
22730
|
}
|
|
22731
|
+
/**
|
|
22732
|
+
* Build the failure message for a duplicate-link conflict. Looks the owning
|
|
22733
|
+
* workspace up through the same Bifrost proxy credentials as the connect
|
|
22734
|
+
* attempt, so the outcome doubles as a visibility probe: a 403 means the
|
|
22735
|
+
* workspace exists for someone else (personal visibility or another
|
|
22736
|
+
* sub-team), which is the common org-mode failure shape.
|
|
22737
|
+
*/
|
|
22738
|
+
async describeWorkspaceLinkConflict(existingWorkspaceId, targetWorkspaceId, repoUrl) {
|
|
22739
|
+
const base = `Repository ${repoUrl} is already linked to workspace ${existingWorkspaceId}, so Bifrost refused the link to workspace ${targetWorkspaceId}.`;
|
|
22740
|
+
let lookupStatus = 0;
|
|
22741
|
+
let workspaceName = "";
|
|
22742
|
+
try {
|
|
22743
|
+
const response = await this.fetchImpl(`${this.bifrostBaseUrl}/ws/proxy`, {
|
|
22744
|
+
method: "POST",
|
|
22745
|
+
headers: this.bifrostHeaders(),
|
|
22746
|
+
body: JSON.stringify({
|
|
22747
|
+
service: "workspaces",
|
|
22748
|
+
method: "GET",
|
|
22749
|
+
path: `/workspaces/${existingWorkspaceId}`
|
|
22750
|
+
})
|
|
22751
|
+
});
|
|
22752
|
+
lookupStatus = response.status;
|
|
22753
|
+
if (response.ok) {
|
|
22754
|
+
const parsed = await response.json();
|
|
22755
|
+
if (typeof parsed?.data?.name === "string" && parsed.data.name) {
|
|
22756
|
+
workspaceName = parsed.data.name;
|
|
22757
|
+
} else if (parsed?.error) {
|
|
22758
|
+
lookupStatus = 403;
|
|
22759
|
+
}
|
|
22760
|
+
}
|
|
22761
|
+
} catch {
|
|
22762
|
+
}
|
|
22763
|
+
if (workspaceName) {
|
|
22764
|
+
return `${base} That workspace is "${workspaceName}" (https://go.postman.co/workspace/${existingWorkspaceId}). To reuse it, pass workspace-id: ${existingWorkspaceId} or set the POSTMAN_WORKSPACE_ID repository variable to it. To link this workspace instead, disconnect the repository from "${workspaceName}" in Workspace Settings or delete that workspace (deleting a workspace also removes its repository link record), then re-run.`;
|
|
22765
|
+
}
|
|
22766
|
+
if (lookupStatus === 401 || lookupStatus === 403) {
|
|
22767
|
+
return `${base} That workspace exists but is invisible to the credentials this action runs with. This usually means an org-mode onboarding run created it without workspace-team-id, leaving it with personal visibility that hides it from teammates, other API keys, and the API Catalog; it may also belong to another sub-team. Ask whoever created it (or a team admin) to disconnect the repository from that workspace or delete it (deleting a workspace also removes its repository link record), then re-run.`;
|
|
22768
|
+
}
|
|
22769
|
+
if (lookupStatus === 404) {
|
|
22770
|
+
return `${base} That workspace looks recently deleted; its repository link record is removed with it. Re-run, and contact Postman support if the conflict persists.`;
|
|
22771
|
+
}
|
|
22772
|
+
return `${base} Details for that workspace could not be resolved with these credentials. Disconnect the repository from it or delete that workspace (deleting a workspace also removes its repository link record) and re-run; if it is invisible to you, ask its creator or a team admin.`;
|
|
22773
|
+
}
|
|
22731
22774
|
async createApiKey(name) {
|
|
22732
22775
|
const url = `${this.bifrostBaseUrl}/ws/proxy`;
|
|
22733
22776
|
const headers = this.bifrostHeaders();
|
package/dist/index.cjs
CHANGED
|
@@ -24626,7 +24626,7 @@ var BifrostInternalIntegrationAdapter = class {
|
|
|
24626
24626
|
const existingWorkspaceId = extractDuplicateWorkspaceId(body);
|
|
24627
24627
|
if (existingWorkspaceId && existingWorkspaceId !== workspaceId) {
|
|
24628
24628
|
throw new Error(
|
|
24629
|
-
|
|
24629
|
+
await this.describeWorkspaceLinkConflict(existingWorkspaceId, workspaceId, repoUrl)
|
|
24630
24630
|
);
|
|
24631
24631
|
}
|
|
24632
24632
|
return;
|
|
@@ -24640,6 +24640,49 @@ var BifrostInternalIntegrationAdapter = class {
|
|
|
24640
24640
|
});
|
|
24641
24641
|
}
|
|
24642
24642
|
}
|
|
24643
|
+
/**
|
|
24644
|
+
* Build the failure message for a duplicate-link conflict. Looks the owning
|
|
24645
|
+
* workspace up through the same Bifrost proxy credentials as the connect
|
|
24646
|
+
* attempt, so the outcome doubles as a visibility probe: a 403 means the
|
|
24647
|
+
* workspace exists for someone else (personal visibility or another
|
|
24648
|
+
* sub-team), which is the common org-mode failure shape.
|
|
24649
|
+
*/
|
|
24650
|
+
async describeWorkspaceLinkConflict(existingWorkspaceId, targetWorkspaceId, repoUrl) {
|
|
24651
|
+
const base = `Repository ${repoUrl} is already linked to workspace ${existingWorkspaceId}, so Bifrost refused the link to workspace ${targetWorkspaceId}.`;
|
|
24652
|
+
let lookupStatus = 0;
|
|
24653
|
+
let workspaceName = "";
|
|
24654
|
+
try {
|
|
24655
|
+
const response = await this.fetchImpl(`${this.bifrostBaseUrl}/ws/proxy`, {
|
|
24656
|
+
method: "POST",
|
|
24657
|
+
headers: this.bifrostHeaders(),
|
|
24658
|
+
body: JSON.stringify({
|
|
24659
|
+
service: "workspaces",
|
|
24660
|
+
method: "GET",
|
|
24661
|
+
path: `/workspaces/${existingWorkspaceId}`
|
|
24662
|
+
})
|
|
24663
|
+
});
|
|
24664
|
+
lookupStatus = response.status;
|
|
24665
|
+
if (response.ok) {
|
|
24666
|
+
const parsed = await response.json();
|
|
24667
|
+
if (typeof parsed?.data?.name === "string" && parsed.data.name) {
|
|
24668
|
+
workspaceName = parsed.data.name;
|
|
24669
|
+
} else if (parsed?.error) {
|
|
24670
|
+
lookupStatus = 403;
|
|
24671
|
+
}
|
|
24672
|
+
}
|
|
24673
|
+
} catch {
|
|
24674
|
+
}
|
|
24675
|
+
if (workspaceName) {
|
|
24676
|
+
return `${base} That workspace is "${workspaceName}" (https://go.postman.co/workspace/${existingWorkspaceId}). To reuse it, pass workspace-id: ${existingWorkspaceId} or set the POSTMAN_WORKSPACE_ID repository variable to it. To link this workspace instead, disconnect the repository from "${workspaceName}" in Workspace Settings or delete that workspace (deleting a workspace also removes its repository link record), then re-run.`;
|
|
24677
|
+
}
|
|
24678
|
+
if (lookupStatus === 401 || lookupStatus === 403) {
|
|
24679
|
+
return `${base} That workspace exists but is invisible to the credentials this action runs with. This usually means an org-mode onboarding run created it without workspace-team-id, leaving it with personal visibility that hides it from teammates, other API keys, and the API Catalog; it may also belong to another sub-team. Ask whoever created it (or a team admin) to disconnect the repository from that workspace or delete it (deleting a workspace also removes its repository link record), then re-run.`;
|
|
24680
|
+
}
|
|
24681
|
+
if (lookupStatus === 404) {
|
|
24682
|
+
return `${base} That workspace looks recently deleted; its repository link record is removed with it. Re-run, and contact Postman support if the conflict persists.`;
|
|
24683
|
+
}
|
|
24684
|
+
return `${base} Details for that workspace could not be resolved with these credentials. Disconnect the repository from it or delete that workspace (deleting a workspace also removes its repository link record) and re-run; if it is invisible to you, ask its creator or a team admin.`;
|
|
24685
|
+
}
|
|
24643
24686
|
async createApiKey(name) {
|
|
24644
24687
|
const url = `${this.bifrostBaseUrl}/ws/proxy`;
|
|
24645
24688
|
const headers = this.bifrostHeaders();
|