@primitive.ai/prim 0.1.0-alpha.73 → 0.1.0-alpha.74
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/hook-runtime/index.js +18 -1
- package/dist/index.js +18 -1
- package/package.json +1 -1
|
@@ -39808,6 +39808,20 @@ var MODE = "install_intent_v1";
|
|
|
39808
39808
|
var START_PATH = "/api/cli/github/install-intents";
|
|
39809
39809
|
var POLL_REQUEST_TIMEOUT_MS2 = 1e4;
|
|
39810
39810
|
var MAX_INTENT_LIFETIME_MS = 15 * 6e4;
|
|
39811
|
+
var REPOSITORY_IDENTITY_MIGRATION_REQUIRED = "repository_identity_migration_required";
|
|
39812
|
+
function isRepositoryIdentityMigrationRequiredStatus(value) {
|
|
39813
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
39814
|
+
return false;
|
|
39815
|
+
}
|
|
39816
|
+
const record2 = value;
|
|
39817
|
+
if (record2.failureCode !== REPOSITORY_IDENTITY_MIGRATION_REQUIRED) {
|
|
39818
|
+
return false;
|
|
39819
|
+
}
|
|
39820
|
+
return isGitHubInstallIntentStatusResponse({
|
|
39821
|
+
...record2,
|
|
39822
|
+
failureCode: "proof_commit_failed"
|
|
39823
|
+
});
|
|
39824
|
+
}
|
|
39811
39825
|
function parseGitHubInstallIntentStart(value, now = Date.now()) {
|
|
39812
39826
|
if (!isGitHubInstallIntentStartResponse(value) || value.expiresAt <= now || value.expiresAt - now > MAX_INTENT_LIFETIME_MS) {
|
|
39813
39827
|
return null;
|
|
@@ -39815,7 +39829,10 @@ function parseGitHubInstallIntentStart(value, now = Date.now()) {
|
|
|
39815
39829
|
return value;
|
|
39816
39830
|
}
|
|
39817
39831
|
function parseGitHubInstallIntentStatus(value, expectedExpiresAt) {
|
|
39818
|
-
if (
|
|
39832
|
+
if (isGitHubInstallIntentStatusResponse(value)) {
|
|
39833
|
+
return value.expiresAt === expectedExpiresAt ? value : null;
|
|
39834
|
+
}
|
|
39835
|
+
if (!isRepositoryIdentityMigrationRequiredStatus(value) || value.expiresAt !== expectedExpiresAt) {
|
|
39819
39836
|
return null;
|
|
39820
39837
|
}
|
|
39821
39838
|
return value;
|
package/dist/index.js
CHANGED
|
@@ -16933,6 +16933,20 @@ var MODE = "install_intent_v1";
|
|
|
16933
16933
|
var START_PATH = "/api/cli/github/install-intents";
|
|
16934
16934
|
var POLL_REQUEST_TIMEOUT_MS = 1e4;
|
|
16935
16935
|
var MAX_INTENT_LIFETIME_MS = 15 * 6e4;
|
|
16936
|
+
var REPOSITORY_IDENTITY_MIGRATION_REQUIRED = "repository_identity_migration_required";
|
|
16937
|
+
function isRepositoryIdentityMigrationRequiredStatus(value) {
|
|
16938
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
16939
|
+
return false;
|
|
16940
|
+
}
|
|
16941
|
+
const record2 = value;
|
|
16942
|
+
if (record2.failureCode !== REPOSITORY_IDENTITY_MIGRATION_REQUIRED) {
|
|
16943
|
+
return false;
|
|
16944
|
+
}
|
|
16945
|
+
return isGitHubInstallIntentStatusResponse({
|
|
16946
|
+
...record2,
|
|
16947
|
+
failureCode: "proof_commit_failed"
|
|
16948
|
+
});
|
|
16949
|
+
}
|
|
16936
16950
|
function parseGitHubInstallIntentStart(value, now = Date.now()) {
|
|
16937
16951
|
if (!isGitHubInstallIntentStartResponse(value) || value.expiresAt <= now || value.expiresAt - now > MAX_INTENT_LIFETIME_MS) {
|
|
16938
16952
|
return null;
|
|
@@ -16940,7 +16954,10 @@ function parseGitHubInstallIntentStart(value, now = Date.now()) {
|
|
|
16940
16954
|
return value;
|
|
16941
16955
|
}
|
|
16942
16956
|
function parseGitHubInstallIntentStatus(value, expectedExpiresAt) {
|
|
16943
|
-
if (
|
|
16957
|
+
if (isGitHubInstallIntentStatusResponse(value)) {
|
|
16958
|
+
return value.expiresAt === expectedExpiresAt ? value : null;
|
|
16959
|
+
}
|
|
16960
|
+
if (!isRepositoryIdentityMigrationRequiredStatus(value) || value.expiresAt !== expectedExpiresAt) {
|
|
16944
16961
|
return null;
|
|
16945
16962
|
}
|
|
16946
16963
|
return value;
|
package/package.json
CHANGED