@wildix/wilma-copilot-sessions-client 1.0.11 → 1.0.13
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/dist-cjs/runtimeConfig.native.js +3 -0
- package/dist-cjs/runtimeConfig.shared.js +2 -2
- package/dist-es/runtimeConfig.native.js +3 -0
- package/dist-es/runtimeConfig.shared.js +2 -2
- package/dist-types/commands/ListRelationshipSessionsCommand.d.ts +5 -6
- package/dist-types/commands/OpenCommand.d.ts +1 -1
- package/dist-types/commands/StreamSessionEventsCommand.d.ts +1 -1
- package/dist-types/runtimeConfig.native.d.ts +2 -1
- package/package.json +7 -5
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRuntimeConfig = void 0;
|
|
4
4
|
const sha256_js_1 = require("@aws-crypto/sha256-js");
|
|
5
|
+
const smithy_react_native_1 = require("@wildix/smithy-react-native");
|
|
5
6
|
const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
|
|
6
7
|
const getRuntimeConfig = (config) => {
|
|
7
8
|
const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
|
|
9
|
+
(0, smithy_react_native_1.installReactNativeGlobals)();
|
|
8
10
|
return {
|
|
9
11
|
...browserDefaults,
|
|
10
12
|
...config,
|
|
11
13
|
runtime: "react-native",
|
|
14
|
+
requestHandler: smithy_react_native_1.XhrHttpHandler.create(config?.requestHandler),
|
|
12
15
|
sha256: config?.sha256 ?? sha256_js_1.Sha256,
|
|
13
16
|
};
|
|
14
17
|
};
|
|
@@ -11,7 +11,7 @@ const endpointResolver_1 = require("./endpoint/endpointResolver");
|
|
|
11
11
|
const schemas_0_1 = require("./schemas/schemas_0");
|
|
12
12
|
const getRuntimeConfig = (config) => {
|
|
13
13
|
return {
|
|
14
|
-
apiVersion: "
|
|
14
|
+
apiVersion: "v2",
|
|
15
15
|
base64Decoder: config?.base64Decoder ?? serde_1.fromBase64,
|
|
16
16
|
base64Encoder: config?.base64Encoder ?? serde_1.toBase64,
|
|
17
17
|
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
@@ -50,7 +50,7 @@ const getRuntimeConfig = (config) => {
|
|
|
50
50
|
protocolSettings: config?.protocolSettings ?? {
|
|
51
51
|
defaultNamespace: "wildix.wilma.copilot.sessions",
|
|
52
52
|
errorTypeRegistries: schemas_0_1.errorTypeRegistries,
|
|
53
|
-
version: "
|
|
53
|
+
version: "v2",
|
|
54
54
|
serviceTarget: "WilmaCopilotSessions",
|
|
55
55
|
},
|
|
56
56
|
sdkStreamMixin: config?.sdkStreamMixin ?? serde_1.sdkStreamMixin,
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
+
import { installReactNativeGlobals, XhrHttpHandler as RequestHandler } from "@wildix/smithy-react-native";
|
|
2
3
|
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
3
4
|
export const getRuntimeConfig = (config) => {
|
|
4
5
|
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
6
|
+
installReactNativeGlobals();
|
|
5
7
|
return {
|
|
6
8
|
...browserDefaults,
|
|
7
9
|
...config,
|
|
8
10
|
runtime: "react-native",
|
|
11
|
+
requestHandler: RequestHandler.create(config?.requestHandler),
|
|
9
12
|
sha256: config?.sha256 ?? Sha256,
|
|
10
13
|
};
|
|
11
14
|
};
|
|
@@ -8,7 +8,7 @@ import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
|
8
8
|
import { errorTypeRegistries } from "./schemas/schemas_0";
|
|
9
9
|
export const getRuntimeConfig = (config) => {
|
|
10
10
|
return {
|
|
11
|
-
apiVersion: "
|
|
11
|
+
apiVersion: "v2",
|
|
12
12
|
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
13
13
|
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
14
14
|
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
@@ -47,7 +47,7 @@ export const getRuntimeConfig = (config) => {
|
|
|
47
47
|
protocolSettings: config?.protocolSettings ?? {
|
|
48
48
|
defaultNamespace: "wildix.wilma.copilot.sessions",
|
|
49
49
|
errorTypeRegistries,
|
|
50
|
-
version: "
|
|
50
|
+
version: "v2",
|
|
51
51
|
serviceTarget: "WilmaCopilotSessions",
|
|
52
52
|
},
|
|
53
53
|
sdkStreamMixin: config?.sdkStreamMixin ?? sdkStreamMixin,
|
|
@@ -27,12 +27,11 @@ declare const ListRelationshipSessionsCommand_base: {
|
|
|
27
27
|
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
30
|
-
* Lists the copilot sessions associated with a relationship, most recent first — the paginated
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* session
|
|
34
|
-
*
|
|
35
|
-
* unknown relationship in scope returns an empty list rather than an error.
|
|
30
|
+
* Lists the copilot sessions associated with a relationship, most recent first — the paginated
|
|
31
|
+
* form of the `related` / `sessions` lists Open, Enrich and Resolve return inline. Use it to page
|
|
32
|
+
* a customer's cross-channel history, and to refresh after a `relationship` stream event announces
|
|
33
|
+
* a new session. Sessions are company-owned and shared within the tenant; an unknown relationship
|
|
34
|
+
* in scope returns an empty list rather than an error.
|
|
36
35
|
* @example
|
|
37
36
|
* Use a bare-bones client and the command you need to make an API call.
|
|
38
37
|
* ```javascript
|
|
@@ -30,7 +30,7 @@ declare const OpenCommand_base: {
|
|
|
30
30
|
* Opens copilot for a client surface. `lookup` (when present) is treated as hints: emails,
|
|
31
31
|
* phones and entity references are resolved authoritatively server-side and merged into a
|
|
32
32
|
* relationship. Routing picks the session — clients never pass conversation ids: the
|
|
33
|
-
* relationship's live conversation session (
|
|
33
|
+
* relationship's live conversation session (created automatically when a call or chat starts)
|
|
34
34
|
* when one exists, otherwise the relationship's `app` session (server-minted, reused while
|
|
35
35
|
* idle). The response returns the sessions already associated with the relationship, so the client
|
|
36
36
|
* can render cross-channel history without a second call.
|
|
@@ -28,7 +28,7 @@ declare const StreamSessionEventsCommand_base: {
|
|
|
28
28
|
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
|
-
* Replays and tails copilot session events as Server-Sent Events (`text/event-stream`). Each frame carries one CopilotSessionEvent: `id:` is the event index, `event:` is the union member name, and `data:` is the JSON document of the union value.
|
|
31
|
+
* Replays and tails copilot session events as Server-Sent Events (`text/event-stream`). Each frame carries one CopilotSessionEvent: `id:` is the event index, `event:` is the union member name, and `data:` is the JSON document of the union value. The stream closes after a `lifecycle` event that leaves the session dormant (`idle`, `archived`) or `failed`; reconnect with the last seen index + 1 as `startIndex` to resume, including after a dormant session revives.
|
|
32
32
|
* @example
|
|
33
33
|
* Use a bare-bones client and the command you need to make an API call.
|
|
34
34
|
* ```javascript
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { XhrHttpHandler as RequestHandler } from "@wildix/smithy-react-native";
|
|
1
2
|
import type { WilmaCopilotSessionsClientConfig } from "./WilmaCopilotSessionsClient";
|
|
2
3
|
/**
|
|
3
4
|
* @internal
|
|
4
5
|
*/
|
|
5
6
|
export declare const getRuntimeConfig: (config: WilmaCopilotSessionsClientConfig) => {
|
|
6
7
|
runtime: string;
|
|
8
|
+
requestHandler: RequestHandler;
|
|
7
9
|
sha256: import("@smithy/types").HashConstructor;
|
|
8
|
-
requestHandler: import("@smithy/types").NodeHttpHandlerOptions | import("@smithy/types").FetchHttpHandlerOptions | Record<string, unknown> | import("@smithy/core/protocols").HttpHandler<any> | import("@smithy/fetch-http-handler").FetchHttpHandler;
|
|
9
10
|
cacheMiddleware?: boolean;
|
|
10
11
|
protocol: import("@smithy/types").ClientProtocol<any, any> | import("@smithy/types").ClientProtocolCtor<any, any> | typeof import("@aws-sdk/core/protocols").AwsRestJsonProtocol;
|
|
11
12
|
protocolSettings: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildix/wilma-copilot-sessions-client",
|
|
3
3
|
"description": "@wildix/wilma-copilot-sessions-client client",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.13",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
7
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"@smithy/core": "^3.24.5",
|
|
25
25
|
"@smithy/fetch-http-handler": "^5.4.5",
|
|
26
26
|
"@smithy/node-http-handler": "^4.7.5",
|
|
27
|
-
"@smithy/types": "^4.14.2"
|
|
27
|
+
"@smithy/types": "^4.14.2",
|
|
28
|
+
"@wildix/smithy-react-native": "^1.0.0"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@tsconfig/node20": "20.1.8",
|
|
@@ -48,10 +49,11 @@
|
|
|
48
49
|
"dist-*/**"
|
|
49
50
|
],
|
|
50
51
|
"license": "Apache-2.0",
|
|
51
|
-
"browser": {
|
|
52
|
-
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
|
|
53
|
-
},
|
|
54
52
|
"react-native": {
|
|
53
|
+
"@aws-sdk/core/client": "@aws-sdk/core/dist-es/submodules/client/index.native.js",
|
|
55
54
|
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
|
|
55
|
+
},
|
|
56
|
+
"browser": {
|
|
57
|
+
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
|
|
56
58
|
}
|
|
57
59
|
}
|