Skip to content

Commit

Permalink
added support for RequestStorageAccess page.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brett McStotts committed Sep 22, 2023
1 parent b292ff1 commit 381ecd4
Show file tree
Hide file tree
Showing 15 changed files with 1,616 additions and 421 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"root": true,
"parserOptions": {
"project": "tsconfig.json"
},
"extends": ["@amzn/lilax-style/lint-ts"],
"globals": {
"globalThis": "readonly",
"globalConnect": "writable"
},
"rules": {
"wrap-iife": ["error", "inside"],
"consistent-return": "off",
"func-names": "off",
"max-len": "off",
"no-console": "off",
"no-underscore-dangle": "off"
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Run `npm run release` to generate new release files. Full instructions for build
In version 1.x, we also support `make` for legacy builds. This option was removed in version 2.x.

# Important Announcements
1. September 2023 - Amazon Connect CCP uses cookies for authentication. As part of Google's [Privacy Sandbox](https://privacysandbox.com/open-web/#the-privacy-sandbox-timeline) initiative, Google Chrome has announced plans to block third-party cookies (that is, cookies passed between two top level domains). Version 2.6.2 comes with request storage access API implementation which allows CCP to continue using third party cookies. [Learn more](https://docs.aws.amazon.com/connect/latest/adminguide/what-is-amazon-connect.html).
1. December 2022 - In addition to the CCP, customers can now embed an application that provides guided experiences to your agents using the connect.agentApp. See the [updated documentation](https://github.com/amazon-connect/amazon-connect-streams/blob/master/Documentation.md#initialization-for-ccp-customer-profiles-wisdom-and-customviews) for details on usage.
* ### Guided experiences for agents
+ With Amazon Connect you can now create guided step-by-step experiences that walk agents through tailored views that focus on what must be seen or done by the agent at a given moment during an interaction. You can design workflows for various types of customer interactions and present agents with different step-by-step guides based on context, such as call queue, customer information, and interactive voice response (IVR). This feature is available in the Connect agent workspace as well as an embeddable application that can be embedded into another website via the Streams API. For more information, visit the AWS website: https://aws.amazon.com/connect/agent-workspace/
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amazon-connect-streams",
"version": "2.6.1",
"version": "2.6.2",
"description": "Amazon Connect Streams Library",
"engines": {
"node": ">=12.0.0"
Expand Down Expand Up @@ -52,4 +52,4 @@
"webpack-cli": "^4.9.1",
"webpack-plugin-replace": "^1.2.0"
}
}
}
2 changes: 1 addition & 1 deletion release/connect-streams-dr-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/connect-streams-dr.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/connect-streams-min.js

Large diffs are not rendered by default.

736 changes: 558 additions & 178 deletions release/connect-streams.js

Large diffs are not rendered by default.

372 changes: 195 additions & 177 deletions src/core.js

Large diffs are not rendered by default.

66 changes: 65 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,23 @@ declare namespace connect {
*/
function hitch<T extends (...args: any[]) => any>(scope: object, method: T): T;

type StorageAcccessCallbackData = {
hasAccess?: boolan;
[key: string]: any;
}

interface StorageAcccessCallbacks {
onInit(options:StorageAcccessCallbackData): Function
onRequest(options:StorageAcccessCallbackData): Function
onDeny(options:StorageAcccessCallbackData): Function
}

interface StorageAccess {
onRequest(options: StorageAcccessCallbacks): {unsubscribe: Function}
}

const storageAccess: StorageAccess;

interface Core {
/**
* Integrates with Amazon Connect by loading the pre-built CCP located at `ccpUrl` into an iframe and placing it into the `container` provided.
Expand Down Expand Up @@ -296,6 +313,51 @@ declare namespace connect {
contactId: string;
}

type StorageAccessParameters = {
/** Defines whether to use a customized request access banner or default connect branded banner*/
mode?: 'default' | 'custom';
/** opt out from storage access flow */
canRequest?: boolean;
/** incase of CCP URL being the SSO URL, use this to pass the connect instance URL, example https://test.my.connect.aws, where test being the instance alias */
instanceUrl?: string;
/** customize style of the custom request access/deny banner, only works for mode "custom" */
style?: {
'font-family': string;
'primary-color': string;
'primary-button-hover-color': string;
'link-color': string;
'banner-box-shadow': string;
'banner-margin': string;
'border-radius': string;
'banner-header-color': string;
'banner-title-color': string;
'banner-request-access-description-color': string;
'banner-request-deny-description-color': string;
'banner-request-access-background': string;
'banner-request-deny-background': string;
'banner-icon-display': string;
'banner-request-access-icon-color': string;
'banner-request-deny-icon-color': string;
'line-height': string;
'header-font-size': string;
'bold-font-weight': string;
'banner-description-font-size': string;
};
/** Customize messaging on the request/deny banners */
custom?: {
header?: string;
title?: string;
accessBannerDescription?: string;
denyBannerDescription?: string;
accessBannerButtonText?: string;
denyBannerButtonText?: string;
accessBannerLearnMoreUrl?: string;
denyBannerLearnMoreUrl?: string;
accessBannerLearnMoreText?: string;
denyBannerLearnMoreText?: string;
};
};

interface SoftPhoneOptions {
/**
* Normally, the softphone microphone and speaker components are not allowed to be hosted in an iframe.
Expand Down Expand Up @@ -419,8 +481,10 @@ declare namespace connect {

/** A timeout in ms that indicates how long streams will wait for the initial ACKNOWLEDGE event from the shared worker while the CCP is still standing itself up. */
readonly ccpLoadTimeout?: number;
}

/** used for request storage access implementations */
readonly storageAccess?: StorageAccessParameters
}

interface OptionalInitCCPOptions {
/**
Expand Down
Loading

0 comments on commit 381ecd4

Please sign in to comment.