Best JavaScript code snippet using playwright-internal
UnifiedMessaging.js
Source:UnifiedMessaging.js
...48 }());49 var UnifiedMessage = (function(){50 var hasProps = false;51 function UnifiedMessage() {52 if (!hasProps) { defineProps(); }53 if (!_util.hasProp(this, '__type')) {54 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:unifiedMessage' });55 }56 UnifiedMessage._super.constructor.apply(this, arguments);57 }58 _util.inherits(UnifiedMessage, _util.DataContract);59 function defineProps() {60 Object.defineProperty(UnifiedMessage.prototype, 'unifiedMessageId', {61 get: function() { return this.__prop_unifiedMessageId; },62 set: function(value) {63 if (!(_util.isString(value))) {64 throw new TypeError('Expected type String for UnifiedMessage.unifiedMessageId, but got ' + _util.inspect(value) + '.');65 }66 this.__prop_unifiedMessageId = value;67 },68 enumerable: true69 });70 Object.defineProperty(UnifiedMessage.prototype, 'state', {71 get: function() { return this.__prop_state; },72 set: function(value) {73 if (!(value instanceof MessageState)) {74 try {75 value = new MessageState(value);76 } catch (e) {77 throw new TypeError('Error setting UnifiedMessage.state: ' + e.message);78 }79 }80 this.__prop_state = value;81 },82 enumerable: true83 });84 hasProps = true;85 }86 Object.defineProperty(UnifiedMessage, '__type', { value: 'urn:inin.com:unifiedMessaging:unifiedMessage' });87 Object.defineProperty(UnifiedMessage, '__propInfo', {88 get: function() {89 var pi = {90 'unifiedMessageId': { required: true, nullable: false },91 'state': { required: true, nullable: false }92 };93 if (_util.DataContract.__propInfo) { _util.extend(pi, _util.DataContract.__propInfo); }94 pi.__type = { required: false, nullable: false };95 return pi;96 }97 });98 _typemap['urn:inin.com:unifiedMessaging:unifiedMessage'] = UnifiedMessage;99 return UnifiedMessage;100 }());101 var Attachment = (function(){102 var hasProps = false;103 function Attachment() {104 if (!hasProps) { defineProps(); }105 if (!_util.hasProp(this, '__type')) {106 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:attachment' });107 }108 Attachment._super.constructor.apply(this, arguments);109 }110 _util.inherits(Attachment, _util.DataContract);111 function defineProps() {112 Object.defineProperty(Attachment.prototype, 'fileUri', {113 get: function() { return this.__prop_fileUri; },114 set: function(value) {115 if (!(_util.isString(value))) {116 throw new TypeError('Expected type String for Attachment.fileUri, but got ' + _util.inspect(value) + '.');117 }118 this.__prop_fileUri = value;119 },120 enumerable: true121 });122 Object.defineProperty(Attachment.prototype, 'fileName', {123 get: function() { return this.__prop_fileName; },124 set: function(value) {125 if (!(_util.isString(value))) {126 throw new TypeError('Expected type String for Attachment.fileName, but got ' + _util.inspect(value) + '.');127 }128 this.__prop_fileName = value;129 },130 enumerable: true131 });132 Object.defineProperty(Attachment.prototype, 'mimeType', {133 get: function() { return this.__prop_mimeType; },134 set: function(value) {135 if (!(_util.isString(value) || value === void 0)) {136 throw new TypeError('Expected type String for Attachment.mimeType, but got ' + _util.inspect(value) + '.');137 }138 this.__prop_mimeType = value;139 },140 enumerable: true141 });142 hasProps = true;143 }144 Object.defineProperty(Attachment, '__type', { value: 'urn:inin.com:unifiedMessaging:attachment' });145 Object.defineProperty(Attachment, '__propInfo', {146 get: function() {147 var pi = {148 'fileUri': { required: true, nullable: false },149 'fileName': { required: true, nullable: false },150 'mimeType': { required: false, nullable: false }151 };152 if (_util.DataContract.__propInfo) { _util.extend(pi, _util.DataContract.__propInfo); }153 pi.__type = { required: false, nullable: false };154 return pi;155 }156 });157 _typemap['urn:inin.com:unifiedMessaging:attachment'] = Attachment;158 return Attachment;159 }());160 var UnifiedMessageUpdateRequest = (function(){161 var hasProps = false;162 function UnifiedMessageUpdateRequest() {163 if (!hasProps) { defineProps(); }164 if (!_util.hasProp(this, '__type')) {165 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:unifiedMessageUpdateRequest' });166 }167 UnifiedMessageUpdateRequest._super.constructor.apply(this, arguments);168 }169 _util.inherits(UnifiedMessageUpdateRequest, _util.DataContract);170 function defineProps() {171 Object.defineProperty(UnifiedMessageUpdateRequest.prototype, 'state', {172 get: function() { return this.__prop_state; },173 set: function(value) {174 if (!(value instanceof MessageState)) {175 try {176 value = new MessageState(value);177 } catch (e) {178 throw new TypeError('Error setting UnifiedMessageUpdateRequest.state: ' + e.message);179 }180 }181 this.__prop_state = value;182 },183 enumerable: true184 });185 hasProps = true;186 }187 Object.defineProperty(UnifiedMessageUpdateRequest, '__type', { value: 'urn:inin.com:unifiedMessaging:unifiedMessageUpdateRequest' });188 Object.defineProperty(UnifiedMessageUpdateRequest, '__propInfo', {189 get: function() {190 var pi = {191 'state': { required: true, nullable: false }192 };193 if (_util.DataContract.__propInfo) { _util.extend(pi, _util.DataContract.__propInfo); }194 pi.__type = { required: false, nullable: false };195 return pi;196 }197 });198 _typemap['urn:inin.com:unifiedMessaging:unifiedMessageUpdateRequest'] = UnifiedMessageUpdateRequest;199 return UnifiedMessageUpdateRequest;200 }());201 var UnifiedMessagePlayOperationRequest = (function(){202 var hasProps = false;203 function UnifiedMessagePlayOperationRequest() {204 if (!hasProps) { defineProps(); }205 if (!_util.hasProp(this, '__type')) {206 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:unifiedMessagePlayOperationRequest' });207 }208 UnifiedMessagePlayOperationRequest._super.constructor.apply(this, arguments);209 }210 _util.inherits(UnifiedMessagePlayOperationRequest, _util.DataContract);211 function defineProps() {212 Object.defineProperty(UnifiedMessagePlayOperationRequest.prototype, 'state', {213 get: function() { return this.__prop_state; },214 set: function(value) {215 if (!(value instanceof MessageState)) {216 try {217 value = new MessageState(value);218 } catch (e) {219 throw new TypeError('Error setting UnifiedMessagePlayOperationRequest.state: ' + e.message);220 }221 }222 this.__prop_state = value;223 },224 enumerable: true225 });226 Object.defineProperty(UnifiedMessagePlayOperationRequest.prototype, 'playTarget', {227 get: function() { return this.__prop_playTarget; },228 set: function(value) {229 if (!(value instanceof VoicemailPlayOperation || value === void 0)) {230 try {231 value = new VoicemailPlayOperation(value);232 } catch (e) {233 throw new TypeError('Error setting UnifiedMessagePlayOperationRequest.playTarget: ' + e.message);234 }235 }236 this.__prop_playTarget = value;237 },238 enumerable: true239 });240 hasProps = true;241 }242 Object.defineProperty(UnifiedMessagePlayOperationRequest, '__type', { value: 'urn:inin.com:unifiedMessaging:unifiedMessagePlayOperationRequest' });243 Object.defineProperty(UnifiedMessagePlayOperationRequest, '__propInfo', {244 get: function() {245 var pi = {246 'state': { required: true, nullable: false },247 'playTarget': { required: false, nullable: false }248 };249 if (_util.DataContract.__propInfo) { _util.extend(pi, _util.DataContract.__propInfo); }250 pi.__type = { required: false, nullable: false };251 return pi;252 }253 });254 _typemap['urn:inin.com:unifiedMessaging:unifiedMessagePlayOperationRequest'] = UnifiedMessagePlayOperationRequest;255 return UnifiedMessagePlayOperationRequest;256 }());257 var VoicemailPlayOperation = (function(){258 var hasProps = false;259 function VoicemailPlayOperation() {260 if (!hasProps) { defineProps(); }261 if (!_util.hasProp(this, '__type')) {262 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailPlayOperation' });263 }264 VoicemailPlayOperation._super.constructor.apply(this, arguments);265 }266 _util.inherits(VoicemailPlayOperation, _util.DataContract);267 function defineProps() {268 hasProps = true;269 }270 Object.defineProperty(VoicemailPlayOperation, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailPlayOperation' });271 Object.defineProperty(VoicemailPlayOperation, '__propInfo', {272 get: function() {273 var pi = {274 };275 if (_util.DataContract.__propInfo) { _util.extend(pi, _util.DataContract.__propInfo); }276 pi.__type = { required: false, nullable: false };277 return pi;278 }279 });280 _typemap['urn:inin.com:unifiedMessaging:voicemailPlayOperation'] = VoicemailPlayOperation;281 return VoicemailPlayOperation;282 }());283 var VoicemailMessagesMessage = (function(){284 var hasProps = false;285 function VoicemailMessagesMessage() {286 if (!hasProps) { defineProps(); }287 if (!_util.hasProp(this, '__type')) {288 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailMessagesMessage', enumerable: true });289 }290 VoicemailMessagesMessage._super.constructor.apply(this, arguments);291 }292 _util.inherits(VoicemailMessagesMessage, Messaging.Message);293 function defineProps() {294 Object.defineProperty(VoicemailMessagesMessage.prototype, 'voicemailMessagesAdded', {295 get: function() { return this.__prop_voicemailMessagesAdded; },296 set: function(value) {297 if (!(_util.isArray(value) && value.every(function(item){ return (item instanceof VoicemailMessageAdded); }) || value === void 0)) {298 try {299 value = value.map(function(item){ return new VoicemailMessageAdded(item); });300 } catch (e) {301 throw new TypeError('Error setting VoicemailMessagesMessage.voicemailMessagesAdded: ' + e.message);302 }303 }304 this.__prop_voicemailMessagesAdded = value;305 },306 enumerable: true307 });308 Object.defineProperty(VoicemailMessagesMessage.prototype, 'voicemailMessagesChanged', {309 get: function() { return this.__prop_voicemailMessagesChanged; },310 set: function(value) {311 if (!(_util.isArray(value) && value.every(function(item){ return (item instanceof VoicemailMessage); }) || value === void 0)) {312 try {313 value = value.map(function(item){ return new VoicemailMessage(item); });314 } catch (e) {315 throw new TypeError('Error setting VoicemailMessagesMessage.voicemailMessagesChanged: ' + e.message);316 }317 }318 this.__prop_voicemailMessagesChanged = value;319 },320 enumerable: true321 });322 Object.defineProperty(VoicemailMessagesMessage.prototype, 'voicemailMessagesRemoved', {323 get: function() { return this.__prop_voicemailMessagesRemoved; },324 set: function(value) {325 if (!(_util.isArray(value) && value.every(function(item){ return (_util.isString(item)); }) || value === void 0)) {326 throw new TypeError('Expected type String[] for VoicemailMessagesMessage.voicemailMessagesRemoved, but got ' + _util.inspect(value) + '.');327 }328 this.__prop_voicemailMessagesRemoved = value;329 },330 enumerable: true331 });332 hasProps = true;333 }334 Object.defineProperty(VoicemailMessagesMessage, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailMessagesMessage' });335 Object.defineProperty(VoicemailMessagesMessage, '__propInfo', {336 get: function() {337 var pi = {338 'voicemailMessagesAdded': { required: false, nullable: false },339 'voicemailMessagesChanged': { required: false, nullable: false },340 'voicemailMessagesRemoved': { required: false, nullable: false }341 };342 if (Messaging.Message.__propInfo) { _util.extend(pi, Messaging.Message.__propInfo); }343 pi.__type = { required: true, nullable: false };344 return pi;345 }346 });347 _typemap['urn:inin.com:unifiedMessaging:voicemailMessagesMessage'] = VoicemailMessagesMessage;348 return VoicemailMessagesMessage;349 }());350 var UnifiedMessageAdded = (function(){351 var hasProps = false;352 function UnifiedMessageAdded() {353 if (!hasProps) { defineProps(); }354 if (!_util.hasProp(this, '__type')) {355 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:unifiedMessageAdded', enumerable: true });356 }357 UnifiedMessageAdded._super.constructor.apply(this, arguments);358 }359 _util.inherits(UnifiedMessageAdded, UnifiedMessage);360 function defineProps() {361 Object.defineProperty(UnifiedMessageAdded.prototype, 'dateReceived', {362 get: function() { return this.__prop_dateReceived; },363 set: function(value) {364 if (_util.isString(value)) { value = _util.dateFromISO8601String(value); }365 if (!(_util.isDate(value))) {366 throw new TypeError('Expected type Date for UnifiedMessageAdded.dateReceived, but got ' + _util.inspect(value) + '.');367 }368 this.__prop_dateReceived = value;369 },370 enumerable: true371 });372 Object.defineProperty(UnifiedMessageAdded.prototype, 'from', {373 get: function() { return this.__prop_from; },374 set: function(value) {375 if (!(_util.isString(value))) {376 throw new TypeError('Expected type String for UnifiedMessageAdded.from, but got ' + _util.inspect(value) + '.');377 }378 this.__prop_from = value;379 },380 enumerable: true381 });382 Object.defineProperty(UnifiedMessageAdded.prototype, 'subject', {383 get: function() { return this.__prop_subject; },384 set: function(value) {385 if (!(_util.isString(value))) {386 throw new TypeError('Expected type String for UnifiedMessageAdded.subject, but got ' + _util.inspect(value) + '.');387 }388 this.__prop_subject = value;389 },390 enumerable: true391 });392 Object.defineProperty(UnifiedMessageAdded.prototype, 'attachments', {393 get: function() { return this.__prop_attachments; },394 set: function(value) {395 if (!(_util.isArray(value) && value.every(function(item){ return (item instanceof Attachment); }))) {396 try {397 value = value.map(function(item){ return new Attachment(item); });398 } catch (e) {399 throw new TypeError('Error setting UnifiedMessageAdded.attachments: ' + e.message);400 }401 }402 this.__prop_attachments = value;403 },404 enumerable: true405 });406 hasProps = true;407 }408 Object.defineProperty(UnifiedMessageAdded, '__type', { value: 'urn:inin.com:unifiedMessaging:unifiedMessageAdded' });409 Object.defineProperty(UnifiedMessageAdded, '__propInfo', {410 get: function() {411 var pi = {412 'dateReceived': { required: true, nullable: false },413 'from': { required: true, nullable: false },414 'subject': { required: true, nullable: false },415 'attachments': { required: true, nullable: false }416 };417 if (UnifiedMessage.__propInfo) { _util.extend(pi, UnifiedMessage.__propInfo); }418 pi.__type = { required: true, nullable: false };419 return pi;420 }421 });422 _typemap['urn:inin.com:unifiedMessaging:unifiedMessageAdded'] = UnifiedMessageAdded;423 return UnifiedMessageAdded;424 }());425 var FaxMessage = (function(){426 var hasProps = false;427 function FaxMessage() {428 if (!hasProps) { defineProps(); }429 if (!_util.hasProp(this, '__type')) {430 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:faxMessage', enumerable: true });431 }432 FaxMessage._super.constructor.apply(this, arguments);433 }434 _util.inherits(FaxMessage, UnifiedMessage);435 function defineProps() {436 hasProps = true;437 }438 Object.defineProperty(FaxMessage, '__type', { value: 'urn:inin.com:unifiedMessaging:faxMessage' });439 Object.defineProperty(FaxMessage, '__propInfo', {440 get: function() {441 var pi = {442 };443 if (UnifiedMessage.__propInfo) { _util.extend(pi, UnifiedMessage.__propInfo); }444 pi.__type = { required: true, nullable: false };445 return pi;446 }447 });448 _typemap['urn:inin.com:unifiedMessaging:faxMessage'] = FaxMessage;449 return FaxMessage;450 }());451 var VoicemailMessage = (function(){452 var hasProps = false;453 function VoicemailMessage() {454 if (!hasProps) { defineProps(); }455 if (!_util.hasProp(this, '__type')) {456 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailMessage', enumerable: true });457 }458 VoicemailMessage._super.constructor.apply(this, arguments);459 }460 _util.inherits(VoicemailMessage, UnifiedMessage);461 function defineProps() {462 hasProps = true;463 }464 Object.defineProperty(VoicemailMessage, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailMessage' });465 Object.defineProperty(VoicemailMessage, '__propInfo', {466 get: function() {467 var pi = {468 };469 if (UnifiedMessage.__propInfo) { _util.extend(pi, UnifiedMessage.__propInfo); }470 pi.__type = { required: true, nullable: false };471 return pi;472 }473 });474 _typemap['urn:inin.com:unifiedMessaging:voicemailMessage'] = VoicemailMessage;475 return VoicemailMessage;476 }());477 var MwiMessage = (function(){478 var hasProps = false;479 function MwiMessage() {480 if (!hasProps) { defineProps(); }481 if (!_util.hasProp(this, '__type')) {482 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:mwiMessage', enumerable: true });483 }484 MwiMessage._super.constructor.apply(this, arguments);485 }486 _util.inherits(MwiMessage, Messaging.Message);487 function defineProps() {488 Object.defineProperty(MwiMessage.prototype, 'messagesWaiting', {489 get: function() { return this.__prop_messagesWaiting; },490 set: function(value) {491 if (!(_util.isNumber(value) && value|0 === value)) {492 throw new TypeError('Expected type Number (integer) for MwiMessage.messagesWaiting, but got ' + _util.inspect(value) + '.');493 }494 this.__prop_messagesWaiting = value;495 },496 enumerable: true497 });498 hasProps = true;499 }500 Object.defineProperty(MwiMessage, '__type', { value: 'urn:inin.com:unifiedMessaging:mwiMessage' });501 Object.defineProperty(MwiMessage, '__propInfo', {502 get: function() {503 var pi = {504 'messagesWaiting': { required: true, nullable: false }505 };506 if (Messaging.Message.__propInfo) { _util.extend(pi, Messaging.Message.__propInfo); }507 pi.__type = { required: true, nullable: false };508 return pi;509 }510 });511 _typemap['urn:inin.com:unifiedMessaging:mwiMessage'] = MwiMessage;512 return MwiMessage;513 }());514 var VoicemailPlayStatusMessage = (function(){515 var hasProps = false;516 function VoicemailPlayStatusMessage() {517 if (!hasProps) { defineProps(); }518 if (!_util.hasProp(this, '__type')) {519 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailPlayStatusMessage', enumerable: true });520 }521 VoicemailPlayStatusMessage._super.constructor.apply(this, arguments);522 }523 _util.inherits(VoicemailPlayStatusMessage, Messaging.Message);524 function defineProps() {525 Object.defineProperty(VoicemailPlayStatusMessage.prototype, 'unifiedMessageId', {526 get: function() { return this.__prop_unifiedMessageId; },527 set: function(value) {528 if (!(_util.isString(value))) {529 throw new TypeError('Expected type String for VoicemailPlayStatusMessage.unifiedMessageId, but got ' + _util.inspect(value) + '.');530 }531 this.__prop_unifiedMessageId = value;532 },533 enumerable: true534 });535 Object.defineProperty(VoicemailPlayStatusMessage.prototype, 'playStatus', {536 get: function() { return this.__prop_playStatus; },537 set: function(value) {538 if (!(value instanceof VoicemailPlayStatus || value === void 0)) {539 try {540 value = new VoicemailPlayStatus(value);541 } catch (e) {542 throw new TypeError('Error setting VoicemailPlayStatusMessage.playStatus: ' + e.message);543 }544 }545 this.__prop_playStatus = value;546 },547 enumerable: true548 });549 hasProps = true;550 }551 Object.defineProperty(VoicemailPlayStatusMessage, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailPlayStatusMessage' });552 Object.defineProperty(VoicemailPlayStatusMessage, '__propInfo', {553 get: function() {554 var pi = {555 'unifiedMessageId': { required: true, nullable: false },556 'playStatus': { required: false, nullable: false }557 };558 if (Messaging.Message.__propInfo) { _util.extend(pi, Messaging.Message.__propInfo); }559 pi.__type = { required: true, nullable: false };560 return pi;561 }562 });563 _typemap['urn:inin.com:unifiedMessaging:voicemailPlayStatusMessage'] = VoicemailPlayStatusMessage;564 return VoicemailPlayStatusMessage;565 }());566 var FaxMessagesMessage = (function(){567 var hasProps = false;568 function FaxMessagesMessage() {569 if (!hasProps) { defineProps(); }570 if (!_util.hasProp(this, '__type')) {571 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:faxMessagesMessage', enumerable: true });572 }573 FaxMessagesMessage._super.constructor.apply(this, arguments);574 }575 _util.inherits(FaxMessagesMessage, Messaging.Message);576 function defineProps() {577 Object.defineProperty(FaxMessagesMessage.prototype, 'faxMessagesAdded', {578 get: function() { return this.__prop_faxMessagesAdded; },579 set: function(value) {580 if (!(_util.isArray(value) && value.every(function(item){ return (item instanceof FaxMessageAdded); }) || value === void 0)) {581 try {582 value = value.map(function(item){ return new FaxMessageAdded(item); });583 } catch (e) {584 throw new TypeError('Error setting FaxMessagesMessage.faxMessagesAdded: ' + e.message);585 }586 }587 this.__prop_faxMessagesAdded = value;588 },589 enumerable: true590 });591 Object.defineProperty(FaxMessagesMessage.prototype, 'faxMessagesChanged', {592 get: function() { return this.__prop_faxMessagesChanged; },593 set: function(value) {594 if (!(_util.isArray(value) && value.every(function(item){ return (item instanceof FaxMessage); }) || value === void 0)) {595 try {596 value = value.map(function(item){ return new FaxMessage(item); });597 } catch (e) {598 throw new TypeError('Error setting FaxMessagesMessage.faxMessagesChanged: ' + e.message);599 }600 }601 this.__prop_faxMessagesChanged = value;602 },603 enumerable: true604 });605 Object.defineProperty(FaxMessagesMessage.prototype, 'faxMessagesRemoved', {606 get: function() { return this.__prop_faxMessagesRemoved; },607 set: function(value) {608 if (!(_util.isArray(value) && value.every(function(item){ return (_util.isString(item)); }) || value === void 0)) {609 throw new TypeError('Expected type String[] for FaxMessagesMessage.faxMessagesRemoved, but got ' + _util.inspect(value) + '.');610 }611 this.__prop_faxMessagesRemoved = value;612 },613 enumerable: true614 });615 hasProps = true;616 }617 Object.defineProperty(FaxMessagesMessage, '__type', { value: 'urn:inin.com:unifiedMessaging:faxMessagesMessage' });618 Object.defineProperty(FaxMessagesMessage, '__propInfo', {619 get: function() {620 var pi = {621 'faxMessagesAdded': { required: false, nullable: false },622 'faxMessagesChanged': { required: false, nullable: false },623 'faxMessagesRemoved': { required: false, nullable: false }624 };625 if (Messaging.Message.__propInfo) { _util.extend(pi, Messaging.Message.__propInfo); }626 pi.__type = { required: true, nullable: false };627 return pi;628 }629 });630 _typemap['urn:inin.com:unifiedMessaging:faxMessagesMessage'] = FaxMessagesMessage;631 return FaxMessagesMessage;632 }());633 var VoicemailPlayTarget = (function(){634 var hasProps = false;635 function VoicemailPlayTarget() {636 if (!hasProps) { defineProps(); }637 if (!_util.hasProp(this, '__type')) {638 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailPlayTarget', enumerable: true });639 }640 VoicemailPlayTarget._super.constructor.apply(this, arguments);641 }642 _util.inherits(VoicemailPlayTarget, VoicemailPlayOperation);643 function defineProps() {644 Object.defineProperty(VoicemailPlayTarget.prototype, 'target', {645 get: function() { return this.__prop_target; },646 set: function(value) {647 if (!(_util.isString(value))) {648 throw new TypeError('Expected type String for VoicemailPlayTarget.target, but got ' + _util.inspect(value) + '.');649 }650 this.__prop_target = value;651 },652 enumerable: true653 });654 hasProps = true;655 }656 Object.defineProperty(VoicemailPlayTarget, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailPlayTarget' });657 Object.defineProperty(VoicemailPlayTarget, '__propInfo', {658 get: function() {659 var pi = {660 'target': { required: true, nullable: false }661 };662 if (VoicemailPlayOperation.__propInfo) { _util.extend(pi, VoicemailPlayOperation.__propInfo); }663 pi.__type = { required: true, nullable: false };664 return pi;665 }666 });667 _typemap['urn:inin.com:unifiedMessaging:voicemailPlayTarget'] = VoicemailPlayTarget;668 return VoicemailPlayTarget;669 }());670 var CurrentStation = (function(){671 var hasProps = false;672 function CurrentStation() {673 if (!hasProps) { defineProps(); }674 if (!_util.hasProp(this, '__type')) {675 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:currentStation', enumerable: true });676 }677 CurrentStation._super.constructor.apply(this, arguments);678 }679 _util.inherits(CurrentStation, VoicemailPlayOperation);680 function defineProps() {681 hasProps = true;682 }683 Object.defineProperty(CurrentStation, '__type', { value: 'urn:inin.com:unifiedMessaging:currentStation' });684 Object.defineProperty(CurrentStation, '__propInfo', {685 get: function() {686 var pi = {687 };688 if (VoicemailPlayOperation.__propInfo) { _util.extend(pi, VoicemailPlayOperation.__propInfo); }689 pi.__type = { required: true, nullable: false };690 return pi;691 }692 });693 _typemap['urn:inin.com:unifiedMessaging:currentStation'] = CurrentStation;694 return CurrentStation;695 }());696 var VoicemailMessageSubscriptionStateMessage = (function(){697 var hasProps = false;698 function VoicemailMessageSubscriptionStateMessage() {699 if (!hasProps) { defineProps(); }700 if (!_util.hasProp(this, '__type')) {701 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailMessageSubscriptionStateMessage', enumerable: true });702 }703 VoicemailMessageSubscriptionStateMessage._super.constructor.apply(this, arguments);704 }705 _util.inherits(VoicemailMessageSubscriptionStateMessage, Messaging.SubscriptionStateMessage);706 function defineProps() {707 hasProps = true;708 }709 Object.defineProperty(VoicemailMessageSubscriptionStateMessage, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailMessageSubscriptionStateMessage' });710 Object.defineProperty(VoicemailMessageSubscriptionStateMessage, '__propInfo', {711 get: function() {712 var pi = {713 };714 if (Messaging.SubscriptionStateMessage.__propInfo) { _util.extend(pi, Messaging.SubscriptionStateMessage.__propInfo); }715 pi.__type = { required: true, nullable: false };716 return pi;717 }718 });719 _typemap['urn:inin.com:unifiedMessaging:voicemailMessageSubscriptionStateMessage'] = VoicemailMessageSubscriptionStateMessage;720 return VoicemailMessageSubscriptionStateMessage;721 }());722 var FaxMessageSubscriptionStateMessage = (function(){723 var hasProps = false;724 function FaxMessageSubscriptionStateMessage() {725 if (!hasProps) { defineProps(); }726 if (!_util.hasProp(this, '__type')) {727 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:faxMessageSubscriptionStateMessage', enumerable: true });728 }729 FaxMessageSubscriptionStateMessage._super.constructor.apply(this, arguments);730 }731 _util.inherits(FaxMessageSubscriptionStateMessage, Messaging.SubscriptionStateMessage);732 function defineProps() {733 hasProps = true;734 }735 Object.defineProperty(FaxMessageSubscriptionStateMessage, '__type', { value: 'urn:inin.com:unifiedMessaging:faxMessageSubscriptionStateMessage' });736 Object.defineProperty(FaxMessageSubscriptionStateMessage, '__propInfo', {737 get: function() {738 var pi = {739 };740 if (Messaging.SubscriptionStateMessage.__propInfo) { _util.extend(pi, Messaging.SubscriptionStateMessage.__propInfo); }741 pi.__type = { required: true, nullable: false };742 return pi;743 }744 });745 _typemap['urn:inin.com:unifiedMessaging:faxMessageSubscriptionStateMessage'] = FaxMessageSubscriptionStateMessage;746 return FaxMessageSubscriptionStateMessage;747 }());748 var MwiSubscriptionStateMessage = (function(){749 var hasProps = false;750 function MwiSubscriptionStateMessage() {751 if (!hasProps) { defineProps(); }752 if (!_util.hasProp(this, '__type')) {753 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:mwiSubscriptionStateMessage', enumerable: true });754 }755 MwiSubscriptionStateMessage._super.constructor.apply(this, arguments);756 }757 _util.inherits(MwiSubscriptionStateMessage, Messaging.SubscriptionStateMessage);758 function defineProps() {759 hasProps = true;760 }761 Object.defineProperty(MwiSubscriptionStateMessage, '__type', { value: 'urn:inin.com:unifiedMessaging:mwiSubscriptionStateMessage' });762 Object.defineProperty(MwiSubscriptionStateMessage, '__propInfo', {763 get: function() {764 var pi = {765 };766 if (Messaging.SubscriptionStateMessage.__propInfo) { _util.extend(pi, Messaging.SubscriptionStateMessage.__propInfo); }767 pi.__type = { required: true, nullable: false };768 return pi;769 }770 });771 _typemap['urn:inin.com:unifiedMessaging:mwiSubscriptionStateMessage'] = MwiSubscriptionStateMessage;772 return MwiSubscriptionStateMessage;773 }());774 var VoicemailMessageAdded = (function(){775 var hasProps = false;776 function VoicemailMessageAdded() {777 if (!hasProps) { defineProps(); }778 if (!_util.hasProp(this, '__type')) {779 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailMessageAdded', enumerable: true });780 }781 VoicemailMessageAdded._super.constructor.apply(this, arguments);782 }783 _util.inherits(VoicemailMessageAdded, UnifiedMessageAdded);784 function defineProps() {785 hasProps = true;786 }787 Object.defineProperty(VoicemailMessageAdded, '__type', { value: 'urn:inin.com:unifiedMessaging:voicemailMessageAdded' });788 Object.defineProperty(VoicemailMessageAdded, '__propInfo', {789 get: function() {790 var pi = {791 };792 if (UnifiedMessageAdded.__propInfo) { _util.extend(pi, UnifiedMessageAdded.__propInfo); }793 pi.__type = { required: true, nullable: false };794 return pi;795 }796 });797 _typemap['urn:inin.com:unifiedMessaging:voicemailMessageAdded'] = VoicemailMessageAdded;798 return VoicemailMessageAdded;799 }());800 var FaxMessageAdded = (function(){801 var hasProps = false;802 function FaxMessageAdded() {803 if (!hasProps) { defineProps(); }804 if (!_util.hasProp(this, '__type')) {805 Object.defineProperty(this, '__type', { value: 'urn:inin.com:unifiedMessaging:faxMessageAdded', enumerable: true });806 }807 FaxMessageAdded._super.constructor.apply(this, arguments);808 }809 _util.inherits(FaxMessageAdded, UnifiedMessageAdded);810 function defineProps() {811 hasProps = true;812 }813 Object.defineProperty(FaxMessageAdded, '__type', { value: 'urn:inin.com:unifiedMessaging:faxMessageAdded' });814 Object.defineProperty(FaxMessageAdded, '__propInfo', {815 get: function() {816 var pi = {817 };818 if (UnifiedMessageAdded.__propInfo) { _util.extend(pi, UnifiedMessageAdded.__propInfo); }819 pi.__type = { required: true, nullable: false };820 return pi;821 }822 });823 _typemap['urn:inin.com:unifiedMessaging:faxMessageAdded'] = FaxMessageAdded;824 return FaxMessageAdded;...
bioassay.js
Source:bioassay.js
...7 COLORS,8} from "./shared";9// BSD = bioassay study design10const BSD = {11 studyId: defineProps("studyId", "Study ID", "study id"),12 studyCitation: defineProps("studyCitation", "Study citation", "study citation"),13 studyIdentifier: defineProps("studyIdentifier", "Study identifier", "study identifier"),14 studyEval: defineProps("studyEval", "Overall study evaluation", "overall study evaluation"),15 experimentType: defineProps("experimentType", "Study design", "experiment type"),16 species: defineProps("species", "Species", "species"),17 strain: defineProps("strain", "Strain", "strain"),18 routeOfExposure: defineProps("routeOfExposure", "Route of exposure", "route of exposure"),19 experimentChemical: defineProps("experimentChemical", "Chemical", "experiment chemical"),20 sex: defineProps("sex", "Sex", "sex"),21 system: defineProps("system", "System", "system"),22 organ: defineProps("organ", "Organ", "organ"),23 effect: defineProps("effect", "Effect", "effect"),24 doseUnits: defineProps("doseUnits", "Dose units", "dose units"),25 },26 BSDSettings = {27 AXIS_OPTIONS: {28 studyCitation: defineAxis(BSD.studyCitation),29 studyEval: defineAxis(BSD.studyEval, {delimiter: "|"}),30 doseUnits: defineAxis(BSD.doseUnits, {delimiter: "|"}),31 experimentType: defineAxis(BSD.experimentType, {delimiter: "|"}),32 routeOfExposure: defineAxis(BSD.routeOfExposure, {delimiter: "|"}),33 experimentChemical: defineAxis(BSD.experimentChemical, {delimiter: "|"}),34 speciesSex: defineMultiAxis([BSD.species, BSD.sex], "speciesSex", "Species & sex", {35 delimiter: "|",36 }),37 speciesStrain: defineMultiAxis(38 [BSD.species, BSD.strain],39 "speciesStrain",40 "Species & strain",41 {delimiter: "|"}42 ),43 system: defineAxis(BSD.system, {delimiter: "|"}),44 organ: defineAxis(BSD.organ, {delimiter: "|"}),45 effect: defineAxis(BSD.effect, {delimiter: "|"}),46 },47 FILTER_OPTIONS: {48 studyCitation: defineFilter(BSD.studyCitation, {on_click_event: "study"}),49 studyIdentifier: defineFilter(BSD.studyIdentifier, {on_click_event: "study"}),50 studyEval: defineFilter(BSD.studyEval, {delimiter: "|"}),51 experimentType: defineFilter(BSD.experimentType, {delimiter: "|"}),52 species: defineFilter(BSD.species, {delimiter: "|"}),53 strain: defineFilter(BSD.strain, {delimiter: "|"}),54 routeOfExposure: defineFilter(BSD.routeOfExposure, {delimiter: "|"}),55 experimentChemical: defineFilter(BSD.experimentChemical, {delimiter: "|"}),56 sex: defineFilter(BSD.sex, {delimiter: "|"}),57 system: defineFilter(BSD.system, {delimiter: "|"}),58 organ: defineFilter(BSD.organ, {delimiter: "|"}),59 effect: defineFilter(BSD.effect, {delimiter: "|"}),60 doseUnits: defineFilter(BSD.doseUnits, {delimiter: "|"}),61 },62 TABLE_FIELDS: {63 studyCitation: defineTable(BSD.studyCitation, {on_click_event: "study"}),64 studyIdentifier: defineTable(BSD.studyIdentifier, {on_click_event: "study"}),65 studyEval: defineTable(BSD.studyEval, {delimiter: "|"}),66 experimentType: defineTable(BSD.experimentType, {delimiter: "|"}),67 species: defineTable(BSD.species, {delimiter: "|"}),68 strain: defineTable(BSD.strain, {delimiter: "|"}),69 routeOfExposure: defineTable(BSD.routeOfExposure, {delimiter: "|"}),70 experimentChemical: defineTable(BSD.experimentChemical, {delimiter: "|"}),71 sex: defineTable(BSD.sex, {delimiter: "|"}),72 system: defineTable(BSD.system, {delimiter: "|"}),73 organ: defineTable(BSD.organ, {delimiter: "|"}),74 effect: defineTable(BSD.effect, {delimiter: "|"}),75 doseUnits: defineTable(BSD.doseUnits, {delimiter: "|"}),76 },77 DASHBOARDS: [],78 };79// define dashboards after building-blocks are defined80BSDSettings.DASHBOARDS = [81 {82 id: "study design vs. system",83 label: "study design vs. system",84 upperColor: COLORS.blue,85 x_axis: BSDSettings.AXIS_OPTIONS.experimentType.id,86 y_axis: BSDSettings.AXIS_OPTIONS.system.id,87 filters: [88 BSDSettings.FILTER_OPTIONS.studyCitation.id,89 BSDSettings.FILTER_OPTIONS.routeOfExposure.id,90 BSDSettings.FILTER_OPTIONS.experimentChemical.id,91 BSDSettings.FILTER_OPTIONS.effect.id,92 ],93 table_fields: [94 BSDSettings.TABLE_FIELDS.studyCitation.id,95 BSDSettings.TABLE_FIELDS.species.id,96 BSDSettings.TABLE_FIELDS.sex.id,97 BSDSettings.TABLE_FIELDS.system.id,98 BSDSettings.TABLE_FIELDS.organ.id,99 BSDSettings.TABLE_FIELDS.effect.id,100 ],101 },102 {103 id: "test subject vs. system",104 label: "test subject vs. system",105 upperColor: COLORS.red,106 x_axis: BSDSettings.AXIS_OPTIONS.speciesSex.id,107 y_axis: BSDSettings.AXIS_OPTIONS.system.id,108 filters: [109 BSDSettings.FILTER_OPTIONS.studyCitation.id,110 BSDSettings.FILTER_OPTIONS.experimentType.id,111 BSDSettings.FILTER_OPTIONS.experimentChemical.id,112 BSDSettings.FILTER_OPTIONS.effect.id,113 ],114 table_fields: [115 BSDSettings.TABLE_FIELDS.studyCitation.id,116 BSDSettings.TABLE_FIELDS.experimentType.id,117 BSDSettings.TABLE_FIELDS.routeOfExposure.id,118 BSDSettings.TABLE_FIELDS.experimentChemical.id,119 BSDSettings.TABLE_FIELDS.system.id,120 BSDSettings.TABLE_FIELDS.organ.id,121 BSDSettings.TABLE_FIELDS.effect.id,122 ],123 },124 {125 id: "system vs. study citation",126 label: "system vs. study citation",127 upperColor: COLORS.green,128 x_axis: BSDSettings.AXIS_OPTIONS.system.id,129 y_axis: BSDSettings.AXIS_OPTIONS.studyCitation.id,130 filters: [],131 table_fields: [132 BSDSettings.TABLE_FIELDS.studyCitation.id,133 BSDSettings.TABLE_FIELDS.experimentType.id,134 BSDSettings.TABLE_FIELDS.species.id,135 BSDSettings.TABLE_FIELDS.strain.id,136 BSDSettings.TABLE_FIELDS.sex.id,137 BSDSettings.TABLE_FIELDS.routeOfExposure.id,138 BSDSettings.TABLE_FIELDS.experimentChemical.id,139 BSDSettings.TABLE_FIELDS.system.id,140 BSDSettings.TABLE_FIELDS.organ.id,141 BSDSettings.TABLE_FIELDS.effect.id,142 ],143 },144 {145 id: "chemical vs. study citation",146 label: "chemical vs. study citation",147 upperColor: COLORS.orange,148 x_axis: BSDSettings.AXIS_OPTIONS.experimentChemical.id,149 y_axis: BSDSettings.AXIS_OPTIONS.studyCitation.id,150 filters: [151 BSDSettings.FILTER_OPTIONS.experimentType.id,152 BSDSettings.FILTER_OPTIONS.routeOfExposure.id,153 BSDSettings.FILTER_OPTIONS.system.id,154 ],155 table_fields: [156 BSDSettings.TABLE_FIELDS.studyCitation.id,157 BSDSettings.TABLE_FIELDS.species.id,158 BSDSettings.TABLE_FIELDS.sex.id,159 BSDSettings.TABLE_FIELDS.system.id,160 BSDSettings.TABLE_FIELDS.organ.id,161 BSDSettings.TABLE_FIELDS.effect.id,162 ],163 },164 {165 id: "dose units vs. study citation",166 label: "dose units vs. study citation",167 upperColor: COLORS.purple,168 x_axis: BSDSettings.AXIS_OPTIONS.doseUnits.id,169 y_axis: BSDSettings.AXIS_OPTIONS.studyCitation.id,170 filters: [171 BSDSettings.FILTER_OPTIONS.experimentType.id,172 BSDSettings.FILTER_OPTIONS.routeOfExposure.id,173 BSDSettings.FILTER_OPTIONS.experimentChemical.id,174 ],175 table_fields: [176 BSDSettings.TABLE_FIELDS.studyCitation.id,177 BSDSettings.TABLE_FIELDS.species.id,178 BSDSettings.TABLE_FIELDS.sex.id,179 BSDSettings.TABLE_FIELDS.system.id,180 BSDSettings.TABLE_FIELDS.organ.id,181 BSDSettings.TABLE_FIELDS.effect.id,182 BSDSettings.TABLE_FIELDS.doseUnits.id,183 ],184 },185];186// BE = Bioassay endpoints187const BE = {188 studyId: defineProps("studyId", "Study id", "study id"),189 studyCitation: defineProps("studyCitation", "Study citation", "study citation"),190 studyIdentifier: defineProps("studyIdentifier", "Study identifier", "study identifier"),191 studyEval: defineProps("studyEval", "Overall study evaluation", "overall study evaluation"),192 experimentId: defineProps("experimentId", "Experiment id", "experiment id"),193 experimentName: defineProps("experimentName", "Experiment name", "experiment name"),194 experimentType: defineProps("experimentType", "Study design", "experiment type"),195 treatmentPeriod: defineProps("treatmentPeriod", "Treatment period", "treatment period"),196 experimentCas: defineProps("experimentCas", "Experiment CAS", "experiment cas"),197 chemical: defineProps("chemical", "Experiment chemical", "experiment chemical"),198 animalGroupId: defineProps("animalGroupId", "Animal group id", "animal group id"),199 animalGroupName: defineProps("animalGroupName", "Animal group name", "animal group name"),200 animalDesc: defineProps("animalDesc", "Animal description", "animal description"),201 animalDescN: defineProps(202 "animalDescN",203 "Animal description, with N",204 "animal description, with n"205 ),206 species: defineProps("species", "Species", "species"),207 strain: defineProps("strain", "Strain", "strain"),208 sex: defineProps("sex", "Sex", "sex"),209 generation: defineProps("generation", "Generation", "generation"),210 routeOfExposure: defineProps("routeOfExposure", "Route of exposure", "route of exposure"),211 endpointId: defineProps("endpointId", "Endpoint ID", "endpoint id"),212 system: defineProps("system", "System", "system"),213 organ: defineProps("organ", "Organ", "organ"),214 effect: defineProps("effect", "Effect", "effect"),215 effectSubtype: defineProps("effectSubtype", "Effect subtype", "effect subtype"),216 endpointName: defineProps("endpointName", "Endpoint name", "endpoint name"),217 observationTime: defineProps("observationTime", "Observation time", "observation time"),218 },219 BESettings = {220 AXIS_OPTIONS: {221 studyCitation: defineAxis(BE.studyCitation),222 studyEval: defineAxis(BE.studyEval),223 speciesSex: defineMultiAxis([BE.species, BE.sex], "speciesSex", "Species & Sex"),224 experimentType: defineAxis(BE.experimentType),225 chemical: defineAxis(BE.chemical),226 routeOfExposure: defineAxis(BE.routeOfExposure),227 system: defineAxis(BE.system),228 organ: defineAxis(BE.organ),229 effect: defineAxis(BE.effect),230 systemOrgan: defineMultiAxis([BE.system, BE.organ], "systemOrgan", "System & organ"),231 experimentTypeSystem: defineMultiAxis(232 [BE.experimentType, BE.system],233 "experimentTypeSystem",234 "Study design & system"235 ),236 endpointName: defineAxis(BE.endpointName),237 },238 FILTER_OPTIONS: {239 studyCitation: defineFilter(BE.studyCitation, {on_click_event: "study"}),240 studyEval: defineFilter(BE.studyEval),241 experimentType: defineFilter(BE.experimentType),242 species: defineFilter(BE.species),243 strain: defineFilter(BE.strain),244 sex: defineFilter(BE.sex),245 generation: defineFilter(BE.generation),246 system: defineFilter(BE.system),247 organ: defineFilter(BE.organ),248 effect: defineFilter(BE.effect),249 effectSubtype: defineFilter(BE.effectSubtype),250 endpointName: defineFilter(BE.endpointName),251 observationTime: defineFilter(BE.observationTime),252 },253 TABLE_FIELDS: {254 studyCitation: defineTable(BE.studyCitation, {on_click_event: "study"}),255 studyEval: defineTable(BE.studyEval),256 experimentName: defineTable(BE.experimentName, {on_click_event: "experiment"}),257 treatmentPeriod: defineTable(BE.treatmentPeriod),258 animalGroupName: defineTable(BE.animalGroupName, {on_click_event: "animal_group"}),259 animalDesc: defineTable(BE.animalDesc, {on_click_event: "animal_group"}),260 animalDescN: defineTable(BE.animalDescN, {on_click_event: "animal_group"}),261 species: defineTable(BE.species),262 strain: defineTable(BE.strain),263 sex: defineTable(BE.sex),264 system: defineTable(BE.system),265 organ: defineTable(BE.organ),266 effect: defineTable(BE.effect),267 effectSubtype: defineTable(BE.effectSubtype),268 endpointName: defineTable(BE.endpointName, {on_click_event: "endpoint_complete"}),269 observationTime: defineTable(BE.observationTime),270 },271 DASHBOARDS: [],272 };273// define dashboards after building-blocks are defined274BESettings.DASHBOARDS = [275 {276 id: "system vs. test subject",277 label: "system vs. test subject",278 upperColor: COLORS.blue,279 x_axis: BESettings.AXIS_OPTIONS.speciesSex.id,280 y_axis: BESettings.AXIS_OPTIONS.system.id,281 filters: [282 BESettings.FILTER_OPTIONS.studyCitation.id,283 BESettings.FILTER_OPTIONS.experimentType.id,284 BESettings.FILTER_OPTIONS.generation.id,285 ],286 table_fields: [287 BESettings.TABLE_FIELDS.studyCitation.id,288 BESettings.TABLE_FIELDS.experimentName.id,289 BESettings.TABLE_FIELDS.animalGroupName.id,290 BESettings.TABLE_FIELDS.system.id,291 BESettings.TABLE_FIELDS.organ.id,292 BESettings.TABLE_FIELDS.effect.id,293 BESettings.TABLE_FIELDS.endpointName.id,294 ],295 },296 {297 id: "test subject vs. study design & system",298 label: "test subject vs. study design & system",299 upperColor: COLORS.red,300 x_axis: BESettings.AXIS_OPTIONS.speciesSex.id,301 y_axis: BESettings.AXIS_OPTIONS.experimentTypeSystem.id,302 filters: [303 BESettings.FILTER_OPTIONS.studyCitation.id,304 BESettings.FILTER_OPTIONS.generation.id,305 BESettings.FILTER_OPTIONS.effect.id,306 ],307 table_fields: [308 BESettings.TABLE_FIELDS.studyCitation.id,309 BESettings.TABLE_FIELDS.experimentName.id,310 BESettings.TABLE_FIELDS.animalGroupName.id,311 BESettings.TABLE_FIELDS.system.id,312 BESettings.TABLE_FIELDS.organ.id,313 BESettings.TABLE_FIELDS.effect.id,314 BESettings.TABLE_FIELDS.endpointName.id,315 ],316 },317 {318 id: "reference vs. system",319 label: "reference vs. system",320 upperColor: COLORS.green,321 x_axis: BESettings.AXIS_OPTIONS.studyCitation.id,322 y_axis: BESettings.AXIS_OPTIONS.system.id,323 filters: [],324 table_fields: [325 BESettings.TABLE_FIELDS.studyCitation.id,326 BESettings.TABLE_FIELDS.experimentName.id,327 BESettings.TABLE_FIELDS.animalGroupName.id,328 BESettings.TABLE_FIELDS.system.id,329 BESettings.TABLE_FIELDS.organ.id,330 BESettings.TABLE_FIELDS.effect.id,331 BESettings.TABLE_FIELDS.endpointName.id,332 ],333 },334 {335 id: "reference vs. study design & system",336 label: "reference vs. study design & system",337 upperColor: COLORS.purple,338 x_axis: BESettings.AXIS_OPTIONS.studyCitation.id,339 y_axis: BESettings.AXIS_OPTIONS.experimentTypeSystem.id,340 filters: [],341 table_fields: [342 BESettings.TABLE_FIELDS.studyCitation.id,343 BESettings.TABLE_FIELDS.experimentName.id,344 BESettings.TABLE_FIELDS.animalGroupName.id,345 BESettings.TABLE_FIELDS.system.id,346 BESettings.TABLE_FIELDS.organ.id,347 BESettings.TABLE_FIELDS.effect.id,348 BESettings.TABLE_FIELDS.endpointName.id,349 ],350 },351];352// BED = Bioassay endpoint doses353const BED = {354 studyId: defineProps("studyId", "Study id", "study id"),355 studyCitation: defineProps("studyCitation", "Study citation", "study citation"),356 studyIdentifier: defineProps("studyIdentifier", "Study identifier", "study identifier"),357 studyEval: defineProps("studyEval", "Overall study evaluation", "overall study evaluation"),358 experimentId: defineProps("experimentId", "Experiment id", "experiment id"),359 experimentName: defineProps("experimentName", "Experiment name", "experiment name"),360 experimentType: defineProps("experimentType", "Study design", "experiment type"),361 treatmentPeriod: defineProps("treatmentPeriod", "Treatment period", "treatment period"),362 experimentCas: defineProps("experimentCas", "Experiment CAS", "experiment cas"),363 chemical: defineProps("chemical", "Experiment chemical", "experiment chemical"),364 animalGroupId: defineProps("animalGroupId", "Animal group id", "animal group id"),365 animalGroupName: defineProps("animalGroupName", "Animal group name", "animal group name"),366 animalDesc: defineProps("animalDesc", "Animal description", "animal description"),367 animalDescN: defineProps(368 "animalDescN",369 "Animal description, with N",370 "animal description, with n"371 ),372 species: defineProps("species", "Species", "species"),373 strain: defineProps("strain", "Strain", "strain"),374 sex: defineProps("sex", "Sex", "sex"),375 generation: defineProps("generation", "Generation", "generation"),376 routeOfExposure: defineProps("routeOfExposure", "Route of exposure", "route of exposure"),377 endpointId: defineProps("endpointId", "Endpoint ID", "endpoint id"),378 system: defineProps("system", "System", "system"),379 organ: defineProps("organ", "Organ", "organ"),380 effect: defineProps("effect", "Effect", "effect"),381 effectSubtype: defineProps("effectSubtype", "Effect subtype", "effect subtype"),382 endpointName: defineProps("endpointName", "Endpoint name", "endpoint name"),383 observationTime: defineProps("observationTime", "Observation time", "observation time"),384 doseUnitsId: defineProps("doseUnitsId", "Dose units ID", "dose units id"),385 doseUnitsName: defineProps("doseUnitsName", "Dose units name", "dose units name"),386 doses: defineProps("doses", "Doses", "doses"),387 noel: defineProps("noel", "NOEL", "noel"),388 loel: defineProps("loel", "LOEL", "loel"),389 fel: defineProps("fel", "FEL", "fel"),390 bmd: defineProps("bmd", "BMD", "bmd"),391 bmdl: defineProps("bmdl", "BMDL", "bmdl"),392 },393 BEDSettings = {394 AXIS_OPTIONS: {395 studyCitation: defineAxis(BED.studyCitation),396 studyEval: defineAxis(BED.studyEval),397 speciesSex: defineMultiAxis([BED.species, BED.sex], "speciesSex", "Species & Sex"),398 experimentType: defineAxis(BED.experimentType),399 system: defineAxis(BED.system),400 organ: defineAxis(BED.organ),401 systemOrgan: defineMultiAxis([BED.system, BED.organ], "systemOrgan", "System & organ"),402 experimentTypeSystem: defineMultiAxis(403 [BED.experimentType, BED.system],404 "experimentTypeSystem",405 "Study design & system"...
epi.js
Source:epi.js
...7 COLORS,8} from "./shared";9// ESD = epi study design10const ESD = {11 studyId: defineProps("studyId", "Study ID", "study id"),12 studyCitation: defineProps("studyCitation", "Study citation", "study citation"),13 studyIdentifier: defineProps("studyIdentifier", "Study identifier", "study identifier"),14 studyEval: defineProps("studyEval", "Overall study evaluation", "overall study evaluation"),15 studyDesign: defineProps("studyDesign", "Study design", "study design"),16 studyPopulationSource: defineProps(17 "studyPopulationSource",18 "Study population source",19 "study population source"20 ),21 exposureName: defineProps("exposureName", "Exposure name", "exposure name"),22 exposureRoute: defineProps("exposureRoute", "Exposure route", "exposure route"),23 exposureMeasure: defineProps("exposureMeasure", "Exposure measure", "exposure measure"),24 exposureMetric: defineProps("exposureMetric", "Exposure metric", "exposure metric"),25 system: defineProps("system", "System", "system"),26 effect: defineProps("effect", "Effect", "effect"),27 effectSubtype: defineProps("effectSubtype", "Effect subtype", "effect subtype"),28 },29 ESDSettings = {30 AXIS_OPTIONS: {31 exposureName: defineAxis(ESD.exposureName, {delimiter: "|"}),32 exposureRoute: defineAxis(ESD.exposureRoute, {delimiter: "|"}),33 exposureMeasure: defineAxis(ESD.exposureMeasure, {delimiter: "|"}),34 exposureMetric: defineAxis(ESD.exposureMetric, {delimiter: "|"}),35 exposureMeasureMetric: defineMultiAxis(36 [ESD.exposureMeasure, ESD.exposureMetric],37 "exposureMeasureMetric",38 "Exposure measurement & metric",39 {delimiter: "|"}40 ),41 studyCitation: defineAxis(ESD.studyCitation),42 studyEval: defineAxis(ESD.studyEval, {delimiter: "|"}),43 studyDesign: defineAxis(ESD.studyDesign, {delimiter: "|"}),44 studyPopulationSource: defineAxis(ESD.studyPopulationSource, {delimiter: "|"}),45 system: defineAxis(ESD.system, {delimiter: "|"}),46 effect: defineAxis(ESD.effect, {delimiter: "|"}),47 systemEffect: defineMultiAxis(48 [ESD.system, ESD.effect],49 "systemEffect",50 "System & Effect",51 {delimiter: "|"}52 ),53 },54 FILTER_OPTIONS: {55 studyCitation: defineFilter(ESD.studyCitation, {on_click_event: "study"}),56 studyEval: defineFilter(ESD.studyEval),57 studyDesign: defineFilter(ESD.studyDesign, {delimiter: "|"}),58 studyPopulationSource: defineFilter(ESD.studyPopulationSource, {delimiter: "|"}),59 exposureMeasure: defineFilter(ESD.exposureMeasure, {delimiter: "|"}),60 exposureMetric: defineFilter(ESD.exposureMetric, {delimiter: "|"}),61 exposureRoute: defineFilter(ESD.exposureRoute, {delimiter: "|"}),62 system: defineFilter(ESD.system, {delimiter: "|"}),63 effect: defineFilter(ESD.effect, {delimiter: "|"}),64 effectSubtype: defineFilter(ESD.effectSubtype, {delimiter: "|"}),65 },66 TABLE_FIELDS: {67 studyCitation: defineTable(ESD.studyCitation, {on_click_event: "study"}),68 studyIdentifier: defineTable(ESD.studyIdentifier, {on_click_event: "study"}),69 studyEval: defineTable(ESD.studyEval),70 studyDesign: defineTable(ESD.studyDesign, {delimiter: "|"}),71 studyPopulationSource: defineTable(ESD.studyPopulationSource, {delimiter: "|"}),72 exposureName: defineTable(ESD.exposureName, {delimiter: "|"}),73 exposureRoute: defineTable(ESD.exposureRoute, {delimiter: "|"}),74 exposureMeasure: defineTable(ESD.exposureMeasure, {delimiter: "|"}),75 exposureMetric: defineTable(ESD.exposureMetric, {delimiter: "|"}),76 system: defineTable(ESD.system, {delimiter: "|"}),77 effect: defineTable(ESD.effect, {delimiter: "|"}),78 effectSubtype: defineTable(ESD.effectSubtype, {delimiter: "|"}),79 },80 };81ESDSettings.DASHBOARDS = [82 {83 id: "study design vs. system & effect",84 label: "study design vs. system & effect",85 upperColor: COLORS.blue,86 x_axis: ESDSettings.AXIS_OPTIONS.studyDesign.id,87 y_axis: ESDSettings.AXIS_OPTIONS.systemEffect.id,88 filters: [89 ESDSettings.FILTER_OPTIONS.studyCitation.id,90 ESDSettings.FILTER_OPTIONS.exposureMeasure.id,91 ],92 table_fields: [93 ESDSettings.TABLE_FIELDS.studyCitation.id,94 ESDSettings.TABLE_FIELDS.studyDesign.id,95 ESDSettings.TABLE_FIELDS.studyPopulationSource.id,96 ESDSettings.TABLE_FIELDS.exposureRoute.id,97 ESDSettings.TABLE_FIELDS.exposureMeasure.id,98 ESDSettings.TABLE_FIELDS.exposureMetric.id,99 ESDSettings.TABLE_FIELDS.system.id,100 ESDSettings.TABLE_FIELDS.effect.id,101 ],102 },103 {104 id: "exposure measure vs. system & effect",105 label: "exposure measure vs. system & effect",106 upperColor: COLORS.red,107 x_axis: ESDSettings.AXIS_OPTIONS.exposureMeasure.id,108 y_axis: ESDSettings.AXIS_OPTIONS.systemEffect.id,109 filters: [110 ESDSettings.FILTER_OPTIONS.studyCitation.id,111 ESDSettings.FILTER_OPTIONS.studyDesign.id,112 ESDSettings.FILTER_OPTIONS.exposureMetric.id,113 ],114 table_fields: [115 ESDSettings.TABLE_FIELDS.studyCitation.id,116 ESDSettings.TABLE_FIELDS.studyDesign.id,117 ESDSettings.TABLE_FIELDS.studyPopulationSource.id,118 ESDSettings.TABLE_FIELDS.exposureRoute.id,119 ESDSettings.TABLE_FIELDS.exposureMeasure.id,120 ESDSettings.TABLE_FIELDS.exposureMetric.id,121 ESDSettings.TABLE_FIELDS.system.id,122 ESDSettings.TABLE_FIELDS.effect.id,123 ],124 },125 {126 id: "exposure route vs. system & effect",127 label: "exposure route vs. system & effect",128 upperColor: COLORS.purple,129 x_axis: ESDSettings.AXIS_OPTIONS.exposureRoute.id,130 y_axis: ESDSettings.AXIS_OPTIONS.systemEffect.id,131 filters: [132 ESDSettings.FILTER_OPTIONS.studyCitation.id,133 ESDSettings.FILTER_OPTIONS.studyDesign.id,134 ESDSettings.FILTER_OPTIONS.exposureMetric.id,135 ESDSettings.FILTER_OPTIONS.exposureMeasure.id,136 ],137 table_fields: [138 ESDSettings.TABLE_FIELDS.studyCitation.id,139 ESDSettings.TABLE_FIELDS.studyDesign.id,140 ESDSettings.TABLE_FIELDS.studyPopulationSource.id,141 ESDSettings.TABLE_FIELDS.exposureRoute.id,142 ESDSettings.TABLE_FIELDS.exposureMeasure.id,143 ESDSettings.TABLE_FIELDS.exposureMetric.id,144 ESDSettings.TABLE_FIELDS.system.id,145 ESDSettings.TABLE_FIELDS.effect.id,146 ],147 },148 {149 id: "epi-sd-study-pop-source-vs-system-effect",150 label: "study population source vs. system & effect",151 upperColor: COLORS.orange,152 x_axis: ESDSettings.AXIS_OPTIONS.studyPopulationSource.id,153 y_axis: ESDSettings.AXIS_OPTIONS.systemEffect.id,154 filters: [155 ESDSettings.FILTER_OPTIONS.studyCitation.id,156 ESDSettings.FILTER_OPTIONS.studyDesign.id,157 ESDSettings.FILTER_OPTIONS.exposureMeasure.id,158 ],159 table_fields: [160 ESDSettings.TABLE_FIELDS.studyCitation.id,161 ESDSettings.TABLE_FIELDS.studyDesign.id,162 ESDSettings.TABLE_FIELDS.studyPopulationSource.id,163 ESDSettings.TABLE_FIELDS.exposureRoute.id,164 ESDSettings.TABLE_FIELDS.exposureMeasure.id,165 ESDSettings.TABLE_FIELDS.exposureMetric.id,166 ESDSettings.TABLE_FIELDS.system.id,167 ESDSettings.TABLE_FIELDS.effect.id,168 ],169 },170 {171 id: "system vs. citation",172 label: "system vs. citation",173 upperColor: COLORS.green,174 x_axis: ESDSettings.AXIS_OPTIONS.system.id,175 y_axis: ESDSettings.AXIS_OPTIONS.studyCitation.id,176 filters: [177 ESDSettings.FILTER_OPTIONS.studyDesign.id,178 ESDSettings.FILTER_OPTIONS.studyPopulationSource.id,179 ESDSettings.FILTER_OPTIONS.exposureMeasure.id,180 ESDSettings.FILTER_OPTIONS.effect.id,181 ],182 table_fields: [183 ESDSettings.TABLE_FIELDS.studyCitation.id,184 ESDSettings.TABLE_FIELDS.studyDesign.id,185 ESDSettings.TABLE_FIELDS.studyPopulationSource.id,186 ESDSettings.TABLE_FIELDS.exposureRoute.id,187 ESDSettings.TABLE_FIELDS.exposureMeasure.id,188 ESDSettings.TABLE_FIELDS.exposureMetric.id,189 ESDSettings.TABLE_FIELDS.system.id,190 ESDSettings.TABLE_FIELDS.effect.id,191 ],192 },193 {194 id: "system & effect vs. citation",195 label: "system & effect vs. citation",196 upperColor: COLORS.red,197 x_axis: ESDSettings.AXIS_OPTIONS.systemEffect.id,198 y_axis: ESDSettings.AXIS_OPTIONS.studyCitation.id,199 filters: [200 ESDSettings.FILTER_OPTIONS.studyDesign.id,201 ESDSettings.FILTER_OPTIONS.studyPopulationSource.id,202 ESDSettings.FILTER_OPTIONS.exposureMeasure.id,203 ESDSettings.FILTER_OPTIONS.exposureMetric.id,204 ],205 table_fields: [206 ESDSettings.TABLE_FIELDS.studyCitation.id,207 ESDSettings.TABLE_FIELDS.studyDesign.id,208 ESDSettings.TABLE_FIELDS.studyPopulationSource.id,209 ESDSettings.TABLE_FIELDS.exposureRoute.id,210 ESDSettings.TABLE_FIELDS.exposureMeasure.id,211 ESDSettings.TABLE_FIELDS.exposureMetric.id,212 ESDSettings.TABLE_FIELDS.system.id,213 ESDSettings.TABLE_FIELDS.effect.id,214 ],215 },216];217// ER = epi results218const ER = {219 studyId: defineProps("studyId", "Study ID", "study id"),220 studyCitation: defineProps("studyCitation", "Study citation", "study citation"),221 studyIdentifier: defineProps("studyIdentifier", "Study identifier", "study identifier"),222 studyEval: defineProps("studyEval", "Overall study evaluation", "overall study evaluation"),223 studyPopulationId: defineProps(224 "studyPopulationId",225 "Study Population ID",226 "study population id"227 ),228 studyPopulationName: defineProps(229 "studyPopulationName",230 "Study population name",231 "study population name"232 ),233 studyPopulationSource: defineProps(234 "studyPopulationSource",235 "Study population source",236 "study population source"237 ),238 studyDesign: defineProps("studyDesign", "Study design", "study design"),239 comparisonSetId: defineProps("comparisonSetId", "comparison set ID", "comparison set id"),240 comparisonSetName: defineProps(241 "comparisonSetName",242 "Comparison set name",243 "comparison set name"244 ),245 exposureId: defineProps("exposureId", "Exposure ID", "exposure id"),246 exposureName: defineProps("exposureName", "Exposure name", "exposure name"),247 exposureRoute: defineProps("exposureRoute", "Exposure route", "exposure route"),248 exposureMeasure: defineProps("exposureMeasure", "Exposure measure", "exposure measure"),249 exposureMetric: defineProps("exposureMetric", "Exposure metric", "exposure metric"),250 outcomeId: defineProps("outcomeId", "Outcome ID", "outcome id"),251 outcomeName: defineProps("outcomeName", "Outcome name", "outcome name"),252 system: defineProps("system", "System", "system"),253 effect: defineProps("effect", "Effect", "effect"),254 effectSubtype: defineProps("effectSubtype", "Effect subtype", "effect subtype"),255 resultId: defineProps("resultId", "Result ID", "result id"),256 resultName: defineProps("resultName", "Result name", "result name"),257 },258 ERSettings = {259 AXIS_OPTIONS: {260 studyCitation: defineAxis(ER.studyCitation),261 studyEval: defineAxis(ER.studyEval),262 studyPopulationSource: defineAxis(ER.studyPopulationSource),263 studyDesign: defineAxis(ER.studyDesign),264 exposureName: defineAxis(ER.exposureName),265 exposureRoute: defineAxis(ER.exposureRoute, {delimiter: "|"}),266 exposureMeasureMetric: defineMultiAxis(267 [ER.exposureMeasure, ER.exposureMetric],268 "exposureMeasureMetric",269 "Exposure Measure & Metric"270 ),...
Common.js
Source:Common.js
...4 'use strict';5 var Error = (function(){6 var hasProps = false;7 function Error() {8 if (!hasProps) { defineProps(); }9 if (!_util.hasProp(this, '__type')) {10 Object.defineProperty(this, '__type', { value: 'urn:inin.com:common:error' });11 }12 Error._super.constructor.apply(this, arguments);13 }14 _util.inherits(Error, _util.DataContract);15 function defineProps() {16 Object.defineProperty(Error.prototype, 'errorId', {17 get: function() { return this.__prop_errorId; },18 set: function(value) {19 if (!(_util.isString(value) || value === void 0)) {20 throw new TypeError('Expected type String for Error.errorId, but got ' + _util.inspect(value) + '.');21 }22 this.__prop_errorId = value;23 },24 enumerable: true25 });26 Object.defineProperty(Error.prototype, 'message', {27 get: function() { return this.__prop_message; },28 set: function(value) {29 if (!(_util.isString(value))) {30 throw new TypeError('Expected type String for Error.message, but got ' + _util.inspect(value) + '.');31 }32 this.__prop_message = value;33 },34 enumerable: true35 });36 hasProps = true;37 }38 Object.defineProperty(Error, '__type', { value: 'urn:inin.com:common:error' });39 Object.defineProperty(Error, '__propInfo', {40 get: function() {41 var pi = {42 'errorId': { required: false, nullable: false },43 'message': { required: true, nullable: false }44 };45 if (_util.DataContract.__propInfo) { _util.extend(pi, _util.DataContract.__propInfo); }46 pi.__type = { required: false, nullable: false };47 return pi;48 }49 });50 _typemap['urn:inin.com:common:error'] = Error;51 return Error;52 }());53 var EditablePhoneNumber = (function(){54 var hasProps = false;55 function EditablePhoneNumber() {56 if (!hasProps) { defineProps(); }57 if (!_util.hasProp(this, '__type')) {58 Object.defineProperty(this, '__type', { value: 'urn:inin.com:common:editablePhoneNumber' });59 }60 EditablePhoneNumber._super.constructor.apply(this, arguments);61 }62 _util.inherits(EditablePhoneNumber, _util.DataContract);63 function defineProps() {64 Object.defineProperty(EditablePhoneNumber.prototype, 'baseNumber', {65 get: function() { return this.__prop_baseNumber; },66 set: function(value) {67 if (!(_util.isString(value) || value === void 0)) {68 throw new TypeError('Expected type String for EditablePhoneNumber.baseNumber, but got ' + _util.inspect(value) + '.');69 }70 this.__prop_baseNumber = value;71 },72 enumerable: true73 });74 Object.defineProperty(EditablePhoneNumber.prototype, 'extension', {75 get: function() { return this.__prop_extension; },76 set: function(value) {77 if (!(_util.isString(value) || value === void 0)) {78 throw new TypeError('Expected type String for EditablePhoneNumber.extension, but got ' + _util.inspect(value) + '.');79 }80 this.__prop_extension = value;81 },82 enumerable: true83 });84 Object.defineProperty(EditablePhoneNumber.prototype, 'autoDialable', {85 get: function() { return this.__prop_autoDialable; },86 set: function(value) {87 if (!(_util.isBoolean(value) || value === void 0)) {88 throw new TypeError('Expected type Boolean for EditablePhoneNumber.autoDialable, but got ' + _util.inspect(value) + '.');89 }90 this.__prop_autoDialable = value;91 },92 enumerable: true93 });94 hasProps = true;95 }96 Object.defineProperty(EditablePhoneNumber, '__type', { value: 'urn:inin.com:common:editablePhoneNumber' });97 Object.defineProperty(EditablePhoneNumber, '__propInfo', {98 get: function() {99 var pi = {100 'baseNumber': { required: false, nullable: false },101 'extension': { required: false, nullable: false },102 'autoDialable': { required: false, nullable: false }103 };104 if (_util.DataContract.__propInfo) { _util.extend(pi, _util.DataContract.__propInfo); }105 pi.__type = { required: false, nullable: false };106 return pi;107 }108 });109 _typemap['urn:inin.com:common:editablePhoneNumber'] = EditablePhoneNumber;110 return EditablePhoneNumber;111 }());112 var PhoneNumber = (function(){113 var hasProps = false;114 function PhoneNumber() {115 if (!hasProps) { defineProps(); }116 if (!_util.hasProp(this, '__type')) {117 Object.defineProperty(this, '__type', { value: 'urn:inin.com:common:phoneNumber' });118 }119 PhoneNumber._super.constructor.apply(this, arguments);120 }121 _util.inherits(PhoneNumber, _util.DataContract);122 function defineProps() {123 Object.defineProperty(PhoneNumber.prototype, 'standardizedNumber', {124 get: function() { return this.__prop_standardizedNumber; },125 set: function(value) {126 if (!(_util.isString(value))) {127 throw new TypeError('Expected type String for PhoneNumber.standardizedNumber, but got ' + _util.inspect(value) + '.');128 }129 this.__prop_standardizedNumber = value;130 },131 enumerable: true132 });133 Object.defineProperty(PhoneNumber.prototype, 'displayString', {134 get: function() { return this.__prop_displayString; },135 set: function(value) {136 if (!(_util.isString(value))) {137 throw new TypeError('Expected type String for PhoneNumber.displayString, but got ' + _util.inspect(value) + '.');138 }139 this.__prop_displayString = value;140 },141 enumerable: true142 });143 Object.defineProperty(PhoneNumber.prototype, 'numberInfo', {144 get: function() { return this.__prop_numberInfo; },145 set: function(value) {146 if (!(value instanceof EditablePhoneNumber || value === void 0)) {147 try {148 value = new EditablePhoneNumber(value);149 } catch (e) {150 throw new TypeError('Error setting PhoneNumber.numberInfo: ' + e.message);151 }152 }153 this.__prop_numberInfo = value;154 },155 enumerable: true156 });157 Object.defineProperty(PhoneNumber.prototype, 'editNumber', {158 get: function() { return this.__prop_editNumber; },159 set: function(value) {160 if (!(_util.isString(value) || value === void 0)) {161 throw new TypeError('Expected type String for PhoneNumber.editNumber, but got ' + _util.inspect(value) + '.');162 }163 this.__prop_editNumber = value;164 },165 enumerable: true166 });167 Object.defineProperty(PhoneNumber.prototype, 'dialable', {168 get: function() { return this.__prop_dialable; },169 set: function(value) {170 if (!(_util.isBoolean(value) || value === void 0)) {171 throw new TypeError('Expected type Boolean for PhoneNumber.dialable, but got ' + _util.inspect(value) + '.');172 }173 this.__prop_dialable = value;174 },175 enumerable: true176 });177 hasProps = true;178 }179 Object.defineProperty(PhoneNumber, '__type', { value: 'urn:inin.com:common:phoneNumber' });180 Object.defineProperty(PhoneNumber, '__propInfo', {181 get: function() {182 var pi = {183 'standardizedNumber': { required: true, nullable: false },184 'displayString': { required: true, nullable: false },185 'numberInfo': { required: false, nullable: false },186 'editNumber': { required: false, nullable: false },187 'dialable': { required: false, nullable: false }188 };189 if (_util.DataContract.__propInfo) { _util.extend(pi, _util.DataContract.__propInfo); }190 pi.__type = { required: false, nullable: false };191 return pi;192 }193 });194 _typemap['urn:inin.com:common:phoneNumber'] = PhoneNumber;195 return PhoneNumber;196 }());197 var FeatureInfo = (function(){198 var hasProps = false;199 function FeatureInfo() {200 if (!hasProps) { defineProps(); }201 if (!_util.hasProp(this, '__type')) {202 Object.defineProperty(this, '__type', { value: 'urn:inin.com:common:featureInfo' });203 }204 FeatureInfo._super.constructor.apply(this, arguments);205 }206 _util.inherits(FeatureInfo, _util.DataContract);207 function defineProps() {208 Object.defineProperty(FeatureInfo.prototype, 'featureId', {209 get: function() { return this.__prop_featureId; },210 set: function(value) {211 if (!(_util.isString(value))) {212 throw new TypeError('Expected type String for FeatureInfo.featureId, but got ' + _util.inspect(value) + '.');213 }214 this.__prop_featureId = value;215 },216 enumerable: true217 });218 Object.defineProperty(FeatureInfo.prototype, 'version', {219 get: function() { return this.__prop_version; },220 set: function(value) {221 if (!(_util.isNumber(value) && value|0 === value)) {222 throw new TypeError('Expected type Number (integer) for FeatureInfo.version, but got ' + _util.inspect(value) + '.');223 }224 this.__prop_version = value;225 },226 enumerable: true227 });228 hasProps = true;229 }230 Object.defineProperty(FeatureInfo, '__type', { value: 'urn:inin.com:common:featureInfo' });231 Object.defineProperty(FeatureInfo, '__propInfo', {232 get: function() {233 var pi = {234 'featureId': { required: true, nullable: false },235 'version': { required: true, nullable: false }236 };237 if (_util.DataContract.__propInfo) { _util.extend(pi, _util.DataContract.__propInfo); }238 pi.__type = { required: false, nullable: false };239 return pi;240 }241 });242 _typemap['urn:inin.com:common:featureInfo'] = FeatureInfo;243 return FeatureInfo;244 }());245 var FeatureInfos = (function(){246 var hasProps = false;247 function FeatureInfos() {248 if (!hasProps) { defineProps(); }249 if (!_util.hasProp(this, '__type')) {250 Object.defineProperty(this, '__type', { value: 'urn:inin.com:common:featureInfos' });251 }252 FeatureInfos._super.constructor.apply(this, arguments);253 }254 _util.inherits(FeatureInfos, _util.DataContract);255 function defineProps() {256 Object.defineProperty(FeatureInfos.prototype, 'featureInfoList', {257 get: function() { return this.__prop_featureInfoList; },258 set: function(value) {259 if (!(_util.isArray(value) && value.every(function(item){ return (item instanceof FeatureInfo); }))) {260 try {261 value = value.map(function(item){ return new FeatureInfo(item); });262 } catch (e) {263 throw new TypeError('Error setting FeatureInfos.featureInfoList: ' + e.message);264 }265 }266 this.__prop_featureInfoList = value;267 },268 enumerable: true269 });270 hasProps = true;271 }272 Object.defineProperty(FeatureInfos, '__type', { value: 'urn:inin.com:common:featureInfos' });273 Object.defineProperty(FeatureInfos, '__propInfo', {274 get: function() {275 var pi = {276 'featureInfoList': { required: true, nullable: false }277 };278 if (_util.DataContract.__propInfo) { _util.extend(pi, _util.DataContract.__propInfo); }279 pi.__type = { required: false, nullable: false };280 return pi;281 }282 });283 _typemap['urn:inin.com:common:featureInfos'] = FeatureInfos;284 return FeatureInfos;285 }());286 var AsyncOperationAcceptedResponse = (function(){287 var hasProps = false;288 function AsyncOperationAcceptedResponse() {289 if (!hasProps) { defineProps(); }290 if (!_util.hasProp(this, '__type')) {291 Object.defineProperty(this, '__type', { value: 'urn:inin.com:common:asyncOperationAcceptedResponse' });292 }293 AsyncOperationAcceptedResponse._super.constructor.apply(this, arguments);294 }295 _util.inherits(AsyncOperationAcceptedResponse, _util.DataContract);296 function defineProps() {297 Object.defineProperty(AsyncOperationAcceptedResponse.prototype, 'requestId', {298 get: function() { return this.__prop_requestId; },299 set: function(value) {300 if (!(_util.isString(value))) {301 throw new TypeError('Expected type String for AsyncOperationAcceptedResponse.requestId, but got ' + _util.inspect(value) + '.');302 }303 this.__prop_requestId = value;304 },305 enumerable: true306 });307 hasProps = true;308 }309 Object.defineProperty(AsyncOperationAcceptedResponse, '__type', { value: 'urn:inin.com:common:asyncOperationAcceptedResponse' });310 Object.defineProperty(AsyncOperationAcceptedResponse, '__propInfo', {311 get: function() {312 var pi = {313 'requestId': { required: true, nullable: false }314 };315 if (_util.DataContract.__propInfo) { _util.extend(pi, _util.DataContract.__propInfo); }316 pi.__type = { required: false, nullable: false };317 return pi;318 }319 });320 _typemap['urn:inin.com:common:asyncOperationAcceptedResponse'] = AsyncOperationAcceptedResponse;321 return AsyncOperationAcceptedResponse;322 }());323 var MissingPropertyError = (function(){324 var hasProps = false;325 function MissingPropertyError() {326 if (!hasProps) { defineProps(); }327 if (!_util.hasProp(this, '__type')) {328 Object.defineProperty(this, '__type', { value: 'urn:inin.com:common:missingPropertyError', enumerable: true });329 }330 MissingPropertyError._super.constructor.apply(this, arguments);331 }332 _util.inherits(MissingPropertyError, Error);333 function defineProps() {334 Object.defineProperty(MissingPropertyError.prototype, 'propertyName', {335 get: function() { return this.__prop_propertyName; },336 set: function(value) {337 if (!(_util.isString(value) || value === void 0)) {338 throw new TypeError('Expected type String for MissingPropertyError.propertyName, but got ' + _util.inspect(value) + '.');339 }340 this.__prop_propertyName = value;341 },342 enumerable: true343 });344 hasProps = true;345 }346 Object.defineProperty(MissingPropertyError, '__type', { value: 'urn:inin.com:common:missingPropertyError' });347 Object.defineProperty(MissingPropertyError, '__propInfo', {348 get: function() {349 var pi = {350 'propertyName': { required: false, nullable: false }351 };352 if (Error.__propInfo) { _util.extend(pi, Error.__propInfo); }353 pi.__type = { required: true, nullable: false };354 return pi;355 }356 });357 _typemap['urn:inin.com:common:missingPropertyError'] = MissingPropertyError;358 return MissingPropertyError;359 }());360 var InvalidPropertyError = (function(){361 var hasProps = false;362 function InvalidPropertyError() {363 if (!hasProps) { defineProps(); }364 if (!_util.hasProp(this, '__type')) {365 Object.defineProperty(this, '__type', { value: 'urn:inin.com:common:invalidPropertyError', enumerable: true });366 }367 InvalidPropertyError._super.constructor.apply(this, arguments);368 }369 _util.inherits(InvalidPropertyError, Error);370 function defineProps() {371 Object.defineProperty(InvalidPropertyError.prototype, 'propertyName', {372 get: function() { return this.__prop_propertyName; },373 set: function(value) {374 if (!(_util.isString(value) || value === void 0)) {375 throw new TypeError('Expected type String for InvalidPropertyError.propertyName, but got ' + _util.inspect(value) + '.');376 }377 this.__prop_propertyName = value;378 },379 enumerable: true380 });381 hasProps = true;382 }383 Object.defineProperty(InvalidPropertyError, '__type', { value: 'urn:inin.com:common:invalidPropertyError' });384 Object.defineProperty(InvalidPropertyError, '__propInfo', {...
Class.js
Source:Class.js
1/**2 * Classæ¯æä¾ç±»çå建çè¾
å©å·¥å
·ã3 * @namespace Class4 * @example5 * const Bird = Hilo3d.Class.create({6 * Extends: Animal,7 * Mixes: EventMixin,8 * constructor: function(name){9 * this.name = name;10 * },11 * fly: function(){12 * console.log('I am flying');13 * },14 * Statics: {15 * isBird: function(bird){16 * return bird instanceof Bird;17 * }18 * }19 * });20 *21 * const swallow = new Bird('swallow');22 * swallow.fly();23 * Bird.isBird(swallow);24 */25const Class = (function() {26 let defineProperty;27 let defineProperties;28 try {29 defineProperty = Object.defineProperty;30 defineProperties = Object.defineProperties;31 defineProperty({}, '$', {32 value: 033 });34 } catch (e) {35 if ('__defineGetter__' in Object) {36 defineProperty = function(obj, prop, desc) {37 if ('value' in desc) obj[prop] = desc.value;38 if ('get' in desc) obj.__defineGetter__(prop, desc.get); // eslint-disable-line39 if ('set' in desc) obj.__defineSetter__(prop, desc.set); // eslint-disable-line40 return obj;41 };42 defineProperties = function(obj, props) {43 for (const prop in props) {44 if (props.hasOwnProperty(prop)) { // eslint-disable-line45 defineProperty(obj, prop, props[prop]);46 }47 }48 return obj;49 };50 }51 }52 /**53 * æ··å
¥å±æ§ææ¹æ³ã54 * @memberOf Class55 * @method mix56 * @param {any} target æ··å
¥ç®æ 对象ã57 * @param {...any} source è¦æ··å
¥çå±æ§åæ¹æ³æ¥æºãå¯æ¯æå¤ä¸ªæ¥æºåæ°ã58 * @returns {any} æ··å
¥ç®æ 对象ã59 */60 const mix = function(target) {61 for (let i = 1, len = arguments.length; i < len; i++) {62 const source = arguments[i];63 let defineProps;64 for (const key in source) {65 const prop = source[key];66 if (prop && typeof prop === 'object') {67 if (prop.value !== undefined || typeof prop.get === 'function' || typeof prop.set === 'function') {68 defineProps = defineProps || {};69 defineProps[key] = prop;70 continue;71 }72 }73 target[key] = prop;74 }75 if (defineProps) defineProperties(target, defineProps);76 }77 return target;78 };79 const createProto = (function() {80 if (Object.__proto__) { // eslint-disable-line81 return function(proto) {82 return {83 __proto__: proto84 };85 };86 }87 const Ctor = function() {};88 return function(proto) {89 Ctor.prototype = proto;90 return new Ctor();91 };92 }());93 const classMutators = /** @ignore */ {94 Extends(parent) {95 const existed = this.prototype;96 const proto = createProto(parent.prototype);97 // inherit static properites98 mix(this, parent);99 // keep existed properties100 mix(proto, existed);101 // correct constructor102 proto.constructor = this;103 // prototype chaining104 this.prototype = proto;105 // shortcut to parent's prototype106 this.superclass = parent.prototype;107 },108 Mixes(items) {109 if (!(items instanceof Array)) {110 items = [items];111 }112 const proto = this.prototype;113 let item;114 while (item = items.shift()) { // eslint-disable-line115 mix(proto, item.prototype || item);116 }117 },118 Statics(properties) {119 mix(this, properties);120 }121 };122 const implement = function(properties) {123 const proto = {};124 let value; let125 key;126 for (key in properties) {127 value = properties[key];128 if (classMutators.hasOwnProperty(key)) { // eslint-disable-line129 classMutators[key].call(this, value);130 } else {131 proto[key] = value;132 }133 }134 mix(this.prototype, proto);135 };136 /**137 * æ ¹æ®åæ°æå®çå±æ§åæ¹æ³å建类ã138 * @memberOf Class139 * @method create140 * @param {Object} params è¦å建çç±»çç¸å
³å±æ§åæ¹æ³ã141 * @param {Object} [params.Statics] æå®ç±»çéæå±æ§ææ¹æ³ã142 * @param {Object} [params.Extends] æå®è¦ç»§æ¿çç¶ç±»ã143 * @param {Object} [params.Mixes] æå®è¦æ··å
¥çæåéå对象144 * @param {Function} [params.constructor] æé å½æ°145 * @param {any} [params.[value:string]] å
¶ä»å建类çæåå±æ§ææ¹æ³ã146 */147 const create = function(properties) {148 properties = properties || {};149 const clazz = properties.hasOwnProperty('constructor') ? properties.constructor : function() {}; // eslint-disable-line150 implement.call(clazz, properties);151 return clazz;152 };153 return {154 create,155 mix156 };157}());...
valid-define-props.js
Source:valid-define-props.js
1/**2 * @author Yosuke Ota <https://github.com/ota-meshi>3 * See LICENSE file in root directory for full license.4 */5'use strict'6const { findVariable } = require('eslint-utils')7const utils = require('../utils')8module.exports = {9 meta: {10 type: 'problem',11 docs: {12 description: 'enforce valid `defineProps` compiler macro',13 // TODO Switch in the major version.14 // categories: ['vue3-essential'],15 categories: undefined,16 url: 'https://eslint.vuejs.org/rules/valid-define-props.html'17 },18 fixable: null,19 schema: [],20 messages: {21 hasTypeAndArg:22 '`defineProps` has both a type-only props and an argument.',23 referencingLocally:24 '`defineProps` are referencing locally declared variables.',25 multiple: '`defineProps` has been called multiple times.',26 notDefined: 'Props are not defined.',27 definedInBoth:28 'Props are defined in both `defineProps` and `export default {}`.'29 }30 },31 /** @param {RuleContext} context */32 create(context) {33 const scriptSetup = utils.getScriptSetupElement(context)34 if (!scriptSetup) {35 return {}36 }37 /** @type {Set<Expression | SpreadElement>} */38 const propsDefExpressions = new Set()39 let hasDefaultExport = false40 /** @type {CallExpression[]} */41 const definePropsNodes = []42 /** @type {CallExpression | null} */43 let emptyDefineProps = null44 return utils.compositingVisitors(45 utils.defineScriptSetupVisitor(context, {46 onDefinePropsEnter(node) {47 definePropsNodes.push(node)48 if (node.arguments.length >= 1) {49 if (node.typeParameters && node.typeParameters.params.length >= 1) {50 // `defineProps` has both a literal type and an argument.51 context.report({52 node,53 messageId: 'hasTypeAndArg'54 })55 return56 }57 propsDefExpressions.add(node.arguments[0])58 } else {59 if (60 !node.typeParameters ||61 node.typeParameters.params.length === 062 ) {63 emptyDefineProps = node64 }65 }66 },67 Identifier(node) {68 for (const defineProps of propsDefExpressions) {69 if (utils.inRange(defineProps.range, node)) {70 const variable = findVariable(context.getScope(), node)71 if (72 variable &&73 variable.references.some((ref) => ref.identifier === node)74 ) {75 if (76 variable.defs.length &&77 variable.defs.every(78 (def) =>79 utils.inRange(scriptSetup.range, def.name) &&80 !utils.inRange(defineProps.range, def.name)81 )82 ) {83 if (utils.withinTypeNode(node)) {84 continue85 }86 //`defineProps` are referencing locally declared variables.87 context.report({88 node,89 messageId: 'referencingLocally'90 })91 }92 }93 }94 }95 }96 }),97 utils.defineVueVisitor(context, {98 onVueObjectEnter(node, { type }) {99 if (type !== 'export' || utils.inRange(scriptSetup.range, node)) {100 return101 }102 hasDefaultExport = Boolean(utils.findProperty(node, 'props'))103 }104 }),105 {106 'Program:exit'() {107 if (!definePropsNodes.length) {108 return109 }110 if (definePropsNodes.length > 1) {111 // `defineProps` has been called multiple times.112 for (const node of definePropsNodes) {113 context.report({114 node,115 messageId: 'multiple'116 })117 }118 return119 }120 if (emptyDefineProps) {121 if (!hasDefaultExport) {122 // Props are not defined.123 context.report({124 node: emptyDefineProps,125 messageId: 'notDefined'126 })127 }128 } else {129 if (hasDefaultExport) {130 // Props are defined in both `defineProps` and `export default {}`.131 for (const node of definePropsNodes) {132 context.report({133 node,134 messageId: 'definedInBoth'135 })136 }137 }138 }139 }140 }141 )142 }...
reactivity.js
Source:reactivity.js
...52 dep,53 defineProps,54 defineArray 55 }56 function defineProps(obj) {57 58 for(let propName in obj){59 let realValue = obj[propName];60 Object.defineProperty(obj, propName, {61 get (){62 dep.depend();63 return realValue;64 },65 set(newValue){66 realValue = newValue;67 if (typeof realValue === 'object' && !Array.isArray(realValue) && realValue !== null) {68 defineProps(realValue)69 } else if (Array.isArray(realValue)) {70 defineArray(realValue)71 }72 dep.notify();73 } 74 });75 if (typeof realValue === 'object' && !Array.isArray(realValue) && realValue !== null) {76 defineProps(realValue)77 } else if (Array.isArray(realValue)) {78 defineArray(realValue)79 }80 } 81 }82 function defineArray(array) {83 array.__proto__ = arrayMethods84 def(array, "__ob__", thisObj)85 for (let item of array) {86 if (typeof item === 'object' && !Array.isArray(item) && item !== null) {87 defineProps(item)88 } else if (Array.isArray(item)) {89 defineArray(item)90 }91 }92 }93 defineProps(obj)94}95class Dep {96 constructor(){97 this.subscribers = new Set();98 }99 depend() {100 if(activeUpdate){101 this.subscribers.add(activeUpdate);102 }103 }104 notify(){105 this.subscribers.forEach(sub => sub());106 }107}...
index.js
Source:index.js
...21 var ret = {};22 Object.keys(styles).forEach(function (name) {23 ret[name] = {24 get: function () {25 var obj = defineProps(function self() {26 var str = [].slice.call(arguments).join(' ');27 if (!chalk.enabled) {28 return str;29 }30 return self._styles.reduce(function (str, name) {31 var code = ansi[name];32 return str ? code.open + str + code.close : '';33 }, str);34 }, styles);35 obj._styles = [];36 return obj[name];37 }38 }39 });40 return ret;41}42defineProps(chalk, init());43chalk.styles = ansi;44chalk.stripColor = stripAnsi;45chalk.supportsColor = hasColor;46// detect mode if not set manually47if (chalk.enabled === undefined) {48 chalk.enabled = chalk.supportsColor;...
Using AI Code Generation
1const playwright = require('playwright');2(async () => {3 const browser = await playwright.chromium.launch({ headless: false });4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.evaluate(() => {7 window['playwright'].defineProps(window, 'navigator', {8 userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.0 Safari/537.36',9 });10 });11 await page.screenshot({ path: 'example.png' });12 await browser.close();13})();14const playwright = require('playwright');15(async () => {16 const browser = await playwright.chromium.launch({ headless: false });17 const context = await browser.newContext();18 const page = await context.newPage();19 await page.evaluate(() => {20 window['playwright'].defineProps(window, 'navigator', {21 userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.0 Safari/537.36',22 });23 });24 await page.screenshot({ path: 'example.png' });25 await browser.close();26})();27const playwright = require('playwright');28(async () => {29 const browser = await playwright.chromium.launch({ headless: false });30 const context = await browser.newContext();31 const page = await context.newPage();32 await page.evaluate(() => {33 window['playwright'].defineProps(window, 'navigator', {
Using AI Code Generation
1const {chromium} = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.evaluate(() => {7 window.defineProps = (obj, props) => {8 Object.defineProperties(obj, props);9 };10 });11 await page.evaluate(() => {12 defineProps(window, {13 myProp: {14 get() {15 return 'custom value';16 }17 }18 });19 });20 await page.screenshot({ path: 'example.png' });21 await browser.close();22})();
Using AI Code Generation
1const {chromium} = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const elementHandle = await page.$('text=Get started');7 await elementHandle.scrollIntoViewIfNeeded();8 await elementHandle.click();9 await page.screenshot({ path: 'example.png' });10 await browser.close();11})();12module.exports = {13 use: {14 viewport: { width: 1920, height: 1080 },15 },16 {17 use: {18 },19 },20};21const {chromium} = require('playwright');22(async () => {23 const browser = await chromium.launch();24 const context = await browser.newContext();25 const page = await context.newPage();26 const elementHandle = await page.$('text=Get started');27 await elementHandle.scrollIntoViewIfNeeded();
Using AI Code Generation
1const {chromium} = require('playwright');2(async () => {3 const browser = await chromium.launch();4 const context = await browser.newContext();5 const page = await context.newPage();6 const element = await page.$('input');7 await element._defineProps({name: 'value', value: 'test'});8 await browser.close();9})();10const {chromium} = require('playwright');11(async () => {12 const browser = await chromium.launch();13 const context = await browser.newContext();14 const page = await context.newPage();15 const element = await page.$('input');16 await element._defineProps({name: 'value', value: 'test'});17 await browser.close();18})();19const {chromium} = require('playwright');20(async () => {21 const browser = await chromium.launch();22 const context = await browser.newContext();23 const page = await context.newPage();24 const element = await page.$('input');25 await element._defineProps({name: 'value', value: 'test'});26 await browser.close();27})();28const {chromium} = require('playwright');29(async () => {30 const browser = await chromium.launch();31 const context = await browser.newContext();32 const page = await context.newPage();33 const element = await page.$('input');34 await element._defineProps({name: 'value', value: 'test'});35 await browser.close();36})();37const {chromium} = require('playwright');38(async () => {39 const browser = await chromium.launch();40 const context = await browser.newContext();41 const page = await context.newPage();42 const element = await page.$('input');43 await element._defineProps({name: 'value', value: 'test'});44 await browser.close();45})();46const {chromium} = require('playwright');47(async () => {48 const browser = await chromium.launch();
Using AI Code Generation
1const playwright = require('playwright');2(async() => {3 const browser = await playwright.webkit.launch({ headless: false });4 const context = await browser.newContext();5 const page = await context.newPage();6 await page.route('**/*', route => {7 console.log(route.request().url());8 route.continue();9 });10 await page.evaluate(() => {11 window.defineProps = function(obj, props) {12 Object.defineProperties(obj, props);13 };14 });15 await page.evaluate(() => {16 const props = {17 url: {18 get() {19 }20 }21 };22 window.defineProps(window.location, props);23 });24 await browser.close();25})();
Using AI Code Generation
1const {Page} = require('playwright/lib/server/page.js');2Page.prototype.defineProps = function() {3 Object.defineProperties(this, {4 title: {5 get: async function() {6 return await this.evaluate(() => document.title);7 }8 },9 url: {10 get: async function() {11 return await this.evaluate(() => document.location.href);12 }13 }14 });15};16const {Frame} = require('playwright/lib/server/frame.js');17Frame.prototype.defineProps = function() {18 Object.defineProperties(this, {19 title: {20 get: async function() {21 return await this.evaluate(() => document.title);22 }23 },24 url: {25 get: async function() {26 return await this.evaluate(() => document.location.href);27 }28 }29 });30};31const {BrowserContext} = require('playwright/lib/server/browserContext.js');32BrowserContext.prototype.defineProps = function() {33 Object.defineProperties(this, {34 title: {35 get: async function() {36 return await this.evaluate(() => document.title);37 }38 },39 url: {40 get: async function() {41 return await this.evaluate(() => document.location.href);42 }43 }44 });45};46const {chromium} = require('playwright');47(async () => {48 const browser = await chromium.launch();49 const context = await browser.newContext();50 const page = await context.newPage();51 page.defineProps();52 console.log(page.title);53 console.log(page.url);54 const frame = page.mainFrame();55 frame.defineProps();56 console.log(frame.title);57 console.log(frame.url);
Using AI Code Generation
1const { defineProps } = require('playwright/lib/server/dom');2const { DOMWorld } = require('playwright/lib/server/domWorld');3const { ElementHandle } = require('playwright/lib/server/dom');4const { JSHandle } = require('playwright/lib/server/jsHandle');5defineProps(ElementHandle, {6 async _getComputedAccessibleNode() {7 return this._page._delegate._getComputedAccessibleNode(this._contextId, this._remoteObject.objectId);8 },9});10defineProps(JSHandle, {11 async _getComputedAccessibleNode() {12 return this._page._delegate._getComputedAccessibleNode(this._contextId, this._remoteObject.objectId);13 },14});15defineProps(DOMWorld, {16 async _getComputedAccessibleNode(contextId, objectId) {17 return this._page._delegate._getComputedAccessibleNode(contextId, objectId);18 },19});20defineProps(JSHandle, {21 async _getComputedAccessibleNode() {22 return this._page._delegate._getComputedAccessibleNode(this._contextId, this._remoteObject.objectId);23 },24});25defineProps(DOMWorld, {26 async _getComputedAccessibleNode(contextId, objectId) {27 return this._page._delegate._getComputedAccessibleNode(contextId, objectId);28 },29});30export function defineProps<T extends Object>(klass: { new (...args: any[]): T }, descriptors: { [key: string]: PropertyDescriptor }) {31 for (const [name, descriptor] of Object.entries(descriptors)) {32 Object.defineProperty(klass.prototype, name, descriptor);33 }34}35export function defineProps<T extends Object>(klass: { new (...args: any[]): T }, descriptors: { [key: string]: PropertyDescriptor }) {36 for (const [name, descriptor] of Object.entries(descriptors)) {37 Object.defineProperty(klass.prototype, name, descriptor);38 }39}40export function defineProps<T extends Object>(klass: { new (...args: any[]): T }, descriptors
Using AI Code Generation
1const { defineProps } = require('playwright-core/lib/server/chromium/crPage');2defineProps(ChromiumPage, ['foo', 'bar']);3module.exports = {4};5const { ChromiumPage } = require('./test.js');6const { test } = require('@playwright/test');7test('test', async ({ page }) => {8 const chromiumPage = new ChromiumPage(page);9 console.log(chromiumPage.foo);10 console.log(chromiumPage.bar);11});12const { defineProps } = require('playwright-core/lib/server/chromium/crPage');13defineProps(ChromiumPage, ['foo', 'bar']);14module.exports = {15};16const { ChromiumPage } = require('./defineProps.js');17const { test } = require('@playwright/test');18test('test', async ({ page }) => {19 const chromiumPage = new ChromiumPage(page);20 console.log(chromiumPage.foo);21 console.log(chromiumPage.bar);22});23I think you need to use ChromiumPage in the defineProps() call as well. It should be:24defineProps(ChromiumPage, ['foo', 'bar']);25defineProps(ChromiumPage, ['foo', 'bar
Using AI Code Generation
1const { defineProps } = require('playwright/lib/server/common/transport.js');2defineProps('Page', ['myMethod']);3const { myMethod } = require('playwright/lib/server/common/transport.js');4await myMethod();5const { defineProps } = require('playwright/lib/server/common/transport.js');6defineProps('Page', ['myMethod']);7const { myMethod } = require('playwright/lib/server/common/transport.js');8await myMethod();9const { defineEvents } = require('playwright/lib/server/common/
Using AI Code Generation
1const { defineProps } = require('@playwright/test');2defineProps({3 foo: {4 },5});6const { test, expect } = require('@playwright/test');7test('test1', async ({ foo }) => {8 expect(foo).toBe('bar');9});10const { defineProps } = require('@playwright/test');11defineProps({12 foo: {13 },14});15const { test, expect } = require('@playwright/test');16test('test1', async ({ foo }) => {17 expect(foo).toBe('bar');18 foo = 'baz';19 expect(foo).toBe('baz');20});
LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!