@dvina/sdk 4.0.121 → 4.0.142

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.
Files changed (31) hide show
  1. package/README.md +12 -8
  2. package/dist/_generated_documents-3N6BQ5SR.js +4 -0
  3. package/dist/{_generated_documents-XATE7GCV.js.map → _generated_documents-3N6BQ5SR.js.map} +1 -1
  4. package/dist/{_generated_documents-H4JUEJGN.cjs → _generated_documents-R4Q64XRB.cjs} +642 -514
  5. package/dist/{_generated_documents-H4JUEJGN.cjs.map → _generated_documents-R4Q64XRB.cjs.map} +1 -1
  6. package/dist/adapters/angular/index.cjs +4 -4
  7. package/dist/adapters/angular/index.d.cts +1 -1
  8. package/dist/adapters/angular/index.d.ts +1 -1
  9. package/dist/adapters/angular/index.js +2 -2
  10. package/dist/{chunk-Q7MZGXS4.js → chunk-4BKKU67P.js} +76 -44
  11. package/dist/chunk-4BKKU67P.js.map +1 -0
  12. package/dist/{chunk-ZN2TPYCR.js → chunk-AYE3QJ2O.js} +843 -56
  13. package/dist/chunk-AYE3QJ2O.js.map +1 -0
  14. package/dist/{chunk-GL6CUR7S.cjs → chunk-D7AKD4KG.cjs} +111 -47
  15. package/dist/chunk-D7AKD4KG.cjs.map +1 -0
  16. package/dist/{chunk-ZWQVDMIR.cjs → chunk-UDXG6COO.cjs} +1346 -548
  17. package/dist/chunk-UDXG6COO.cjs.map +1 -0
  18. package/dist/client-BK4gb0rI.d.ts +6171 -0
  19. package/dist/client-Bqg_UhDO.d.cts +6171 -0
  20. package/dist/index.cjs +432 -388
  21. package/dist/index.d.cts +99 -5799
  22. package/dist/index.d.ts +99 -5799
  23. package/dist/index.js +2 -2
  24. package/package.json +1 -1
  25. package/dist/_generated_documents-XATE7GCV.js +0 -4
  26. package/dist/chunk-GL6CUR7S.cjs.map +0 -1
  27. package/dist/chunk-Q7MZGXS4.js.map +0 -1
  28. package/dist/chunk-ZN2TPYCR.js.map +0 -1
  29. package/dist/chunk-ZWQVDMIR.cjs.map +0 -1
  30. package/dist/client-B5LbpEC3.d.ts +0 -77
  31. package/dist/client-Dp5JOq16.d.cts +0 -77
@@ -1,77 +0,0 @@
1
- import { D as DvinaError } from './error-CsVoUTY8.js';
2
- import { a as DvinaRequest, b as DvinaSubscribe } from './types-2RotD0Ab.js';
3
- import { S as SyncEngine } from './sync-engine-BmE8-rhX.js';
4
- import { I as InferenceClient } from './client-Bb2gD6Iz.js';
5
- import { BillingClient } from './billing/index.js';
6
-
7
- interface DvinaSdkBaseOptions {
8
- /** Base URL without protocol (e.g. 'api.dvina.ai' or 'localhost:4000'). Default: 'api.dvina.ai' */
9
- baseUrl?: string;
10
- /**
11
- * Override the billing API base URL.
12
- * Accepts either a bare host (e.g. 'billing.dvina.ai') or a full URL with protocol
13
- * (e.g. 'http://dvina-billing:3010'). When a protocol is included, it is used as-is.
14
- * By default, derived from `baseUrl` by replacing the leading `api.` with `billing.`
15
- * (e.g. 'api.dvina.ai' → 'billing.dvina.ai').
16
- */
17
- billingUrl?: string;
18
- /** Preferred language for API responses. Static string or reactive callback. */
19
- language?: string | (() => string);
20
- /**
21
- * Global error callback invoked for every terminal SDK error (after all
22
- * retries and token refreshes have been exhausted).
23
- *
24
- * Receives typed error subclasses — use `instanceof` to branch:
25
- * - `DvinaPlanRestrictionError` — plan/billing limit exceeded (check `restrictionCode`)
26
- * - `DvinaTokenLimitError` — session token limit reached
27
- * - `DvinaNotFoundError` — resource not found
28
- * - `DvinaAuthenticationError` — authentication permanently failed
29
- * - `DvinaNetworkError` — network/HTTP failure
30
- * - `DvinaGraphQLError` — other GraphQL errors
31
- */
32
- onError?: (error: DvinaError) => void;
33
- }
34
- interface DvinaSdkTokenOptions extends DvinaSdkBaseOptions {
35
- /** Static auth token. Use for scripts, CLI tools, and tests. */
36
- token: string;
37
- getToken?: never;
38
- }
39
- interface DvinaSdkCallbackOptions extends DvinaSdkBaseOptions {
40
- /**
41
- * Async callback that returns an auth token.
42
- * When called with `{ forceRefresh: true }`, the callback must bypass any
43
- * cache and obtain a brand-new token (e.g. via Auth0's silent refresh).
44
- */
45
- getToken: (options?: {
46
- forceRefresh?: boolean;
47
- }) => Promise<string>;
48
- token?: never;
49
- }
50
- type DvinaSdkOptions = DvinaSdkTokenOptions | DvinaSdkCallbackOptions;
51
- interface DvinaClientResult {
52
- syncEngine: SyncEngine;
53
- /** Request function that routes through SyncEngine (normalize + Dexie write). Used by model classes for compat. */
54
- request: DvinaRequest;
55
- /** Subscribe function that routes through WebSocket transport for GraphQL subscriptions. */
56
- subscribe: DvinaSubscribe;
57
- getToken: (options?: {
58
- forceRefresh?: boolean;
59
- }) => Promise<string>;
60
- /** Terminate the WebSocket connection (call on logout / SDK teardown). */
61
- terminateWs: () => void;
62
- /** Close and remove the cached IndexedDB database (call on logout / workspace switch / SDK teardown). */
63
- closeDb: () => Promise<void>;
64
- /** Inference client for the /inference/v1 REST API (chat completions, responses, models). */
65
- inference: InferenceClient;
66
- /** Billing client for the Dvina Billing GraphQL API (plans, subscriptions, seats, sessions). */
67
- billing: BillingClient;
68
- /** The resolved base URL (e.g. 'api.dvina.ai'). Used by models to resolve relative asset paths. */
69
- baseUrl: string;
70
- }
71
- /**
72
- * Create a fully configured Dvina client with SyncEngine, HTTP transport, and WS transport.
73
- * Called by the DvinaSdk constructor (generated code).
74
- */
75
- declare function createDvinaClient(options: DvinaSdkOptions): DvinaClientResult;
76
-
77
- export { type DvinaSdkOptions as D, type DvinaSdkBaseOptions as a, type DvinaSdkCallbackOptions as b, type DvinaSdkTokenOptions as c, createDvinaClient as d };
@@ -1,77 +0,0 @@
1
- import { D as DvinaError } from './error-CsVoUTY8.cjs';
2
- import { a as DvinaRequest, b as DvinaSubscribe } from './types-2RotD0Ab.cjs';
3
- import { S as SyncEngine } from './sync-engine-DN0tSqtg.cjs';
4
- import { I as InferenceClient } from './client-Bb2gD6Iz.cjs';
5
- import { BillingClient } from './billing/index.cjs';
6
-
7
- interface DvinaSdkBaseOptions {
8
- /** Base URL without protocol (e.g. 'api.dvina.ai' or 'localhost:4000'). Default: 'api.dvina.ai' */
9
- baseUrl?: string;
10
- /**
11
- * Override the billing API base URL.
12
- * Accepts either a bare host (e.g. 'billing.dvina.ai') or a full URL with protocol
13
- * (e.g. 'http://dvina-billing:3010'). When a protocol is included, it is used as-is.
14
- * By default, derived from `baseUrl` by replacing the leading `api.` with `billing.`
15
- * (e.g. 'api.dvina.ai' → 'billing.dvina.ai').
16
- */
17
- billingUrl?: string;
18
- /** Preferred language for API responses. Static string or reactive callback. */
19
- language?: string | (() => string);
20
- /**
21
- * Global error callback invoked for every terminal SDK error (after all
22
- * retries and token refreshes have been exhausted).
23
- *
24
- * Receives typed error subclasses — use `instanceof` to branch:
25
- * - `DvinaPlanRestrictionError` — plan/billing limit exceeded (check `restrictionCode`)
26
- * - `DvinaTokenLimitError` — session token limit reached
27
- * - `DvinaNotFoundError` — resource not found
28
- * - `DvinaAuthenticationError` — authentication permanently failed
29
- * - `DvinaNetworkError` — network/HTTP failure
30
- * - `DvinaGraphQLError` — other GraphQL errors
31
- */
32
- onError?: (error: DvinaError) => void;
33
- }
34
- interface DvinaSdkTokenOptions extends DvinaSdkBaseOptions {
35
- /** Static auth token. Use for scripts, CLI tools, and tests. */
36
- token: string;
37
- getToken?: never;
38
- }
39
- interface DvinaSdkCallbackOptions extends DvinaSdkBaseOptions {
40
- /**
41
- * Async callback that returns an auth token.
42
- * When called with `{ forceRefresh: true }`, the callback must bypass any
43
- * cache and obtain a brand-new token (e.g. via Auth0's silent refresh).
44
- */
45
- getToken: (options?: {
46
- forceRefresh?: boolean;
47
- }) => Promise<string>;
48
- token?: never;
49
- }
50
- type DvinaSdkOptions = DvinaSdkTokenOptions | DvinaSdkCallbackOptions;
51
- interface DvinaClientResult {
52
- syncEngine: SyncEngine;
53
- /** Request function that routes through SyncEngine (normalize + Dexie write). Used by model classes for compat. */
54
- request: DvinaRequest;
55
- /** Subscribe function that routes through WebSocket transport for GraphQL subscriptions. */
56
- subscribe: DvinaSubscribe;
57
- getToken: (options?: {
58
- forceRefresh?: boolean;
59
- }) => Promise<string>;
60
- /** Terminate the WebSocket connection (call on logout / SDK teardown). */
61
- terminateWs: () => void;
62
- /** Close and remove the cached IndexedDB database (call on logout / workspace switch / SDK teardown). */
63
- closeDb: () => Promise<void>;
64
- /** Inference client for the /inference/v1 REST API (chat completions, responses, models). */
65
- inference: InferenceClient;
66
- /** Billing client for the Dvina Billing GraphQL API (plans, subscriptions, seats, sessions). */
67
- billing: BillingClient;
68
- /** The resolved base URL (e.g. 'api.dvina.ai'). Used by models to resolve relative asset paths. */
69
- baseUrl: string;
70
- }
71
- /**
72
- * Create a fully configured Dvina client with SyncEngine, HTTP transport, and WS transport.
73
- * Called by the DvinaSdk constructor (generated code).
74
- */
75
- declare function createDvinaClient(options: DvinaSdkOptions): DvinaClientResult;
76
-
77
- export { type DvinaSdkOptions as D, type DvinaSdkBaseOptions as a, type DvinaSdkCallbackOptions as b, type DvinaSdkTokenOptions as c, createDvinaClient as d };