@fairmint/captable-ai 0.1.36 → 0.1.37
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.js +20 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15113,22 +15113,27 @@ function deriveExtractionReadinessPhase(summary) {
|
|
|
15113
15113
|
return "complete";
|
|
15114
15114
|
}
|
|
15115
15115
|
var IMPORT_SESSION_CLOCK_SKEW_MS = 5e3;
|
|
15116
|
-
function
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
const cutoffMs = sessionMs - IMPORT_SESSION_CLOCK_SKEW_MS;
|
|
15116
|
+
function sameUuid(a, b) {
|
|
15117
|
+
return typeof b === "string" && a.toLowerCase() === b.toLowerCase();
|
|
15118
|
+
}
|
|
15119
|
+
function documentsForImportSession(documents, sessionCreatedAt, sessionId) {
|
|
15120
|
+
const sessionMs = typeof sessionCreatedAt === "string" ? parseTimestampMs(sessionCreatedAt) : null;
|
|
15121
|
+
const cutoffMs = sessionMs === null ? null : sessionMs - IMPORT_SESSION_CLOCK_SKEW_MS;
|
|
15123
15122
|
return documents.filter((document) => {
|
|
15124
|
-
if (typeof document.
|
|
15123
|
+
if (typeof document.importSessionId === "string") {
|
|
15124
|
+
return sameUuid(document.importSessionId, sessionId);
|
|
15125
|
+
}
|
|
15126
|
+
if (cutoffMs === null || typeof document.createdAt !== "string")
|
|
15125
15127
|
return false;
|
|
15126
15128
|
const createdMs = parseTimestampMs(document.createdAt);
|
|
15127
15129
|
return createdMs !== null && createdMs >= cutoffMs;
|
|
15128
15130
|
});
|
|
15129
15131
|
}
|
|
15130
15132
|
function importSessionScopeUnknown(documents) {
|
|
15131
|
-
return documents.length > 0 && documents.every((document) =>
|
|
15133
|
+
return documents.length > 0 && documents.every((document) => (
|
|
15134
|
+
// A stamped document is attributable without a creation time.
|
|
15135
|
+
typeof document.importSessionId !== "string" && (typeof document.createdAt !== "string" || parseTimestampMs(document.createdAt) === null)
|
|
15136
|
+
));
|
|
15132
15137
|
}
|
|
15133
15138
|
var HAS_ZONE = /(?:Z|[+-]\d{2}(?::?\d{2})?)$/i;
|
|
15134
15139
|
function parseTimestampMs(value) {
|
|
@@ -15608,6 +15613,7 @@ var documentProcessingStatusItemSchema = external_exports.object({
|
|
|
15608
15613
|
name: external_exports.string().nullable().optional().describe("Original file name; absent on older servers."),
|
|
15609
15614
|
status: external_exports.string().describe("Document processing status."),
|
|
15610
15615
|
createdAt: external_exports.string().nullable().optional().describe("Immutable document creation timestamp; absent on older servers."),
|
|
15616
|
+
importSessionId: external_exports.string().nullable().optional().describe("Import session the upload named (set when the document is uploaded or re-uploaded into that session); null for older uploads and uploads that named none; absent on older servers."),
|
|
15611
15617
|
lastActivityAt: external_exports.string().nullable().describe("Last backend activity timestamp (updated_at / heartbeat); null if unknown."),
|
|
15612
15618
|
queuePosition: external_exports.number().int().min(0).nullable().describe("0 = at the head (processing); >0 = waiting behind others; null = not in pipeline."),
|
|
15613
15619
|
health: external_exports.enum(DOCUMENT_HEALTH_VALUES).describe("Derived health from backend heartbeat + queue position.")
|
|
@@ -23344,7 +23350,11 @@ async function runImportStatus(args) {
|
|
|
23344
23350
|
`/import-sessions/${encodeURIComponent(sessionId)}/status`
|
|
23345
23351
|
);
|
|
23346
23352
|
const portalDocuments = response.data?.processing?.documents ?? [];
|
|
23347
|
-
const documents = documentsForImportSession(
|
|
23353
|
+
const documents = documentsForImportSession(
|
|
23354
|
+
portalDocuments,
|
|
23355
|
+
response.data?.session?.createdAt,
|
|
23356
|
+
sessionId
|
|
23357
|
+
);
|
|
23348
23358
|
const documentIds = documents.flatMap(
|
|
23349
23359
|
(document) => typeof document.s3AssetId === "string" ? [document.s3AssetId] : []
|
|
23350
23360
|
);
|
package/package.json
CHANGED