@nebulateam/jarvis-sdk 0.0.0-stage → 5.57.9-fix.1

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 CHANGED
@@ -1,3 +1,227 @@
1
- # Temporary Holding Version
1
+ # @nebulateam/jarvis-sdk
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ JavaScript/TypeScript SDK for the **Jarvis public API**, distributed as an ES module with full type definitions,
4
+ so editors such as VS Code offer IntelliSense on every client, request and response.
5
+
6
+ This build targets **Jarvis 5.57.9** (SDK version 5.57.9-fix.1).
7
+
8
+ ## Installation
9
+
10
+ ```sh
11
+ npm install @nebulateam/jarvis-sdk
12
+ ```
13
+
14
+ The package is ESM only (`import`), it has no runtime dependencies and uses the standard `fetch` API:
15
+ it runs in browsers and in Node.js 18 or later. Its type definitions work with `moduleResolution`
16
+ `bundler` (browser projects) and `NodeNext` (Node ESM projects, e.g. scripts run with `tsx`).
17
+
18
+ ## Versions
19
+
20
+ The SDK version follows the Jarvis release it was generated from: SDK `5.57.10` is built from the public API of Jarvis `5.57.10`.
21
+
22
+ When the SDK needs a fix without a new Jarvis release, a version such as `5.57.10-fix.1` is published.
23
+ For npm these are pre-release versions, so ranges like `^5.57.10` or `~5.57.10` do **not** pick them up. To get them:
24
+
25
+ | What you need | Install |
26
+ |---|---|
27
+ | The latest SDK | `npm install @nebulateam/jarvis-sdk` (dist-tag `latest`) |
28
+ | The latest SDK build for a given Jarvis version, fixes included | `npm install @nebulateam/jarvis-sdk@jarvis-5.57.10` |
29
+ | An exact build | `npm install @nebulateam/jarvis-sdk@5.57.10-fix.1` |
30
+
31
+ Use the SDK built for the Jarvis version you are calling: newer SDKs may contain endpoints your Jarvis does not have yet.
32
+
33
+ ## Quick start
34
+
35
+ ```ts
36
+ import { Jarvis } from '@nebulateam/jarvis-sdk';
37
+
38
+ const API_VERSION = '2';
39
+ const jarvis = Jarvis.CreateClient('https://my-jarvis.example.com', process.env.JARVIS_TOKEN, { callInfoHeader: 'my-app' });
40
+
41
+ const result = await jarvis.createWorkTaskClient().searchV2(API_VERSION, 'Workspace_12', {
42
+ text: 'pump',
43
+ startIndex: 0,
44
+ pageSize: 20
45
+ });
46
+
47
+ if (result.success) {
48
+ for (const task of result.data ?? []) {
49
+ console.log(task.id, task.title, task.statusId);
50
+ }
51
+ } else {
52
+ console.error(result.error?.message);
53
+ }
54
+ ```
55
+
56
+ ### Creating the client
57
+
58
+ | Method | When to use it |
59
+ |---|---|
60
+ | `Jarvis.CreateClient(url, token?, { callInfoHeader?, fetch? })` | Scripts, back-ends and applications that call a known Jarvis. |
61
+ | `Jarvis.Autodiscover(devLocation?)` | Components served by Jarvis itself: they call the Jarvis that serves the page. On `localhost` they use `devLocation` (`{ url, token }`). |
62
+ | `Jarvis.ConnectTo(location, token?)` | Like `Autodiscover`, with an explicit `Location`. |
63
+
64
+ - **Authentication**: the token is sent in the `jarvis-auth-token` header. Omit it when the calls run in a browser page already authenticated on Jarvis.
65
+ - **Call info**: `callInfoHeader` (or the `jarvisInfoHeader` argument of every `create...Client` method) is sent as `X-Jarvis-Call-Info`, to tag the calls made by your application.
66
+ - **fetch**: the global `fetch` by default (`globalThis.fetch`, in browsers and Node.js). Pass your own to add logging,
67
+ retries or a proxy, or to test without a Jarvis:
68
+
69
+ ```ts
70
+ import { Jarvis, type JarvisFetch } from '@nebulateam/jarvis-sdk';
71
+
72
+ const loggingFetch: JarvisFetch = async (input, init) => {
73
+ const response = await fetch(input, init);
74
+ console.log(init?.method, String(input), response.status);
75
+ return response;
76
+ };
77
+ const jarvis = Jarvis.CreateClient('https://my-jarvis.example.com', process.env.JARVIS_TOKEN, { fetch: loggingFetch });
78
+ ```
79
+
80
+ ### API clients
81
+
82
+ `JarvisClient` creates one client per area of the public API, for example:
83
+
84
+ | Method | Area |
85
+ |---|---|
86
+ | `createWorkspaceClient()`, `createWorkspacePlanningClient()`, `createWorkTaskClient()`, `createTaskTypeV2Client()` | Workspaces, planning and work tasks |
87
+ | `createDatasetClient()`, `createFieldsClient()`, `createPropertiesClient()` | Datasets, fields and properties |
88
+ | `createDocumentClient()`, `createDocumentTypeClient()`, `createContainerClient()`, `createDmsSearchClient()`, `createFileUploadClient()` | Documents (DMS) |
89
+ | `createTicketClient()` | Tickets |
90
+ | `createAccountV2Client()`, `createContactV2Client()`, `createUsersClient()`, `createAvatarClient()` | Accounts, contacts and users |
91
+ | `createIdTranslationV1Client()`, `createLongRunningJobClient()`, `createIntegrationClient()` | Utilities |
92
+
93
+ Every client, method, request and response is documented in the type definitions: hover on a method in your editor to read it.
94
+ All the generated clients and DTOs are also exported, so you can import types such as `OmniSearchPublicSearchRequest` directly.
95
+ The V1 clients (`ContactV1Client`, `PropertiesV1Client`, `IdTranslationV1Client`, …) are exported too; DTOs and enums
96
+ with the same name in V1 and V2 are exported once, from V2.
97
+
98
+ Each method takes the API version as first argument: use `'2'` for the V2 clients and `'1'` for the V1 ones.
99
+
100
+ ### Responses and errors
101
+
102
+ Most methods resolve to a response with:
103
+
104
+ - `success`: `false` when the request failed validation or a constraint;
105
+ - `data`: the result of the operation;
106
+ - `logs` and `error`: what happened on the server.
107
+
108
+ When Jarvis answers with an unexpected HTTP status the promise is rejected with an `ApiException`
109
+ (`status`, `response`, `headers`):
110
+
111
+ ```ts
112
+ import { ApiException } from '@nebulateam/jarvis-sdk';
113
+
114
+ try {
115
+ const ticket = await jarvis.createTicketClient().detail('2', { ticketId: 'Ticket_1' });
116
+ if (!ticket.success) console.warn(ticket.error?.message, ticket.logs);
117
+ } catch (e) {
118
+ if (e instanceof ApiException) console.error(e.status, e.response);
119
+ }
120
+ ```
121
+
122
+ ## Examples
123
+
124
+ ### Filter work tasks by field values
125
+
126
+ `filteringExpression` combines conditions on fields with `PublicFilteringLogic.And` / `Or`; operands can be nested expressions.
127
+ Field values of a work task are returned in `fields`, one entry per field with its `values`.
128
+
129
+ ```ts
130
+ import { PublicFilteringLogic, WorkTaskSearchResult } from '@nebulateam/jarvis-sdk';
131
+
132
+ const workTasks = jarvis.createWorkTaskClient();
133
+
134
+ const response = await workTasks.searchV2('2', 'Workspace_12', {
135
+ startIndex: 0,
136
+ pageSize: 100,
137
+ showArchived: false,
138
+ sortField: 'version',
139
+ sortDescending: true,
140
+ filteringExpression: {
141
+ logic: PublicFilteringLogic.And,
142
+ operands: [
143
+ { field: 'modelname', value: 'PUMP-200' },
144
+ { field: 'taskstatusid', filterType: 'notEqual', value: 'TaskStatus_9' }
145
+ ]
146
+ }
147
+ });
148
+
149
+ const fieldValue = (task: WorkTaskSearchResult, fieldId: string) =>
150
+ task.fields?.find((f) => f.id?.toLowerCase() === fieldId)?.values?.[0];
151
+
152
+ for (const task of response.data ?? []) {
153
+ console.log(task.title, fieldValue(task, 'modelname'), fieldValue(task, 'assettype'));
154
+ }
155
+ ```
156
+
157
+ ### Page through all the results
158
+
159
+ ```ts
160
+ const pageSize = 200;
161
+ const all: WorkTaskSearchResult[] = [];
162
+ for (let startIndex = 0; ; startIndex += pageSize) {
163
+ const page = await workTasks.searchV2('2', 'Workspace_12', { startIndex, pageSize, showArchived: false });
164
+ if (!page.success) throw new Error(page.error?.message);
165
+ all.push(...(page.data ?? []));
166
+ if (!page.data?.length || all.length >= (page.total ?? 0)) break;
167
+ }
168
+ ```
169
+
170
+ ### Search the selectable values of a field
171
+
172
+ Useful to build pickers for selection fields (users, datasets, other work tasks...):
173
+
174
+ ```ts
175
+ const fields = jarvis.createFieldsClient();
176
+
177
+ const selection = await fields.searchSelection('2', {
178
+ field: 'customer',
179
+ term: 'acme',
180
+ startIndex: 0,
181
+ numOfRecords: 20
182
+ });
183
+
184
+ const options = (selection.data?.items ?? []).map((item) => ({ id: item.id, label: item.title }));
185
+ console.log(`${options.length} of ${selection.data?.total ?? 0}`);
186
+ ```
187
+
188
+ ## Components embedded in Jarvis
189
+
190
+ `JarvisShell` lets a page shown inside Jarvis (iframe or web component) interact with the host:
191
+
192
+ ```ts
193
+ import { Jarvis, JarvisShell } from '@nebulateam/jarvis-sdk';
194
+
195
+ // served by Jarvis: calls go to the same Jarvis with the user session; on localhost to the given dev instance
196
+ const jarvis = Jarvis.Autodiscover({ url: 'https://my-dev-jarvis.example.com/', token: '<dev token>' }, undefined, { callInfoHeader: 'my-component' });
197
+
198
+ const shell = new JarvisShell();
199
+ shell.init((host, configuration) => {
200
+ host.showToast('Ready', `Hello ${configuration?.user.fullName}`, 'success');
201
+ host.on('WorkTask.Updated', (notification) => console.log('updated', notification.modelId));
202
+ host.on('WorkTask.Created', (notification) => console.log('created', notification.modelId));
203
+ });
204
+
205
+ // open a work task in Jarvis, in a new tab
206
+ shell.navigateById('WorkTask_42', 'Workspace_12', true);
207
+ ```
208
+
209
+ Available actions: `navigate`, `navigateById`, `openDetail`, `showToast`, `showDialog`, `showContextMenu` and subscriptions to Jarvis events (`on`).
210
+ The actions supported by the host are listed in `configuration.capabilities`.
211
+
212
+ ## Automation workflows
213
+
214
+ `AutomationClient` calls Jarvis Automation: `getWorkflowInstance`, `getWorkflowInstances`, `dispatchSignal`, `triggerWorkflow`,
215
+ and `request(path, init)` for any other Automation endpoint.
216
+
217
+ - In components served by Jarvis, `new AutomationClient()` uses urls relative to the page and the browser session.
218
+ - From scripts and Node.js, create it from the Jarvis client, with the same address, token and fetch:
219
+
220
+ ```ts
221
+ const automation = jarvis.createAutomationClient();
222
+ await automation.dispatchSignal('order-approved', { orderId: 'Order_42' });
223
+ const definitions = await automation.request('v1/workflow-definitions');
224
+ ```
225
+
226
+ or explicitly with `new AutomationClient({ baseUrl, token, callInfoHeader?, fetch? })`.
227
+ - Workflows whose HTTP endpoint allows unauthenticated calls can be triggered without a token.
@@ -0,0 +1,57 @@
1
+ import { DispatchSignalResponse, GetWorkflowInstancesRequest, WorkflowInstance, WorkflowResponse } from "./automation-client.models.js";
2
+ import type { JarvisFetch } from "./jarvis-client.js";
3
+ /** Options of {@link AutomationClient}; with none it behaves as in a page served by Jarvis. */
4
+ export interface AutomationClientOptions {
5
+ /** Jarvis address, e.g. https://my-jarvis.example.com; empty: urls relative to the page. */
6
+ baseUrl?: string;
7
+ /** API token sent as jarvis-auth-token; omit it in pages authenticated on Jarvis or for workflows callable unauthenticated. */
8
+ token?: string;
9
+ /** X-Jarvis-Call-Info header sent with every call. */
10
+ callInfoHeader?: string;
11
+ /** fetch used for the calls instead of the global one. */
12
+ fetch?: JarvisFetch;
13
+ }
14
+ /** Result of {@link AutomationClient.triggerWorkflow}. */
15
+ export declare class ResponseDto {
16
+ ok: boolean;
17
+ json: {
18
+ body?: any;
19
+ errorMessage?: string;
20
+ };
21
+ static create(ok: boolean, body?: string, errorMessage?: string): ResponseDto;
22
+ }
23
+ /**
24
+ * Client of Jarvis Automation (workflows).
25
+ * Without options, for components served by Jarvis: urls relative to the page and the browser session.
26
+ * With baseUrl and token (or from {@link JarvisClient.createAutomationClient}), from scripts and Node.js.
27
+ */
28
+ export declare class AutomationClient {
29
+ private baseUrl;
30
+ private workflowActivationBaseUrl;
31
+ private readonly automationRoot;
32
+ private readonly headers;
33
+ private readonly fetchImpl?;
34
+ constructor(options?: AutomationClientOptions);
35
+ /**
36
+ * Calls any Automation endpoint with the address, token and fetch of this client
37
+ * (e.g. the Elsa workflow-definitions api, which this client does not wrap).
38
+ * @param path relative to /automation, e.g. "v1/workflow-definitions"
39
+ */
40
+ request(path: string, init?: RequestInit): Promise<Response>;
41
+ /** Gets a workflow instance by id. @throws AutomationApiException when the call fails */
42
+ getWorkflowInstance(id: string): Promise<WorkflowInstance>;
43
+ /** Searches the instances of a workflow. @throws AutomationApiException when the call fails */
44
+ getWorkflowInstances(request: GetWorkflowInstancesRequest): Promise<WorkflowResponse>;
45
+ /** Dispatches a signal to the workflows waiting for it. @throws AutomationApiException when the call fails */
46
+ dispatchSignal(signalName: string, input: any): Promise<DispatchSignalResponse>;
47
+ /**
48
+ * Triggers a workflow exposed through an HTTP endpoint.
49
+ * @param endpointVerb the verb of the workflow endpoint
50
+ * @param url the endpoint path, relative to /automation/workflows
51
+ * @param inputs query parameters (GET) or body (POST, required)
52
+ */
53
+ triggerWorkflow(endpointVerb: 'GET' | 'POST', url: string, inputs?: string[][] | Record<string, string | string[]>): Promise<ResponseDto>;
54
+ private fetchGet;
55
+ private fetchPost;
56
+ private send;
57
+ }
@@ -0,0 +1,77 @@
1
+ /** Error raised by {@link AutomationClient} when Jarvis Automation answers with an error status. */
2
+ export declare class AutomationApiException extends Error {
3
+ message: string;
4
+ status: number;
5
+ constructor(message: string, status: number);
6
+ }
7
+ export interface WorkflowResponse {
8
+ $id: string;
9
+ items: WorkflowInstance[];
10
+ page: number;
11
+ pageSize: number;
12
+ totalCount: number;
13
+ }
14
+ export interface WorkflowInstanceFault {
15
+ $id: string;
16
+ message: string;
17
+ exception: {
18
+ $id: string;
19
+ type: string;
20
+ message: string;
21
+ stackTrace: string;
22
+ };
23
+ }
24
+ export interface WorkflowInstance {
25
+ $id: string;
26
+ id: string;
27
+ definitionId: string;
28
+ definitionVersionId: string;
29
+ version: number;
30
+ workflowStatus: string;
31
+ correlationId: string;
32
+ createdAt: string;
33
+ lastExecutedAt: string;
34
+ finishedAt: string;
35
+ metadata: {
36
+ $id: string;
37
+ };
38
+ variables: {
39
+ $id: string;
40
+ data: {
41
+ [key: string]: any;
42
+ };
43
+ };
44
+ faults: WorkflowInstanceFault[];
45
+ }
46
+ export interface GetWorkflowInstancesRequest {
47
+ status?: string;
48
+ orderBy: string;
49
+ pageSize: number;
50
+ workflow: string;
51
+ }
52
+ export interface DispatchSignalResponse {
53
+ startedWorkflows: StartedWorkflow[];
54
+ }
55
+ export interface StartedWorkflow {
56
+ workflowInstanceId: string;
57
+ workflowInstance: StartedWorkflowInstance;
58
+ activityId: string;
59
+ }
60
+ export interface StartedWorkflowInstance {
61
+ definitionId: string;
62
+ definitionVersionId: string;
63
+ version: number;
64
+ workflowStatus: string;
65
+ correlationId: string;
66
+ createdAt: string;
67
+ variables: {
68
+ data: any;
69
+ };
70
+ activityData: any;
71
+ metadata: any;
72
+ blockingActivities: any[];
73
+ faults: any[];
74
+ scheduledActivities: any[];
75
+ scopes: any[];
76
+ id: string;
77
+ }
@@ -0,0 +1,211 @@
1
+ import { AccountV2Client, ContactV2Client, ContainerV2Client, DatasetV2Client, DmsSearchV2Client, DocumentTypeV2Client, DocumentV2Client, FileUploadV2Client, JarvisApiBaseClient, JarvisApiConfig, JarvisFieldsV2Client, LongRunningJobPublicV2Client, PropertiesV2Client, TaskTypeV2Client, TicketV2Client, UsersV2Client, WorkTaskV2Client, WorkspaceV2Client, AvatarV2Client, IntegrationV2Client, WorkspacePlanningV2Client } from "./jarvis-public-api-v2.client.js";
2
+ import { ContactV1Client, IdTranslationV1Client, PropertiesV1Client } from "./jarvis-public-api.client.js";
3
+ import { AutomationClient } from "./automation-client.js";
4
+ /** Locale aware helpers to format dates for display and for the Jarvis API. */
5
+ export declare class Formatters {
6
+ private _locale;
7
+ /**
8
+ *Creates an instance of Formatters.
9
+ * @param {string} [_locale="it-IT"]
10
+ * @memberof Formatters
11
+ */
12
+ constructor(_locale?: string);
13
+ static longDate: Intl.DateTimeFormatOptions;
14
+ static shortDate: Intl.DateTimeFormatOptions;
15
+ /** Formats a date with the client locale (short date by default). */
16
+ dateTime: (date: Date, options?: Intl.DateTimeFormatOptions) => string;
17
+ /** Formats a date as yyyyMMdd, the date-only format expected by the Jarvis API. */
18
+ toAPIDateOnly: (date: Date) => string;
19
+ }
20
+ /** A fetch implementation: the global fetch by default, or a wrapper (logging, retries, tests). */
21
+ export type JarvisFetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
22
+ /** Options of {@link Jarvis.CreateClient}. */
23
+ export interface JarvisClientOptions {
24
+ /** X-Jarvis-Call-Info header sent with every call, to tag the calls made by the application. */
25
+ callInfoHeader?: string;
26
+ /** fetch used for the calls instead of the global one. */
27
+ fetch?: JarvisFetch;
28
+ }
29
+ /**
30
+ * Factory of the clients of the Jarvis public API, all sharing the same Jarvis address and credentials.
31
+ * Create it with {@link Jarvis.CreateClient} or {@link Jarvis.Autodiscover}.
32
+ * @example
33
+ * const jarvis = Jarvis.CreateClient('https://my-jarvis.example.com', '<api token>');
34
+ * const result = await jarvis.createWorkspaceClient().searchAllWorkspaces('2', { pageSize: 10 });
35
+ */
36
+ export declare class JarvisClient {
37
+ private root;
38
+ private token?;
39
+ private callInfo?;
40
+ /** Date formatting helpers. */
41
+ readonly format: Formatters;
42
+ private readonly http?;
43
+ /**
44
+ * @param root the Jarvis address, e.g. https://my-jarvis.example.com
45
+ * @param token the API token, sent in the jarvis-auth-token header; omit it when the browser session is already authenticated
46
+ * @param callInfo default value of the X-Jarvis-Call-Info header, which tags the calls made by this client
47
+ * @param fetch fetch used for the calls instead of the global one
48
+ */
49
+ constructor(root: string, token?: string | undefined, callInfo?: string | undefined, fetch?: JarvisFetch);
50
+ /**
51
+ * Creates an AutomationClient with the address, token and fetch of this client (scripts, Node.js).
52
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
53
+ */
54
+ createAutomationClient: (jarvisInfoHeader?: string) => AutomationClient;
55
+ /** True when the client points to a local Jarvis (localhost or 127.0.0.1). */
56
+ isLocalHost(): boolean;
57
+ /**
58
+ * Creates a TicketV2Client.
59
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
60
+ */
61
+ createTicketClient: (jarvisInfoHeader?: string) => TicketV2Client;
62
+ /**
63
+ * Creates a WorkspaceV2Client.
64
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
65
+ */
66
+ createWorkspaceClient: (jarvisInfoHeader?: string) => WorkspaceV2Client;
67
+ /**
68
+ * Creates a WorkspacePlanningV2Client.
69
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
70
+ */
71
+ createWorkspacePlanningClient: (jarvisInfoHeader?: string) => WorkspacePlanningV2Client;
72
+ /**
73
+ * Creates a WorkTaskV2Client.
74
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
75
+ */
76
+ createWorkTaskClient: (jarvisInfoHeader?: string) => WorkTaskV2Client;
77
+ /**
78
+ * Creates a DatasetV2Client.
79
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
80
+ */
81
+ createDatasetClient: (jarvisInfoHeader?: string) => DatasetV2Client;
82
+ /**
83
+ * Creates a DocumentV2Client.
84
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
85
+ */
86
+ createDocumentClient: (jarvisInfoHeader?: string) => DocumentV2Client;
87
+ /**
88
+ * Creates a ContainerV2Client.
89
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
90
+ */
91
+ createContainerClient: (jarvisInfoHeader?: string) => ContainerV2Client;
92
+ /**
93
+ * Creates a DocumentTypeV2Client.
94
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
95
+ */
96
+ createDocumentTypeClient: (jarvisInfoHeader?: string) => DocumentTypeV2Client;
97
+ /**
98
+ * Creates a DmsSearchV2Client.
99
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
100
+ */
101
+ createDmsSearchClient: (jarvisInfoHeader?: string) => DmsSearchV2Client;
102
+ /**
103
+ * Creates a UsersV2Client.
104
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
105
+ */
106
+ createUsersClient: (jarvisInfoHeader?: string) => UsersV2Client;
107
+ /**
108
+ * Creates a FileUploadV2Client.
109
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
110
+ */
111
+ createFileUploadClient: (jarvisInfoHeader?: string) => FileUploadV2Client;
112
+ /**
113
+ * Creates a ContactV1Client.
114
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
115
+ */
116
+ createContactV1Client: (jarvisInfoHeader?: string) => ContactV1Client;
117
+ /**
118
+ * Creates a ContactV2Client.
119
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
120
+ */
121
+ createContactV2Client: (jarvisInfoHeader?: string) => ContactV2Client;
122
+ /**
123
+ * Creates a AccountV2Client.
124
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
125
+ */
126
+ createAccountV2Client: (jarvisInfoHeader?: string) => AccountV2Client;
127
+ /**
128
+ * Creates a PropertiesV2Client.
129
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
130
+ */
131
+ createPropertiesClient: (jarvisInfoHeader?: string) => PropertiesV2Client;
132
+ /**
133
+ * Creates a JarvisFieldsV2Client.
134
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
135
+ */
136
+ createFieldsClient: (jarvisInfoHeader?: string) => JarvisFieldsV2Client;
137
+ /**
138
+ * Creates a PropertiesV1Client.
139
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
140
+ */
141
+ createPropertiesV1Client: (jarvisInfoHeader?: string) => PropertiesV1Client;
142
+ /**
143
+ * Creates a IdTranslationV1Client.
144
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
145
+ */
146
+ createIdTranslationV1Client: (jarvisInfoHeader?: string) => IdTranslationV1Client;
147
+ /**
148
+ * Creates a LongRunningJobPublicV2Client.
149
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
150
+ */
151
+ createLongRunningJobClient: (jarvisInfoHeader?: string) => LongRunningJobPublicV2Client;
152
+ /**
153
+ * Creates a TaskTypeV2Client.
154
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
155
+ */
156
+ createTaskTypeV2Client: (jarvisInfoHeader?: string) => TaskTypeV2Client;
157
+ /**
158
+ * Creates a AvatarV2Client.
159
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
160
+ */
161
+ createAvatarClient: (jarvisInfoHeader?: string) => AvatarV2Client;
162
+ /**
163
+ * Creates a IntegrationV2Client.
164
+ * @param jarvisInfoHeader overrides the X-Jarvis-Call-Info header for the calls of this client
165
+ */
166
+ createIntegrationClient: (jarvisInfoHeader?: string) => IntegrationV2Client;
167
+ }
168
+ /** Creates a generated API client with the configuration of a {@link JarvisClient}. */
169
+ export declare class JarvisTsClient<T extends JarvisApiBaseClient> {
170
+ private clientType;
171
+ private baseUrl?;
172
+ private token?;
173
+ private jarvisCallInfoHeader?;
174
+ constructor(clientType: new (config: JarvisApiConfig, baseUrl?: string, http?: {
175
+ fetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
176
+ }) => T, baseUrl?: string | undefined, token?: string | undefined, jarvisCallInfoHeader?: string | undefined);
177
+ /** @param http object whose fetch is used for the calls; the global fetch when missing */
178
+ createClient(http?: {
179
+ fetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
180
+ }): T;
181
+ }
182
+ /** Entry point of the SDK: creates a {@link JarvisClient}. */
183
+ export declare class Jarvis {
184
+ /**
185
+ * Creates a client for the given Jarvis address.
186
+ * @param root the Jarvis address, e.g. https://my-jarvis.example.com
187
+ * @param token the API token; omit it when the browser session is already authenticated
188
+ * @param contextInfo optional X-Jarvis-Call-Info header sent with every call and fetch to use instead of the global one
189
+ */
190
+ static CreateClient: (root: string, token?: string, contextInfo?: JarvisClientOptions) => JarvisClient;
191
+ /**
192
+ * For components hosted inside Jarvis: connects to the Jarvis that serves the page.
193
+ * On localhost it uses {@link Jarvis.CreateDevClient} instead.
194
+ * @param jarvisLocation Jarvis address and token to use during local development
195
+ * @param location the page location, window.location by default
196
+ */
197
+ static Autodiscover: (jarvisLocation?: {
198
+ url: string;
199
+ token: string;
200
+ }, location?: Location, contextInfo?: JarvisClientOptions) => JarvisClient;
201
+ /**
202
+ * Client for local development: uses jarvisLocation or, when missing, the JARVIS_URI and token
203
+ * globals defined by the development proxy.
204
+ */
205
+ static CreateDevClient: (jarvisLocation?: {
206
+ url: string;
207
+ token: string;
208
+ }, contextInfo?: JarvisClientOptions) => JarvisClient;
209
+ /** Creates a client for the Jarvis at the given page location (protocol, host and port). */
210
+ static ConnectTo: (location: Location, token?: string, contextInfo?: JarvisClientOptions) => JarvisClient;
211
+ }
@@ -0,0 +1,2 @@
1
+ export { AccountV1Client, AcesV1Client, AuthProxyV1Client, AvatarV1Client, ContactV1Client, ContainerV1Client, DatasetV1Client, DocumentTypeV1Client, DocumentV1Client, FileUploadV1Client, IdTranslationV1Client, JarvisAppConfigurationV1Client, LongRunningJobPublicV1Client, OutlookExtension1Client, PermalinkV1Client, PropertiesV1Client, PropertiesV1Old1Client, SearchV1Client, TeamsV1Client, TicketV1Client, UsersV1Client, WorkTaskV1Client, WorkspaceV1Client, } from './jarvis-public-api.client.js';
2
+ export type { CreateWorkTaskFromMailResponseDto, } from './jarvis-public-api.client.js';