@wxcc-desktop/sdk 1.2.6 → 1.2.10

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 (67) hide show
  1. package/README.md +18 -391
  2. package/dist/index.js +1 -0
  3. package/dist/types/index.d.ts +21 -0
  4. package/dist/types/jsapi/actions-jsapi.d.ts +33 -0
  5. package/dist/types/jsapi/agent-contact-jsapi.d.ts +430 -0
  6. package/dist/types/jsapi/agent-state-info-jsapi.d.ts +88 -0
  7. package/dist/types/jsapi/common/_logger.d.ts +4 -0
  8. package/dist/types/jsapi/common/_service-checker.d.ts +12 -0
  9. package/dist/types/jsapi/common/_service-events.d.ts +31 -0
  10. package/dist/types/jsapi/config-jsapi.d.ts +26 -0
  11. package/dist/types/jsapi/dialer-jsapi.d.ts +73 -0
  12. package/dist/types/jsapi/i18n-jsapi.d.ts +23 -0
  13. package/dist/types/jsapi/logger-jsapi.d.ts +19 -0
  14. package/dist/types/jsapi/screenpop-jsapi.d.ts +29 -0
  15. package/dist/types/jsapi/shortcut-key-jsapi.d.ts +67 -0
  16. package/dist/types/sdk.d.ts +1 -0
  17. package/package.json +5 -60
  18. package/.eslintignore +0 -5
  19. package/.eslintrc.js +0 -22
  20. package/.prettierignore +0 -5
  21. package/.prettierrc +0 -5
  22. package/README_PUBLISH.md +0 -36
  23. package/jenkins-automation/MergePipeline.groovy +0 -143
  24. package/jest.config.js +0 -15
  25. package/sonar-project.properties +0 -17
  26. package/src/[sandbox]/README.md +0 -55
  27. package/src/[sandbox]/assets/i18n/de/app.json +0 -6
  28. package/src/[sandbox]/assets/i18n/en/app.json +0 -6
  29. package/src/[sandbox]/assets/i18n/widget-using-js-api/de/widget-using-js-api.json +0 -5
  30. package/src/[sandbox]/assets/i18n/widget-using-js-api/en/widget-using-js-api.json +0 -5
  31. package/src/[sandbox]/favicon.ico +0 -0
  32. package/src/[sandbox]/index.html +0 -9
  33. package/src/[sandbox]/sandbox-config.ts +0 -23
  34. package/src/[sandbox]/sandbox-mock.ts +0 -218
  35. package/src/[sandbox]/sandbox.ts +0 -164
  36. package/src/[sandbox]/widget-using-js-api.ts +0 -658
  37. package/src/global.d.ts +0 -5
  38. package/src/index.ts +0 -101
  39. package/src/jsapi/actions-jsapi.test.ts +0 -155
  40. package/src/jsapi/actions-jsapi.ts +0 -410
  41. package/src/jsapi/agent-contact-jsapi.test.ts +0 -217
  42. package/src/jsapi/agent-contact-jsapi.ts +0 -275
  43. package/src/jsapi/agent-state-info-jsapi.test.ts +0 -176
  44. package/src/jsapi/agent-state-info-jsapi.ts +0 -288
  45. package/src/jsapi/common/_logger.test.ts +0 -16
  46. package/src/jsapi/common/_logger.ts +0 -9
  47. package/src/jsapi/common/_service-checker.test.ts +0 -44
  48. package/src/jsapi/common/_service-checker.ts +0 -28
  49. package/src/jsapi/common/_service-events.test.ts +0 -122
  50. package/src/jsapi/common/_service-events.ts +0 -156
  51. package/src/jsapi/config-jsapi.test.ts +0 -78
  52. package/src/jsapi/config-jsapi.ts +0 -106
  53. package/src/jsapi/dialer-jsapi.test.ts +0 -101
  54. package/src/jsapi/dialer-jsapi.ts +0 -116
  55. package/src/jsapi/i18n-jsapi.test.ts +0 -62
  56. package/src/jsapi/i18n-jsapi.ts +0 -77
  57. package/src/jsapi/logger-jsapi.test.ts +0 -45
  58. package/src/jsapi/logger-jsapi.ts +0 -62
  59. package/src/jsapi/screenpop-jsapi.test.ts +0 -80
  60. package/src/jsapi/screenpop-jsapi.ts +0 -100
  61. package/src/jsapi/shortcut-key-jsapi.test.ts +0 -88
  62. package/src/jsapi/shortcut-key-jsapi.ts +0 -112
  63. package/src/sdk.ts +0 -3
  64. package/src/tsconfig.json +0 -18
  65. package/tsconfig.json +0 -13
  66. package/webpack.config.dev.server.ts +0 -12
  67. package/webpack.config.ts +0 -134
@@ -1,23 +0,0 @@
1
- export const PROCESS_ENV_SANDBOX = {
2
- COMPLIANCE_SERVICE_URL: "https://ccc-compliance.qaus1.ciscoccservice.com/ccc-compliance/v1",
3
- CONFIG_URL: "https://config.qaus1.ciscoccservice.com/config/v1",
4
-
5
- // api endpoints
6
- AQM_HOST: "https://aqm.qaus1.ciscoccservice.com/aqm/v1",
7
- EMM_HOST: "https://emm.qaus1.ciscoccservice.com/emm/v1",
8
- NOTIF_HOST: "https://notifs.qaus1.ciscoccservice.com/notifs/v1",
9
- WXM_HOST: "https://api.getcloudcherry.com/api",
10
- CMS_HOST: "https://cms.qaus1.ciscoccservice.com",
11
- DIALER_HOST: "https://dialer.qaus1.ciscoccservice.com/dialer/v1",
12
- MEDIA_SERVICE_HOST: "https://mediastorage.qaus1.ciscoccservice.com/media",
13
-
14
- // auth
15
- ID_BROKER_URL: "https://idbrokerbts.webex.com",
16
- IDENTITY_URL: "https://identitybts.webex.com",
17
- AUTH_CLIENT_ID: "Ce05996acf8f05ea974343aba080d8e1d057401c9506ca69825a08ef69cfb875a",
18
- AUTH_CLIENT_SECRET: "0a1521cc5644767724a7ab2b9417ac33c59c39240814e30ebe3bc6c4378c20f0",
19
- AUTH_SCOPE:
20
- "cloud-contact-center:pod_read cloud-contact-center:pod_conv contact-center-context:pod_read contact-center-context:pod_write cloud-contact-center-digital:read cloud-contact-center-digital:write webex-squared:kms_write webex-squared:kms_bind webex-squared:kms_read webexsquare:get_conversation Identity:SCIM spark:all spark:kms cjp:config_read sunlight-internal-service:write spark:messages_write",
21
- UUIP_WEB_SERVICE: "https://uuip-web-services.qaus1.ciscoccservice.com",
22
- FLS_URL: "https://ciflsbts.webex.com/federation"
23
- };
@@ -1,218 +0,0 @@
1
- import { Service } from "@wxcc-desktop/sdk-types";
2
-
3
- export const buddyAgentPayload: Service.Aqm.Contact.BuddyAgents = {
4
- agentProfileId: "AXCLfZhH9S1oTdqE1OFw",
5
- channelName: "chat",
6
- state: "Available"
7
- };
8
-
9
- export const vTeamListpayload: Service.Aqm.Contact.VTeam = {
10
- agentProfileId: "AXCLfZhH9S1oTdqE1OFw",
11
- agentSessionId: "5a84d32c-691b-4500-b163-d6cdba2a3163",
12
- channelType: "chat",
13
- type: "inboundqueue"
14
- };
15
-
16
- export const consultQueue: Service.Aqm.Contact.ConsultQueue = {
17
- agentId: "df276f7a-5113-4d30-831b-ba2d51010203",
18
- queueId: "3268",
19
- trackingId: "3d0ab7d7-e92a-4b24-a238-92f940e64489"
20
- };
21
-
22
- export const consultAgent: Service.Aqm.Contact.ConsultAgent = {
23
- agentId: "df276f7a-5113-4d30-831b-ba2d51010203",
24
- destAgentDN: "9997770095",
25
- destAgentId: "299b728a-d6f8-4934-8fad-577525c0b7fc",
26
- destAgentTeamId: "960",
27
- destSiteId: "472",
28
- mediaType: "telephony",
29
- trackingId: "3d0ab7d7-e92a-4b24-a198-92f940e64489"
30
- };
31
-
32
- export const consultDN: Service.Aqm.Contact.ConsultDN = {
33
- destAgentId: "9997770095",
34
- destinationType: "DN",
35
- mediaType: "telephony",
36
- trackingId: "3d0ab7d7-e92a-2324-a198-92f940e64489"
37
- };
38
-
39
- export const vteamTransferMockPayLoad = {
40
- vteamId: "AXDiuOLjKin42Ov3QJXN",
41
- vteamType: "inboundqueue"
42
- };
43
-
44
- export const blindTransferMockPayLoad = {
45
- agentId: "f795f41f-3782-44fa-97a4-c8b4dc029477",
46
- destAgentId: "299b728a-d6f8-4934-8fad-577525c0b7fc",
47
- mediaType: "chat",
48
- destAgentTeamId: "964",
49
- destAgentDN: "9997770095",
50
- destSiteId: "472"
51
- };
52
-
53
- export const consultTransferMockPayLoad = {
54
- agentId: "43bfcdef-5551-45b1-a8f9-a0b33e66e3fe",
55
- destAgentId: "f795f41f-3782-44fa-97a4-c8b4dc029477",
56
- mediaType: "telephony",
57
- mediaResourceId: "b102ed10-fac2-4f8e-bece-1c2da6ba6dd8"
58
- };
59
-
60
- export const contactPayload = {
61
- mediaResourceId: "49bcf26b-ec75-4351-89fa-55d54682c20c",
62
- eventType: "RoutingMessage",
63
- agentId: "16839506-7c48-4a71-ba1b-d585e5d37607",
64
- trackingId: "354deeae-c98a-4a8c-9e04-e56e129fdb9f",
65
- interaction: {
66
- isFcManaged: false,
67
- isTerminated: false,
68
- mediaType: "telephony",
69
- previousVTeams: ["AXCZ0YCAXrf9I0XFBI7b"],
70
- state: "connected",
71
- currentVTeam: "3268",
72
- participants: {
73
- "+19997770096": { id: "+19997770096", pType: "Customer", type: "Customer" },
74
- "aad323de-32d8-48c9-af6b-b68dfbabfe20": {
75
- name: "uuip-agent2",
76
- pType: "Agent",
77
- teamName: "Team X",
78
- lastUpdated: 1597681728863,
79
- teamId: "962",
80
- joinTimestamp: 1597681728863,
81
- isConsulted: false,
82
- hasJoined: true,
83
- consultTimestamp: null,
84
- dn: "9997770194",
85
- queueId: "3268",
86
- id: "16839506-7c48-4a71-ba1b-d585e5d37607",
87
- sessionId: "319d8e83-2a75-4ef3-9cb8-1c845edb15a0",
88
- consultState: null,
89
- queueMgrId: "aqm",
90
- siteId: "473",
91
- type: "Agent",
92
- channelId: "ab8b3603-84a7-4f61-b987-9044b4d69cf2",
93
- wrapUpTimestamp: null,
94
- isWrapUp: false
95
- }
96
- },
97
- interactionId: "49bcf26b-ec75-4351-89fa-55d54682c20c",
98
- orgId: "f222e3af-1a53-42ef-9deb-7520034b8a10",
99
- callAssociatedData: {
100
- customerName: { value: "test", name: "r", agentEditable: false, type: "s", displayName: "d" }
101
- },
102
- callAssociatedDetails: {
103
- virtualTeamName: "Queue - Telephony",
104
- ani: "+19997770096",
105
- ronaTimeout: "30",
106
- dn: "+12147659000",
107
- pathId: " StartCall PlayDone out out out",
108
- IvrPath: " EOI",
109
- subject: "",
110
- toAddress: "",
111
- inReplyTo: "",
112
- customerName: "",
113
- ccAddress: "",
114
- entryPointId: "",
115
- accountId: "",
116
- reasonCode: "",
117
- reason: "",
118
- references: "",
119
- contentType: "",
120
- date: "",
121
- replyToAddress: "",
122
- fromAddress: "",
123
- messageId: "",
124
- from: "",
125
- threadId: "",
126
- bccAddress: "",
127
- queueType: "",
128
- dnis: "",
129
- category: "",
130
- sourceNumber: "",
131
- sourcePage: "",
132
- appUser: "",
133
- customerNumber: ""
134
- },
135
- callProcessingDetails: {
136
- QMgrName: "aqm",
137
- pauseResumeEnabled: "true",
138
- taskToBeSelfServiced: "false",
139
- ani: "+19997770096",
140
- recordInProgress: "true",
141
- pauseDuration: "10",
142
- dnis: "+12147659000",
143
- tenantId: "133",
144
- QueueId: "3268",
145
- vteamId: "3268",
146
- jscriptId: "AXCZ4c3mjkwgAuS7vSIU",
147
- customerName: "",
148
- virtualTeamName: "Queue - Telephony",
149
- ronaTimeout: "30",
150
- category: "",
151
- reason: "",
152
- sourceNumber: "",
153
- sourcePage: "",
154
- appUser: "",
155
- customerNumber: "",
156
- reasonCode: "",
157
- IvrPath: " EOI",
158
- pathId: " StartCall PlayDone out out out",
159
- fromAddress: ""
160
- },
161
- media: {
162
- "49bcf26b-ec75-4351-89fa-55d54682c20c": {
163
- mediaResourceId: "49bcf26b-ec75-4351-89fa-55d54682c20c",
164
- mediaType: "telephony",
165
- mediaMgr: "vmm",
166
- participants: ["+19997770096", "16839506-7c48-4a71-ba1b-d585e5d37607"],
167
- mType: "mainCall",
168
- isHold: false,
169
- holdTimestamp: null
170
- }
171
- },
172
- owner: "16839506-7c48-4a71-ba1b-d585e5d37607",
173
- mediaChannel: "broadcloud",
174
- contactDirection: { type: "INBOUND" },
175
- callFlowParams: {
176
- Play2: {
177
- name: "Play2",
178
- qualifier: "",
179
- description: "(A valid text.)",
180
- valueDataType: "string",
181
- value: "Welcome to Agent X Team Space"
182
- },
183
- Queue3: {
184
- name: "Queue3",
185
- qualifier: "vteam",
186
- description: "(vteam, A valid VTeam.)",
187
- valueDataType: "string",
188
- value: "3268"
189
- }
190
- }
191
- },
192
- interactionId: "49bcf26b-ec75-4351-89fa-55d54682c20c",
193
- orgId: "f222e3af-1a53-42ef-9deb-7520034b8a10",
194
- queueMgr: "aqm",
195
- type: "AgentContactAssigned",
196
- destAgentId: "16839506-7c48-4a71-ba1b-d585e5d37607",
197
- consultMediaResourceId: "",
198
- owner: "",
199
- isConferencing: false
200
- };
201
-
202
- ///////////////////////////////////////////////////////
203
- export const mocksShortcutKeys = [
204
- {
205
- widgetElement: "custom-element",
206
- group: "custom widget",
207
- action: "login",
208
- modifierKeys: "ctrlKey_altKey",
209
- key: "r"
210
- },
211
- {
212
- widgetElement: "custom-element",
213
- group: "custom widget",
214
- action: "logout",
215
- modifierKeys: "ctrlKey_altKey",
216
- key: "n"
217
- }
218
- ];
@@ -1,164 +0,0 @@
1
- import { initAgentxServices, SERVICE } from "@wxcc-desktop/sdk-types";
2
- import { CI, OAuth } from "@uuip/unified-ui-platform";
3
- import { css, customElement, html, internalProperty, LitElement } from "lit-element";
4
- import { PROCESS_ENV_SANDBOX } from "./sandbox-config";
5
- import "./widget-using-js-api";
6
- import { nothing } from "lit-html";
7
- import { I18N } from "@uuip/unified-ui-platform-sdk";
8
-
9
- // SANDBOX I18N Instance (widget using it's own)
10
- const i18n = SERVICE.i18n;
11
- const i18nMixin = I18N.createMixin({ i18n });
12
-
13
- // SANDBOX I18N "t" function (widget using it's own)
14
- function t(...args: Parameters<typeof i18n.t>) {
15
- return i18n.t(...args);
16
- }
17
-
18
- @customElement("agentx-js-api-sandbox")
19
- export class Sandbox extends i18nMixin(LitElement) {
20
- // SANDBOX
21
- @internalProperty() private isAuthorized = false;
22
- @internalProperty() private isAgentLoggedIn = false;
23
- @internalProperty() private oAuthToken?: OAuth.Token;
24
- @internalProperty() private isServiceInited = false;
25
-
26
- // SANDBOX Auth Instance
27
- private auth = new OAuth.Service({
28
- clientId: PROCESS_ENV_SANDBOX.AUTH_CLIENT_ID,
29
- clientSecret: PROCESS_ENV_SANDBOX.AUTH_CLIENT_SECRET,
30
- scopes: PROCESS_ENV_SANDBOX.AUTH_SCOPE,
31
- idbrokerUrl: PROCESS_ENV_SANDBOX.ID_BROKER_URL,
32
- identityUrl: PROCESS_ENV_SANDBOX.IDENTITY_URL,
33
- uuipWebServiceUrl: PROCESS_ENV_SANDBOX.UUIP_WEB_SERVICE,
34
- flsUrl: PROCESS_ENV_SANDBOX.FLS_URL
35
- });
36
-
37
- constructor() {
38
- super();
39
- // Initing SANDBOX I18N Instance
40
- i18n.init(SERVICE.i18n.DEFAULT_INIT_OPTIONS);
41
- }
42
-
43
- async connectedCallback() {
44
- super.connectedCallback();
45
-
46
- // AUTH
47
- const oAuthToken = await this.auth.getToken();
48
- if (oAuthToken) {
49
- this.oAuthToken = oAuthToken;
50
-
51
- // INIT SERVICE Singleton
52
- await initAgentxServices(PROCESS_ENV_SANDBOX, oAuthToken.access_token);
53
-
54
- this.isServiceInited = true;
55
-
56
- await this.loginFlow();
57
-
58
- this.isAuthorized = true;
59
- }
60
- }
61
-
62
- onLoginClick() {
63
- this.auth.login();
64
- }
65
-
66
- onLogoutClick() {
67
- this.oAuthToken && this.auth.logout(this.oAuthToken.access_token);
68
- }
69
-
70
- async loginFlow() {
71
- const ci = new CI.Service({
72
- accessToken: this.oAuthToken?.access_token!,
73
- identityUrl: PROCESS_ENV_SANDBOX.IDENTITY_URL
74
- });
75
- const me = await ci.getUserMe();
76
- console.log("ME:", me);
77
- console.log("");
78
-
79
- // LOGIN
80
- // -------------------
81
-
82
- try {
83
- const reload = await SERVICE.aqm.agent.reload();
84
- console.log("RELOADED", reload);
85
- console.log("");
86
- } catch (error) {
87
- console.log("RELOAD FAILED", JSON.stringify(error));
88
- const profile = SERVICE.conf.profile ? SERVICE.conf.profile : await SERVICE.conf.fetchProfile();
89
- const defaultAuxCode = profile.idleCodes.filter(option => option.isDefault)[0]?.id;
90
- const login = await SERVICE.aqm.agent.stationLogin({
91
- data: {
92
- dn: "192837465500",
93
- usesOtherDN: false,
94
- siteId: profile.siteId,
95
- teamId: profile.teams[0].teamId,
96
- teamName: profile.teams[0].teamName,
97
- skillProfileId: profile.skillProfileId,
98
- auxCodeId: defaultAuxCode.toString()
99
- }
100
- });
101
- console.log("Station LOGIN", login);
102
- console.log("");
103
- }
104
-
105
- // STATE
106
- // -------------
107
-
108
- const agentState = await SERVICE.aqm.agent.stateChange({
109
- data: {
110
- state: "Available",
111
- auxCodeIdArray: "0"
112
- }
113
- });
114
- console.log("STATE", agentState);
115
- console.log("");
116
-
117
- this.isAgentLoggedIn = true;
118
- }
119
-
120
- static get styles() {
121
- return css`
122
- :host {
123
- height: 100vh;
124
- }
125
- `;
126
- }
127
-
128
- render() {
129
- return html`
130
- <section>
131
- <div>
132
- <h3 style="margin-top: 0">${t("app:preparing")}:</h3>
133
-
134
- <div>
135
- <p style="word-break: break-all">${JSON.stringify(PROCESS_ENV_SANDBOX)}</p>
136
- </div>
137
- </div>
138
- <br />
139
- <div>
140
- ${!this.isAuthorized && this.oAuthToken?.access_token
141
- ? html`
142
- <span>${t("app:wait")}...</span>
143
- `
144
- : html`
145
- ${this.isAgentLoggedIn
146
- ? html`
147
- <button @click="${() => this.onLogoutClick()}">${t("app:logout")}</button>
148
- `
149
- : html`
150
- <button @click="${() => this.onLoginClick()}">${t("app:login")}</button>
151
- `}
152
- `}
153
- ${this.isServiceInited
154
- ? html`
155
- <hr />
156
- <br />
157
- <widget-using-js-api .accessToken="${this.oAuthToken?.access_token}"></widget-using-js-api>
158
- `
159
- : nothing}
160
- </div>
161
- </section>
162
- `;
163
- }
164
- }