@aui.io/aui-client 1.2.40 → 2.0.0
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 +108 -2
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/controllerApi/client/Client.d.ts +0 -13
- package/dist/cjs/api/resources/controllerApi/client/Client.js +0 -66
- package/dist/cjs/api/resources/controllerApi/client/requests/CreateTaskRequest.d.ts +1 -0
- package/dist/cjs/api/resources/controllerApi/client/requests/SubmitMessageRequest.d.ts +0 -1
- package/dist/cjs/api/resources/controllerApi/client/requests/index.d.ts +0 -1
- package/dist/cjs/api/types/AgentMetadata.d.ts +6 -0
- package/dist/cjs/api/types/ConstraintTriggerType.d.ts +5 -0
- package/dist/cjs/api/types/ConstraintTriggerType.js +8 -0
- package/dist/cjs/api/types/LatencyMetadata.d.ts +6 -0
- package/dist/cjs/api/types/LatencyUnit.d.ts +7 -0
- package/dist/cjs/api/types/LatencyUnit.js +10 -0
- package/dist/cjs/api/types/OffsetType.d.ts +6 -0
- package/dist/cjs/api/types/OffsetType.js +9 -0
- package/dist/cjs/api/types/OffsetUnit.d.ts +10 -0
- package/dist/cjs/api/types/OffsetUnit.js +13 -0
- package/dist/cjs/api/types/OptionsSearchSelfReviewMethod.d.ts +2 -0
- package/dist/cjs/api/types/OptionsSearchSelfReviewMethod.js +2 -0
- package/dist/cjs/api/types/SimpleViewCondition.d.ts +66 -0
- package/dist/cjs/api/types/SimpleViewCondition.js +3 -0
- package/dist/cjs/api/types/SimpleViewMethod.d.ts +19 -0
- package/dist/cjs/api/types/SimpleViewMethod.js +22 -0
- package/dist/cjs/api/types/SimpleViewOperation.d.ts +48 -0
- package/dist/cjs/api/types/SimpleViewOperation.js +51 -0
- package/dist/cjs/api/types/TaskParameter.d.ts +5 -1
- package/dist/cjs/api/types/TraceDecisionRuleTriggered.d.ts +2 -1
- package/dist/cjs/api/types/TraceDecisionToolTextResponse.d.ts +2 -0
- package/dist/cjs/api/types/TraceEntity.d.ts +4 -1
- package/dist/cjs/api/types/TraceInfo.d.ts +2 -0
- package/dist/cjs/api/types/TraceMcpIntegration.d.ts +2 -0
- package/dist/cjs/api/types/TraceMcpToolCall.d.ts +2 -0
- package/dist/cjs/api/types/TraceReferencedEntity.d.ts +4 -1
- package/dist/cjs/api/types/TraceRuleAction.d.ts +1 -0
- package/dist/cjs/api/types/TraceRuleAction.js +1 -0
- package/dist/cjs/api/types/TraceRuleAskForConfirmation.d.ts +13 -0
- package/dist/cjs/api/types/TraceRuleAskForConfirmation.js +3 -0
- package/dist/cjs/api/types/TraceRuleConditionResult.d.ts +5 -0
- package/dist/cjs/api/types/TraceRuleConditionResult.js +3 -0
- package/dist/cjs/api/types/TraceRuleTriggerEvaluation.d.ts +6 -0
- package/dist/cjs/api/types/TraceRuleTriggerEvaluation.js +3 -0
- package/dist/cjs/api/types/TraceRuleType.d.ts +1 -0
- package/dist/cjs/api/types/TraceRuleType.js +1 -0
- package/dist/cjs/api/types/TraceSelfReviewEntity.d.ts +4 -2
- package/dist/cjs/api/types/index.d.ts +12 -1
- package/dist/cjs/api/types/index.js +12 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/controllerApi/client/Client.d.mts +0 -13
- package/dist/esm/api/resources/controllerApi/client/Client.mjs +0 -66
- package/dist/esm/api/resources/controllerApi/client/requests/CreateTaskRequest.d.mts +1 -0
- package/dist/esm/api/resources/controllerApi/client/requests/SubmitMessageRequest.d.mts +0 -1
- package/dist/esm/api/resources/controllerApi/client/requests/index.d.mts +0 -1
- package/dist/esm/api/types/AgentMetadata.d.mts +6 -0
- package/dist/esm/api/types/ConstraintTriggerType.d.mts +5 -0
- package/dist/esm/api/types/ConstraintTriggerType.mjs +5 -0
- package/dist/esm/api/types/LatencyMetadata.d.mts +6 -0
- package/dist/esm/api/types/LatencyUnit.d.mts +7 -0
- package/dist/esm/api/types/LatencyUnit.mjs +7 -0
- package/dist/esm/api/types/OffsetType.d.mts +6 -0
- package/dist/esm/api/types/OffsetType.mjs +6 -0
- package/dist/esm/api/types/OffsetUnit.d.mts +10 -0
- package/dist/esm/api/types/OffsetUnit.mjs +10 -0
- package/dist/esm/api/types/OptionsSearchSelfReviewMethod.d.mts +2 -0
- package/dist/esm/api/types/OptionsSearchSelfReviewMethod.mjs +2 -0
- package/dist/esm/api/types/SimpleViewCondition.d.mts +66 -0
- package/dist/esm/api/types/SimpleViewCondition.mjs +2 -0
- package/dist/esm/api/types/SimpleViewMethod.d.mts +19 -0
- package/dist/esm/api/types/SimpleViewMethod.mjs +19 -0
- package/dist/esm/api/types/SimpleViewOperation.d.mts +48 -0
- package/dist/esm/api/types/SimpleViewOperation.mjs +48 -0
- package/dist/esm/api/types/TaskParameter.d.mts +5 -1
- package/dist/esm/api/types/TraceDecisionRuleTriggered.d.mts +2 -1
- package/dist/esm/api/types/TraceDecisionToolTextResponse.d.mts +2 -0
- package/dist/esm/api/types/TraceEntity.d.mts +4 -1
- package/dist/esm/api/types/TraceInfo.d.mts +2 -0
- package/dist/esm/api/types/TraceMcpIntegration.d.mts +2 -0
- package/dist/esm/api/types/TraceMcpToolCall.d.mts +2 -0
- package/dist/esm/api/types/TraceReferencedEntity.d.mts +4 -1
- package/dist/esm/api/types/TraceRuleAction.d.mts +1 -0
- package/dist/esm/api/types/TraceRuleAction.mjs +1 -0
- package/dist/esm/api/types/TraceRuleAskForConfirmation.d.mts +13 -0
- package/dist/esm/api/types/TraceRuleAskForConfirmation.mjs +2 -0
- package/dist/esm/api/types/TraceRuleConditionResult.d.mts +5 -0
- package/dist/esm/api/types/TraceRuleConditionResult.mjs +2 -0
- package/dist/esm/api/types/TraceRuleTriggerEvaluation.d.mts +6 -0
- package/dist/esm/api/types/TraceRuleTriggerEvaluation.mjs +2 -0
- package/dist/esm/api/types/TraceRuleType.d.mts +1 -0
- package/dist/esm/api/types/TraceRuleType.mjs +1 -0
- package/dist/esm/api/types/TraceSelfReviewEntity.d.mts +4 -2
- package/dist/esm/api/types/index.d.mts +12 -1
- package/dist/esm/api/types/index.mjs +12 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +0 -51
- package/dist/cjs/api/resources/controllerApi/client/requests/GetProductMetadataRequest.d.ts +0 -9
- package/dist/cjs/api/types/TracSelfReviewSubEntity.d.ts +0 -4
- package/dist/esm/api/resources/controllerApi/client/requests/GetProductMetadataRequest.d.mts +0 -9
- package/dist/esm/api/types/TracSelfReviewSubEntity.d.mts +0 -4
- /package/dist/cjs/api/{resources/controllerApi/client/requests/GetProductMetadataRequest.js → types/AgentMetadata.js} +0 -0
- /package/dist/cjs/api/types/{TracSelfReviewSubEntity.js → LatencyMetadata.js} +0 -0
- /package/dist/esm/api/{resources/controllerApi/client/requests/GetProductMetadataRequest.mjs → types/AgentMetadata.mjs} +0 -0
- /package/dist/esm/api/types/{TracSelfReviewSubEntity.mjs → LatencyMetadata.mjs} +0 -0
package/README.md
CHANGED
|
@@ -100,7 +100,7 @@ socket.on('open', () => {
|
|
|
100
100
|
// Handle streaming responses
|
|
101
101
|
socket.on('message', (message) => {
|
|
102
102
|
// Streaming updates (partial responses)
|
|
103
|
-
if (message.channel?.
|
|
103
|
+
if (message.channel?.event_name === 'thread-message-text-content-updated') {
|
|
104
104
|
console.log('Agent is typing:', message.data?.text);
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -386,6 +386,53 @@ response.suggestions?.forEach((suggestion, index) => {
|
|
|
386
386
|
});
|
|
387
387
|
```
|
|
388
388
|
|
|
389
|
+
#### `startTextConversation(request)` - Start Text Conversation (NEW)
|
|
390
|
+
Start a phone-channel conversation (SMS or WhatsApp) with an initial outbound message.
|
|
391
|
+
|
|
392
|
+
The SDK creates a task on the AUI backend and then proxies to the `third-party-auth` service so the first message is delivered to the recipient over the chosen channel. Subsequent inbound replies from the user feed back into the same task and can be observed via the standard message / WebSocket APIs.
|
|
393
|
+
|
|
394
|
+
```typescript
|
|
395
|
+
const response = await client.controllerApi.startTextConversation({
|
|
396
|
+
phoneNumber: string, // Recipient phone number in E.164 format (e.g., '+19999999999')
|
|
397
|
+
channel: 'sms' | 'whatsapp',// Outbound channel
|
|
398
|
+
message?: string // Optional initial message to send (e.g., 'Hello!')
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
// Returns: TextConversationInitiateResponse
|
|
402
|
+
// {
|
|
403
|
+
// status: boolean, // true on success
|
|
404
|
+
// data: Record<string, string>, // backend payload (e.g., task / message identifiers)
|
|
405
|
+
// message: string, // human-readable status message
|
|
406
|
+
// statusCode: number // HTTP-style status code
|
|
407
|
+
// }
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
**Parameters:**
|
|
411
|
+
|
|
412
|
+
- `phoneNumber` *(required)* — Must include the country code in E.164 format. Example: `+15551234567`. Numbers without a country code are rejected by the upstream third-party-auth service.
|
|
413
|
+
- `channel` *(required)* — Either `'sms'` or `'whatsapp'`. Determines which provider sends the initial message.
|
|
414
|
+
- `message` *(optional)* — The first outbound message body. If omitted, the conversation is created but no initial message is sent.
|
|
415
|
+
|
|
416
|
+
**Example:**
|
|
417
|
+
|
|
418
|
+
```typescript
|
|
419
|
+
const response = await client.controllerApi.startTextConversation({
|
|
420
|
+
phoneNumber: '+19999999999',
|
|
421
|
+
channel: 'sms',
|
|
422
|
+
message: 'Hello!'
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
console.log('Status: ', response.status); // true
|
|
426
|
+
console.log('Status Code:', response.statusCode); // e.g. 200
|
|
427
|
+
console.log('Message: ', response.message); // e.g. 'Conversation initiated'
|
|
428
|
+
console.log('Data: ', response.data); // e.g. { task_id: '...', ... }
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
> ℹ️ **Tip:** During development you can default to a sandbox number with an env var, e.g.
|
|
432
|
+
> `phoneNumber: process.env.TEST_PHONE_NUMBER ?? '+15551234567'`. The placeholder
|
|
433
|
+
> `+15551234567` is rejected by the upstream provider — use a real, reachable E.164
|
|
434
|
+
> number to validate end-to-end delivery.
|
|
435
|
+
|
|
389
436
|
---
|
|
390
437
|
|
|
391
438
|
### WebSocket API
|
|
@@ -491,7 +538,7 @@ async function searchProducts(userId: string, query: string) {
|
|
|
491
538
|
});
|
|
492
539
|
|
|
493
540
|
socket.on('message', (message) => {
|
|
494
|
-
if (message.channel?.
|
|
541
|
+
if (message.channel?.event_name === 'thread-message-text-content-updated') {
|
|
495
542
|
// Show real-time updates
|
|
496
543
|
console.log('Agent:', message.data?.text);
|
|
497
544
|
}
|
|
@@ -712,6 +759,63 @@ getSuggestedQuestions('task-123', 'user-456');
|
|
|
712
759
|
// 3. "Can I schedule a test drive?"
|
|
713
760
|
```
|
|
714
761
|
|
|
762
|
+
### Start a Text Conversation - SMS / WhatsApp (NEW)
|
|
763
|
+
|
|
764
|
+
Reach a user over their phone channel (SMS or WhatsApp) with an initial outbound message. Internally, the SDK creates a task and dispatches the first message through Apollo's `third-party-auth` service — replies from the user thread back into the same task so you can keep using the existing message APIs and WebSocket events.
|
|
765
|
+
|
|
766
|
+
```typescript
|
|
767
|
+
import { ApolloClient, Apollo } from '@aui.io/aui-client';
|
|
768
|
+
|
|
769
|
+
const client = new ApolloClient({
|
|
770
|
+
networkApiKey: 'API_KEY_YOUR_KEY_HERE'
|
|
771
|
+
});
|
|
772
|
+
|
|
773
|
+
async function startTextConversation(
|
|
774
|
+
phoneNumber: string,
|
|
775
|
+
channel: 'sms' | 'whatsapp',
|
|
776
|
+
message: string
|
|
777
|
+
) {
|
|
778
|
+
try {
|
|
779
|
+
const response: Apollo.TextConversationInitiateResponse =
|
|
780
|
+
await client.controllerApi.startTextConversation({
|
|
781
|
+
phoneNumber, // E.164 format, e.g. '+19999999999'
|
|
782
|
+
channel, // 'sms' or 'whatsapp'
|
|
783
|
+
message // initial message body, e.g. 'Hello!'
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
console.log('✅ Conversation initiated');
|
|
787
|
+
console.log(' Status: ', response.status);
|
|
788
|
+
console.log(' Status Code:', response.statusCode);
|
|
789
|
+
console.log(' Message: ', response.message);
|
|
790
|
+
console.log(' Data: ', response.data);
|
|
791
|
+
|
|
792
|
+
return response;
|
|
793
|
+
} catch (error: any) {
|
|
794
|
+
console.error('❌ Error starting text conversation:', error.message);
|
|
795
|
+
if (error.body) {
|
|
796
|
+
console.error(' Body:', error.body);
|
|
797
|
+
}
|
|
798
|
+
throw error;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
// SMS
|
|
803
|
+
startTextConversation('+19999999999', 'sms', 'Hello!');
|
|
804
|
+
|
|
805
|
+
// WhatsApp
|
|
806
|
+
startTextConversation('+971501234567', 'whatsapp', 'Hi from AUI!');
|
|
807
|
+
```
|
|
808
|
+
|
|
809
|
+
**UI mapping:** This is the API behind the "Start Text Conversation" panel — phone number + channel selector (SMS / WhatsApp) + initial message — wired directly to `client.controllerApi.startTextConversation({ phoneNumber, channel, message })`.
|
|
810
|
+
|
|
811
|
+
**Common errors:**
|
|
812
|
+
|
|
813
|
+
| Symptom | Likely cause | Fix |
|
|
814
|
+
|---------|--------------|-----|
|
|
815
|
+
| `500` from upstream `third-party-auth` | Invalid or unreachable phone number (e.g., placeholder `+15551234567`) | Use a real E.164 number, including the country code |
|
|
816
|
+
| `422 Unprocessable Entity` | `phoneNumber` or `channel` missing / wrong shape | Ensure `channel` is exactly `'sms'` or `'whatsapp'` and `phoneNumber` starts with `+` |
|
|
817
|
+
| `401 / 403` | Missing or invalid `networkApiKey` | Pass `networkApiKey` to `ApolloClient` (or the `x-network-api-key` header) |
|
|
818
|
+
|
|
715
819
|
## 🔧 Advanced Configuration
|
|
716
820
|
|
|
717
821
|
### Custom Timeout and Retries
|
|
@@ -793,6 +897,7 @@ import {
|
|
|
793
897
|
CreateExternalTaskRequest,
|
|
794
898
|
SubmitExternalMessageRequest,
|
|
795
899
|
UserMessagePayload,
|
|
900
|
+
TextConversationInitiateRequest,
|
|
796
901
|
// Response types
|
|
797
902
|
CreateExternalTaskResponse,
|
|
798
903
|
ExternalTaskMessage,
|
|
@@ -800,6 +905,7 @@ import {
|
|
|
800
905
|
StreamingUpdatePayload,
|
|
801
906
|
FinalMessagePayload,
|
|
802
907
|
ErrorMessagePayload,
|
|
908
|
+
TextConversationInitiateResponse,
|
|
803
909
|
// Error types
|
|
804
910
|
ApolloError,
|
|
805
911
|
UnprocessableEntityError
|
package/dist/cjs/Client.js
CHANGED
|
@@ -45,8 +45,8 @@ class ApolloClient {
|
|
|
45
45
|
"x-network-api-key": _options === null || _options === void 0 ? void 0 : _options.networkApiKey,
|
|
46
46
|
"X-Fern-Language": "JavaScript",
|
|
47
47
|
"X-Fern-SDK-Name": "@aui.io/aui-client",
|
|
48
|
-
"X-Fern-SDK-Version": "
|
|
49
|
-
"User-Agent": "@aui.io/aui-client/
|
|
48
|
+
"X-Fern-SDK-Version": "2.0.0",
|
|
49
|
+
"User-Agent": "@aui.io/aui-client/2.0.0",
|
|
50
50
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
51
51
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
52
52
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -77,19 +77,6 @@ export declare class ControllerApi {
|
|
|
77
77
|
*/
|
|
78
78
|
sendMessage(request: Apollo.SubmitMessageRequest, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.Message>;
|
|
79
79
|
private __sendMessage;
|
|
80
|
-
/**
|
|
81
|
-
* @param {Apollo.GetProductMetadataRequest} request
|
|
82
|
-
* @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
83
|
-
*
|
|
84
|
-
* @throws {@link Apollo.UnprocessableEntityError}
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* await client.controllerApi.getProductMetadata({
|
|
88
|
-
* link: "link"
|
|
89
|
-
* })
|
|
90
|
-
*/
|
|
91
|
-
getProductMetadata(request: Apollo.GetProductMetadataRequest, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Record<string, unknown>>;
|
|
92
|
-
private __getProductMetadata;
|
|
93
80
|
/**
|
|
94
81
|
* @param {Record<string, unknown>} request
|
|
95
82
|
* @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -407,72 +407,6 @@ class ControllerApi {
|
|
|
407
407
|
}
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
|
-
/**
|
|
411
|
-
* @param {Apollo.GetProductMetadataRequest} request
|
|
412
|
-
* @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
413
|
-
*
|
|
414
|
-
* @throws {@link Apollo.UnprocessableEntityError}
|
|
415
|
-
*
|
|
416
|
-
* @example
|
|
417
|
-
* await client.controllerApi.getProductMetadata({
|
|
418
|
-
* link: "link"
|
|
419
|
-
* })
|
|
420
|
-
*/
|
|
421
|
-
getProductMetadata(request, requestOptions) {
|
|
422
|
-
return core.HttpResponsePromise.fromPromise(this.__getProductMetadata(request, requestOptions));
|
|
423
|
-
}
|
|
424
|
-
__getProductMetadata(request, requestOptions) {
|
|
425
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
426
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
427
|
-
const { link } = request;
|
|
428
|
-
const _queryParams = {};
|
|
429
|
-
_queryParams.link = link;
|
|
430
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
431
|
-
"x-network-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.networkApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.networkApiKey,
|
|
432
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
433
|
-
const _response = yield core.fetcher({
|
|
434
|
-
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, "api/v1/external/product-metadata"),
|
|
435
|
-
method: "GET",
|
|
436
|
-
headers: _headers,
|
|
437
|
-
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
438
|
-
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
439
|
-
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
440
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
441
|
-
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
442
|
-
logging: this._options.logging,
|
|
443
|
-
});
|
|
444
|
-
if (_response.ok) {
|
|
445
|
-
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
446
|
-
}
|
|
447
|
-
if (_response.error.reason === "status-code") {
|
|
448
|
-
switch (_response.error.statusCode) {
|
|
449
|
-
case 422:
|
|
450
|
-
throw new Apollo.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
451
|
-
default:
|
|
452
|
-
throw new errors.ApolloError({
|
|
453
|
-
statusCode: _response.error.statusCode,
|
|
454
|
-
body: _response.error.body,
|
|
455
|
-
rawResponse: _response.rawResponse,
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
switch (_response.error.reason) {
|
|
460
|
-
case "non-json":
|
|
461
|
-
throw new errors.ApolloError({
|
|
462
|
-
statusCode: _response.error.statusCode,
|
|
463
|
-
body: _response.error.rawBody,
|
|
464
|
-
rawResponse: _response.rawResponse,
|
|
465
|
-
});
|
|
466
|
-
case "timeout":
|
|
467
|
-
throw new errors.ApolloTimeoutError("Timeout exceeded when calling GET /api/v1/external/product-metadata.");
|
|
468
|
-
case "unknown":
|
|
469
|
-
throw new errors.ApolloError({
|
|
470
|
-
message: _response.error.errorMessage,
|
|
471
|
-
rawResponse: _response.rawResponse,
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
410
|
/**
|
|
477
411
|
* @param {Record<string, unknown>} request
|
|
478
412
|
* @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export type { CreateTaskRequest } from "./CreateTaskRequest.js";
|
|
2
2
|
export type { DirectFollowupSuggestionsRequest } from "./DirectFollowupSuggestionsRequest.js";
|
|
3
3
|
export type { ExternalWidgetRenderRequest } from "./ExternalWidgetRenderRequest.js";
|
|
4
|
-
export type { GetProductMetadataRequest } from "./GetProductMetadataRequest.js";
|
|
5
4
|
export type { GetTraceInfoRequest } from "./GetTraceInfoRequest.js";
|
|
6
5
|
export type { ListUserTasksRequest } from "./ListUserTasksRequest.js";
|
|
7
6
|
export type { SubmitMessageRequest } from "./SubmitMessageRequest.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ConstraintTriggerType = void 0;
|
|
5
|
+
exports.ConstraintTriggerType = {
|
|
6
|
+
Init: "init",
|
|
7
|
+
PreIntegration: "pre-integration",
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.LatencyUnit = void 0;
|
|
5
|
+
exports.LatencyUnit = {
|
|
6
|
+
Microsecond: "microsecond",
|
|
7
|
+
Millisecond: "millisecond",
|
|
8
|
+
Second: "second",
|
|
9
|
+
Minute: "minute",
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.OffsetType = void 0;
|
|
5
|
+
/** How ``offset`` is combined with the target for ``gt_offset`` / ``lte_offset`` / etc. */
|
|
6
|
+
exports.OffsetType = {
|
|
7
|
+
Add: "add",
|
|
8
|
+
Subtract: "subtract",
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Time/calendar units for ``offset`` with ``after_date_offset`` (and similar). */
|
|
2
|
+
export declare const OffsetUnit: {
|
|
3
|
+
readonly Minutes: "minutes";
|
|
4
|
+
readonly Hours: "hours";
|
|
5
|
+
readonly Days: "days";
|
|
6
|
+
readonly Weeks: "weeks";
|
|
7
|
+
readonly Months: "months";
|
|
8
|
+
readonly Years: "years";
|
|
9
|
+
};
|
|
10
|
+
export type OffsetUnit = (typeof OffsetUnit)[keyof typeof OffsetUnit];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.OffsetUnit = void 0;
|
|
5
|
+
/** Time/calendar units for ``offset`` with ``after_date_offset`` (and similar). */
|
|
6
|
+
exports.OffsetUnit = {
|
|
7
|
+
Minutes: "minutes",
|
|
8
|
+
Hours: "hours",
|
|
9
|
+
Days: "days",
|
|
10
|
+
Weeks: "weeks",
|
|
11
|
+
Months: "months",
|
|
12
|
+
Years: "years",
|
|
13
|
+
};
|
|
@@ -2,6 +2,8 @@ export declare const OptionsSearchSelfReviewMethod: {
|
|
|
2
2
|
readonly InventoryClassification: "INVENTORY_CLASSIFICATION";
|
|
3
3
|
readonly Llm: "LLM";
|
|
4
4
|
readonly LlmPerOption: "LLM_PER_OPTION";
|
|
5
|
+
readonly CrossEncoderRanker: "CROSS_ENCODER_RANKER";
|
|
6
|
+
readonly CohereRanker: "COHERE_RANKER";
|
|
5
7
|
readonly ConstantScore: "CONSTANT_SCORE";
|
|
6
8
|
readonly ParamMatching: "PARAM_MATCHING";
|
|
7
9
|
};
|
|
@@ -6,6 +6,8 @@ exports.OptionsSearchSelfReviewMethod = {
|
|
|
6
6
|
InventoryClassification: "INVENTORY_CLASSIFICATION",
|
|
7
7
|
Llm: "LLM",
|
|
8
8
|
LlmPerOption: "LLM_PER_OPTION",
|
|
9
|
+
CrossEncoderRanker: "CROSS_ENCODER_RANKER",
|
|
10
|
+
CohereRanker: "COHERE_RANKER",
|
|
9
11
|
ConstantScore: "CONSTANT_SCORE",
|
|
10
12
|
ParamMatching: "PARAM_MATCHING",
|
|
11
13
|
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type * as Apollo from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* A leaf condition in a when clause. Combines a method (what to check),
|
|
4
|
+
* params/entities (what to check on), an operation (how to compare),
|
|
5
|
+
* and a value (what to compare against).
|
|
6
|
+
*/
|
|
7
|
+
export interface SimpleViewCondition {
|
|
8
|
+
method: SimpleViewCondition.Method;
|
|
9
|
+
/** List of param codes (can be empty) */
|
|
10
|
+
params?: string[];
|
|
11
|
+
/** Optional entity context */
|
|
12
|
+
entities?: string[];
|
|
13
|
+
/** Optional sub-entity context in case of checking sub-entity param value as source and not entity, entities and params should be filled when filling sub_entities */
|
|
14
|
+
sub_entities?: string[];
|
|
15
|
+
/** Optional operation, in case of having more than one param under params, then the only allowed operations are all_has_value and any_has_value */
|
|
16
|
+
operation?: Apollo.SimpleViewOperation;
|
|
17
|
+
/** Value to compare against. Can be a literal (string, number, boolean). */
|
|
18
|
+
value?: SimpleViewCondition.Value;
|
|
19
|
+
/** Target param code to compare against instead of static value as value will be null when this is filled. */
|
|
20
|
+
target_param?: string;
|
|
21
|
+
/** Target entity name to fetch target value to compare with by target_param instead of static value as value will be null when this is filled. */
|
|
22
|
+
target_entity?: string;
|
|
23
|
+
/** When target_entity is used, fetch the target value from desired entities only. Set false to include saved task entities too. Defaults to true when not set. */
|
|
24
|
+
target_from_desired_only?: boolean;
|
|
25
|
+
/** Multiple target param codes (e.g. gt_sum, gte_sum, lt_sum, lte_sum). Stored as target_param_ids in predicate kwargs. */
|
|
26
|
+
target_params?: string[];
|
|
27
|
+
/** Numeric offset: gt_offset/lte_offset margins, after_date_offset magnitude (with offset_unit), *_entity_sum / *_sum margins, etc. */
|
|
28
|
+
offset?: SimpleViewCondition.Offset;
|
|
29
|
+
/** For gt_offset / lte_offset: add or subtract (with offset) relative to the target value. */
|
|
30
|
+
offset_type?: Apollo.OffsetType;
|
|
31
|
+
/** For gt_percentage / lt_percentage / lte_percentage / gte_percentage: percentage of target value to compare against. */
|
|
32
|
+
percentage?: SimpleViewCondition.Percentage;
|
|
33
|
+
/** Calendar/time unit for offset fields: use with any offset-related operation (gt_offset, lte_offset, between_offset, after_date_offset, gt/gte/lt/lte_entity_sum, gt/gte/lt/lte_sum, etc.). */
|
|
34
|
+
offset_unit?: Apollo.OffsetUnit;
|
|
35
|
+
/** For between_offset: lower bound relative to target. */
|
|
36
|
+
offset_min?: SimpleViewCondition.OffsetMin;
|
|
37
|
+
/** For between_offset: upper bound relative to target. */
|
|
38
|
+
offset_max?: SimpleViewCondition.OffsetMax;
|
|
39
|
+
/** For gt/gte/lt/lte_entity_sum: aggregate function name (e.g. sum). */
|
|
40
|
+
aggregate?: string;
|
|
41
|
+
/** For gt/gte/lt/lte_entity_sum: filter on related entity records. */
|
|
42
|
+
filter?: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
export declare namespace SimpleViewCondition {
|
|
45
|
+
type Method = Apollo.SimpleViewMethod | string;
|
|
46
|
+
/**
|
|
47
|
+
* Value to compare against. Can be a literal (string, number, boolean).
|
|
48
|
+
*/
|
|
49
|
+
type Value = string | number | number | boolean | unknown[] | Record<string, unknown>;
|
|
50
|
+
/**
|
|
51
|
+
* Numeric offset: gt_offset/lte_offset margins, after_date_offset magnitude (with offset_unit), *_entity_sum / *_sum margins, etc.
|
|
52
|
+
*/
|
|
53
|
+
type Offset = number | number;
|
|
54
|
+
/**
|
|
55
|
+
* For gt_percentage / lt_percentage / lte_percentage / gte_percentage: percentage of target value to compare against.
|
|
56
|
+
*/
|
|
57
|
+
type Percentage = number | number;
|
|
58
|
+
/**
|
|
59
|
+
* For between_offset: lower bound relative to target.
|
|
60
|
+
*/
|
|
61
|
+
type OffsetMin = number | number;
|
|
62
|
+
/**
|
|
63
|
+
* For between_offset: upper bound relative to target.
|
|
64
|
+
*/
|
|
65
|
+
type OffsetMax = number | number;
|
|
66
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Full set of condition methods supported by the SimpleView when-tree. Subsets are exposed per rule kind (`ConstraintMethod`, `SummaryMethod`, `ToolTriggerMethod`). */
|
|
2
|
+
export declare const SimpleViewMethod: {
|
|
3
|
+
readonly EntityParamReferenced: "entity_param_referenced";
|
|
4
|
+
readonly EntityParam: "entity_param";
|
|
5
|
+
readonly ParamValue: "param_value";
|
|
6
|
+
readonly ParamExtractedCurrent: "param_extracted_current";
|
|
7
|
+
readonly UserQuestion: "user_question";
|
|
8
|
+
readonly ConversationStarted: "conversation_started";
|
|
9
|
+
readonly ParamMissing: "param_missing";
|
|
10
|
+
readonly UserProfileParam: "user_profile_param";
|
|
11
|
+
readonly CurrentUrl: "current_url";
|
|
12
|
+
readonly ApiRequestParamValue: "api_request_param_value";
|
|
13
|
+
readonly ApiResponseParamValue: "api_response_param_value";
|
|
14
|
+
readonly EntityMissing: "entity_missing";
|
|
15
|
+
readonly ToolParamsFilled: "tool_params_filled";
|
|
16
|
+
readonly ToolRequiredParamsFilled: "tool_required_params_filled";
|
|
17
|
+
readonly ToolOptionalParamsFilled: "tool_optional_params_filled";
|
|
18
|
+
};
|
|
19
|
+
export type SimpleViewMethod = (typeof SimpleViewMethod)[keyof typeof SimpleViewMethod];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SimpleViewMethod = void 0;
|
|
5
|
+
/** Full set of condition methods supported by the SimpleView when-tree. Subsets are exposed per rule kind (`ConstraintMethod`, `SummaryMethod`, `ToolTriggerMethod`). */
|
|
6
|
+
exports.SimpleViewMethod = {
|
|
7
|
+
EntityParamReferenced: "entity_param_referenced",
|
|
8
|
+
EntityParam: "entity_param",
|
|
9
|
+
ParamValue: "param_value",
|
|
10
|
+
ParamExtractedCurrent: "param_extracted_current",
|
|
11
|
+
UserQuestion: "user_question",
|
|
12
|
+
ConversationStarted: "conversation_started",
|
|
13
|
+
ParamMissing: "param_missing",
|
|
14
|
+
UserProfileParam: "user_profile_param",
|
|
15
|
+
CurrentUrl: "current_url",
|
|
16
|
+
ApiRequestParamValue: "api_request_param_value",
|
|
17
|
+
ApiResponseParamValue: "api_response_param_value",
|
|
18
|
+
EntityMissing: "entity_missing",
|
|
19
|
+
ToolParamsFilled: "tool_params_filled",
|
|
20
|
+
ToolRequiredParamsFilled: "tool_required_params_filled",
|
|
21
|
+
ToolOptionalParamsFilled: "tool_optional_params_filled",
|
|
22
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Comparison operators a condition may apply to its parameter value (eq, gt, contains, regex, offset/sum variants, etc.). Operator validity per parameter type and per kwarg shape is declared in the OPERATION_* tables below. */
|
|
2
|
+
export declare const SimpleViewOperation: {
|
|
3
|
+
readonly Eq: "eq";
|
|
4
|
+
readonly Neq: "neq";
|
|
5
|
+
readonly Gt: "gt";
|
|
6
|
+
readonly Lt: "lt";
|
|
7
|
+
readonly Gte: "gte";
|
|
8
|
+
readonly Lte: "lte";
|
|
9
|
+
readonly Contains: "contains";
|
|
10
|
+
readonly Exist: "exist";
|
|
11
|
+
readonly AnyHasValue: "any_has_value";
|
|
12
|
+
readonly AllHasValue: "all_has_value";
|
|
13
|
+
readonly About: "about";
|
|
14
|
+
readonly Between: "between";
|
|
15
|
+
readonly WithinLastXDay: "within_last_x_day";
|
|
16
|
+
readonly WithinNextXDay: "within_next_x_day";
|
|
17
|
+
readonly WithinNextXHours: "within_next_x_hours";
|
|
18
|
+
readonly WithinLastXHours: "within_last_x_hours";
|
|
19
|
+
readonly AfterToday: "after_today";
|
|
20
|
+
readonly BeforeToday: "before_today";
|
|
21
|
+
readonly EqualToday: "equal_today";
|
|
22
|
+
readonly NotEqualToday: "not_equal_today";
|
|
23
|
+
readonly NotExist: "not_exist";
|
|
24
|
+
readonly MoreThanNextXDay: "more_than_next_x_day";
|
|
25
|
+
readonly MoreThanLastXDay: "more_than_last_x_day";
|
|
26
|
+
readonly EqRegex: "eq_regex";
|
|
27
|
+
readonly NeqRegex: "neq_regex";
|
|
28
|
+
readonly GtOffset: "gt_offset";
|
|
29
|
+
readonly LteOffset: "lte_offset";
|
|
30
|
+
readonly GteOffset: "gte_offset";
|
|
31
|
+
readonly LtOffset: "lt_offset";
|
|
32
|
+
readonly GtPercentage: "gt_percentage";
|
|
33
|
+
readonly LtPercentage: "lt_percentage";
|
|
34
|
+
readonly LtePercentage: "lte_percentage";
|
|
35
|
+
readonly GtePercentage: "gte_percentage";
|
|
36
|
+
readonly AfterDateOffset: "after_date_offset";
|
|
37
|
+
readonly BeforeDateOffset: "before_date_offset";
|
|
38
|
+
readonly BetweenOffset: "between_offset";
|
|
39
|
+
readonly GtEntitySum: "gt_entity_sum";
|
|
40
|
+
readonly LtEntitySum: "lt_entity_sum";
|
|
41
|
+
readonly GteEntitySum: "gte_entity_sum";
|
|
42
|
+
readonly LteEntitySum: "lte_entity_sum";
|
|
43
|
+
readonly GtSum: "gt_sum";
|
|
44
|
+
readonly LtSum: "lt_sum";
|
|
45
|
+
readonly GteSum: "gte_sum";
|
|
46
|
+
readonly LteSum: "lte_sum";
|
|
47
|
+
};
|
|
48
|
+
export type SimpleViewOperation = (typeof SimpleViewOperation)[keyof typeof SimpleViewOperation];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SimpleViewOperation = void 0;
|
|
5
|
+
/** Comparison operators a condition may apply to its parameter value (eq, gt, contains, regex, offset/sum variants, etc.). Operator validity per parameter type and per kwarg shape is declared in the OPERATION_* tables below. */
|
|
6
|
+
exports.SimpleViewOperation = {
|
|
7
|
+
Eq: "eq",
|
|
8
|
+
Neq: "neq",
|
|
9
|
+
Gt: "gt",
|
|
10
|
+
Lt: "lt",
|
|
11
|
+
Gte: "gte",
|
|
12
|
+
Lte: "lte",
|
|
13
|
+
Contains: "contains",
|
|
14
|
+
Exist: "exist",
|
|
15
|
+
AnyHasValue: "any_has_value",
|
|
16
|
+
AllHasValue: "all_has_value",
|
|
17
|
+
About: "about",
|
|
18
|
+
Between: "between",
|
|
19
|
+
WithinLastXDay: "within_last_x_day",
|
|
20
|
+
WithinNextXDay: "within_next_x_day",
|
|
21
|
+
WithinNextXHours: "within_next_x_hours",
|
|
22
|
+
WithinLastXHours: "within_last_x_hours",
|
|
23
|
+
AfterToday: "after_today",
|
|
24
|
+
BeforeToday: "before_today",
|
|
25
|
+
EqualToday: "equal_today",
|
|
26
|
+
NotEqualToday: "not_equal_today",
|
|
27
|
+
NotExist: "not_exist",
|
|
28
|
+
MoreThanNextXDay: "more_than_next_x_day",
|
|
29
|
+
MoreThanLastXDay: "more_than_last_x_day",
|
|
30
|
+
EqRegex: "eq_regex",
|
|
31
|
+
NeqRegex: "neq_regex",
|
|
32
|
+
GtOffset: "gt_offset",
|
|
33
|
+
LteOffset: "lte_offset",
|
|
34
|
+
GteOffset: "gte_offset",
|
|
35
|
+
LtOffset: "lt_offset",
|
|
36
|
+
GtPercentage: "gt_percentage",
|
|
37
|
+
LtPercentage: "lt_percentage",
|
|
38
|
+
LtePercentage: "lte_percentage",
|
|
39
|
+
GtePercentage: "gte_percentage",
|
|
40
|
+
AfterDateOffset: "after_date_offset",
|
|
41
|
+
BeforeDateOffset: "before_date_offset",
|
|
42
|
+
BetweenOffset: "between_offset",
|
|
43
|
+
GtEntitySum: "gt_entity_sum",
|
|
44
|
+
LtEntitySum: "lt_entity_sum",
|
|
45
|
+
GteEntitySum: "gte_entity_sum",
|
|
46
|
+
LteEntitySum: "lte_entity_sum",
|
|
47
|
+
GtSum: "gt_sum",
|
|
48
|
+
LtSum: "lt_sum",
|
|
49
|
+
GteSum: "gte_sum",
|
|
50
|
+
LteSum: "lte_sum",
|
|
51
|
+
};
|
|
@@ -10,11 +10,15 @@ export interface TaskParameter {
|
|
|
10
10
|
is_anchor?: boolean;
|
|
11
11
|
is_value_filled?: boolean;
|
|
12
12
|
is_visible?: boolean;
|
|
13
|
+
is_exist_param?: boolean;
|
|
13
14
|
param_type?: Apollo.ParameterType;
|
|
14
15
|
code?: string;
|
|
15
16
|
}
|
|
16
17
|
export declare namespace TaskParameter {
|
|
17
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Value to compare against. Can be a literal (string, number, boolean).
|
|
20
|
+
*/
|
|
21
|
+
type Value = string | number | number | boolean | unknown[] | Record<string, unknown>;
|
|
18
22
|
type ValueHistory = ValueHistory.Item[];
|
|
19
23
|
namespace ValueHistory {
|
|
20
24
|
type Item = Apollo.TaskParameterValue | Apollo.TaskParameterRangeValue;
|
|
@@ -4,7 +4,8 @@ export interface TraceDecisionRuleTriggered {
|
|
|
4
4
|
tool: string;
|
|
5
5
|
rule: TraceDecisionRuleTriggered.Rule;
|
|
6
6
|
track_id?: string;
|
|
7
|
+
trigger_type?: Apollo.ConstraintTriggerType;
|
|
7
8
|
}
|
|
8
9
|
export declare namespace TraceDecisionRuleTriggered {
|
|
9
|
-
type Rule = Apollo.
|
|
10
|
+
type Rule = Apollo.TraceRuleAskForConfirmation | Apollo.TraceRuleParamsMissing | Apollo.TraceRuleMissingInfo | Apollo.TraceRuleBase;
|
|
10
11
|
}
|