forkit-connect 0.1.6 → 0.1.7
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/cli.js +10 -0
- package/dist/launcher.js +13 -1
- package/dist/v1/service.js +5 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2709,6 +2709,9 @@ async function run() {
|
|
|
2709
2709
|
else if (message === 'SIMILAR_PASSPORT_EXISTS') {
|
|
2710
2710
|
console.error('A similar or existing passport already exists in your Forkit.dev account. Open inbox and review the connected/passport match before creating a new draft.');
|
|
2711
2711
|
}
|
|
2712
|
+
else if (message === 'INVALID_DRAFT_VISIBILITY') {
|
|
2713
|
+
console.error('This registration must start as a private draft. Review it in inbox/start first, or choose publish only when Forkit is ready to finish the passport.');
|
|
2714
|
+
}
|
|
2712
2715
|
else if (message.startsWith('DRAFT_CREATE_FAILED:')) {
|
|
2713
2716
|
console.error(`[forkit-connect] Draft creation failed (${message.split(':')[1]}).`);
|
|
2714
2717
|
}
|
|
@@ -3871,6 +3874,8 @@ async function run() {
|
|
|
3871
3874
|
return 'A backend draft already exists for this model. No duplicate draft created.';
|
|
3872
3875
|
if (raw === 'SIMILAR_PASSPORT_EXISTS')
|
|
3873
3876
|
return 'A similar or existing passport already exists in your Forkit.dev account. Review existing records before creating a new draft.';
|
|
3877
|
+
if (raw === 'INVALID_DRAFT_VISIBILITY')
|
|
3878
|
+
return 'This registration must start as a private draft. Review it in inbox/start first, or choose publish only when Forkit is ready to finish the passport.';
|
|
3874
3879
|
if (raw === 'WORKSPACE_PROJECT_BINDING_REQUIRED')
|
|
3875
3880
|
return 'No governed workspace/project scope is linked yet. Select or create scope first.';
|
|
3876
3881
|
if (raw === 'DRAFT_CREATION_NOT_ALLOWED_BY_BINDING')
|
|
@@ -4538,6 +4543,11 @@ async function run() {
|
|
|
4538
4543
|
process.exitCode = 2;
|
|
4539
4544
|
return;
|
|
4540
4545
|
}
|
|
4546
|
+
if (message === 'INVALID_DRAFT_VISIBILITY') {
|
|
4547
|
+
console.error('This registration must start as a private draft. Review it in inbox/start first, or choose publish only when Forkit is ready to finish the passport.');
|
|
4548
|
+
process.exitCode = 2;
|
|
4549
|
+
return;
|
|
4550
|
+
}
|
|
4541
4551
|
if (message.startsWith('DRAFT_CREATE_FAILED:')) {
|
|
4542
4552
|
console.error(`[forkit-connect] Draft creation failed (${message.split(':')[1]}).`);
|
|
4543
4553
|
process.exitCode = 2;
|
package/dist/launcher.js
CHANGED
|
@@ -535,6 +535,16 @@ function normalizeDiscoveryRegistrationFailure(message) {
|
|
|
535
535
|
message: 'A similar passport already exists in Forkit. Review existing records before creating a new one.',
|
|
536
536
|
};
|
|
537
537
|
}
|
|
538
|
+
if (normalized === 'INVALID_DRAFT_VISIBILITY') {
|
|
539
|
+
return {
|
|
540
|
+
code: normalized,
|
|
541
|
+
message: 'This registration needs to start as a private draft before it can be published.',
|
|
542
|
+
nextActions: [
|
|
543
|
+
'Keep the item in review or open the draft path first.',
|
|
544
|
+
'Choose publish only when Forkit is ready to finish the passport.',
|
|
545
|
+
],
|
|
546
|
+
};
|
|
547
|
+
}
|
|
538
548
|
if (normalized === 'WORKSPACE_PROJECT_BINDING_REQUIRED') {
|
|
539
549
|
return {
|
|
540
550
|
code: normalized,
|
|
@@ -7581,9 +7591,11 @@ function renderLauncherHtml(launcherToken) {
|
|
|
7581
7591
|
actionSummary: result && result.code === 'GOVERNED_PASSPORT_CAPACITY_REACHED'
|
|
7582
7592
|
? 'Capacity full · use an existing passport or free space'
|
|
7583
7593
|
: result && result.code === 'DRAFT_LIMIT_REACHED'
|
|
7584
|
-
|
|
7594
|
+
? 'Draft capacity full · use an existing passport, clear a draft, or upgrade'
|
|
7585
7595
|
: result && result.code === 'SIMILAR_PASSPORT_EXISTS'
|
|
7586
7596
|
? 'Matching passport exists · reuse it instead of creating another'
|
|
7597
|
+
: result && result.code === 'INVALID_DRAFT_VISIBILITY'
|
|
7598
|
+
? 'Draft first · keep this registration private until it is ready to publish'
|
|
7587
7599
|
: result && (result.code === 'WORKSPACE_PROJECT_BINDING_REQUIRED' || result.code === 'DRAFT_CREATION_NOT_ALLOWED_BY_BINDING')
|
|
7588
7600
|
? 'Scope required · choose workspace and project'
|
|
7589
7601
|
: null,
|
package/dist/v1/service.js
CHANGED
|
@@ -7793,7 +7793,10 @@ class ConnectV1Service {
|
|
|
7793
7793
|
const soloDraftAllowed = draftBindingStatus.allowed && draftBindingStatus.reasonCode === 'solo_passport_draft_allowed';
|
|
7794
7794
|
const localScopedDraftAllowed = draftBindingStatus.allowed && draftBindingStatus.reasonCode === 'local_workspace_project_draft_allowed';
|
|
7795
7795
|
const model = this.resolveModelSelection(selector, state);
|
|
7796
|
-
const
|
|
7796
|
+
const requestedDestination = options?.destination === 'passport' ? 'passport' : 'draft';
|
|
7797
|
+
const requestedVisibility = options?.visibility === 'public' && requestedDestination === 'passport'
|
|
7798
|
+
? 'public'
|
|
7799
|
+
: 'private';
|
|
7797
7800
|
this.clearModelReviewDeferral(model);
|
|
7798
7801
|
const { payload, registrationKey } = this.buildConnectDraftPayload(model, state, draftScope, {
|
|
7799
7802
|
visibility: requestedVisibility,
|
|
@@ -7802,7 +7805,7 @@ class ConnectV1Service {
|
|
|
7802
7805
|
const binding = this.findBindingForModel(this.stateStore.readState(), model, registrationKey);
|
|
7803
7806
|
const pendingQueue = this.findPendingQueueItem(state, model, registrationKey);
|
|
7804
7807
|
const shouldPublishImmediately = requestedVisibility === 'public'
|
|
7805
|
-
&& (
|
|
7808
|
+
&& (requestedDestination === 'passport' || (soloDraftAllowed && requestedDestination !== 'draft'));
|
|
7806
7809
|
const bindingWithRuntime = binding ? {
|
|
7807
7810
|
...binding,
|
|
7808
7811
|
runtimeGaid: binding.runtimeGaid ?? runtimePassport?.runtime_gaid ?? null,
|