@dvina/sdk 4.0.248 → 4.0.251
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/adapters/angular/index.cjs +3 -3
- package/dist/adapters/angular/index.d.cts +2 -2
- package/dist/adapters/angular/index.d.ts +2 -2
- package/dist/adapters/angular/index.js +1 -1
- package/dist/{chunk-NKZWSHJW.js → chunk-YHU4BXFB.js} +53 -8
- package/dist/chunk-YHU4BXFB.js.map +1 -0
- package/dist/{chunk-FAENNJ6Q.cjs → chunk-YLVE4CQ3.cjs} +53 -8
- package/dist/chunk-YLVE4CQ3.cjs.map +1 -0
- package/dist/{client-BY5yHPBJ.d.ts → client-KWpOMWFE.d.ts} +1 -1
- package/dist/{client-BAqOMON2.d.cts → client-xxgIvyCC.d.cts} +1 -1
- package/dist/{index-DqQrAjp3.d.ts → index-BbpmtqXB.d.ts} +1 -1
- package/dist/{index-Bwe8KY0Z.d.cts → index-CNWwsIBc.d.cts} +1 -1
- package/dist/index.cjs +391 -391
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/pagination/index.d.cts +2 -2
- package/dist/pagination/index.d.ts +2 -2
- package/dist/{sync-engine-DPVgCDPC.d.cts → sync-engine-CHzQF0ON.d.cts} +4 -0
- package/dist/{sync-engine-CYIG5amb.d.ts → sync-engine-KnLTtyTA.d.ts} +4 -0
- package/package.json +1 -1
- package/dist/chunk-FAENNJ6Q.cjs.map +0 -1
- package/dist/chunk-NKZWSHJW.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYLVE4CQ3_cjs = require('../../chunk-YLVE4CQ3.cjs');
|
|
4
4
|
require('../../chunk-342BFYZZ.cjs');
|
|
5
5
|
require('../../chunk-UELAE75E.cjs');
|
|
6
6
|
require('../../chunk-4Y42KQCH.cjs');
|
|
@@ -147,10 +147,10 @@ function hasDispose(value) {
|
|
|
147
147
|
function provideDvina(optionsOrFactory) {
|
|
148
148
|
return core.makeEnvironmentProviders([
|
|
149
149
|
{
|
|
150
|
-
provide:
|
|
150
|
+
provide: chunkYLVE4CQ3_cjs.DvinaSdk,
|
|
151
151
|
useFactory: () => {
|
|
152
152
|
const options = typeof optionsOrFactory === "function" ? optionsOrFactory() : optionsOrFactory;
|
|
153
|
-
return new
|
|
153
|
+
return new chunkYLVE4CQ3_cjs.DvinaSdk(options);
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Signal, DestroyRef, EnvironmentProviders } from '@angular/core';
|
|
2
|
-
import { D as DvinaSdkOptions } from '../../client-
|
|
2
|
+
import { D as DvinaSdkOptions } from '../../client-xxgIvyCC.cjs';
|
|
3
3
|
import { D as DvinaQueryRef } from '../../types-2RotD0Ab.cjs';
|
|
4
4
|
import '../../error-CsVoUTY8.cjs';
|
|
5
|
-
import '../../sync-engine-
|
|
5
|
+
import '../../sync-engine-CHzQF0ON.cjs';
|
|
6
6
|
import 'graphql';
|
|
7
7
|
import 'dexie';
|
|
8
8
|
import '../../client-Bb2gD6Iz.cjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Signal, DestroyRef, EnvironmentProviders } from '@angular/core';
|
|
2
|
-
import { D as DvinaSdkOptions } from '../../client-
|
|
2
|
+
import { D as DvinaSdkOptions } from '../../client-KWpOMWFE.js';
|
|
3
3
|
import { D as DvinaQueryRef } from '../../types-2RotD0Ab.js';
|
|
4
4
|
import '../../error-CsVoUTY8.js';
|
|
5
|
-
import '../../sync-engine-
|
|
5
|
+
import '../../sync-engine-KnLTtyTA.js';
|
|
6
6
|
import 'graphql';
|
|
7
7
|
import 'dexie';
|
|
8
8
|
import '../../client-Bb2gD6Iz.js';
|
|
@@ -8404,15 +8404,19 @@ function createSseTransport(options) {
|
|
|
8404
8404
|
}
|
|
8405
8405
|
return;
|
|
8406
8406
|
}
|
|
8407
|
-
if (!eventId) {
|
|
8408
|
-
return;
|
|
8409
|
-
}
|
|
8410
|
-
currentLastSyncId = eventId;
|
|
8411
8407
|
if (eventType === "cursor") {
|
|
8408
|
+
if (!eventId) {
|
|
8409
|
+
return;
|
|
8410
|
+
}
|
|
8411
|
+
currentLastSyncId = eventId;
|
|
8412
8412
|
options.onCursor?.(eventId);
|
|
8413
8413
|
return;
|
|
8414
8414
|
}
|
|
8415
8415
|
if (eventType === "sync" && eventData) {
|
|
8416
|
+
if (!eventId) {
|
|
8417
|
+
return;
|
|
8418
|
+
}
|
|
8419
|
+
currentLastSyncId = eventId;
|
|
8416
8420
|
try {
|
|
8417
8421
|
const parsed = JSON.parse(eventData);
|
|
8418
8422
|
options.onEvent({
|
|
@@ -9094,13 +9098,35 @@ var CacheManager = class {
|
|
|
9094
9098
|
const freshness = await this._db._sync.get(getQueryFreshnessKey(queryKey));
|
|
9095
9099
|
return typeof freshness?.value === "number" ? freshness.value : fallback?.fetchedAt;
|
|
9096
9100
|
}
|
|
9101
|
+
async getQuerySyncId(queryKey) {
|
|
9102
|
+
const entry = await this._db._queryResults.get(queryKey);
|
|
9103
|
+
return entry?.querySyncId;
|
|
9104
|
+
}
|
|
9105
|
+
async setQuerySyncId(queryKey, querySyncId) {
|
|
9106
|
+
const entry = await this._db._queryResults.get(queryKey);
|
|
9107
|
+
if (!entry || entry.querySyncId === querySyncId) {
|
|
9108
|
+
return;
|
|
9109
|
+
}
|
|
9110
|
+
entry.querySyncId = querySyncId;
|
|
9111
|
+
await this._db._queryResults.put(entry);
|
|
9112
|
+
}
|
|
9097
9113
|
/**
|
|
9098
9114
|
* Write connection metadata to the `_queryResults` table.
|
|
9099
9115
|
*/
|
|
9100
|
-
async writeQueryResult(queryKey, connection) {
|
|
9116
|
+
async writeQueryResult(queryKey, connection, options) {
|
|
9101
9117
|
const fetchedAt = Date.now();
|
|
9102
9118
|
const existing = await this._db._queryResults.get(queryKey);
|
|
9119
|
+
const nextQuerySyncId = options?.querySyncId ?? existing?.querySyncId;
|
|
9103
9120
|
if (existing && hasSameQueryResultContents(existing, connection)) {
|
|
9121
|
+
if (existing.querySyncId !== nextQuerySyncId) {
|
|
9122
|
+
existing.querySyncId = nextQuerySyncId;
|
|
9123
|
+
existing.fetchedAt = fetchedAt;
|
|
9124
|
+
await this._db.transaction("rw", [this._db._queryResults, this._db._sync], async () => {
|
|
9125
|
+
await this._db._queryResults.put(existing);
|
|
9126
|
+
await this._touchQueryFreshness(queryKey, fetchedAt);
|
|
9127
|
+
});
|
|
9128
|
+
return;
|
|
9129
|
+
}
|
|
9104
9130
|
await this._touchQueryFreshness(queryKey, fetchedAt);
|
|
9105
9131
|
return;
|
|
9106
9132
|
}
|
|
@@ -9110,6 +9136,7 @@ var CacheManager = class {
|
|
|
9110
9136
|
entityIds: connection.entityIds,
|
|
9111
9137
|
pageInfo: connection.pageInfo,
|
|
9112
9138
|
totalCount: connection.totalCount,
|
|
9139
|
+
querySyncId: nextQuerySyncId,
|
|
9113
9140
|
fetchedAt
|
|
9114
9141
|
};
|
|
9115
9142
|
await this._db.transaction("rw", [this._db._queryResults, this._db._sync], async () => {
|
|
@@ -9478,7 +9505,11 @@ var QueryExecutor = class {
|
|
|
9478
9505
|
}
|
|
9479
9506
|
}
|
|
9480
9507
|
}
|
|
9508
|
+
const querySyncId = await this._db.getLastSyncId();
|
|
9481
9509
|
const networkResult = await this.query(document2, variables, operationName);
|
|
9510
|
+
if (querySyncId !== "0") {
|
|
9511
|
+
await this._cache.setQuerySyncId(queryKey, querySyncId).catch(() => void 0);
|
|
9512
|
+
}
|
|
9482
9513
|
try {
|
|
9483
9514
|
const result = await buildResult(this._db);
|
|
9484
9515
|
ref._markInitialized(result);
|
|
@@ -9989,7 +10020,7 @@ var SyncEngine = class {
|
|
|
9989
10020
|
});
|
|
9990
10021
|
if (this._sse) {
|
|
9991
10022
|
this._subscriptionToQueryKey.set(subscriptionDescriptor.id, queryKey);
|
|
9992
|
-
this.
|
|
10023
|
+
void this._subscribeWithQuerySyncId(subscriptionDescriptor, queryKey);
|
|
9993
10024
|
}
|
|
9994
10025
|
void this._revalidateSubscriptionIfStale(subscriptionDescriptor.id);
|
|
9995
10026
|
const originalDispose = ref.dispose.bind(ref);
|
|
@@ -10011,6 +10042,16 @@ var SyncEngine = class {
|
|
|
10011
10042
|
}
|
|
10012
10043
|
return ref;
|
|
10013
10044
|
}
|
|
10045
|
+
async _subscribeWithQuerySyncId(subscriptionDescriptor, queryKey) {
|
|
10046
|
+
const cachedQuerySyncId = await this._cache.getQuerySyncId(queryKey).catch(() => void 0);
|
|
10047
|
+
if (!this._subscriptionToQueryKey.has(subscriptionDescriptor.id)) {
|
|
10048
|
+
return;
|
|
10049
|
+
}
|
|
10050
|
+
if (cachedQuerySyncId) {
|
|
10051
|
+
subscriptionDescriptor.querySyncId = cachedQuerySyncId;
|
|
10052
|
+
}
|
|
10053
|
+
this._sse?.subscribe(subscriptionDescriptor);
|
|
10054
|
+
}
|
|
10014
10055
|
// ─── Mutate ────────────────────────────────────────────────────────────
|
|
10015
10056
|
/**
|
|
10016
10057
|
* Execute a mutation with optional optimistic update and automatic cache rule.
|
|
@@ -10196,7 +10237,11 @@ var SyncEngine = class {
|
|
|
10196
10237
|
const startedAt = Date.now();
|
|
10197
10238
|
this._lastRevalidatedAt.set(subscription.queryKey, startedAt);
|
|
10198
10239
|
try {
|
|
10240
|
+
const querySyncId = await this._db.getLastSyncId();
|
|
10199
10241
|
await this.query(subscription.document, subscription.variables, subscription.operationName);
|
|
10242
|
+
if (querySyncId !== "0") {
|
|
10243
|
+
await this._cache.setQuerySyncId(subscription.queryKey, querySyncId).catch(() => void 0);
|
|
10244
|
+
}
|
|
10200
10245
|
this._clearRevalidationRetry(subscription.queryKey);
|
|
10201
10246
|
} catch {
|
|
10202
10247
|
this._lastRevalidatedAt.delete(subscription.queryKey);
|
|
@@ -23161,5 +23206,5 @@ var DvinaSdk = class extends Request {
|
|
|
23161
23206
|
};
|
|
23162
23207
|
|
|
23163
23208
|
export { AbortChatMutation, Action, AddInsightToReportMutation, Agent, AgentConnection, AgentQuery, AgentSubBuilder, Agent_ChatsQuery, AgentsQuery, AiProviderSettingQuery, Artifact, ArtifactConnection, ArtifactQuery, ArtifactSubBuilder, Artifact_ChatQuery, Artifact_Chat_DesktopDeviceQuery, Artifact_Chat_InsightQuery, Artifact_Chat_ProjectQuery, Artifact_FileQuery, Artifact_MessageQuery, Artifact_Message_ChatQuery, Artifact_Message_ContentsQuery, Artifact_Message_FeedbackQuery, ArtifactsQuery, AudioEventOutput, CancelOauthFlowMutation, CancelWorkspaceDeletionMutation, Candidate, CandidateEvidence, Chat, ChatConnection, ChatImportExecuteOutput, ChatImportPreviewOutput, ChatMessage, ChatMessageConnection, ChatMessageQuery, ChatMessageSubBuilder, ChatMessage_ArtifactsQuery, ChatMessage_ChatQuery, ChatMessage_Chat_DesktopDeviceQuery, ChatMessage_Chat_InsightQuery, ChatMessage_Chat_ProjectQuery, ChatMessage_ContentsQuery, ChatMessage_FeedbackQuery, ChatMessagesQuery, ChatQuery, ChatSubBuilder, ChatTitleEventOutput, Chat_AgentsQuery, Chat_ArtifactsQuery, Chat_DesktopDeviceQuery, Chat_DesktopDevice_DesktopBindingsQuery, Chat_InsightQuery, Chat_Insight_ReportMembersQuery, Chat_Insight_ThumbnailFileQuery, Chat_MessagesQuery, Chat_ProjectQuery, Chat_Project_DesktopBindingQuery, ChatsQuery, ConnectIntegrationMutation, ConsumePulseEventsMutation, ContentBlock, ContentMask, ContinueImportedChatMutation, ContinueInterpretationMutation, CreateAgentMutation, CreateChatMutation, CreateDatabaseMutation, CreateDocumentMutation, CreateFeedbackMutation, CreateFolderMutation, CreateInsightMutation, CreateIntegrationMutation, CreateIntegrationOutput, CreateProjectMutation, CreateReportMutation, CreateTableMutation, CreateUserSkillFileMutation, CreateUserSkillFolderMutation, CubeModel, DB_ENTITY_SCHEMA, Database, DatabaseCatalog, DatabaseCatalogConnection, DatabaseCatalogQuery, DatabaseCatalogSubBuilder, DatabaseCatalog_EngineQuery, DatabaseCatalogsQuery, DatabaseConnection, DatabaseEngine, DatabaseQuery, DatabaseSchemaQuery, DatabaseSubBuilder, Database_EngineQuery, Database_Engine_CatalogQuery, Database_TablesQuery, DatabasesQuery, DeepAnalysisUsage, DeferredDvinaQueryRef, DeleteAgentMutation, DeleteAiProviderSettingMutation, DeleteArtifactMutation, DeleteChatMutation, DeleteDatabaseMutation, DeleteDocumentMutation, DeleteFolderMutation, DeleteInsightMutation, DeleteInsightsMutation, DeleteIntegrationMutation, DeleteProjectMutation, DeleteReportMutation, DeleteTableMutation, DeleteUserSkillFileMutation, DeleteUserSkillFolderMutation, DesktopDevice, DesktopDeviceConnection, DesktopDeviceQuery, DesktopDeviceSubBuilder, DesktopDevice_ChatsQuery, DesktopDevice_DesktopBindingsQuery, DesktopDevicesQuery, DevAccessTokenOutput, DexieLiveQueryRef, DisconnectIntegrationMutation, DismissPulseEventMutation, Document, DocumentCatalog, DocumentCatalogConnection, DocumentCatalogQuery, DocumentCatalogSubBuilder, DocumentCatalog_FormatQuery, DocumentCatalogsQuery, DocumentConnection, DocumentContent, DocumentFormat, DocumentQuery, DocumentSubBuilder, Document_ContentsQuery, Document_FileQuery, Document_FormatQuery, Document_Format_CatalogQuery, Document_TablesQuery, DocumentsQuery, DvinaDatabase, DvinaModel, DvinaSdk, Evidence, ExecuteChatImportMutation, ExportQuery, ExportWithInsightIdQuery, FailedSyncEventIngestion, FeedArtifactData, FeedConnection, FeedDatabaseData, FeedDocumentData, FeedInsightData, FeedIntegrationData, FeedItem, FeedItemGenerated, FeedItemQuery, FeedItemSubBuilder, FeedItem_ActionQuery, FeedItem_DataQuery, FeedItemsQuery, FeedLiveContextData, FeedProjectData, FeedPulseData, FeedSendMessageAction, Feedback, File, FileMetaQuery, FileModel, FileQuery, FileUrlsQuery, FinalContentEventOutput, FindFitTierQuery, Folder, FolderConnection, FolderQuery, FoldersQuery, GenerateUploadUriMutation, GetCapabilityQuery, GetDevAccessTokenQuery, GetLimitQuery, GetRemainingQuery, GetTokenUsageByModelQuery, GetTokenUsageHistoryQuery, GetTokenUsageStatusQuery, GetTokenUsageStatus_WindowsQuery, GetTokenUsageStatus_Windows_DayQuery, GetTokenUsageStatus_Windows_FiveHourQuery, GetTokenUsageStatus_Windows_MonthQuery, GetTokenUsageStatus_Windows_WeekQuery, GetUsageQuery, ImportedChatSummaryOutput, InferenceRequestAudit, Insight, InsightConnection, InsightQuery, InsightSubBuilder, Insight_ChatQuery, Insight_Chat_DesktopDeviceQuery, Insight_Chat_ProjectQuery, Insight_ReportMembersQuery, Insight_ReportsQuery, Insight_ThumbnailFileQuery, InsightsQuery, Integration, IntegrationCatalog, IntegrationCatalogConnection, IntegrationCatalogQuery, IntegrationCatalogSubBuilder, IntegrationCatalogToolsQuery, IntegrationCatalog_ProviderQuery, IntegrationCatalogsQuery, IntegrationConnection, IntegrationProvider, IntegrationQuery, IntegrationSubBuilder, Integration_ProviderQuery, Integration_Provider_CatalogQuery, IntegrationsQuery, Interpretation, InterpretationConnection, InterpretationsQuery, Invocation, LegacyCodeMigratedChatSummaryOutput, LegacyCodeMigrationOutput, LiveContext, LiveContextConnection, LiveContextQuery, LiveContextSubBuilder, LiveContext_ItemsQuery, LiveContext_SourceQuery, LiveContext_Source_EvidencesQuery, LiveContextsQuery, LocalSandboxDeviceStatusModel, LocalSandboxDeviceStatusesQuery, MUTATION_CACHE_RULES, MappedDvinaQueryRef, McpAuthUpdateModel, McpAuthUpdatesSubscription, McpClientInformation, McpCodeVerifier, McpServer, McpTokens, McpTool, MessageEndEventOutput, MessageStartEventOutput, MigrateLegacyCodeChatsMutation, ModelTokenUsage, Notification, NotificationConnection, NotificationQuery, NotificationsByReferenceQuery, NotificationsQuery, PRIMARY_KEY_CONFIG, PreviewChatImportMutation, PrivacyStats, PrivacyStatsQuery, ProgressSummaryEventOutput, Project, ProjectConnection, ProjectDesktopBinding, ProjectQuery, ProjectSubBuilder, Project_ChatsQuery, Project_DesktopBindingQuery, Project_DesktopBinding_DeviceQuery, ProjectsQuery, PulseAppSummaryModel, PulseAppSummaryQuery, PulseEvent, PulseEventConnection, PulseEventQuery, PulseEventSubBuilder, PulseEvent_IntegrationQuery, PulseEvent_Integration_ProviderQuery, PulseEventsQuery, PulseTriggerSettingModel, PulseTriggerSettingsQuery, QueryQuery, QueryWithInsightIdQuery, QueryWithMessageIdQuery, ReanalyzeDocumentMutation, ReasoningEventOutput, RefineAgentInstructionMutation, RefineSkillInstructionMutation, RefreshDatabaseSchemaMutation, RefreshInsightMutation, RegisterDesktopDeviceMutation, ReinterpretSourceMutation, ReinterpretSourcesOfuserMutation, Relation, RelocateInsightMutation, RemoveInsightFromReportMutation, Report, ReportConnection, ReportMember, ReportQuery, ReportSubBuilder, Report_InsightsQuery, Report_LayoutQuery, ReportsQuery, ResetWorkspaceMutation, ResolvePulseEventMutation, ResolvedFileUrl, ScheduleWorkspaceDeletionMutation, SendMessageMutation, SetDatabasePrimaryKeyMutation, SkillCatalogItem, SkillCatalogQuery, StreamEventSchemaAnchor, StreamMessageContentOutput, StreamMessageOutput, SyncEngine, SyncEvent, SyncEventCursor, SyncProjectDesktopBindingMutation, TABLE_TO_TYPENAME, TYPENAME_TO_TABLE, Table, TableConnection, TableQuery, TableSubBuilder, Table_DatabaseQuery, Table_Database_EngineQuery, Table_DocumentQuery, Table_Document_ContentsQuery, Table_Document_FileQuery, Table_Document_FormatQuery, Table_FromRelationsQuery, Table_ToRelationsQuery, TablesQuery, TextBlockEventOutput, TextDeltaEventOutput, TokenUsage, TokenUsageUpdatesSubscription, ToolInputDeltaEventOutput, ToolResultArtifactOutput, ToolResultEventOutput, ToolStartEventOutput, UpdateAgentMutation, UpdateArtifactNameMutation, UpdateChatMutation, UpdateDatabaseMutation, UpdateDocumentMutation, UpdateFolderMutation, UpdateInsightInReportMutation, UpdateInsightMutation, UpdateInsightThumbnailMutation, UpdateInterpMutation, UpdateLiveContextMutation, UpdateProjectMutation, UpdatePulseTriggerMutation, UpdateReportMutation, UpdateTableMutation, UpdateUserSkillFileMutation, UpdateUserSkillFolderMutation, UpsertAiProviderSettingMutation, UsageMetaOutput, UsageStatus, UsageWindowsStatusType, UserAiProviderSetting, UserSkillFile, UserSkillFileModel, UserSkillFileQuery, UserSkillFilesQuery, UserSkillFolder, UserSkillFolderModel, UserSkillFolderQuery, UserSkillFoldersQuery, WidgetBlockCompleteEventOutput, WidgetBlockErrorEventOutput, WidgetBlockStartEventOutput, WidgetHtmlDeltaEventOutput, WindowDetailType, WorkspaceDeleteSchedule, WorkspaceDeletionScheduleQuery, closeDatabase, createChatStreamClient, createDvinaClient, createLazySyncEngine, createSseTransport, createWsTransport, deleteDatabase, getOrCreateDatabase, reconstructConnectionNodes, reconstructEntity, uploadFile };
|
|
23164
|
-
//# sourceMappingURL=chunk-
|
|
23165
|
-
//# sourceMappingURL=chunk-
|
|
23209
|
+
//# sourceMappingURL=chunk-YHU4BXFB.js.map
|
|
23210
|
+
//# sourceMappingURL=chunk-YHU4BXFB.js.map
|