@halix/action-sdk 1.0.28 → 1.0.30
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/lib/cjs/ai.js +227 -0
- package/lib/cjs/data-crud.js +7 -4
- package/lib/cjs/index.js +15 -3
- package/lib/cjs/preferences.js +47 -16
- package/lib/cjs/types/ai.d.ts +53 -0
- package/lib/cjs/types/ai.d.ts.map +1 -0
- package/lib/cjs/types/data-aggregate.d.ts +4 -4
- package/lib/cjs/types/data-aggregate.d.ts.map +1 -1
- package/lib/cjs/types/data-crud.d.ts +9 -7
- package/lib/cjs/types/data-crud.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +2 -2
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/lists.d.ts +5 -3
- package/lib/cjs/types/lists.d.ts.map +1 -1
- package/lib/cjs/types/preferences.d.ts +19 -4
- package/lib/cjs/types/preferences.d.ts.map +1 -1
- package/lib/esm/ai.js +201 -0
- package/lib/esm/ai.js.map +1 -0
- package/lib/esm/data-aggregate.js.map +1 -1
- package/lib/esm/data-crud.js +7 -4
- package/lib/esm/data-crud.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/index.mjs +9 -1
- package/lib/esm/lists.js.map +1 -1
- package/lib/esm/preferences.js +39 -14
- package/lib/esm/preferences.js.map +1 -1
- package/lib/esm/types/ai.d.ts +52 -0
- package/lib/esm/types/data-aggregate.d.ts +4 -4
- package/lib/esm/types/data-crud.d.ts +9 -7
- package/lib/esm/types/index.d.ts +2 -2
- package/lib/esm/types/lists.d.ts +5 -3
- package/lib/esm/types/preferences.d.ts +19 -4
- package/package.json +2 -1
- package/lib/cjs/filter-expressions.js +0 -10
- package/lib/cjs/types/filter-expressions.d.ts +0 -82
- package/lib/cjs/types/filter-expressions.d.ts.map +0 -1
- package/lib/esm/filter-expressions.js +0 -10
- package/lib/esm/filter-expressions.js.map +0 -1
- package/lib/esm/types/filter-expressions.d.ts +0 -81
package/lib/cjs/ai.js
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Halix SDK License v1.0
|
|
3
|
+
// Copyright (c) 2025 halix.io LLC.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed for use **only** within applications
|
|
6
|
+
// running on the Halix platform, in accordance with Halix SDK guidelines.
|
|
7
|
+
//
|
|
8
|
+
// Unauthorized use outside the Halix platform is prohibited.
|
|
9
|
+
// Full license terms available in the LICENSE file.
|
|
10
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
14
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
15
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
16
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
20
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.LLMProvider = void 0;
|
|
24
|
+
exports.sendAIMessage = sendAIMessage;
|
|
25
|
+
exports.sendAIMessageAsObservable = sendAIMessageAsObservable;
|
|
26
|
+
/**
|
|
27
|
+
* @module @halix/action-sdk/ai
|
|
28
|
+
* @description AI functions for the Halix Platform action SDK. This module provides
|
|
29
|
+
* functions for sending messages to LLM providers (Anthropic, OpenAI, Google, xAI)
|
|
30
|
+
* using API keys stored as organization preferences.
|
|
31
|
+
*/
|
|
32
|
+
const axios_1 = __importDefault(require("axios"));
|
|
33
|
+
const rxjs_1 = require("rxjs");
|
|
34
|
+
const preferences_1 = require("./preferences");
|
|
35
|
+
// ================================================================================
|
|
36
|
+
// TYPES AND ENUMS
|
|
37
|
+
// ================================================================================
|
|
38
|
+
/**
|
|
39
|
+
* Supported LLM providers.
|
|
40
|
+
*/
|
|
41
|
+
var LLMProvider;
|
|
42
|
+
(function (LLMProvider) {
|
|
43
|
+
LLMProvider["Anthropic"] = "anthropic";
|
|
44
|
+
LLMProvider["OpenAI"] = "openai";
|
|
45
|
+
LLMProvider["Google"] = "google";
|
|
46
|
+
LLMProvider["xAI"] = "xai";
|
|
47
|
+
})(LLMProvider || (exports.LLMProvider = LLMProvider = {}));
|
|
48
|
+
// ================================================================================
|
|
49
|
+
// INTERNAL HELPERS
|
|
50
|
+
// ================================================================================
|
|
51
|
+
/**
|
|
52
|
+
* Maps an LLM provider to the corresponding organization preference key.
|
|
53
|
+
*/
|
|
54
|
+
const providerPreferenceKeys = {
|
|
55
|
+
[LLMProvider.Anthropic]: 'AnthropicAPIKey',
|
|
56
|
+
[LLMProvider.OpenAI]: 'OpenAIAPIKey',
|
|
57
|
+
[LLMProvider.Google]: 'GoogleAPIKey',
|
|
58
|
+
[LLMProvider.xAI]: 'xAIAPIKey'
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Detects the LLM provider from a model name string.
|
|
62
|
+
*
|
|
63
|
+
* @param model - The model identifier (e.g. 'claude-3-sonnet', 'gpt-4o', 'gemini-2.0-flash', 'grok-3')
|
|
64
|
+
* @returns The detected LLMProvider
|
|
65
|
+
* @throws Error if the model name cannot be mapped to a known provider
|
|
66
|
+
*/
|
|
67
|
+
function detectProvider(model) {
|
|
68
|
+
const lowerModel = model.toLowerCase();
|
|
69
|
+
if (lowerModel.startsWith('claude')) {
|
|
70
|
+
return LLMProvider.Anthropic;
|
|
71
|
+
}
|
|
72
|
+
if (lowerModel.startsWith('gpt') || lowerModel.startsWith('o1') || lowerModel.startsWith('o3') || lowerModel.startsWith('o4')) {
|
|
73
|
+
return LLMProvider.OpenAI;
|
|
74
|
+
}
|
|
75
|
+
if (lowerModel.startsWith('gemini')) {
|
|
76
|
+
return LLMProvider.Google;
|
|
77
|
+
}
|
|
78
|
+
if (lowerModel.startsWith('grok')) {
|
|
79
|
+
return LLMProvider.xAI;
|
|
80
|
+
}
|
|
81
|
+
throw new Error(`Unable to detect LLM provider for model "${model}". ` +
|
|
82
|
+
`Supported model prefixes: claude (Anthropic), gpt/o1/o3/o4 (OpenAI), gemini (Google), grok (xAI).`);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Fetches the API key for the given provider from organization preferences.
|
|
86
|
+
*/
|
|
87
|
+
function getApiKey(provider) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
const prefKey = providerPreferenceKeys[provider];
|
|
90
|
+
const apiKey = yield (0, preferences_1.getOrganizationPreference)(prefKey);
|
|
91
|
+
if (!apiKey) {
|
|
92
|
+
throw new Error(`API key not configured. Set the "${prefKey}" organization preference to use ${provider} models.`);
|
|
93
|
+
}
|
|
94
|
+
return apiKey;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Sends a message to the Anthropic Messages API and returns the response text.
|
|
99
|
+
*/
|
|
100
|
+
function callAnthropic(model, message, apiKey, options) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
var _a;
|
|
103
|
+
const body = {
|
|
104
|
+
model,
|
|
105
|
+
max_tokens: (_a = options.maxTokens) !== null && _a !== void 0 ? _a : 1024,
|
|
106
|
+
messages: [{ role: 'user', content: message }]
|
|
107
|
+
};
|
|
108
|
+
if (options.systemPrompt) {
|
|
109
|
+
body.system = options.systemPrompt;
|
|
110
|
+
}
|
|
111
|
+
const response = yield axios_1.default.post('https://api.anthropic.com/v1/messages', body, {
|
|
112
|
+
headers: {
|
|
113
|
+
'x-api-key': apiKey,
|
|
114
|
+
'anthropic-version': '2023-06-01',
|
|
115
|
+
'Content-Type': 'application/json'
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
return response.data.content[0].text;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Sends a message to an OpenAI-compatible chat completions API and returns the response text.
|
|
123
|
+
* Used for both OpenAI and xAI (which uses the same API format).
|
|
124
|
+
*/
|
|
125
|
+
function callOpenAICompatible(baseUrl, model, message, apiKey, options) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
var _a;
|
|
128
|
+
const messages = [];
|
|
129
|
+
if (options.systemPrompt) {
|
|
130
|
+
messages.push({ role: 'system', content: options.systemPrompt });
|
|
131
|
+
}
|
|
132
|
+
messages.push({ role: 'user', content: message });
|
|
133
|
+
// GPT-5.x and newer models require max_completion_tokens instead of max_tokens
|
|
134
|
+
const lowerModel = model.toLowerCase();
|
|
135
|
+
const useMaxCompletionTokens = lowerModel.startsWith('gpt-5') || lowerModel.startsWith('gpt-6');
|
|
136
|
+
const tokenLimit = (_a = options.maxTokens) !== null && _a !== void 0 ? _a : 1024;
|
|
137
|
+
const body = Object.assign({ model,
|
|
138
|
+
messages }, (useMaxCompletionTokens
|
|
139
|
+
? { max_completion_tokens: tokenLimit }
|
|
140
|
+
: { max_tokens: tokenLimit }));
|
|
141
|
+
const response = yield axios_1.default.post(`${baseUrl}/chat/completions`, body, {
|
|
142
|
+
headers: {
|
|
143
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
144
|
+
'Content-Type': 'application/json'
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
return response.data.choices[0].message.content;
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Sends a message to the Google Gemini API and returns the response text.
|
|
152
|
+
*/
|
|
153
|
+
function callGoogle(model, message, apiKey, options) {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
var _a;
|
|
156
|
+
const contents = [];
|
|
157
|
+
if (options.systemPrompt) {
|
|
158
|
+
contents.push({ role: 'user', parts: [{ text: options.systemPrompt }] });
|
|
159
|
+
contents.push({ role: 'model', parts: [{ text: 'Understood.' }] });
|
|
160
|
+
}
|
|
161
|
+
contents.push({ role: 'user', parts: [{ text: message }] });
|
|
162
|
+
const body = {
|
|
163
|
+
contents,
|
|
164
|
+
generationConfig: {
|
|
165
|
+
maxOutputTokens: (_a = options.maxTokens) !== null && _a !== void 0 ? _a : 1024
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const response = yield axios_1.default.post(`https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent?key=${apiKey}`, body, {
|
|
169
|
+
headers: { 'Content-Type': 'application/json' }
|
|
170
|
+
});
|
|
171
|
+
return response.data.candidates[0].content.parts[0].text;
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
// ================================================================================
|
|
175
|
+
// PUBLIC API
|
|
176
|
+
// ================================================================================
|
|
177
|
+
/**
|
|
178
|
+
* Sends a message to an LLM and returns its text response.
|
|
179
|
+
*
|
|
180
|
+
* The LLM provider is automatically detected from the model name. The corresponding
|
|
181
|
+
* API key is retrieved from organization preferences:
|
|
182
|
+
* - Anthropic (claude-*) → AnthropicAPIKey
|
|
183
|
+
* - OpenAI (gpt-*, o1-*, o3-*, o4-*) → OpenAIAPIKey
|
|
184
|
+
* - Google (gemini-*) → GoogleAPIKey
|
|
185
|
+
* - xAI (grok-*) → xAIAPIKey
|
|
186
|
+
*
|
|
187
|
+
* @param message - The user message to send to the model
|
|
188
|
+
* @param model - The model identifier (e.g. 'claude-3-sonnet-20240229', 'gpt-4o', 'gemini-2.0-flash', 'grok-3')
|
|
189
|
+
* @param options - Optional configuration (system prompt, max tokens)
|
|
190
|
+
* @returns Promise<string> - The model's text response
|
|
191
|
+
* @throws Error if SDK not initialized, organization context unavailable, API key not configured, or model not recognized
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* // Simple usage
|
|
195
|
+
* const response = await sendAIMessage('What is the capital of France?', 'gpt-4o');
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* // With options
|
|
199
|
+
* const response = await sendAIMessage(
|
|
200
|
+
* 'Summarize this document.',
|
|
201
|
+
* 'claude-3-sonnet-20240229',
|
|
202
|
+
* { systemPrompt: 'You are a helpful assistant.', maxTokens: 2048 }
|
|
203
|
+
* );
|
|
204
|
+
*/
|
|
205
|
+
function sendAIMessage(message, model, options) {
|
|
206
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
207
|
+
const resolvedOptions = options !== null && options !== void 0 ? options : {};
|
|
208
|
+
const provider = detectProvider(model);
|
|
209
|
+
const apiKey = yield getApiKey(provider);
|
|
210
|
+
switch (provider) {
|
|
211
|
+
case LLMProvider.Anthropic:
|
|
212
|
+
return callAnthropic(model, message, apiKey, resolvedOptions);
|
|
213
|
+
case LLMProvider.OpenAI:
|
|
214
|
+
return callOpenAICompatible('https://api.openai.com/v1', model, message, apiKey, resolvedOptions);
|
|
215
|
+
case LLMProvider.Google:
|
|
216
|
+
return callGoogle(model, message, apiKey, resolvedOptions);
|
|
217
|
+
case LLMProvider.xAI:
|
|
218
|
+
return callOpenAICompatible('https://api.x.ai/v1', model, message, apiKey, resolvedOptions);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Observable version of sendAIMessage. See sendAIMessage for details.
|
|
224
|
+
*/
|
|
225
|
+
function sendAIMessageAsObservable(message, model, options) {
|
|
226
|
+
return (0, rxjs_1.from)(sendAIMessage(message, model, options));
|
|
227
|
+
}
|
package/lib/cjs/data-crud.js
CHANGED
|
@@ -88,9 +88,9 @@ function getObjectAsObservable(dataElementId, key, fetchedRelationships) {
|
|
|
88
88
|
* Retrieves all objects related to a parent through a schema relationship. Commonly used to get objects belonging to current user/org proxy.
|
|
89
89
|
*
|
|
90
90
|
* @param parentElementId - Parent element ID
|
|
91
|
-
* @param parentKey - Parent object key
|
|
91
|
+
* @param parentKey - Parent object key; important: this establishes the scope of the query; use an appropriate scope key
|
|
92
92
|
* @param elementId - Child element ID
|
|
93
|
-
* @param filter - Optional filter
|
|
93
|
+
* @param filter - Optional filter; call `dataexpr_agent` to generate the filter expression. Must be less than 200 characters.
|
|
94
94
|
* @param fetchedRelationships - Optional relationships to include as nested objects
|
|
95
95
|
* @returns Promise<any[]>
|
|
96
96
|
*/
|
|
@@ -134,9 +134,12 @@ function getRelatedObjectsAsObservable(parentElementId, parentKey, elementId, fi
|
|
|
134
134
|
/**
|
|
135
135
|
* Saves a related object and establishes relationship to parent. Returns saved object with any server-assigned values (objKey, calculated fields).
|
|
136
136
|
*
|
|
137
|
+
* @param parentElementId - Parent element ID
|
|
138
|
+
* @param parentKey - Parent object key; important: this establishes the scope of the save operation; use an appropriate scope Key
|
|
139
|
+
* @param elementId - Child element ID for the object being saved
|
|
137
140
|
* @param objectToSave - JSON string of object data
|
|
138
|
-
* @param opts - Optional
|
|
139
|
-
* @returns Promise<any> - saved object with updates
|
|
141
|
+
* @param opts - Optional save options (e.g., bypassValidation)
|
|
142
|
+
* @returns Promise<any> - saved object with updates including server-assigned values (objKey, calculated fields)
|
|
140
143
|
*/
|
|
141
144
|
function saveRelatedObject(parentElementId, parentKey, elementId, objectToSave, opts) {
|
|
142
145
|
return __awaiter(this, void 0, void 0, function* () {
|
package/lib/cjs/index.js
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
// Unauthorized use outside the Halix platform is prohibited.
|
|
9
9
|
// Full license terms available in the LICENSE file.
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.
|
|
11
|
+
exports.getValueFromObject = exports.compareValues = exports.sortObjectArray = exports.sendAIMessageAsObservable = exports.sendAIMessage = exports.LLMProvider = exports.getAggregateDataAsObservable = exports.getAggregateData = exports.AggregationResponse = exports.massDeleteAsObservable = exports.massDelete = exports.massEditAsObservable = exports.massEdit = exports.getListDataAsObservable = exports.getListData = exports.getOrganizationPreferenceAsObservable = exports.getUserPreferenceAsObservable = exports.getOrganizationPreference = exports.getUserPreference = exports.sendMessageAsObservable = exports.sendMessage = exports.MessageMethod = exports.createOrUpdateResourceAsObservable = exports.createOrUpdateResource = exports.sendFileContentsAsObservable = exports.sendFileContents = exports.saveResourceAsObservable = exports.saveResource = exports.getOrCreateResourceAsObservable = exports.getOrCreateResource = exports.deleteRelatedObjectsAsObservable = exports.deleteRelatedObjects = exports.deleteRelatedObjectAsObservable = exports.deleteRelatedObject = exports.saveRelatedObjectAsObservable = exports.saveRelatedObject = exports.getRelatedObjectsAsObservable = exports.getRelatedObjects = exports.getObjectAsObservable = exports.getObject = exports.prepareErrorResponse = exports.prepareSuccessResponse = exports.initialize = exports.useBody = exports.params = exports.userContext = exports.actionSubject = exports.serviceAddress = exports.sandboxKey = exports.getAuthToken = void 0;
|
|
12
|
+
exports.debounceFn = void 0;
|
|
12
13
|
/**
|
|
13
14
|
* @module @halix/action-sdk
|
|
14
15
|
* @description Halix Platform action SDK for developing NodeJS Lambda-based actions on the Halix
|
|
@@ -75,8 +76,10 @@ Object.defineProperty(exports, "sendMessageAsObservable", { enumerable: true, ge
|
|
|
75
76
|
// ================================================================================
|
|
76
77
|
var preferences_1 = require("./preferences");
|
|
77
78
|
// Preference Functions
|
|
78
|
-
Object.defineProperty(exports, "
|
|
79
|
-
Object.defineProperty(exports, "
|
|
79
|
+
Object.defineProperty(exports, "getUserPreference", { enumerable: true, get: function () { return preferences_1.getUserPreference; } });
|
|
80
|
+
Object.defineProperty(exports, "getOrganizationPreference", { enumerable: true, get: function () { return preferences_1.getOrganizationPreference; } });
|
|
81
|
+
Object.defineProperty(exports, "getUserPreferenceAsObservable", { enumerable: true, get: function () { return preferences_1.getUserPreferenceAsObservable; } });
|
|
82
|
+
Object.defineProperty(exports, "getOrganizationPreferenceAsObservable", { enumerable: true, get: function () { return preferences_1.getOrganizationPreferenceAsObservable; } });
|
|
80
83
|
// ================================================================================
|
|
81
84
|
// LIST DATA FUNCTIONS
|
|
82
85
|
// ================================================================================
|
|
@@ -98,6 +101,15 @@ Object.defineProperty(exports, "AggregationResponse", { enumerable: true, get: f
|
|
|
98
101
|
Object.defineProperty(exports, "getAggregateData", { enumerable: true, get: function () { return data_aggregate_1.getAggregateData; } });
|
|
99
102
|
Object.defineProperty(exports, "getAggregateDataAsObservable", { enumerable: true, get: function () { return data_aggregate_1.getAggregateDataAsObservable; } });
|
|
100
103
|
// ================================================================================
|
|
104
|
+
// AI FUNCTIONS
|
|
105
|
+
// ================================================================================
|
|
106
|
+
var ai_1 = require("./ai");
|
|
107
|
+
// AI Enums
|
|
108
|
+
Object.defineProperty(exports, "LLMProvider", { enumerable: true, get: function () { return ai_1.LLMProvider; } });
|
|
109
|
+
// AI Functions
|
|
110
|
+
Object.defineProperty(exports, "sendAIMessage", { enumerable: true, get: function () { return ai_1.sendAIMessage; } });
|
|
111
|
+
Object.defineProperty(exports, "sendAIMessageAsObservable", { enumerable: true, get: function () { return ai_1.sendAIMessageAsObservable; } });
|
|
112
|
+
// ================================================================================
|
|
101
113
|
// UTILITY FUNCTIONS
|
|
102
114
|
// ================================================================================
|
|
103
115
|
var utilities_1 = require("./utilities");
|
package/lib/cjs/preferences.js
CHANGED
|
@@ -20,8 +20,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
20
20
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
23
|
+
exports.getUserPreference = getUserPreference;
|
|
24
|
+
exports.getOrganizationPreference = getOrganizationPreference;
|
|
25
|
+
exports.getUserPreferenceAsObservable = getUserPreferenceAsObservable;
|
|
26
|
+
exports.getOrganizationPreferenceAsObservable = getOrganizationPreferenceAsObservable;
|
|
25
27
|
/**
|
|
26
28
|
* @module @halix/action-sdk/preferences
|
|
27
29
|
* @description Preference management functions for the Halix Platform action SDK. This module
|
|
@@ -41,23 +43,58 @@ const sdk_general_1 = require("./sdk-general");
|
|
|
41
43
|
* @throws Error if SDK not initialized or user context not available
|
|
42
44
|
*
|
|
43
45
|
* @example
|
|
44
|
-
* const preferenceValue = await
|
|
46
|
+
* const preferenceValue = await getUserPreference('myPreferenceId');
|
|
45
47
|
*/
|
|
46
|
-
function
|
|
48
|
+
function getUserPreference(prefID) {
|
|
47
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
50
|
var _a;
|
|
49
|
-
if (!sdk_general_1.
|
|
50
|
-
const errorMessage = '
|
|
51
|
+
if (!((_a = sdk_general_1.userContext === null || sdk_general_1.userContext === void 0 ? void 0 : sdk_general_1.userContext.user) === null || _a === void 0 ? void 0 : _a.objKey)) {
|
|
52
|
+
const errorMessage = 'User context not available. Cannot retrieve user preference value.';
|
|
51
53
|
console.error(errorMessage);
|
|
52
54
|
throw new Error(errorMessage);
|
|
53
55
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
return getPreferenceInternal(prefID, 'user', sdk_general_1.userContext.user.objKey);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Retrieves a preference value for the current organization.
|
|
61
|
+
*
|
|
62
|
+
* @param prefID - The preference ID to retrieve
|
|
63
|
+
* @returns Promise<any> - the preference value
|
|
64
|
+
* @throws Error if SDK not initialized or organization context not available
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* const preferenceValue = await getOrganizationPreference('myPreferenceId');
|
|
68
|
+
*/
|
|
69
|
+
function getOrganizationPreference(prefID) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
if (!(sdk_general_1.userContext === null || sdk_general_1.userContext === void 0 ? void 0 : sdk_general_1.userContext.orgKey)) {
|
|
72
|
+
const errorMessage = 'Organization context not available. Cannot retrieve organization preference value.';
|
|
73
|
+
console.error(errorMessage);
|
|
74
|
+
throw new Error(errorMessage);
|
|
75
|
+
}
|
|
76
|
+
return getPreferenceInternal(prefID, 'organization', sdk_general_1.userContext.orgKey);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Observable version of getUserPreference. See getUserPreference for details.
|
|
81
|
+
*/
|
|
82
|
+
function getUserPreferenceAsObservable(prefID) {
|
|
83
|
+
return (0, rxjs_1.from)(getUserPreference(prefID));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Observable version of getOrganizationPreference. See getOrganizationPreference for details.
|
|
87
|
+
*/
|
|
88
|
+
function getOrganizationPreferenceAsObservable(prefID) {
|
|
89
|
+
return (0, rxjs_1.from)(getOrganizationPreference(prefID));
|
|
90
|
+
}
|
|
91
|
+
function getPreferenceInternal(prefID, ownerElementID, ownerKey) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
if (!sdk_general_1.getAuthToken) {
|
|
94
|
+
const errorMessage = 'SDK not initialized.';
|
|
56
95
|
console.error(errorMessage);
|
|
57
96
|
throw new Error(errorMessage);
|
|
58
97
|
}
|
|
59
|
-
const ownerElementID = 'user';
|
|
60
|
-
const ownerKey = sdk_general_1.userContext.user.objKey;
|
|
61
98
|
let url = `${sdk_general_1.serviceAddress}/sysapi/preference/${prefID}/${ownerElementID}/${ownerKey}`;
|
|
62
99
|
let authToken = yield (0, rxjs_1.lastValueFrom)((0, sdk_general_1.getAuthToken)());
|
|
63
100
|
console.log("Sending GET request to " + url + " with token " + authToken);
|
|
@@ -67,9 +104,3 @@ function getPreference(prefID) {
|
|
|
67
104
|
return response.data;
|
|
68
105
|
});
|
|
69
106
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Observable version of getPreference. See getPreference for details.
|
|
72
|
-
*/
|
|
73
|
-
function getPreferenceAsObservable(prefID) {
|
|
74
|
-
return (0, rxjs_1.from)(getPreference(prefID));
|
|
75
|
-
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* Supported LLM providers.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum LLMProvider {
|
|
6
|
+
Anthropic = "anthropic",
|
|
7
|
+
OpenAI = "openai",
|
|
8
|
+
Google = "google",
|
|
9
|
+
xAI = "xai"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Options for configuring an AI message request.
|
|
13
|
+
*/
|
|
14
|
+
export interface AIRequestOptions {
|
|
15
|
+
/** Optional system prompt to guide the model's behavior */
|
|
16
|
+
systemPrompt?: string;
|
|
17
|
+
/** Maximum number of tokens in the response. Defaults to 1024 */
|
|
18
|
+
maxTokens?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Sends a message to an LLM and returns its text response.
|
|
22
|
+
*
|
|
23
|
+
* The LLM provider is automatically detected from the model name. The corresponding
|
|
24
|
+
* API key is retrieved from organization preferences:
|
|
25
|
+
* - Anthropic (claude-*) → AnthropicAPIKey
|
|
26
|
+
* - OpenAI (gpt-*, o1-*, o3-*, o4-*) → OpenAIAPIKey
|
|
27
|
+
* - Google (gemini-*) → GoogleAPIKey
|
|
28
|
+
* - xAI (grok-*) → xAIAPIKey
|
|
29
|
+
*
|
|
30
|
+
* @param message - The user message to send to the model
|
|
31
|
+
* @param model - The model identifier (e.g. 'claude-3-sonnet-20240229', 'gpt-4o', 'gemini-2.0-flash', 'grok-3')
|
|
32
|
+
* @param options - Optional configuration (system prompt, max tokens)
|
|
33
|
+
* @returns Promise<string> - The model's text response
|
|
34
|
+
* @throws Error if SDK not initialized, organization context unavailable, API key not configured, or model not recognized
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Simple usage
|
|
38
|
+
* const response = await sendAIMessage('What is the capital of France?', 'gpt-4o');
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // With options
|
|
42
|
+
* const response = await sendAIMessage(
|
|
43
|
+
* 'Summarize this document.',
|
|
44
|
+
* 'claude-3-sonnet-20240229',
|
|
45
|
+
* { systemPrompt: 'You are a helpful assistant.', maxTokens: 2048 }
|
|
46
|
+
* );
|
|
47
|
+
*/
|
|
48
|
+
export declare function sendAIMessage(message: string, model: string, options?: AIRequestOptions): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* Observable version of sendAIMessage. See sendAIMessage for details.
|
|
51
|
+
*/
|
|
52
|
+
export declare function sendAIMessageAsObservable(message: string, model: string, options?: AIRequestOptions): Observable<string>;
|
|
53
|
+
//# sourceMappingURL=ai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../../src/ai.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAQ,UAAU,EAAE,MAAM,MAAM,CAAC;AAOxC;;GAEG;AACH,oBAAY,WAAW;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,GAAG,QAAQ;CACd;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AA2JD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAe/G;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,UAAU,CAAC,MAAM,CAAC,CAExH"}
|
|
@@ -62,20 +62,20 @@ export interface AggregationRequest {
|
|
|
62
62
|
* The ID of the parent data element that defines the overall scope of records.
|
|
63
63
|
* The dataElementId must be related to this through a foreign key or key array.
|
|
64
64
|
*/
|
|
65
|
-
parentDataElementId
|
|
65
|
+
parentDataElementId: string;
|
|
66
66
|
/**
|
|
67
67
|
* The key of a parent object that all records must be related to.
|
|
68
68
|
* Works with parentDataElementId to scope results.
|
|
69
69
|
*/
|
|
70
|
-
parentKey
|
|
70
|
+
parentKey: string;
|
|
71
71
|
/**
|
|
72
72
|
* Optional field to specify the foreign key field on the data element that defines
|
|
73
73
|
* the relationship to the parent. If omitted, a derived key is assumed.
|
|
74
74
|
*/
|
|
75
75
|
parentKeyField?: string;
|
|
76
76
|
/**
|
|
77
|
-
* Filter expression to limit records before aggregation.
|
|
78
|
-
*
|
|
77
|
+
* Filter expression to limit records before aggregation. Call `dataexpr_agent` to generate the
|
|
78
|
+
* filter expression.
|
|
79
79
|
*/
|
|
80
80
|
filter?: string;
|
|
81
81
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-aggregate.d.ts","sourceRoot":"","sources":["../../../src/data-aggregate.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAQ,UAAU,EAAiB,MAAM,MAAM,CAAC;AAOvD;;GAEG;AACH,MAAM,MAAM,aAAa,GACnB,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GACrD,WAAW,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,eAAe,GACrB,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC,2CAA2C;IAC3C,SAAS,EAAE,aAAa,CAAC;IACzB,gDAAgD;IAChD,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,iGAAiG;IACjG,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,cAAc,EAAE,KAAK,GAAG,MAAM,CAAC;IAC/B,yDAAyD;IACzD,UAAU,CAAC,EAAE,yB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AAG,OAAO,CAAC,mBAAmB,CAAC,CAqBhG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,kBAAkB,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAEzG"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { FilterExpression } from './filter-expressions';
|
|
3
2
|
/**
|
|
4
3
|
* SaveOptions is an interface for specifying save operation options.
|
|
5
4
|
*/
|
|
@@ -21,23 +20,26 @@ export declare function getObjectAsObservable(dataElementId: string, key: string
|
|
|
21
20
|
* Retrieves all objects related to a parent through a schema relationship. Commonly used to get objects belonging to current user/org proxy.
|
|
22
21
|
*
|
|
23
22
|
* @param parentElementId - Parent element ID
|
|
24
|
-
* @param parentKey - Parent object key
|
|
23
|
+
* @param parentKey - Parent object key; important: this establishes the scope of the query; use an appropriate scope key
|
|
25
24
|
* @param elementId - Child element ID
|
|
26
|
-
* @param filter - Optional filter
|
|
25
|
+
* @param filter - Optional filter; call `dataexpr_agent` to generate the filter expression. Must be less than 200 characters.
|
|
27
26
|
* @param fetchedRelationships - Optional relationships to include as nested objects
|
|
28
27
|
* @returns Promise<any[]>
|
|
29
28
|
*/
|
|
30
|
-
export declare function getRelatedObjects(parentElementId: string, parentKey: string, elementId: string, filter?:
|
|
29
|
+
export declare function getRelatedObjects(parentElementId: string, parentKey: string, elementId: string, filter?: string, fetchedRelationships?: string[]): Promise<any[]>;
|
|
31
30
|
/**
|
|
32
31
|
* Observable version of getRelatedObjects. See getRelatedObjects for details.
|
|
33
32
|
*/
|
|
34
|
-
export declare function getRelatedObjectsAsObservable(parentElementId: string, parentKey: string, elementId: string, filter?:
|
|
33
|
+
export declare function getRelatedObjectsAsObservable(parentElementId: string, parentKey: string, elementId: string, filter?: string, fetchedRelationships?: string[]): Observable<any[]>;
|
|
35
34
|
/**
|
|
36
35
|
* Saves a related object and establishes relationship to parent. Returns saved object with any server-assigned values (objKey, calculated fields).
|
|
37
36
|
*
|
|
37
|
+
* @param parentElementId - Parent element ID
|
|
38
|
+
* @param parentKey - Parent object key; important: this establishes the scope of the save operation; use an appropriate scope Key
|
|
39
|
+
* @param elementId - Child element ID for the object being saved
|
|
38
40
|
* @param objectToSave - JSON string of object data
|
|
39
|
-
* @param opts - Optional
|
|
40
|
-
* @returns Promise<any> - saved object with updates
|
|
41
|
+
* @param opts - Optional save options (e.g., bypassValidation)
|
|
42
|
+
* @returns Promise<any> - saved object with updates including server-assigned values (objKey, calculated fields)
|
|
41
43
|
*/
|
|
42
44
|
export declare function saveRelatedObject(parentElementId: string, parentKey: string, elementId: string, objectToSave: string, opts?: SaveOptions): Promise<any>;
|
|
43
45
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-crud.d.ts","sourceRoot":"","sources":["../../../src/data-crud.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAQ,UAAU,EAAiB,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"data-crud.d.ts","sourceRoot":"","sources":["../../../src/data-crud.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAQ,UAAU,EAAiB,MAAM,MAAM,CAAC;AAOvD;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,mCAAmC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAMD;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,MAAM,EAAE,gBA6BlG;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,CAE1H;AAED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,E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AG,OAAO,CAAC,OAAO,CAAC,CAuBpJ;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAE7J"}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -7,9 +7,9 @@ export { getAuthToken, sandboxKey, serviceAddress, actionSubject, userContext, p
|
|
|
7
7
|
export { type SaveOptions, getObject, getObjectAsObservable, getRelatedObjects, getRelatedObjectsAsObservable, saveRelatedObject, saveRelatedObjectAsObservable, deleteRelatedObject, deleteRelatedObjectAsObservable, deleteRelatedObjects, deleteRelatedObjectsAsObservable } from './data-crud';
|
|
8
8
|
export { type ContentResource, getOrCreateResource, getOrCreateResourceAsObservable, saveResource, saveResourceAsObservable, sendFileContents, sendFileContentsAsObservable, createOrUpdateResource, createOrUpdateResourceAsObservable } from './content';
|
|
9
9
|
export { MessageMethod, type MessageRequest, sendMessage, sendMessageAsObservable } from './messaging';
|
|
10
|
-
export {
|
|
11
|
-
export { type FilterExpression } from './filter-expressions';
|
|
10
|
+
export { getUserPreference, getOrganizationPreference, getUserPreferenceAsObservable, getOrganizationPreferenceAsObservable } from './preferences';
|
|
12
11
|
export { type SortField, type DataSortField, type BaseListDataRequest, type PagedListDataRequest, type ListDataResponse, type ListDataOptions, type ListDataSearchOptions, type MassEditValueType, type MassEditRequest, type MassDeleteRequest, type MassChangeResponse, getListData, getListDataAsObservable, massEdit, massEditAsObservable, massDelete, massDeleteAsObservable } from './lists';
|
|
13
12
|
export { AggregationResponse, type AggregationRequest, type AggregationRow, type AggregationGroup, type AggregationSort, type Aggregation, type AggregationGroupTransform, type TransformType, type AggregationType, getAggregateData, getAggregateDataAsObservable } from './data-aggregate';
|
|
13
|
+
export { LLMProvider, type AIRequestOptions, sendAIMessage, sendAIMessageAsObservable } from './ai';
|
|
14
14
|
export { sortObjectArray, compareValues, getValueFromObject, debounceFn } from './utilities';
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AASA;;;;GAIG;AAMH,OAAO,EAEH,YAAY,EACZ,UAAU,EACV,cAAc,EACd,aAAa,EACb,WAAW,EACX,MAAM,EACN,OAAO,EAGP,UAAU,EAGV,KAAK,WAAW,EAChB,KAAK,iBAAiB,EAGtB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAGlB,sBAAsB,EACtB,oBAAoB,EACvB,MAAM,eAAe,CAAC;AAMvB,OAAO,EAEH,KAAK,WAAW,EAGhB,SAAS,EACT,qBAAqB,EACrB,iBAAiB,EACjB,6BAA6B,EAG7B,iBAAiB,EACjB,6BAA6B,EAG7B,mBAAmB,EACnB,+BAA+B,EAC/B,oBAAoB,EACpB,gCAAgC,EACnC,MAAM,aAAa,CAAC;AAMrB,OAAO,EAEH,KAAK,eAAe,EAGpB,mBAAmB,EACnB,+BAA+B,EAC/B,YAAY,EACZ,wBAAwB,EACxB,gBAAgB,EAChB,4BAA4B,EAC5B,sBAAsB,EACtB,kCAAkC,EACrC,MAAM,WAAW,CAAC;AAMnB,OAAO,EAEH,aAAa,EAGb,KAAK,cAAc,EAGnB,WAAW,EACX,uBAAuB,EAC1B,MAAM,aAAa,CAAC;AAMrB,OAAO,EAEH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AASA;;;;GAIG;AAMH,OAAO,EAEH,YAAY,EACZ,UAAU,EACV,cAAc,EACd,aAAa,EACb,WAAW,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B,OAAO,EAEH,mBAAmB,EAGnB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAClB,KAAK,eAAe,EAGpB,gBAAgB,EAChB,4BAA4B,EAC/B,MAAM,kBAAkB,CAAC;AAM1B,OAAO,EAEH,WAAW,EAGX,KAAK,gBAAgB,EAGrB,aAAa,EACb,yBAAyB,EAC5B,MAAM,MAAM,CAAC;AAMd,OAAO,EACH,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,UAAU,EACb,MAAM,aAAa,CAAC"}
|
package/lib/cjs/types/lists.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { FilterExpression } from './filter-expressions';
|
|
3
2
|
/**
|
|
4
3
|
* SortField is an interface for specifying sort fields.
|
|
5
4
|
*/
|
|
@@ -46,6 +45,8 @@ export interface BaseListDataRequest {
|
|
|
46
45
|
/**
|
|
47
46
|
* The key of an object that all records must be related to.
|
|
48
47
|
* Works with parentDataElementId to scope results.
|
|
48
|
+
*
|
|
49
|
+
* Important: this establishes the scope of the query; use an appropriate scope key
|
|
49
50
|
*/
|
|
50
51
|
parentKey?: string;
|
|
51
52
|
/**
|
|
@@ -60,9 +61,10 @@ export interface BaseListDataRequest {
|
|
|
60
61
|
childKeysField?: string;
|
|
61
62
|
/**
|
|
62
63
|
* Filter expression to limit results. Evaluated within the parent key scope.
|
|
63
|
-
*
|
|
64
|
+
* Call `dataexpr_agent` to generate the filter expression.
|
|
65
|
+
* Must be less than 200 characters.
|
|
64
66
|
*/
|
|
65
|
-
filter?:
|
|
67
|
+
filter?: string;
|
|
66
68
|
/**
|
|
67
69
|
* List of fields being displayed on the list. Only these fields are populated in
|
|
68
70
|
* returned objects to reduce payload size. If fields include relationship paths,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../../src/lists.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAQ,UAAU,EAAiB,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"lists.d.ts","sourceRoot":"","sources":["../../../src/lists.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAQ,UAAU,EAAiB,MAAM,MAAM,CAAC;AAOvD;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qDAAqD;IACrD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,qCAAqC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,8GAA8G;IAC9G,WAAW,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC;IAEvB;;;;;OAKG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC7D;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,C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