Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/omnichannel-amsclient

Package Overview
Dependencies
Maintainers
5
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/omnichannel-amsclient - npm Package Compare versions

Comparing version 0.1.4-main.09cfa3b to 0.1.4-main.1c702fc

lib/utils/extractFileExtension.d.ts

2

CHANGELOG.md

@@ -5,2 +5,4 @@ # Changelog

## [Unreleased]
### Added
- Update `AMSLogData` to include `MimeType` & `FileExtension`

@@ -7,0 +9,0 @@ ## [0.1.3] - 2023-01-13

@@ -5,2 +5,3 @@ export default interface AMSLogData {

DocumentId?: string;
MimeType?: string;
ElapsedTimeInMilliseconds?: number;

@@ -11,2 +12,3 @@ Event?: string;

AMSClientVersion: string;
FileExtension?: string;
}

2

lib/config.js

@@ -1,1 +0,1 @@

exports.baseUrl = 'https://comms.omnichannelengagementhub.com/ams'; exports.sdkVersion = '0.1.4-main.09cfa3b';
exports.baseUrl = 'https://comms.omnichannelengagementhub.com/ams'; exports.sdkVersion = '0.1.4-main.1c702fc';

@@ -44,2 +44,3 @@ "use strict";

var uuid_1 = require("./utils/uuid");
var extractFileExtension_1 = require("./utils/extractFileExtension");
var FramedlessClient = /** @class */ (function () {

@@ -95,2 +96,3 @@ function FramedlessClient(logger) {

(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(PostMessageEventName_1.default.SkypeTokenAuth, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_b = this.chatToken) === null || _b === void 0 ? void 0 : _b.chatId,

@@ -106,2 +108,3 @@ });

(_c = this.scenarioMarker) === null || _c === void 0 ? void 0 : _c.failScenario(PostMessageEventName_1.default.SkypeTokenAuth, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_d = this.chatToken) === null || _d === void 0 ? void 0 : _d.chatId,

@@ -114,2 +117,3 @@ ExceptionDetails: {

(_e = this.scenarioMarker) === null || _e === void 0 ? void 0 : _e.completeScenario(PostMessageEventName_1.default.SkypeTokenAuth, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_f = this.chatToken) === null || _f === void 0 ? void 0 : _f.chatId

@@ -121,2 +125,3 @@ });

(_g = this.scenarioMarker) === null || _g === void 0 ? void 0 : _g.failScenario(PostMessageEventName_1.default.SkypeTokenAuth, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_h = this.chatToken) === null || _h === void 0 ? void 0 : _h.chatId,

@@ -141,3 +146,6 @@ ExceptionDetails: error_1

(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(PostMessageEventName_1.default.CreateObject, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_b = this.chatToken) === null || _b === void 0 ? void 0 : _b.chatId,
MimeType: file.type,
FileExtension: extractFileExtension_1.default(file.name)
});

@@ -151,4 +159,7 @@ _g.label = 1;

(_c = this.scenarioMarker) === null || _c === void 0 ? void 0 : _c.completeScenario(PostMessageEventName_1.default.CreateObject, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_d = this.chatToken) === null || _d === void 0 ? void 0 : _d.chatId,
DocumentId: response === null || response === void 0 ? void 0 : response.id
DocumentId: response === null || response === void 0 ? void 0 : response.id,
MimeType: file.type,
FileExtension: extractFileExtension_1.default(file.name)
});

@@ -159,3 +170,6 @@ return [2 /*return*/, response];

(_e = this.scenarioMarker) === null || _e === void 0 ? void 0 : _e.failScenario(PostMessageEventName_1.default.CreateObject, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_f = this.chatToken) === null || _f === void 0 ? void 0 : _f.chatId,
MimeType: file.type,
FileExtension: extractFileExtension_1.default(file.name),
ExceptionDetails: error_2

@@ -179,4 +193,7 @@ });

(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(PostMessageEventName_1.default.UploadDocument, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_b = this.chatToken) === null || _b === void 0 ? void 0 : _b.chatId,
DocumentId: documentId
DocumentId: documentId,
MimeType: file.type,
FileExtension: extractFileExtension_1.default(file.name)
});

@@ -190,4 +207,7 @@ _g.label = 1;

(_c = this.scenarioMarker) === null || _c === void 0 ? void 0 : _c.completeScenario(PostMessageEventName_1.default.UploadDocument, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_d = this.chatToken) === null || _d === void 0 ? void 0 : _d.chatId,
DocumentId: documentId
DocumentId: documentId,
MimeType: file.type,
FileExtension: extractFileExtension_1.default(file.name)
});

@@ -198,4 +218,7 @@ return [2 /*return*/, response];

(_e = this.scenarioMarker) === null || _e === void 0 ? void 0 : _e.failScenario(PostMessageEventName_1.default.UploadDocument, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_f = this.chatToken) === null || _f === void 0 ? void 0 : _f.chatId,
DocumentId: documentId,
MimeType: file.type,
FileExtension: extractFileExtension_1.default(file.name),
ExceptionDetails: error_3

@@ -219,4 +242,7 @@ });

(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(PostMessageEventName_1.default.GetViewStatus, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_b = this.chatToken) === null || _b === void 0 ? void 0 : _b.chatId,
DocumentId: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.id
DocumentId: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.id,
MimeType: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.type,
FileExtension: extractFileExtension_1.default((fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.name) || '')
});

@@ -230,4 +256,7 @@ _g.label = 1;

(_c = this.scenarioMarker) === null || _c === void 0 ? void 0 : _c.completeScenario(PostMessageEventName_1.default.GetViewStatus, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_d = this.chatToken) === null || _d === void 0 ? void 0 : _d.chatId,
DocumentId: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.id
DocumentId: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.id,
MimeType: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.type,
FileExtension: extractFileExtension_1.default((fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.name) || '')
});

@@ -238,4 +267,7 @@ return [2 /*return*/, response];

(_e = this.scenarioMarker) === null || _e === void 0 ? void 0 : _e.failScenario(PostMessageEventName_1.default.GetViewStatus, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_f = this.chatToken) === null || _f === void 0 ? void 0 : _f.chatId,
DocumentId: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.id,
MimeType: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.type,
FileExtension: extractFileExtension_1.default((fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.name) || ''),
ExceptionDetails: error_4

@@ -259,4 +291,7 @@ });

(_a = this.scenarioMarker) === null || _a === void 0 ? void 0 : _a.startScenario(PostMessageEventName_1.default.GetView, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_b = this.chatToken) === null || _b === void 0 ? void 0 : _b.chatId,
DocumentId: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.id
DocumentId: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.id,
MimeType: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.type,
FileExtension: extractFileExtension_1.default((fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.name) || '')
});

@@ -270,4 +305,7 @@ _g.label = 1;

(_c = this.scenarioMarker) === null || _c === void 0 ? void 0 : _c.completeScenario(PostMessageEventName_1.default.GetView, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_d = this.chatToken) === null || _d === void 0 ? void 0 : _d.chatId,
DocumentId: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.id
DocumentId: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.id,
MimeType: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.type,
FileExtension: extractFileExtension_1.default((fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.name) || '')
});

@@ -278,4 +316,7 @@ return [2 /*return*/, response];

(_e = this.scenarioMarker) === null || _e === void 0 ? void 0 : _e.failScenario(PostMessageEventName_1.default.GetView, {
AMSClientRuntimeId: this.runtimeId,
ChatId: chatToken ? chatToken.chatId : (_f = this.chatToken) === null || _f === void 0 ? void 0 : _f.chatId,
DocumentId: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.id,
MimeType: fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.type,
FileExtension: extractFileExtension_1.default((fileMetadata === null || fileMetadata === void 0 ? void 0 : fileMetadata.name) || ''),
ExceptionDetails: error_5

@@ -282,0 +323,0 @@ });

@@ -59,2 +59,3 @@ "use strict";

var AMSLogger_1 = require("./AMSLogger");
var extractFileExtension_1 = require("./utils/extractFileExtension");
var IframeCommunicator = /** @class */ (function () {

@@ -103,7 +104,7 @@ function IframeCommunicator(clientId) {

IframeCommunicator.prototype.handleEvent = function (event) {
var _a, _b, _c, _d, _e, _f;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
return __awaiter(this, void 0, void 0, function () {
var data, response, postMessageData, error_1, response, postMessageData, error_2, response, postMessageData, error_3, response, postMessageData, error_4, response, postMessageData, error_5;
return __generator(this, function (_g) {
switch (_g.label) {
return __generator(this, function (_u) {
switch (_u.label) {
case 0:

@@ -121,8 +122,8 @@ if (event.data.clientId !== this.clientId) {

});
_g.label = 1;
_u.label = 1;
case 1:
_g.trys.push([1, 3, , 4]);
_u.trys.push([1, 3, , 4]);
return [4 /*yield*/, API_1.default.skypeTokenAuth(data.chatToken)];
case 2:
response = _g.sent();
response = _u.sent();
postMessageData = {

@@ -153,3 +154,3 @@ requestId: data.requestId,

case 3:
error_1 = _g.sent();
error_1 = _u.sent();
this.postMessage(PostMessageEventType_1.default.Response, PostMessageEventName_1.default.SkypeTokenAuth, {}, PostMessageEventStatus_1.default.Failure);

@@ -167,10 +168,12 @@ this.scenarioMarker.failScenario(PostMessageEventName_1.default.SkypeTokenAuth, {

AMSClientRuntimeId: data.runtimeId,
ChatId: data.chatToken.chatId
ChatId: data.chatToken.chatId,
MimeType: data.file.type,
FileExtension: extractFileExtension_1.default(data.file.name)
});
_g.label = 6;
_u.label = 6;
case 6:
_g.trys.push([6, 8, , 9]);
_u.trys.push([6, 8, , 9]);
return [4 /*yield*/, API_1.default.createObject(data.id, data.file, data.chatToken)];
case 7:
response = _g.sent();
response = _u.sent();
postMessageData = {

@@ -186,3 +189,5 @@ requestId: data.requestId,

ChatId: data.chatToken.chatId,
DocumentId: response === null || response === void 0 ? void 0 : response.id
DocumentId: response === null || response === void 0 ? void 0 : response.id,
MimeType: data.file.type,
FileExtension: extractFileExtension_1.default(data.file.name)
});

@@ -192,3 +197,3 @@ this.postMessage(PostMessageEventType_1.default.Response, PostMessageEventName_1.default.CreateObject, postMessageData, PostMessageEventStatus_1.default.Success);

case 8:
error_2 = _g.sent();
error_2 = _u.sent();
this.postMessage(PostMessageEventType_1.default.Response, PostMessageEventName_1.default.CreateObject, {}, PostMessageEventStatus_1.default.Failure);

@@ -198,2 +203,4 @@ this.scenarioMarker.failScenario(PostMessageEventName_1.default.CreateObject, {

ChatId: data.chatToken.chatId,
MimeType: data.file.type,
FileExtension: extractFileExtension_1.default(data.file.name),
ExceptionDetails: error_2

@@ -208,10 +215,12 @@ });

ChatId: data.chatToken.chatId,
DocumentId: data.documentId
DocumentId: data.documentId,
MimeType: data.file.type,
FileExtension: extractFileExtension_1.default(data.file.name)
});
_g.label = 11;
_u.label = 11;
case 11:
_g.trys.push([11, 13, , 14]);
_u.trys.push([11, 13, , 14]);
return [4 /*yield*/, API_1.default.uploadDocument(data.documentId, data.file, data.chatToken)];
case 12:
response = _g.sent();
response = _u.sent();
postMessageData = {

@@ -228,3 +237,5 @@ requestId: data.requestId,

ChatId: data.chatToken.chatId,
DocumentId: data.documentId
DocumentId: data.documentId,
MimeType: data.file.type,
FileExtension: extractFileExtension_1.default(data.file.name)
});

@@ -234,3 +245,3 @@ this.postMessage(PostMessageEventType_1.default.Response, PostMessageEventName_1.default.UploadDocument, postMessageData, PostMessageEventStatus_1.default.Success);

case 13:
error_3 = _g.sent();
error_3 = _u.sent();
this.postMessage(PostMessageEventType_1.default.Response, PostMessageEventName_1.default.UploadDocument, {}, PostMessageEventStatus_1.default.Failure);

@@ -241,2 +252,4 @@ this.scenarioMarker.failScenario(PostMessageEventName_1.default.UploadDocument, {

DocumentId: data.documentId,
MimeType: data.file.type,
FileExtension: extractFileExtension_1.default(data.file.name),
ExceptionDetails: error_3

@@ -251,10 +264,12 @@ });

ChatId: data.chatToken.chatId,
DocumentId: (_a = data.fileMetadata) === null || _a === void 0 ? void 0 : _a.id
DocumentId: (_a = data.fileMetadata) === null || _a === void 0 ? void 0 : _a.id,
MimeType: (_b = data.fileMetadata) === null || _b === void 0 ? void 0 : _b.type,
FileExtension: extractFileExtension_1.default((_c = data.fileMetadata) === null || _c === void 0 ? void 0 : _c.name),
});
_g.label = 16;
_u.label = 16;
case 16:
_g.trys.push([16, 18, , 19]);
_u.trys.push([16, 18, , 19]);
return [4 /*yield*/, API_1.default.getViewStatus(data.fileMetadata, data.chatToken)];
case 17:
response = _g.sent();
response = _u.sent();
postMessageData = {

@@ -271,3 +286,5 @@ requestId: data.requestId,

ChatId: data.chatToken.chatId,
DocumentId: (_b = data.fileMetadata) === null || _b === void 0 ? void 0 : _b.id
DocumentId: (_d = data.fileMetadata) === null || _d === void 0 ? void 0 : _d.id,
MimeType: (_e = data.fileMetadata) === null || _e === void 0 ? void 0 : _e.type,
FileExtension: extractFileExtension_1.default((_f = data.fileMetadata) === null || _f === void 0 ? void 0 : _f.name),
});

@@ -277,3 +294,3 @@ this.postMessage(PostMessageEventType_1.default.Response, PostMessageEventName_1.default.GetViewStatus, postMessageData, PostMessageEventStatus_1.default.Success);

case 18:
error_4 = _g.sent();
error_4 = _u.sent();
this.postMessage(PostMessageEventType_1.default.Response, PostMessageEventName_1.default.GetViewStatus, {}, PostMessageEventStatus_1.default.Failure);

@@ -283,3 +300,5 @@ this.scenarioMarker.failScenario(PostMessageEventName_1.default.GetViewStatus, {

ChatId: data.chatToken.chatId,
DocumentId: (_c = data.fileMetadata) === null || _c === void 0 ? void 0 : _c.id,
DocumentId: (_g = data.fileMetadata) === null || _g === void 0 ? void 0 : _g.id,
MimeType: (_h = data.fileMetadata) === null || _h === void 0 ? void 0 : _h.type,
FileExtension: extractFileExtension_1.default((_j = data.fileMetadata) === null || _j === void 0 ? void 0 : _j.name),
ExceptionDetails: error_4

@@ -294,10 +313,12 @@ });

ChatId: data.chatToken.chatId,
DocumentId: (_d = data.fileMetadata) === null || _d === void 0 ? void 0 : _d.id
DocumentId: (_k = data.fileMetadata) === null || _k === void 0 ? void 0 : _k.id,
MimeType: (_l = data.fileMetadata) === null || _l === void 0 ? void 0 : _l.type,
FileExtension: extractFileExtension_1.default((_m = data.fileMetadata) === null || _m === void 0 ? void 0 : _m.name),
});
_g.label = 21;
_u.label = 21;
case 21:
_g.trys.push([21, 23, , 24]);
_u.trys.push([21, 23, , 24]);
return [4 /*yield*/, API_1.default.getView(data.fileMetadata, data.viewLocation, data.chatToken)];
case 22:
response = _g.sent();
response = _u.sent();
postMessageData = {

@@ -314,3 +335,5 @@ requestId: data.requestId,

ChatId: data.chatToken.chatId,
DocumentId: (_e = data.fileMetadata) === null || _e === void 0 ? void 0 : _e.id
DocumentId: (_o = data.fileMetadata) === null || _o === void 0 ? void 0 : _o.id,
MimeType: (_p = data.fileMetadata) === null || _p === void 0 ? void 0 : _p.type,
FileExtension: extractFileExtension_1.default((_q = data.fileMetadata) === null || _q === void 0 ? void 0 : _q.name),
});

@@ -320,3 +343,3 @@ this.postMessage(PostMessageEventType_1.default.Response, PostMessageEventName_1.default.GetView, postMessageData, PostMessageEventStatus_1.default.Success);

case 23:
error_5 = _g.sent();
error_5 = _u.sent();
this.postMessage(PostMessageEventType_1.default.Response, PostMessageEventName_1.default.GetView, {}, PostMessageEventStatus_1.default.Failure);

@@ -326,3 +349,5 @@ this.scenarioMarker.failScenario(PostMessageEventName_1.default.GetView, {

ChatId: data.chatToken.chatId,
DocumentId: (_f = data.fileMetadata) === null || _f === void 0 ? void 0 : _f.id,
DocumentId: (_r = data.fileMetadata) === null || _r === void 0 ? void 0 : _r.id,
MimeType: (_s = data.fileMetadata) === null || _s === void 0 ? void 0 : _s.type,
FileExtension: extractFileExtension_1.default((_t = data.fileMetadata) === null || _t === void 0 ? void 0 : _t.name),
ExceptionDetails: error_5

@@ -329,0 +354,0 @@ });

{
"name": "@microsoft/omnichannel-amsclient",
"version": "0.1.4-main.09cfa3b",
"version": "0.1.4-main.1c702fc",
"description": "Microsoft Omnichannel AMSClient",

@@ -5,0 +5,0 @@ "files": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc