@aui.io/aui-client 1.2.31 → 1.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/README.md +22 -0
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/controllerApi/client/Client.d.ts +18 -0
  4. package/dist/cjs/api/resources/controllerApi/client/Client.js +74 -0
  5. package/dist/cjs/api/resources/controllerApi/client/requests/TextConversationInitiateRequest.d.ts +15 -0
  6. package/dist/cjs/api/resources/controllerApi/client/requests/TextConversationInitiateRequest.js +3 -0
  7. package/dist/cjs/api/resources/controllerApi/client/requests/index.d.ts +1 -0
  8. package/dist/cjs/api/types/TextConversationInitiateResponse.d.ts +6 -0
  9. package/dist/cjs/api/types/TextConversationInitiateResponse.js +3 -0
  10. package/dist/cjs/api/types/index.d.ts +1 -0
  11. package/dist/cjs/api/types/index.js +1 -0
  12. package/dist/cjs/version.d.ts +1 -1
  13. package/dist/cjs/version.js +1 -1
  14. package/dist/esm/Client.mjs +2 -2
  15. package/dist/esm/api/resources/controllerApi/client/Client.d.mts +18 -0
  16. package/dist/esm/api/resources/controllerApi/client/Client.mjs +74 -0
  17. package/dist/esm/api/resources/controllerApi/client/requests/TextConversationInitiateRequest.d.mts +15 -0
  18. package/dist/esm/api/resources/controllerApi/client/requests/TextConversationInitiateRequest.mjs +2 -0
  19. package/dist/esm/api/resources/controllerApi/client/requests/index.d.mts +1 -0
  20. package/dist/esm/api/types/TextConversationInitiateResponse.d.mts +6 -0
  21. package/dist/esm/api/types/TextConversationInitiateResponse.mjs +2 -0
  22. package/dist/esm/api/types/index.d.mts +1 -0
  23. package/dist/esm/api/types/index.mjs +1 -0
  24. package/dist/esm/version.d.mts +1 -1
  25. package/dist/esm/version.mjs +1 -1
  26. package/package.json +1 -1
  27. package/reference.md +68 -0
package/README.md CHANGED
@@ -235,6 +235,28 @@ const taskResponse = await client.controllerApi.createTask({
235
235
 
236
236
  **Note:** `task_origin_type` is required in v1.2.17+. Common values: `'web-widget'`, `'mobile-app'`, `'api'`, `'internal-tool'`
237
237
 
238
+ #### `getTask(taskId)` - Get Task By ID
239
+ Retrieve a specific task by its ID.
240
+
241
+ ```typescript
242
+ const task = await client.controllerApi.getTask(taskId: string);
243
+
244
+ // Returns: { id: string, user_id: string, title: string, welcome_message?: string }
245
+ ```
246
+
247
+ **Example:**
248
+
249
+ ```typescript
250
+ const task = await client.controllerApi.getTask('your-task-id');
251
+
252
+ console.log('Task ID:', task.id);
253
+ console.log('User ID:', task.user_id);
254
+ console.log('Title:', task.title);
255
+ if (task.welcome_message) {
256
+ console.log('Welcome:', task.welcome_message);
257
+ }
258
+ ```
259
+
238
260
  #### `getTaskMessages(taskId)` - Get Task Messages
239
261
  Retrieve all messages for a specific task.
240
262
 
@@ -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": "1.2.31",
49
- "User-Agent": "@aui.io/aui-client/1.2.31",
48
+ "X-Fern-SDK-Version": "1.2.33",
49
+ "User-Agent": "@aui.io/aui-client/1.2.33",
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) });
@@ -126,4 +126,22 @@ export declare class ControllerApi {
126
126
  */
127
127
  getWorkflowsMetadata(requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.WorkflowsMetadataResponse>;
128
128
  private __getWorkflowsMetadata;
129
+ /**
130
+ * Start a text conversation (WhatsApp or SMS).
131
+ *
132
+ * Creates a task and then proxies to third-party-auth(BE) service to send the initial message.
133
+ *
134
+ * @param {Apollo.TextConversationInitiateRequest} request
135
+ * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
136
+ *
137
+ * @throws {@link Apollo.UnprocessableEntityError}
138
+ *
139
+ * @example
140
+ * await client.controllerApi.startTextConversation({
141
+ * phoneNumber: "phoneNumber",
142
+ * channel: "channel"
143
+ * })
144
+ */
145
+ startTextConversation(request: Apollo.TextConversationInitiateRequest, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.TextConversationInitiateResponse>;
146
+ private __startTextConversation;
129
147
  }
@@ -659,5 +659,79 @@ class ControllerApi {
659
659
  }
660
660
  });
661
661
  }
662
+ /**
663
+ * Start a text conversation (WhatsApp or SMS).
664
+ *
665
+ * Creates a task and then proxies to third-party-auth(BE) service to send the initial message.
666
+ *
667
+ * @param {Apollo.TextConversationInitiateRequest} request
668
+ * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
669
+ *
670
+ * @throws {@link Apollo.UnprocessableEntityError}
671
+ *
672
+ * @example
673
+ * await client.controllerApi.startTextConversation({
674
+ * phoneNumber: "phoneNumber",
675
+ * channel: "channel"
676
+ * })
677
+ */
678
+ startTextConversation(request, requestOptions) {
679
+ return core.HttpResponsePromise.fromPromise(this.__startTextConversation(request, requestOptions));
680
+ }
681
+ __startTextConversation(request, requestOptions) {
682
+ return __awaiter(this, void 0, void 0, function* () {
683
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
684
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
685
+ "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,
686
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
687
+ const _response = yield core.fetcher({
688
+ 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/text/conversation"),
689
+ method: "POST",
690
+ headers: _headers,
691
+ contentType: "application/json",
692
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
693
+ requestType: "json",
694
+ body: request,
695
+ 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,
696
+ 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,
697
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
698
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
699
+ logging: this._options.logging,
700
+ });
701
+ if (_response.ok) {
702
+ return {
703
+ data: _response.body,
704
+ rawResponse: _response.rawResponse,
705
+ };
706
+ }
707
+ if (_response.error.reason === "status-code") {
708
+ switch (_response.error.statusCode) {
709
+ case 422:
710
+ throw new Apollo.UnprocessableEntityError(_response.error.body, _response.rawResponse);
711
+ default:
712
+ throw new errors.ApolloError({
713
+ statusCode: _response.error.statusCode,
714
+ body: _response.error.body,
715
+ rawResponse: _response.rawResponse,
716
+ });
717
+ }
718
+ }
719
+ switch (_response.error.reason) {
720
+ case "non-json":
721
+ throw new errors.ApolloError({
722
+ statusCode: _response.error.statusCode,
723
+ body: _response.error.rawBody,
724
+ rawResponse: _response.rawResponse,
725
+ });
726
+ case "timeout":
727
+ throw new errors.ApolloTimeoutError("Timeout exceeded when calling POST /api/v1/external/text/conversation.");
728
+ case "unknown":
729
+ throw new errors.ApolloError({
730
+ message: _response.error.errorMessage,
731
+ rawResponse: _response.rawResponse,
732
+ });
733
+ }
734
+ });
735
+ }
662
736
  }
663
737
  exports.ControllerApi = ControllerApi;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * phoneNumber: "phoneNumber",
5
+ * channel: "channel"
6
+ * }
7
+ */
8
+ export interface TextConversationInitiateRequest {
9
+ /** Phone number in E.164 format (e.g., +1234567890) */
10
+ phoneNumber: string;
11
+ /** Channel type: 'whatsapp' or 'sms' */
12
+ channel: string;
13
+ /** Optional initial message to send */
14
+ message?: string;
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,3 +2,4 @@ export type { CreateTaskRequest } from "./CreateTaskRequest.js";
2
2
  export type { GetProductMetadataRequest } from "./GetProductMetadataRequest.js";
3
3
  export type { ListUserTasksRequest } from "./ListUserTasksRequest.js";
4
4
  export type { SubmitMessageRequest } from "./SubmitMessageRequest.js";
5
+ export type { TextConversationInitiateRequest } from "./TextConversationInitiateRequest.js";
@@ -0,0 +1,6 @@
1
+ export interface TextConversationInitiateResponse {
2
+ status: boolean;
3
+ data: Record<string, string>;
4
+ message: string;
5
+ statusCode: number;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -40,6 +40,7 @@ export * from "./TaskParameterType.js";
40
40
  export * from "./TaskParameterValue.js";
41
41
  export * from "./TaskTopicEntity.js";
42
42
  export * from "./TaskTopicEntityItem.js";
43
+ export * from "./TextConversationInitiateResponse.js";
43
44
  export * from "./UserMessagePayload.js";
44
45
  export * from "./ValidationError.js";
45
46
  export * from "./WorkflowMetadata.js";
@@ -56,6 +56,7 @@ __exportStar(require("./TaskParameterType.js"), exports);
56
56
  __exportStar(require("./TaskParameterValue.js"), exports);
57
57
  __exportStar(require("./TaskTopicEntity.js"), exports);
58
58
  __exportStar(require("./TaskTopicEntityItem.js"), exports);
59
+ __exportStar(require("./TextConversationInitiateResponse.js"), exports);
59
60
  __exportStar(require("./UserMessagePayload.js"), exports);
60
61
  __exportStar(require("./ValidationError.js"), exports);
61
62
  __exportStar(require("./WorkflowMetadata.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.2.31";
1
+ export declare const SDK_VERSION = "1.2.33";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.2.31";
4
+ exports.SDK_VERSION = "1.2.33";
@@ -9,8 +9,8 @@ export class ApolloClient {
9
9
  "x-network-api-key": _options === null || _options === void 0 ? void 0 : _options.networkApiKey,
10
10
  "X-Fern-Language": "JavaScript",
11
11
  "X-Fern-SDK-Name": "@aui.io/aui-client",
12
- "X-Fern-SDK-Version": "1.2.31",
13
- "User-Agent": "@aui.io/aui-client/1.2.31",
12
+ "X-Fern-SDK-Version": "1.2.33",
13
+ "User-Agent": "@aui.io/aui-client/1.2.33",
14
14
  "X-Fern-Runtime": core.RUNTIME.type,
15
15
  "X-Fern-Runtime-Version": core.RUNTIME.version,
16
16
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -126,4 +126,22 @@ export declare class ControllerApi {
126
126
  */
127
127
  getWorkflowsMetadata(requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.WorkflowsMetadataResponse>;
128
128
  private __getWorkflowsMetadata;
129
+ /**
130
+ * Start a text conversation (WhatsApp or SMS).
131
+ *
132
+ * Creates a task and then proxies to third-party-auth(BE) service to send the initial message.
133
+ *
134
+ * @param {Apollo.TextConversationInitiateRequest} request
135
+ * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
136
+ *
137
+ * @throws {@link Apollo.UnprocessableEntityError}
138
+ *
139
+ * @example
140
+ * await client.controllerApi.startTextConversation({
141
+ * phoneNumber: "phoneNumber",
142
+ * channel: "channel"
143
+ * })
144
+ */
145
+ startTextConversation(request: Apollo.TextConversationInitiateRequest, requestOptions?: ControllerApi.RequestOptions): core.HttpResponsePromise<Apollo.TextConversationInitiateResponse>;
146
+ private __startTextConversation;
129
147
  }
@@ -623,4 +623,78 @@ export class ControllerApi {
623
623
  }
624
624
  });
625
625
  }
626
+ /**
627
+ * Start a text conversation (WhatsApp or SMS).
628
+ *
629
+ * Creates a task and then proxies to third-party-auth(BE) service to send the initial message.
630
+ *
631
+ * @param {Apollo.TextConversationInitiateRequest} request
632
+ * @param {ControllerApi.RequestOptions} requestOptions - Request-specific configuration.
633
+ *
634
+ * @throws {@link Apollo.UnprocessableEntityError}
635
+ *
636
+ * @example
637
+ * await client.controllerApi.startTextConversation({
638
+ * phoneNumber: "phoneNumber",
639
+ * channel: "channel"
640
+ * })
641
+ */
642
+ startTextConversation(request, requestOptions) {
643
+ return core.HttpResponsePromise.fromPromise(this.__startTextConversation(request, requestOptions));
644
+ }
645
+ __startTextConversation(request, requestOptions) {
646
+ return __awaiter(this, void 0, void 0, function* () {
647
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
648
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
649
+ "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,
650
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
651
+ const _response = yield core.fetcher({
652
+ 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/text/conversation"),
653
+ method: "POST",
654
+ headers: _headers,
655
+ contentType: "application/json",
656
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
657
+ requestType: "json",
658
+ body: request,
659
+ 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,
660
+ 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,
661
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
662
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
663
+ logging: this._options.logging,
664
+ });
665
+ if (_response.ok) {
666
+ return {
667
+ data: _response.body,
668
+ rawResponse: _response.rawResponse,
669
+ };
670
+ }
671
+ if (_response.error.reason === "status-code") {
672
+ switch (_response.error.statusCode) {
673
+ case 422:
674
+ throw new Apollo.UnprocessableEntityError(_response.error.body, _response.rawResponse);
675
+ default:
676
+ throw new errors.ApolloError({
677
+ statusCode: _response.error.statusCode,
678
+ body: _response.error.body,
679
+ rawResponse: _response.rawResponse,
680
+ });
681
+ }
682
+ }
683
+ switch (_response.error.reason) {
684
+ case "non-json":
685
+ throw new errors.ApolloError({
686
+ statusCode: _response.error.statusCode,
687
+ body: _response.error.rawBody,
688
+ rawResponse: _response.rawResponse,
689
+ });
690
+ case "timeout":
691
+ throw new errors.ApolloTimeoutError("Timeout exceeded when calling POST /api/v1/external/text/conversation.");
692
+ case "unknown":
693
+ throw new errors.ApolloError({
694
+ message: _response.error.errorMessage,
695
+ rawResponse: _response.rawResponse,
696
+ });
697
+ }
698
+ });
699
+ }
626
700
  }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * phoneNumber: "phoneNumber",
5
+ * channel: "channel"
6
+ * }
7
+ */
8
+ export interface TextConversationInitiateRequest {
9
+ /** Phone number in E.164 format (e.g., +1234567890) */
10
+ phoneNumber: string;
11
+ /** Channel type: 'whatsapp' or 'sms' */
12
+ channel: string;
13
+ /** Optional initial message to send */
14
+ message?: string;
15
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -2,3 +2,4 @@ export type { CreateTaskRequest } from "./CreateTaskRequest.mjs";
2
2
  export type { GetProductMetadataRequest } from "./GetProductMetadataRequest.mjs";
3
3
  export type { ListUserTasksRequest } from "./ListUserTasksRequest.mjs";
4
4
  export type { SubmitMessageRequest } from "./SubmitMessageRequest.mjs";
5
+ export type { TextConversationInitiateRequest } from "./TextConversationInitiateRequest.mjs";
@@ -0,0 +1,6 @@
1
+ export interface TextConversationInitiateResponse {
2
+ status: boolean;
3
+ data: Record<string, string>;
4
+ message: string;
5
+ statusCode: number;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -40,6 +40,7 @@ export * from "./TaskParameterType.mjs";
40
40
  export * from "./TaskParameterValue.mjs";
41
41
  export * from "./TaskTopicEntity.mjs";
42
42
  export * from "./TaskTopicEntityItem.mjs";
43
+ export * from "./TextConversationInitiateResponse.mjs";
43
44
  export * from "./UserMessagePayload.mjs";
44
45
  export * from "./ValidationError.mjs";
45
46
  export * from "./WorkflowMetadata.mjs";
@@ -40,6 +40,7 @@ export * from "./TaskParameterType.mjs";
40
40
  export * from "./TaskParameterValue.mjs";
41
41
  export * from "./TaskTopicEntity.mjs";
42
42
  export * from "./TaskTopicEntityItem.mjs";
43
+ export * from "./TextConversationInitiateResponse.mjs";
43
44
  export * from "./UserMessagePayload.mjs";
44
45
  export * from "./ValidationError.mjs";
45
46
  export * from "./WorkflowMetadata.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.2.31";
1
+ export declare const SDK_VERSION = "1.2.33";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.2.31";
1
+ export const SDK_VERSION = "1.2.33";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aui.io/aui-client",
3
- "version": "1.2.31",
3
+ "version": "1.2.33",
4
4
  "private": false,
5
5
  "repository": "github:aui-io/aui-client-typescript",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -459,6 +459,74 @@ await client.controllerApi.getWorkflowsMetadata();
459
459
  </dl>
460
460
 
461
461
 
462
+ </dd>
463
+ </dl>
464
+ </details>
465
+
466
+ <details><summary><code>client.controllerApi.<a href="/src/api/resources/controllerApi/client/Client.ts">startTextConversation</a>({ ...params }) -> Apollo.TextConversationInitiateResponse</code></summary>
467
+ <dl>
468
+ <dd>
469
+
470
+ #### 📝 Description
471
+
472
+ <dl>
473
+ <dd>
474
+
475
+ <dl>
476
+ <dd>
477
+
478
+ Start a text conversation (WhatsApp or SMS).
479
+
480
+ Creates a task and then proxies to third-party-auth(BE) service to send the initial message.
481
+ </dd>
482
+ </dl>
483
+ </dd>
484
+ </dl>
485
+
486
+ #### 🔌 Usage
487
+
488
+ <dl>
489
+ <dd>
490
+
491
+ <dl>
492
+ <dd>
493
+
494
+ ```typescript
495
+ await client.controllerApi.startTextConversation({
496
+ phoneNumber: "phoneNumber",
497
+ channel: "channel"
498
+ });
499
+
500
+ ```
501
+ </dd>
502
+ </dl>
503
+ </dd>
504
+ </dl>
505
+
506
+ #### ⚙️ Parameters
507
+
508
+ <dl>
509
+ <dd>
510
+
511
+ <dl>
512
+ <dd>
513
+
514
+ **request:** `Apollo.TextConversationInitiateRequest`
515
+
516
+ </dd>
517
+ </dl>
518
+
519
+ <dl>
520
+ <dd>
521
+
522
+ **requestOptions:** `ControllerApi.RequestOptions`
523
+
524
+ </dd>
525
+ </dl>
526
+ </dd>
527
+ </dl>
528
+
529
+
462
530
  </dd>
463
531
  </dl>
464
532
  </details>