@dvina/sdk 4.1.111 → 4.1.173
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/README.md +37 -134
- package/dist/_generated_documents-6WGCKLGZ.js +1 -0
- package/dist/_generated_sdk-7_X86mtI.d.ts +17341 -0
- package/dist/adapters/react/index.d.ts +36 -24
- package/dist/adapters/react/index.js +1 -1
- package/dist/ai/index.d.ts +570 -0
- package/dist/ai/index.js +3 -0
- package/dist/billing/index.d.ts +43 -15
- package/dist/billing/index.js +1 -1
- package/dist/chunk-32KGDH2Q.js +1 -0
- package/dist/chunk-37LLNIGO.js +1 -0
- package/dist/chunk-OCM5W3JH.js +1 -0
- package/dist/chunk-W764PDVJ.js +31 -0
- package/dist/chunk-Z2ADTQ64.js +1 -0
- package/dist/{sync-engine-DYHreGOv.d.ts → connection-ClMdDUce.d.ts} +223 -11
- package/dist/{error-CsVoUTY8.d.ts → error-Bk0Jmuzd.d.ts} +11 -3
- package/dist/index.d.ts +24 -3523
- package/dist/index.js +4 -1
- package/dist/package.json +8 -13
- package/dist/pagination/index.d.ts +18 -4
- package/dist/pagination/index.js +1 -1
- package/dist/{types-Chg8ASmf.d.ts → types-BfiQdtra.d.ts} +1 -9
- package/package.json +26 -21
- package/dist/_generated_documents-HFKWCKIO.js +0 -1
- package/dist/adapters/angular/index.d.ts +0 -254
- package/dist/adapters/angular/index.js +0 -1
- package/dist/chunk-2EXM4BMP.js +0 -1
- package/dist/chunk-5E7LX4YQ.js +0 -1
- package/dist/chunk-G34ETQUN.js +0 -1
- package/dist/chunk-H3TI6B7T.js +0 -1
- package/dist/chunk-IIQ3WGOJ.js +0 -1
- package/dist/chunk-V5FAQENQ.js +0 -5
- package/dist/chunk-YUQTEBYO.js +0 -31
- package/dist/client-Bb2gD6Iz.d.ts +0 -488
- package/dist/client-OupfxAUq.d.ts +0 -7949
- package/dist/index-DoGg4ya_.d.ts +0 -79
- package/dist/inference/index.d.ts +0 -80
- package/dist/inference/index.js +0 -1
package/dist/package.json
CHANGED
|
@@ -8,10 +8,6 @@
|
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
9
|
"default": "./index.js"
|
|
10
10
|
},
|
|
11
|
-
"./angular": {
|
|
12
|
-
"types": "./adapters/angular/index.d.ts",
|
|
13
|
-
"default": "./adapters/angular/index.js"
|
|
14
|
-
},
|
|
15
11
|
"./react": {
|
|
16
12
|
"types": "./adapters/react/index.d.ts",
|
|
17
13
|
"default": "./adapters/react/index.js"
|
|
@@ -20,30 +16,29 @@
|
|
|
20
16
|
"types": "./pagination/index.d.ts",
|
|
21
17
|
"default": "./pagination/index.js"
|
|
22
18
|
},
|
|
23
|
-
"./inference": {
|
|
24
|
-
"types": "./inference/index.d.ts",
|
|
25
|
-
"default": "./inference/index.js"
|
|
26
|
-
},
|
|
27
19
|
"./billing": {
|
|
28
20
|
"types": "./billing/index.d.ts",
|
|
29
21
|
"default": "./billing/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./ai": {
|
|
24
|
+
"types": "./ai/index.d.ts",
|
|
25
|
+
"default": "./ai/index.js"
|
|
30
26
|
}
|
|
31
27
|
},
|
|
32
28
|
"dependencies": {
|
|
33
29
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
34
30
|
"dexie": "^4.3.0",
|
|
35
|
-
"graphql": "^16.9.0"
|
|
36
|
-
"graphql-ws": "^6.0.0"
|
|
31
|
+
"graphql": "^16.9.0"
|
|
37
32
|
},
|
|
38
33
|
"peerDependencies": {
|
|
39
|
-
"
|
|
34
|
+
"ai": "^7.0.0",
|
|
40
35
|
"react": ">=18.0.0"
|
|
41
36
|
},
|
|
42
37
|
"peerDependenciesMeta": {
|
|
43
|
-
"
|
|
38
|
+
"react": {
|
|
44
39
|
"optional": true
|
|
45
40
|
},
|
|
46
|
-
"
|
|
41
|
+
"ai": {
|
|
47
42
|
"optional": true
|
|
48
43
|
}
|
|
49
44
|
}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { f as Connection } from '../connection-ClMdDUce.js';
|
|
2
|
+
export { A as AbstractConnection, P as PageInfo, r as defaultConnection } from '../connection-ClMdDUce.js';
|
|
3
|
+
import '../types-BfiQdtra.js';
|
|
3
4
|
import 'graphql';
|
|
4
|
-
import '../sync-engine-DYHreGOv.js';
|
|
5
5
|
import 'dexie';
|
|
6
|
-
import '../error-
|
|
6
|
+
import '../error-Bk0Jmuzd.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Extract all nodes from a connection.
|
|
10
|
+
*/
|
|
11
|
+
declare function extractNodes<T>(connection: Connection<T>): T[];
|
|
12
|
+
/**
|
|
13
|
+
* Merge two connections into a new connection. Appends the second connection's
|
|
14
|
+
* nodes after the first's. Uses the second connection's end cursor and hasNextPage.
|
|
15
|
+
*
|
|
16
|
+
* Neither input connection is modified.
|
|
17
|
+
*/
|
|
18
|
+
declare function mergeConnections<T>(first: Connection<T>, second: Connection<T>): Connection<T>;
|
|
19
|
+
|
|
20
|
+
export { Connection, extractNodes, mergeConnections };
|
package/dist/pagination/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{d as AbstractConnection,e as Connection,c as PageInfo,b as defaultConnection,f as extractNodes,g as mergeConnections}from'../chunk-OCM5W3JH.js';import'../chunk-EK7ODJWE.js';
|
|
@@ -22,14 +22,6 @@ interface MutationOptions {
|
|
|
22
22
|
* @template T - The expected response data shape
|
|
23
23
|
*/
|
|
24
24
|
type DvinaRequest = <T>(document: DocumentNode, variables?: Record<string, unknown>, options?: FetchOptions) => Promise<T>;
|
|
25
|
-
/**
|
|
26
|
-
* Subscription transport abstraction.
|
|
27
|
-
* Returns an `AsyncIterable` that yields values as the server pushes them
|
|
28
|
-
* over WebSocket (graphql-ws protocol).
|
|
29
|
-
*
|
|
30
|
-
* @template T - The expected payload shape per emission
|
|
31
|
-
*/
|
|
32
|
-
type DvinaSubscribe = <T>(document: DocumentNode, variables?: Record<string, unknown>) => AsyncIterable<T>;
|
|
33
25
|
/**
|
|
34
26
|
* Store-reactive query reference. Implements `AsyncIterable` so it can be consumed
|
|
35
27
|
* with `for await...of` in any JavaScript environment, and converted to framework
|
|
@@ -113,4 +105,4 @@ interface PageInfoData {
|
|
|
113
105
|
endCursor?: string | null;
|
|
114
106
|
}
|
|
115
107
|
|
|
116
|
-
export type { ConnectionVariables as C,
|
|
108
|
+
export type { ConnectionVariables as C, DvinaQueryRef as D, FetchOptions as F, MutationOptions as M, PageInfoData as P, WithIncludes as W, ConnectionWithNodes as a, DvinaAsyncRef as b, DvinaRequest as c };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dvina/sdk",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.173",
|
|
4
4
|
"description": "Type-safe SDK for the Dvina GraphQL API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"default": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
-
"./angular": {
|
|
13
|
-
"types": "./dist/adapters/angular/index.d.ts",
|
|
14
|
-
"default": "./dist/adapters/angular/index.js"
|
|
15
|
-
},
|
|
16
12
|
"./react": {
|
|
17
13
|
"types": "./dist/adapters/react/index.d.ts",
|
|
18
14
|
"default": "./dist/adapters/react/index.js"
|
|
@@ -21,13 +17,13 @@
|
|
|
21
17
|
"types": "./dist/pagination/index.d.ts",
|
|
22
18
|
"default": "./dist/pagination/index.js"
|
|
23
19
|
},
|
|
24
|
-
"./inference": {
|
|
25
|
-
"types": "./dist/inference/index.d.ts",
|
|
26
|
-
"default": "./dist/inference/index.js"
|
|
27
|
-
},
|
|
28
20
|
"./billing": {
|
|
29
21
|
"types": "./dist/billing/index.d.ts",
|
|
30
22
|
"default": "./dist/billing/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./ai": {
|
|
25
|
+
"types": "./dist/ai/index.d.ts",
|
|
26
|
+
"default": "./dist/ai/index.js"
|
|
31
27
|
}
|
|
32
28
|
},
|
|
33
29
|
"files": [
|
|
@@ -35,6 +31,7 @@
|
|
|
35
31
|
],
|
|
36
32
|
"scripts": {
|
|
37
33
|
"build": "tsup",
|
|
34
|
+
"build:swap": "node scripts/build-swap.mjs",
|
|
38
35
|
"build:codegen": "pnpm --filter @dvina/codegen-doc run build && pnpm --filter @dvina/codegen-sdk run build && pnpm --filter @dvina/codegen-test run build",
|
|
39
36
|
"build:workspace": "pnpm run generate:workspace && pnpm run build",
|
|
40
37
|
"build:types": "tsc --noEmit",
|
|
@@ -43,11 +40,12 @@
|
|
|
43
40
|
"generate:sdk": "graphql-codegen --config codegen.sdk.yml",
|
|
44
41
|
"generate:sdk:standalone": "tsx codegen/codegen-sdk/src/generate.ts",
|
|
45
42
|
"generate:billing": "graphql-codegen --config codegen.billing.yml",
|
|
43
|
+
"generate:messages": "node scripts/generate-messages.mjs",
|
|
46
44
|
"generate:test": "graphql-codegen --config codegen.test.yml",
|
|
47
|
-
"generate": "pnpm run generate:doc && pnpm run generate:sdk && pnpm run generate:billing && pnpm run generate:test",
|
|
45
|
+
"generate": "pnpm run generate:doc && pnpm run generate:sdk && pnpm run generate:billing && pnpm run generate:messages && pnpm run generate:test",
|
|
48
46
|
"generate:workspace": "pnpm run build:codegen && pnpm run generate",
|
|
49
47
|
"test": "vitest run",
|
|
50
|
-
"lint": "eslint src
|
|
48
|
+
"lint": "eslint src",
|
|
51
49
|
"type-check": "tsc --noEmit"
|
|
52
50
|
},
|
|
53
51
|
"keywords": [
|
|
@@ -61,26 +59,23 @@
|
|
|
61
59
|
"author": "Dvina Inc.",
|
|
62
60
|
"license": "MIT",
|
|
63
61
|
"peerDependencies": {
|
|
64
|
-
"
|
|
62
|
+
"ai": "^7.0.0",
|
|
65
63
|
"react": ">=18.0.0"
|
|
66
64
|
},
|
|
67
65
|
"peerDependenciesMeta": {
|
|
68
|
-
"
|
|
66
|
+
"react": {
|
|
69
67
|
"optional": true
|
|
70
68
|
},
|
|
71
|
-
"
|
|
69
|
+
"ai": {
|
|
72
70
|
"optional": true
|
|
73
71
|
}
|
|
74
72
|
},
|
|
75
73
|
"dependencies": {
|
|
76
74
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
77
75
|
"dexie": "^4.3.0",
|
|
78
|
-
"graphql": "^16.9.0"
|
|
79
|
-
"graphql-ws": "^6.0.0"
|
|
76
|
+
"graphql": "^16.9.0"
|
|
80
77
|
},
|
|
81
78
|
"devDependencies": {
|
|
82
|
-
"@angular/core": "22.1.5",
|
|
83
|
-
"@apollo/client": "^3.11.0",
|
|
84
79
|
"@dvina/codegen-doc": "workspace:*",
|
|
85
80
|
"@dvina/codegen-sdk": "workspace:*",
|
|
86
81
|
"@dvina/codegen-test": "workspace:*",
|
|
@@ -90,18 +85,28 @@
|
|
|
90
85
|
"@graphql-codegen/typescript": "^2.8.0",
|
|
91
86
|
"@graphql-codegen/typescript-operations": "^2.5.0",
|
|
92
87
|
"@graphql-codegen/visitor-plugin-common": "^2.13.0",
|
|
93
|
-
"@types/node": "^20.11.16",
|
|
94
|
-
"@types/react": "^19.2.14",
|
|
95
88
|
"@graphql-tools/mock": "^9.0.0",
|
|
96
89
|
"@graphql-tools/schema": "^10.0.0",
|
|
90
|
+
"@types/node": "^20.11.16",
|
|
91
|
+
"@types/react": "^19.2.14",
|
|
92
|
+
"ai": "^7.0.128",
|
|
93
|
+
"eslint": "^9.39.5",
|
|
94
|
+
"eslint-config-prettier": "^10.1.8",
|
|
95
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
97
96
|
"fake-indexeddb": "^6.0.0",
|
|
98
97
|
"get-port": "^7.1.0",
|
|
99
|
-
"react": "^19.
|
|
98
|
+
"react": "^19.3.0",
|
|
100
99
|
"tsup": "^8.0.2",
|
|
101
100
|
"typescript": "^5.3.3",
|
|
101
|
+
"typescript-eslint": "^8.71.0",
|
|
102
102
|
"vitest": "^4.0.17"
|
|
103
103
|
},
|
|
104
104
|
"publishConfig": {
|
|
105
105
|
"access": "public"
|
|
106
|
+
},
|
|
107
|
+
"repository": {
|
|
108
|
+
"type": "git",
|
|
109
|
+
"url": "git+https://github.com/kantist/dvina.git",
|
|
110
|
+
"directory": "projects/sdk"
|
|
106
111
|
}
|
|
107
112
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{Mg as AbortChatDocument,na as ActionAvgAggregateFragmentDoc,oa as ActionCountAggregateFragmentDoc,ma as ActionFragmentDoc,pa as ActionMaxAggregateFragmentDoc,qa as ActionMinAggregateFragmentDoc,ra as ActionSumAggregateFragmentDoc,b as ActionType,c as ActiveWindowType,Ng as AddInsightToReportDocument,Og as AddMcpServerDocument,ta as AgentConnectionFragmentDoc,ua as AgentCountAggregateFragmentDoc,oi as AgentDocument,sa as AgentFragmentDoc,va as AgentMaxAggregateFragmentDoc,wa as AgentMinAggregateFragmentDoc,d as AgentOrderByRelevanceFieldEnum,pi as Agent_ChatsDocument,qi as AgentsDocument,ri as AiProviderSettingDocument,a as AiResourceType,ya as ArtifactConnectionFragmentDoc,za as ArtifactCountAggregateFragmentDoc,si as ArtifactDocument,xa as ArtifactFragmentDoc,e as ArtifactKind,Aa as ArtifactMaxAggregateFragmentDoc,Ba as ArtifactMinAggregateFragmentDoc,f as ArtifactOrderByRelevanceFieldEnum,ti as Artifact_ChatDocument,ui as Artifact_Chat_DesktopDeviceDocument,vi as Artifact_Chat_InsightDocument,wi as Artifact_Chat_ProjectDocument,xi as Artifact_FileDocument,yi as Artifact_MessageDocument,zi as Artifact_Message_ChatDocument,Ai as Artifact_Message_ContentsDocument,Bi as Artifact_Message_FeedbackDocument,Ci as ArtifactsDocument,vf as AudioEventOutputFragmentDoc,Pg as CancelOauthFlowDocument,Qg as CancelWorkspaceDeletionDocument,Da as CandidateAvgAggregateFragmentDoc,Ea as CandidateCountAggregateFragmentDoc,Ga as CandidateEvidenceCountAggregateFragmentDoc,Fa as CandidateEvidenceFragmentDoc,Ha as CandidateEvidenceMaxAggregateFragmentDoc,Ia as CandidateEvidenceMinAggregateFragmentDoc,Ca as CandidateFragmentDoc,Ka as CandidateGenerationRejectionCountAggregateFragmentDoc,Ja as CandidateGenerationRejectionFragmentDoc,La as CandidateGenerationRejectionMaxAggregateFragmentDoc,Ma as CandidateGenerationRejectionMinAggregateFragmentDoc,Oa as CandidateGenerationRejectionNeighbourAvgAggregateFragmentDoc,Pa as CandidateGenerationRejectionNeighbourCountAggregateFragmentDoc,Na as CandidateGenerationRejectionNeighbourFragmentDoc,Qa as CandidateGenerationRejectionNeighbourMaxAggregateFragmentDoc,Ra as CandidateGenerationRejectionNeighbourMinAggregateFragmentDoc,Sa as CandidateGenerationRejectionNeighbourSumAggregateFragmentDoc,Ta as CandidateMaxAggregateFragmentDoc,Ua as CandidateMinAggregateFragmentDoc,Wa as CandidateScheduleStateAvgAggregateFragmentDoc,Xa as CandidateScheduleStateCountAggregateFragmentDoc,Va as CandidateScheduleStateFragmentDoc,Ya as CandidateScheduleStateMaxAggregateFragmentDoc,Za as CandidateScheduleStateMinAggregateFragmentDoc,_a as CandidateScheduleStateSumAggregateFragmentDoc,ab as CandidateSignalsAvgAggregateFragmentDoc,bb as CandidateSignalsCountAggregateFragmentDoc,$a as CandidateSignalsFragmentDoc,cb as CandidateSignalsMaxAggregateFragmentDoc,db as CandidateSignalsMinAggregateFragmentDoc,eb as CandidateSignalsSumAggregateFragmentDoc,g as CandidateState,fb as CandidateSumAggregateFragmentDoc,h as CapabilityType,hb as ChatConnectionFragmentDoc,ib as ChatCountAggregateFragmentDoc,Di as ChatDocument,gb as ChatFragmentDoc,kb as ChatImportExecuteOutputFragmentDoc,lb as ChatImportPreviewOutputFragmentDoc,mb as ChatMaxAggregateFragmentDoc,qb as ChatMessageConnectionFragmentDoc,rb as ChatMessageCountAggregateFragmentDoc,Oi as ChatMessageDocument,pb as ChatMessageFragmentDoc,i as ChatMessageFromEnum,sb as ChatMessageMaxAggregateFragmentDoc,tb as ChatMessageMinAggregateFragmentDoc,j as ChatMessageOrderByRelevanceFieldEnum,Pi as ChatMessage_ArtifactsDocument,Qi as ChatMessage_ChatDocument,Ri as ChatMessage_Chat_DesktopDeviceDocument,Si as ChatMessage_Chat_InsightDocument,Ti as ChatMessage_Chat_ProjectDocument,Ui as ChatMessage_ContentsDocument,Vi as ChatMessage_Contents_AgentDocument,Wi as ChatMessage_Contents_MasksDocument,Xi as ChatMessage_FeedbackDocument,Yi as ChatMessagesDocument,ub as ChatMinAggregateFragmentDoc,k as ChatOrderByRelevanceFieldEnum,l as ChatSourceImportFidelityEnum,m as ChatSourceImportModeEnum,n as ChatSourceProviderEnum,wf as ChatTitleEventOutputFragmentDoc,o as ChatWorkspaceMode,Ei as Chat_AgentsDocument,Fi as Chat_ArtifactsDocument,Gi as Chat_DesktopDeviceDocument,Hi as Chat_DesktopDevice_DesktopBindingsDocument,Ii as Chat_InsightDocument,Ji as Chat_Insight_ReportMembersDocument,Ki as Chat_Insight_ThumbnailFileDocument,Li as Chat_MessagesDocument,Mi as Chat_ProjectDocument,Ni as Chat_Project_DesktopBindingDocument,Zi as ChatsDocument,Rg as CloseActiveTabsDocument,Sg as ConnectIntegrationDocument,Tg as ConsumePulseEventsDocument,nb as ContentBlockAgentOutputFragmentDoc,vb as ContentBlockAvgAggregateFragmentDoc,wb as ContentBlockCountAggregateFragmentDoc,ob as ContentBlockFragmentDoc,xb as ContentBlockMaxAggregateFragmentDoc,yb as ContentBlockMinAggregateFragmentDoc,zb as ContentBlockSumAggregateFragmentDoc,p as ContentBlockType,Bb as ContentMaskCountAggregateFragmentDoc,Ab as ContentMaskFragmentDoc,Cb as ContentMaskMaxAggregateFragmentDoc,Db as ContentMaskMinAggregateFragmentDoc,xf as ContextUsageEventOutputFragmentDoc,Ug as ContinueImportedChatDocument,Vg as ContinueInterpretationDocument,Wg as CreateAgentDocument,Xg as CreateChatDocument,Yg as CreateDatabaseDocument,Zg as CreateDocumentDocument,_g as CreateFeedbackDocument,$g as CreateFolderDocument,ah as CreateInsightDocument,bh as CreateIntegrationDocument,Eb as CreateIntegrationOutputFragmentDoc,ch as CreateProjectDocument,dh as CreateReportDocument,eh as CreateTableDocument,fh as CreateUserSkillFileDocument,gh as CreateUserSkillFolderDocument,Gb as CubeModelCountAggregateFragmentDoc,Fb as CubeModelFragmentDoc,Hb as CubeModelMaxAggregateFragmentDoc,Ib as CubeModelMinAggregateFragmentDoc,Jb as DatabaseCatalogAvgAggregateFragmentDoc,Lb as DatabaseCatalogConnectionFragmentDoc,Mb as DatabaseCatalogCountAggregateFragmentDoc,cj as DatabaseCatalogDocument,Kb as DatabaseCatalogFragmentDoc,Nb as DatabaseCatalogMaxAggregateFragmentDoc,Ob as DatabaseCatalogMinAggregateFragmentDoc,q as DatabaseCatalogOrderByRelevanceFieldEnum,Pb as DatabaseCatalogSumAggregateFragmentDoc,dj as DatabaseCatalog_EngineDocument,ej as DatabaseCatalogsDocument,Rb as DatabaseConnectionFragmentDoc,Sb as DatabaseCountAggregateFragmentDoc,_i as DatabaseDocument,Ub as DatabaseEngineCountAggregateFragmentDoc,Tb as DatabaseEngineFragmentDoc,Vb as DatabaseEngineMaxAggregateFragmentDoc,Wb as DatabaseEngineMinAggregateFragmentDoc,Qb as DatabaseFragmentDoc,Xb as DatabaseMaxAggregateFragmentDoc,Yb as DatabaseMinAggregateFragmentDoc,r as DatabaseOrderByRelevanceFieldEnum,fj as DatabaseSchemaDocument,$i as Database_EngineDocument,aj as Database_Engine_CatalogDocument,bj as Database_TablesDocument,gj as DatabasesDocument,_b as DeepAnalysisUsageAvgAggregateFragmentDoc,$b as DeepAnalysisUsageCountAggregateFragmentDoc,Zb as DeepAnalysisUsageFragmentDoc,ac as DeepAnalysisUsageMaxAggregateFragmentDoc,bc as DeepAnalysisUsageMinAggregateFragmentDoc,cc as DeepAnalysisUsageSumAggregateFragmentDoc,hh as DeleteAgentDocument,ih as DeleteAiProviderSettingDocument,jh as DeleteArtifactDocument,kh as DeleteChatDocument,lh as DeleteDatabaseDocument,mh as DeleteDocumentDocument,nh as DeleteFolderDocument,oh as DeleteInsightDocument,ph as DeleteInsightsDocument,qh as DeleteIntegrationDocument,rh as DeleteProjectDocument,sh as DeleteReportDocument,th as DeleteSavedAiProviderModelDocument,uh as DeleteTableDocument,vh as DeleteUserSkillFileDocument,wh as DeleteUserSkillFolderDocument,dc as DesktopDeviceAvgAggregateFragmentDoc,fc as DesktopDeviceConnectionFragmentDoc,gc as DesktopDeviceCountAggregateFragmentDoc,hj as DesktopDeviceDocument,ec as DesktopDeviceFragmentDoc,hc as DesktopDeviceMaxAggregateFragmentDoc,ic as DesktopDeviceMinAggregateFragmentDoc,s as DesktopDeviceOrderByRelevanceFieldEnum,jc as DesktopDeviceSumAggregateFragmentDoc,ij as DesktopDevice_ChatsDocument,jj as DesktopDevice_DesktopBindingsDocument,kj as DesktopDevice_DesktopBindings_ProjectDocument,lj as DesktopDevicesDocument,kc as DevAccessTokenOutputFragmentDoc,xh as DisconnectIntegrationDocument,yh as DismissPulseEventDocument,lc as DocumentCatalogAvgAggregateFragmentDoc,nc as DocumentCatalogConnectionFragmentDoc,oc as DocumentCatalogCountAggregateFragmentDoc,sj as DocumentCatalogDocument,mc as DocumentCatalogFragmentDoc,pc as DocumentCatalogMaxAggregateFragmentDoc,qc as DocumentCatalogMinAggregateFragmentDoc,t as DocumentCatalogOrderByRelevanceFieldEnum,rc as DocumentCatalogSumAggregateFragmentDoc,tj as DocumentCatalog_FormatDocument,uj as DocumentCatalogsDocument,tc as DocumentConnectionFragmentDoc,vc as DocumentContentAvgAggregateFragmentDoc,wc as DocumentContentCountAggregateFragmentDoc,uc as DocumentContentFragmentDoc,xc as DocumentContentMaxAggregateFragmentDoc,yc as DocumentContentMinAggregateFragmentDoc,zc as DocumentContentSumAggregateFragmentDoc,Ac as DocumentCountAggregateFragmentDoc,mj as DocumentDocument,Cc as DocumentFormatCountAggregateFragmentDoc,Bc as DocumentFormatFragmentDoc,Dc as DocumentFormatMaxAggregateFragmentDoc,Ec as DocumentFormatMinAggregateFragmentDoc,sc as DocumentFragmentDoc,Fc as DocumentMaxAggregateFragmentDoc,Gc as DocumentMinAggregateFragmentDoc,u as DocumentOrderByRelevanceFieldEnum,nj as Document_ContentsDocument,oj as Document_FileDocument,pj as Document_FormatDocument,qj as Document_Format_CatalogDocument,rj as Document_TablesDocument,vj as DocumentsDocument,v as EntitlementTier,Ic as EvidenceCountAggregateFragmentDoc,Hc as EvidenceFragmentDoc,Jc as EvidenceMaxAggregateFragmentDoc,Kc as EvidenceMinAggregateFragmentDoc,zh as ExecuteChatImportDocument,wj as ExportDocument,xj as ExportWithInsightIdDocument,Mc as FailedSyncEventIngestionAvgAggregateFragmentDoc,Nc as FailedSyncEventIngestionCountAggregateFragmentDoc,Lc as FailedSyncEventIngestionFragmentDoc,Oc as FailedSyncEventIngestionMaxAggregateFragmentDoc,Pc as FailedSyncEventIngestionMinAggregateFragmentDoc,Qc as FailedSyncEventIngestionSumAggregateFragmentDoc,w as FeedActionType,Sc as FeedArtifactDataFragmentDoc,$c as FeedConnectionFragmentDoc,Tc as FeedDatabaseDataFragmentDoc,Uc as FeedDocumentDataFragmentDoc,Vc as FeedInsightDataFragmentDoc,Wc as FeedIntegrationDataFragmentDoc,ad as FeedItemCountAggregateFragmentDoc,yj as FeedItemDocument,_c as FeedItemFragmentDoc,bd as FeedItemGeneratedFragmentDoc,x as FeedItemKind,cd as FeedItemMaxAggregateFragmentDoc,dd as FeedItemMinAggregateFragmentDoc,y as FeedItemOrderByRelevanceFieldEnum,zj as FeedItem_ActionDocument,Aj as FeedItem_DataDocument,Bj as FeedItemsDocument,Xc as FeedLiveContextDataFragmentDoc,Yc as FeedProjectDataFragmentDoc,Zc as FeedPulseDataFragmentDoc,Rc as FeedSendMessageActionFragmentDoc,fd as FeedbackCountAggregateFragmentDoc,ed as FeedbackFragmentDoc,gd as FeedbackMaxAggregateFragmentDoc,hd as FeedbackMinAggregateFragmentDoc,z as FeedbackOrderByRelevanceFieldEnum,A as FeedbackType,jd as FileAvgAggregateFragmentDoc,kd as FileCountAggregateFragmentDoc,Cj as FileDocument,id as FileFragmentDoc,ld as FileMaxAggregateFragmentDoc,Dj as FileMetaDocument,md as FileMinAggregateFragmentDoc,nd as FileModelFragmentDoc,B as FileOrderByRelevanceFieldEnum,od as FileSumAggregateFragmentDoc,C as FileUrlVariant,Ej as FileUrlsDocument,Cf as FinalContentEventOutputFragmentDoc,Fj as FindFitTierDocument,qd as FolderConnectionFragmentDoc,rd as FolderCountAggregateFragmentDoc,Gj as FolderDocument,pd as FolderFragmentDoc,sd as FolderMaxAggregateFragmentDoc,td as FolderMinAggregateFragmentDoc,D as FolderOrderByRelevanceFieldEnum,Hj as FoldersDocument,Ah as GenerateUploadUriDocument,Ij as GetCapabilityDocument,Jj as GetDevAccessTokenDocument,Kj as GetLimitDocument,Lj as GetRemainingDocument,Mj as GetTokenUsageByModelDocument,Nj as GetTokenUsageHistoryDocument,Oj as GetTokenUsageStatusDocument,Pj as GetTokenUsageStatus_WindowsDocument,Qj as GetTokenUsageStatus_Windows_DayDocument,Rj as GetTokenUsageStatus_Windows_FiveHourDocument,Sj as GetTokenUsageStatus_Windows_MonthDocument,Tj as GetTokenUsageStatus_Windows_WeekDocument,Uj as GetUsageDocument,jb as ImportedChatSummaryOutputFragmentDoc,vd as InferenceRequestAuditAvgAggregateFragmentDoc,wd as InferenceRequestAuditCountAggregateFragmentDoc,ud as InferenceRequestAuditFragmentDoc,xd as InferenceRequestAuditMaxAggregateFragmentDoc,yd as InferenceRequestAuditMinAggregateFragmentDoc,zd as InferenceRequestAuditSumAggregateFragmentDoc,Bd as InsightConnectionFragmentDoc,Cd as InsightCountAggregateFragmentDoc,Vj as InsightDocument,Ad as InsightFragmentDoc,Dd as InsightMaxAggregateFragmentDoc,Ed as InsightMinAggregateFragmentDoc,E as InsightOrderByRelevanceFieldEnum,Wj as Insight_ChatDocument,Xj as Insight_Chat_DesktopDeviceDocument,Yj as Insight_Chat_ProjectDocument,Zj as Insight_ReportMembersDocument,_j as Insight_ReportMembers_ReportDocument,$j as Insight_ReportsDocument,ak as Insight_ThumbnailFileDocument,bk as InsightsDocument,Fd as IntegrationAvgAggregateFragmentDoc,Gd as IntegrationCatalogAvgAggregateFragmentDoc,Id as IntegrationCatalogConnectionFragmentDoc,Jd as IntegrationCatalogCountAggregateFragmentDoc,fk as IntegrationCatalogDocument,Hd as IntegrationCatalogFragmentDoc,Kd as IntegrationCatalogMaxAggregateFragmentDoc,Ld as IntegrationCatalogMinAggregateFragmentDoc,F as IntegrationCatalogOrderByRelevanceFieldEnum,Md as IntegrationCatalogSumAggregateFragmentDoc,hk as IntegrationCatalogToolsDocument,gk as IntegrationCatalog_ProviderDocument,ik as IntegrationCatalogsDocument,Od as IntegrationConnectionFragmentDoc,Pd as IntegrationCountAggregateFragmentDoc,ck as IntegrationDocument,Nd as IntegrationFragmentDoc,Qd as IntegrationMaxAggregateFragmentDoc,Rd as IntegrationMinAggregateFragmentDoc,G as IntegrationOrderByRelevanceFieldEnum,Td as IntegrationProviderCountAggregateFragmentDoc,Sd as IntegrationProviderFragmentDoc,Ud as IntegrationProviderMaxAggregateFragmentDoc,Vd as IntegrationProviderMinAggregateFragmentDoc,H as IntegrationStatus,Wd as IntegrationSumAggregateFragmentDoc,dk as Integration_ProviderDocument,ek as Integration_Provider_CatalogDocument,jk as IntegrationsDocument,Yd as InterpretationConnectionFragmentDoc,Zd as InterpretationCountAggregateFragmentDoc,Xd as InterpretationFragmentDoc,_d as InterpretationMaxAggregateFragmentDoc,$d as InterpretationMinAggregateFragmentDoc,I as InterpretationOrderByRelevanceFieldEnum,J as InterpretationType,kk as InterpretationsDocument,Df as InterruptEventOutputFragmentDoc,be as InvocationAvgAggregateFragmentDoc,ce as InvocationCountAggregateFragmentDoc,ae as InvocationFragmentDoc,de as InvocationMaxAggregateFragmentDoc,ee as InvocationMinAggregateFragmentDoc,fe as InvocationSumAggregateFragmentDoc,K as LimitType,he as LiveContextConnectionFragmentDoc,ie as LiveContextCountAggregateFragmentDoc,lk as LiveContextDocument,ge as LiveContextFragmentDoc,je as LiveContextMaxAggregateFragmentDoc,ke as LiveContextMinAggregateFragmentDoc,L as LiveContextOrderByRelevanceFieldEnum,M as LiveContextStatus,mk as LiveContext_ItemsDocument,nk as LiveContext_SourceDocument,ok as LiveContext_Source_EvidencesDocument,pk as LiveContext_Source_SignalsDocument,qk as LiveContextsDocument,N as LocalSandboxDeviceConnectionState,le as LocalSandboxDeviceStatusModelFragmentDoc,rk as LocalSandboxDeviceStatusesDocument,sk as ManagedChatModelsDocument,O as McpAuthPhase,me as McpAuthUpdateModelFragmentDoc,gl as McpAuthUpdatesDocument,oe as McpClientInformationCountAggregateFragmentDoc,ne as McpClientInformationFragmentDoc,pe as McpClientInformationMaxAggregateFragmentDoc,qe as McpClientInformationMinAggregateFragmentDoc,se as McpCodeVerifierCountAggregateFragmentDoc,re as McpCodeVerifierFragmentDoc,te as McpCodeVerifierMaxAggregateFragmentDoc,ue as McpCodeVerifierMinAggregateFragmentDoc,we as McpServerCountAggregateFragmentDoc,ve as McpServerFragmentDoc,xe as McpServerMaxAggregateFragmentDoc,ye as McpServerMinAggregateFragmentDoc,ze as McpServerTestOutputFragmentDoc,Be as McpTokensCountAggregateFragmentDoc,Ae as McpTokensFragmentDoc,Ce as McpTokensMaxAggregateFragmentDoc,De as McpTokensMinAggregateFragmentDoc,Fe as McpToolCountAggregateFragmentDoc,Ee as McpToolFragmentDoc,Ge as McpToolMaxAggregateFragmentDoc,He as McpToolMinAggregateFragmentDoc,Ef as MessageEndEventOutputFragmentDoc,Ff as MessageStartEventOutputFragmentDoc,Ie as ModelTokenUsageFragmentDoc,P as NotificationCategory,Ke as NotificationConnectionFragmentDoc,Le as NotificationCountAggregateFragmentDoc,tk as NotificationDocument,Je as NotificationFragmentDoc,Me as NotificationMaxAggregateFragmentDoc,Ne as NotificationMinAggregateFragmentDoc,Q as NotificationOrderByRelevanceFieldEnum,R as NotificationPriority,S as NotificationStatus,vk as NotificationsByReferenceDocument,uk as NotificationsDocument,T as NullsOrder,Bh as OpenActiveTabDocument,Oe as PageInfoFragmentDoc,U as Presentation,Ch as PreviewChatImportDocument,wk as PrivacyStatsDocument,Pe as PrivacyStatsFragmentDoc,Af as PrivacyStatsOutputFragmentDoc,xk as PrivateMcpServersDocument,Re as ProjectConnectionFragmentDoc,Se as ProjectCountAggregateFragmentDoc,Ue as ProjectDesktopBindingCountAggregateFragmentDoc,Te as ProjectDesktopBindingFragmentDoc,Ve as ProjectDesktopBindingMaxAggregateFragmentDoc,We as ProjectDesktopBindingMinAggregateFragmentDoc,V as ProjectDesktopBindingOrderByRelevanceFieldEnum,W as ProjectDesktopContextKind,yk as ProjectDocument,Qe as ProjectFragmentDoc,Xe as ProjectMaxAggregateFragmentDoc,Ye as ProjectMinAggregateFragmentDoc,X as ProjectOrderByRelevanceFieldEnum,Y as ProjectSource,zk as Project_ChatsDocument,Ak as Project_DesktopBindingDocument,Bk as Project_DesktopBinding_DeviceDocument,Ck as ProjectsDocument,Dk as PulseAppSummaryDocument,Ze as PulseAppSummaryModelFragmentDoc,$e as PulseEventConnectionFragmentDoc,af as PulseEventCountAggregateFragmentDoc,Ek as PulseEventDocument,_e as PulseEventFragmentDoc,Z as PulseEventKind,bf as PulseEventMaxAggregateFragmentDoc,cf as PulseEventMinAggregateFragmentDoc,_ as PulseEventOrderByRelevanceFieldEnum,$ as PulseEventPriority,Fk as PulseEvent_IntegrationDocument,Gk as PulseEvent_Integration_ProviderDocument,Hk as PulseEventsDocument,df as PulseTriggerSettingModelFragmentDoc,Ik as PulseTriggerSettingsDocument,Jk as QueryDocument,aa as QueryMode,Kk as QueryWithInsightIdDocument,Lk as QueryWithMessageIdDocument,Dh as ReanalyzeDocumentDocument,ba as ReasoningEffort,Gf as ReasoningEventOutputFragmentDoc,Eh as RefineAgentInstructionDocument,Fh as RefineSkillInstructionDocument,Gh as RefreshDatabaseSchemaDocument,Hh as RefreshInsightDocument,Ih as RegisterDesktopDeviceDocument,Jh as ReinterpretSourceDocument,Kh as ReinterpretSourcesOfuserDocument,ff as RelationCountAggregateFragmentDoc,ef as RelationFragmentDoc,gf as RelationMaxAggregateFragmentDoc,hf as RelationMinAggregateFragmentDoc,ca as RelationType,Lh as RelocateInsightDocument,Mh as RemoveInsightFromReportDocument,Nh as RemoveMcpServerDocument,jf as ReportConnectionFragmentDoc,kf as ReportCountAggregateFragmentDoc,Mk as ReportDocument,if as ReportFragmentDoc,lf as ReportMaxAggregateFragmentDoc,nf as ReportMemberAvgAggregateFragmentDoc,of as ReportMemberCountAggregateFragmentDoc,mf as ReportMemberFragmentDoc,pf as ReportMemberMaxAggregateFragmentDoc,qf as ReportMemberMinAggregateFragmentDoc,da as ReportMemberSize,rf as ReportMemberSumAggregateFragmentDoc,sf as ReportMinAggregateFragmentDoc,ea as ReportOrderByRelevanceFieldEnum,Nk as Report_InsightsDocument,Ok as Report_LayoutDocument,Pk as Report_Layout_InsightDocument,Qk as ReportsDocument,Oh as ResetWorkspaceDocument,Ph as ResolvePulseEventDocument,tf as ResolvedFileUrlFragmentDoc,Qh as ResumeMessageDocument,Rh as ScheduleWorkspaceDeletionDocument,Sh as SendMessageDocument,fa as SendMessageModel,Th as SetDatabasePrimaryKeyDocument,Rk as SkillCatalogDocument,uf as SkillCatalogItemFragmentDoc,ga as SkillCatalogSource,ha as SortOrder,Rf as StreamEventSchemaAnchorFragmentDoc,yf as StreamMessageContentOutputFragmentDoc,zf as StreamMessageOutputFragmentDoc,Tf as SyncEventAvgAggregateFragmentDoc,Uf as SyncEventCountAggregateFragmentDoc,Wf as SyncEventCursorAvgAggregateFragmentDoc,Xf as SyncEventCursorCountAggregateFragmentDoc,Vf as SyncEventCursorFragmentDoc,Yf as SyncEventCursorMaxAggregateFragmentDoc,Zf as SyncEventCursorMinAggregateFragmentDoc,_f as SyncEventCursorSumAggregateFragmentDoc,Sf as SyncEventFragmentDoc,$f as SyncEventMaxAggregateFragmentDoc,ag as SyncEventMinAggregateFragmentDoc,bg as SyncEventSumAggregateFragmentDoc,Uh as SyncProjectDesktopBindingDocument,dg as TableConnectionFragmentDoc,eg as TableCountAggregateFragmentDoc,Sk as TableDocument,cg as TableFragmentDoc,fg as TableMaxAggregateFragmentDoc,gg as TableMinAggregateFragmentDoc,ia as TableOrderByRelevanceFieldEnum,ja as TableStatus,Tk as Table_DatabaseDocument,Uk as Table_Database_EngineDocument,Vk as Table_DocumentDocument,Wk as Table_Document_ContentsDocument,Xk as Table_Document_FileDocument,Yk as Table_Document_FormatDocument,Zk as Table_FromRelationsDocument,_k as Table_ToRelationsDocument,$k as TablesDocument,Wh as TestMcpServerConnectionDocument,Vh as TestMcpServerDocument,Hf as TextBlockEventOutputFragmentDoc,If as TextDeltaEventOutputFragmentDoc,ig as TokenUsageAvgAggregateFragmentDoc,jg as TokenUsageCountAggregateFragmentDoc,hg as TokenUsageFragmentDoc,ka as TokenUsageLimit,kg as TokenUsageMaxAggregateFragmentDoc,lg as TokenUsageMinAggregateFragmentDoc,mg as TokenUsageSumAggregateFragmentDoc,hl as TokenUsageUpdatesDocument,Jf as ToolInputDeltaEventOutputFragmentDoc,Kf as ToolResultArtifactOutputFragmentDoc,Lf as ToolResultEventOutputFragmentDoc,Mf as ToolStartEventOutputFragmentDoc,Xh as UpdateAgentDocument,Yh as UpdateArtifactNameDocument,Zh as UpdateChatDocument,_h as UpdateDatabaseDocument,$h as UpdateDocumentDocument,ai as UpdateFolderDocument,bi as UpdateInsightDocument,ci as UpdateInsightInReportDocument,di as UpdateInsightThumbnailDocument,ei as UpdateInterpDocument,fi as UpdateLiveContextDocument,gi as UpdateProjectDocument,hi as UpdatePulseTriggerDocument,ii as UpdateReportDocument,ji as UpdateTableDocument,ki as UpdateUserSkillFileDocument,li as UpdateUserSkillFolderDocument,mi as UpsertAiProviderSettingDocument,ni as UpsertWorkspaceAiModelDocument,la as UsageHistoryGranularity,Bf as UsageMetaOutputFragmentDoc,pg as UsageStatusFragmentDoc,og as UsageWindowsStatusTypeFragmentDoc,rg as UserAiProviderSettingCountAggregateFragmentDoc,qg as UserAiProviderSettingFragmentDoc,sg as UserAiProviderSettingMaxAggregateFragmentDoc,tg as UserAiProviderSettingMinAggregateFragmentDoc,vg as UserSkillFileCountAggregateFragmentDoc,al as UserSkillFileDocument,ug as UserSkillFileFragmentDoc,wg as UserSkillFileMaxAggregateFragmentDoc,xg as UserSkillFileMinAggregateFragmentDoc,yg as UserSkillFileModelFragmentDoc,bl as UserSkillFilesDocument,Ag as UserSkillFolderCountAggregateFragmentDoc,cl as UserSkillFolderDocument,zg as UserSkillFolderFragmentDoc,Bg as UserSkillFolderMaxAggregateFragmentDoc,Cg as UserSkillFolderMinAggregateFragmentDoc,Dg as UserSkillFolderModelFragmentDoc,dl as UserSkillFoldersDocument,Nf as WidgetBlockCompleteEventOutputFragmentDoc,Of as WidgetBlockErrorEventOutputFragmentDoc,Pf as WidgetBlockStartEventOutputFragmentDoc,Qf as WidgetHtmlDeltaEventOutputFragmentDoc,ng as WindowDetailTypeFragmentDoc,el as WorkspaceAiModelDocument,Fg as WorkspaceAiModelSettingCountAggregateFragmentDoc,Eg as WorkspaceAiModelSettingFragmentDoc,Gg as WorkspaceAiModelSettingMaxAggregateFragmentDoc,Hg as WorkspaceAiModelSettingMinAggregateFragmentDoc,Jg as WorkspaceDeleteScheduleCountAggregateFragmentDoc,Ig as WorkspaceDeleteScheduleFragmentDoc,Kg as WorkspaceDeleteScheduleMaxAggregateFragmentDoc,Lg as WorkspaceDeleteScheduleMinAggregateFragmentDoc,fl as WorkspaceDeletionScheduleDocument}from'./chunk-2EXM4BMP.js';import'./chunk-EK7ODJWE.js';
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { Signal, DestroyRef, EnvironmentProviders } from '@angular/core';
|
|
2
|
-
import { D as DvinaSdkOptions } from '../../client-OupfxAUq.js';
|
|
3
|
-
import { D as DvinaAsyncRef } from '../../types-Chg8ASmf.js';
|
|
4
|
-
import '../../error-CsVoUTY8.js';
|
|
5
|
-
import '../../sync-engine-DYHreGOv.js';
|
|
6
|
-
import 'graphql';
|
|
7
|
-
import 'dexie';
|
|
8
|
-
import '../../client-Bb2gD6Iz.js';
|
|
9
|
-
import '../../billing/index.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Angular adapter for @dvina/sdk.
|
|
13
|
-
*
|
|
14
|
-
* Provides primitives for integrating the Dvina SDK with Angular's DI and signal system:
|
|
15
|
-
*
|
|
16
|
-
* - {@link provideDvina} — register a singleton `DvinaSdk` instance in the Angular DI system
|
|
17
|
-
* - {@link toSignal} — lightweight converter from `DvinaQueryRef` to a readonly `Signal`
|
|
18
|
-
* - {@link dvnResource} — full resource primitive inspired by Angular's `resource()` API,
|
|
19
|
-
* supporting both `Promise` and `AsyncIterable` loaders with reactive params tracking,
|
|
20
|
-
* status/error signals, and automatic cleanup.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```typescript
|
|
24
|
-
* import { provideDvina, toSignal, dvnResource } from '@dvina/sdk/angular';
|
|
25
|
-
* import { DvinaSdk } from '@dvina/sdk';
|
|
26
|
-
*
|
|
27
|
-
* // app.config.ts
|
|
28
|
-
* export const appConfig: ApplicationConfig = {
|
|
29
|
-
* providers: [
|
|
30
|
-
* provideDvina(() => ({
|
|
31
|
-
* getToken: (opts) => inject(AuthService).getAccessTokenSilently(opts),
|
|
32
|
-
* language: () => inject(TranslocoService).getActiveLang(),
|
|
33
|
-
* })),
|
|
34
|
-
* ],
|
|
35
|
-
* };
|
|
36
|
-
*
|
|
37
|
-
* // component.ts
|
|
38
|
-
* @Component({ ... })
|
|
39
|
-
* class ReportsComponent {
|
|
40
|
-
* private sdk = inject(DvinaSdk);
|
|
41
|
-
*
|
|
42
|
-
* // Simple signal conversion
|
|
43
|
-
* reports = toSignal(this.sdk.reports({ first: 20 }).watch());
|
|
44
|
-
*
|
|
45
|
-
* // Full resource with status tracking
|
|
46
|
-
* reportResource = dvnResource({
|
|
47
|
-
* params: () => ({ first: 20 }),
|
|
48
|
-
* loader: ({ params }) => this.sdk.reports(params).watch(),
|
|
49
|
-
* });
|
|
50
|
-
* }
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* @packageDocumentation
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
interface ToSignalOptions {
|
|
57
|
-
/**
|
|
58
|
-
* Optional DestroyRef for automatic cleanup. If not provided, `inject(DestroyRef)`
|
|
59
|
-
* is called — which requires an injection context (constructor, field initializer,
|
|
60
|
-
* or `runInInjectionContext`).
|
|
61
|
-
*
|
|
62
|
-
* Pass explicitly when calling outside an injection context.
|
|
63
|
-
*
|
|
64
|
-
* Follows the same convention as Angular's `takeUntilDestroyed()`.
|
|
65
|
-
*/
|
|
66
|
-
destroyRef?: DestroyRef;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Convert a `DvinaQueryRef` (AsyncIterable) into a readonly Angular Signal.
|
|
70
|
-
*
|
|
71
|
-
* The signal updates automatically whenever the underlying Dexie-based SyncEngine emits new data.
|
|
72
|
-
* Cleanup (disposal of the async iterable) happens automatically when the component/service
|
|
73
|
-
* is destroyed via `DestroyRef`.
|
|
74
|
-
*
|
|
75
|
-
* Must be called in an **injection context** (field initializer, constructor,
|
|
76
|
-
* or `runInInjectionContext`) unless `options.destroyRef` is provided explicitly.
|
|
77
|
-
*
|
|
78
|
-
* @param ref - A DvinaQueryRef returned by `.watch()` on any SDK query
|
|
79
|
-
* @param options - Optional configuration
|
|
80
|
-
* @returns A readonly Signal that reflects the latest value from the query ref
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* ```typescript
|
|
84
|
-
* // Field initializer (most common)
|
|
85
|
-
* reports = toSignal(this.sdk.reports({ first: 20 }).watch());
|
|
86
|
-
*
|
|
87
|
-
* // With explicit DestroyRef (for use outside injection context)
|
|
88
|
-
* const destroyRef = inject(DestroyRef);
|
|
89
|
-
* // ... later, in a method:
|
|
90
|
-
* this.reports = toSignal(ref, { destroyRef });
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
declare function toSignal<T>(ref: DvinaAsyncRef<T>, options?: ToSignalOptions): Signal<T | undefined>;
|
|
94
|
-
/**
|
|
95
|
-
* Status of a {@link DvnResourceRef}.
|
|
96
|
-
*
|
|
97
|
-
* Mirrors Angular's `ResourceStatus` with the statuses relevant to
|
|
98
|
-
* Dvina SDK operations.
|
|
99
|
-
*
|
|
100
|
-
* | Status | `value()` | Description |
|
|
101
|
-
* |---------------|-------------------|-------------|
|
|
102
|
-
* | `'idle'` | `undefined` | `params` returned `undefined`; loader has not run. |
|
|
103
|
-
* | `'loading'` | `undefined` | Loader is running for the first time. |
|
|
104
|
-
* | `'reloading'` | Previous value | Loader is re-running (params changed or `reload()` called). |
|
|
105
|
-
* | `'resolved'` | Resolved value | Loader completed successfully. |
|
|
106
|
-
* | `'error'` | `undefined` | Loader threw an error. |
|
|
107
|
-
*/
|
|
108
|
-
type DvnResourceStatus = 'idle' | 'loading' | 'reloading' | 'resolved' | 'error';
|
|
109
|
-
/**
|
|
110
|
-
* The object returned by {@link dvnResource}.
|
|
111
|
-
*
|
|
112
|
-
* Provides reactive access to the loader's value, status, and error,
|
|
113
|
-
* plus imperative `reload()` and `destroy()` methods.
|
|
114
|
-
*/
|
|
115
|
-
interface DvnResourceRef<TResult> {
|
|
116
|
-
/** The most recently resolved value, or `undefined` while loading / on error / idle. */
|
|
117
|
-
readonly value: Signal<TResult | undefined>;
|
|
118
|
-
/** Current lifecycle status of the resource. */
|
|
119
|
-
readonly status: Signal<DvnResourceStatus>;
|
|
120
|
-
/** `true` when status is `'loading'` or `'reloading'`. */
|
|
121
|
-
readonly isLoading: Signal<boolean>;
|
|
122
|
-
/** The last error thrown by the loader, or `undefined`. */
|
|
123
|
-
readonly error: Signal<Error | undefined>;
|
|
124
|
-
/** Whether `value()` is not `undefined`. */
|
|
125
|
-
hasValue(): boolean;
|
|
126
|
-
/** Re-run the loader with the current params. Status transitions to `'reloading'`. */
|
|
127
|
-
reload(): void;
|
|
128
|
-
/** Abort / dispose any active loader and reset to `'idle'`. */
|
|
129
|
-
destroy(): void;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* A loader function that returns either a `Promise` (one-shot fetch) or an
|
|
133
|
-
* `AsyncIterable` / `DvinaQueryRef` (live stream).
|
|
134
|
-
*
|
|
135
|
-
* The runtime inspects the return value:
|
|
136
|
-
* - If it has `Symbol.asyncIterator` → consumed as a stream (`for await…of`)
|
|
137
|
-
* - Otherwise → awaited as a `Promise`
|
|
138
|
-
*/
|
|
139
|
-
type DvnResourceLoader<TParams, TResult> = (ctx: DvnResourceLoaderCtx<TParams>) => Promise<TResult> | AsyncIterable<TResult>;
|
|
140
|
-
/**
|
|
141
|
-
* Context object passed to the loader function.
|
|
142
|
-
*
|
|
143
|
-
* When the resource has `params`, `ctx.params` contains the current
|
|
144
|
-
* non-`undefined` params value. `abortSignal` can be forwarded to `fetch()`
|
|
145
|
-
* or any other cancellable API.
|
|
146
|
-
*/
|
|
147
|
-
interface DvnResourceLoaderCtx<TParams> {
|
|
148
|
-
/** Current params value (never `undefined`). Only present when `params` is configured. */
|
|
149
|
-
params: TParams;
|
|
150
|
-
/** Aborted when params change, `reload()` is called, or the resource is destroyed. */
|
|
151
|
-
abortSignal: AbortSignal;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Create a Dvina resource **without reactive params**.
|
|
155
|
-
*
|
|
156
|
-
* The loader runs immediately and can be re-triggered via `reload()`.
|
|
157
|
-
*
|
|
158
|
-
* @example
|
|
159
|
-
* ```typescript
|
|
160
|
-
* config = dvnResource({
|
|
161
|
-
* loader: () => this.sdk.config().fetch(),
|
|
162
|
-
* });
|
|
163
|
-
* ```
|
|
164
|
-
*/
|
|
165
|
-
declare function dvnResource<TResult>(config: {
|
|
166
|
-
params?: never;
|
|
167
|
-
loader: (ctx: {
|
|
168
|
-
abortSignal: AbortSignal;
|
|
169
|
-
}) => Promise<TResult> | AsyncIterable<TResult>;
|
|
170
|
-
}): DvnResourceRef<TResult>;
|
|
171
|
-
/**
|
|
172
|
-
* Create a Dvina resource **with reactive params**.
|
|
173
|
-
*
|
|
174
|
-
* The loader re-runs every time `params()` produces a new non-`undefined`
|
|
175
|
-
* value. When `params()` returns `undefined` the resource enters `'idle'`.
|
|
176
|
-
*
|
|
177
|
-
* @example
|
|
178
|
-
* ```typescript
|
|
179
|
-
* // Promise-based (one-shot fetch)
|
|
180
|
-
* userResource = dvnResource({
|
|
181
|
-
* params: () => ({ id: this.userId() }),
|
|
182
|
-
* loader: ({ params }) => this.sdk.user(params).fetch(),
|
|
183
|
-
* });
|
|
184
|
-
*
|
|
185
|
-
* // AsyncIterable-based (live query)
|
|
186
|
-
* reportsResource = dvnResource({
|
|
187
|
-
* params: () => ({ first: 20 }),
|
|
188
|
-
* loader: ({ params }) => this.sdk.reports(params).watch(),
|
|
189
|
-
* });
|
|
190
|
-
* ```
|
|
191
|
-
*/
|
|
192
|
-
declare function dvnResource<TParams, TResult>(config: {
|
|
193
|
-
params: () => TParams | undefined;
|
|
194
|
-
loader: (ctx: DvnResourceLoaderCtx<TParams>) => Promise<TResult> | AsyncIterable<TResult>;
|
|
195
|
-
}): DvnResourceRef<TResult>;
|
|
196
|
-
/**
|
|
197
|
-
* Register a singleton {@link DvinaSdk} instance in the Angular dependency injection system.
|
|
198
|
-
*
|
|
199
|
-
* Accepts either a static options object or a **factory function**. The factory
|
|
200
|
-
* variant runs inside an injection context, so Angular's `inject()` can be used
|
|
201
|
-
* to resolve auth services, language providers, and other dependencies.
|
|
202
|
-
*
|
|
203
|
-
* The SDK instance is automatically destroyed (WebSocket terminated, SSE stopped,
|
|
204
|
-
* IndexedDB closed) when the environment injector is torn down.
|
|
205
|
-
*
|
|
206
|
-
* @param optionsOrFactory - A {@link DvinaSdkOptions} object, or a factory
|
|
207
|
-
* function that returns one. The factory is called within an injection context.
|
|
208
|
-
* @returns `EnvironmentProviders` to be added to the application config.
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* ```typescript
|
|
212
|
-
* // app.config.ts
|
|
213
|
-
* import { provideDvina } from '@dvina/sdk/angular';
|
|
214
|
-
*
|
|
215
|
-
* export const appConfig: ApplicationConfig = {
|
|
216
|
-
* providers: [
|
|
217
|
-
* provideDvina(() => {
|
|
218
|
-
* const auth = inject(AuthService);
|
|
219
|
-
* const transloco = inject(TranslocoService);
|
|
220
|
-
*
|
|
221
|
-
* return {
|
|
222
|
-
* getToken: (opts) => auth.getAccessTokenSilently(opts),
|
|
223
|
-
* language: () => transloco.getActiveLang(),
|
|
224
|
-
* };
|
|
225
|
-
* }),
|
|
226
|
-
* ],
|
|
227
|
-
* };
|
|
228
|
-
* ```
|
|
229
|
-
*
|
|
230
|
-
* @example
|
|
231
|
-
* ```typescript
|
|
232
|
-
* // Static token (scripts, tests)
|
|
233
|
-
* provideDvina({
|
|
234
|
-
* token: 'my-static-token',
|
|
235
|
-
* baseUrl: 'localhost:4000',
|
|
236
|
-
* })
|
|
237
|
-
* ```
|
|
238
|
-
*
|
|
239
|
-
* @example
|
|
240
|
-
* ```typescript
|
|
241
|
-
* // Consuming the SDK in a service
|
|
242
|
-
* import { DvinaSdk } from '@dvina/sdk';
|
|
243
|
-
*
|
|
244
|
-
* @Injectable({ providedIn: 'root' })
|
|
245
|
-
* export class ReportService {
|
|
246
|
-
* private readonly sdk = inject(DvinaSdk);
|
|
247
|
-
*
|
|
248
|
-
* reports = toSignal(this.sdk.reports({ first: 20 }).watch());
|
|
249
|
-
* }
|
|
250
|
-
* ```
|
|
251
|
-
*/
|
|
252
|
-
declare function provideDvina(optionsOrFactory: DvinaSdkOptions | (() => DvinaSdkOptions)): EnvironmentProviders;
|
|
253
|
-
|
|
254
|
-
export { type DvnResourceLoader, type DvnResourceLoaderCtx, type DvnResourceRef, type DvnResourceStatus, type ToSignalOptions, dvnResource, provideDvina, toSignal };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {Fg}from'../../chunk-V5FAQENQ.js';import'../../chunk-H3TI6B7T.js';import'../../chunk-IIQ3WGOJ.js';import'../../chunk-YUQTEBYO.js';import'../../chunk-5E7LX4YQ.js';import'../../chunk-2EXM4BMP.js';import'../../chunk-EK7ODJWE.js';import {inject,DestroyRef,signal,effect,computed,makeEnvironmentProviders,untracked}from'@angular/core';function L(e,i){let l=i?.destroyRef??inject(DestroyRef),t=signal(e.current),r=true;return (async()=>{try{for await(let o of e){if(!r)break;t.set(o);}}catch{}})(),l.onDestroy(()=>{r=false,e.dispose();}),t.asReadonly()}function j(e){let i=inject(DestroyRef),l="params"in e&&e.params!==void 0,t=signal(void 0),r=signal("idle"),o=signal(void 0),a=null,u=false,m=null,c=()=>{a?.abort(),a=null,u=false,m?.dispose(),m=null;},f=s=>{c(),o.set(void 0);let D=untracked(()=>t()!==void 0);r.set(D?"reloading":"loading"),a=new AbortController;let x=l?{params:s,abortSignal:a.signal}:{abortSignal:a.signal},d=e.loader(x);if(A(d)){h(d)&&(m=d),u=true;let p=a;(async()=>{try{for await(let n of d){if(!u)break;t.set(n),r.set("resolved"),o.set(void 0);}}catch(n){if(!u||p.signal.aborted)return;let y=n instanceof Error?n:new Error(String(n));o.set(y),r.set("error");}})();}else {let p=a;d.then(n=>{p.signal.aborted||(t.set(n),r.set("resolved"));},n=>{if(p.signal.aborted||n instanceof DOMException&&n.name==="AbortError")return;let y=n instanceof Error?n:new Error(String(n));o.set(y),r.set("error");});}};l?effect(()=>{let s=e.params();s!==void 0?f(s):(c(),t.set(void 0),r.set("idle"),o.set(void 0));}):f(),i.onDestroy(()=>{c();});let b=r.asReadonly(),S=computed(()=>{let s=r();return s==="loading"||s==="reloading"});return {value:t.asReadonly(),status:b,isLoading:S,error:o.asReadonly(),hasValue:()=>t()!==void 0,reload(){if(l){let s=e.params();s!==void 0&&f(s);}else f();},destroy(){c(),t.set(void 0),r.set("idle"),o.set(void 0);}}}function A(e){return e!=null&&typeof e=="object"&&Symbol.asyncIterator in e}function h(e){return e!=null&&typeof e=="object"&&"dispose"in e&&typeof e.dispose=="function"}function O(e){return makeEnvironmentProviders([{provide:Fg,useFactory:()=>{let i=typeof e=="function"?e():e;return new Fg(i)}}])}export{j as dvnResource,O as provideDvina,L as toSignal};
|