1{ 2 "title": "JSON schema for module.json", 3 "$schema": "http://json-schema.org/draft-07/schema#", 4 "type": "object", 5 "additionalProperties": true, 6 "required": [ 7 "module" 8 ], 9 "propertyNames": { 10 "enum": [ 11 "module" 12 ] 13 }, 14 "properties": { 15 "module": { 16 "description": "Indicates the configuration of a .hap file. The module configuration is valid only for the current .hap file.", 17 "type": "object", 18 "allOf": [ 19 { 20 "if": { 21 "properties": { 22 "type": { 23 "const": "har" 24 } 25 }, 26 "then": { 27 "propertyNames": { 28 "enum": [ 29 "name", 30 "type", 31 "srcEntrance", 32 "description", 33 "process", 34 "mainElement", 35 "deviceTypes", 36 "installationFree", 37 "virtualMachine", 38 "uiSyntax", 39 "metadata", 40 "abilities", 41 "extensionAbilities", 42 "requestPermissions", 43 "definePermissions", 44 "testRunner" 45 ] 46 }, 47 "required": [ 48 "name", 49 "type", 50 "deviceTypes" 51 ] 52 } 53 }, 54 "else": { 55 "propertyNames": { 56 "enum": [ 57 "name", 58 "type", 59 "srcEntrance", 60 "description", 61 "process", 62 "mainElement", 63 "deviceTypes", 64 "deliveryWithInstall", 65 "installationFree", 66 "virtualMachine", 67 "uiSyntax", 68 "pages", 69 "metadata", 70 "abilities", 71 "extensionAbilities", 72 "requestPermissions", 73 "definePermissions", 74 "testRunner" 75 ] 76 }, 77 "required": [ 78 "name", 79 "type", 80 "deviceTypes", 81 "deliveryWithInstall", 82 "pages" 83 ] 84 } 85 } 86 ], 87 "properties": { 88 "name": { 89 "description": "Indicates the module name.", 90 "type": "string", 91 "maxLength": 31 92 }, 93 "type": { 94 "description": "Indicates the type of the module.", 95 "type": "string", 96 "enum": [ 97 "entry", 98 "feature", 99 "har" 100 ] 101 }, 102 "srcEntrance": { 103 "description": "This tag indicates the entry js code path corresponding to hap", 104 "type": "string", 105 "maxLength": 127 106 }, 107 "description": { 108 "description": "Indicates the description of the current .hap file.", 109 "type": "string", 110 "maxLength": 255 111 }, 112 "process": { 113 "description": "Indicates the name of the process running the module.", 114 "type": "string", 115 "maxLength": 31 116 }, 117 "mainElement": { 118 "description": "Describes hap entry ability name or extension name.", 119 "type": "string", 120 "maxLength": 255 121 }, 122 "deviceTypes": { 123 "description": "Indicates the type of devices on which the abilities can run.This label cannot be left blank.", 124 "type": "array", 125 "uniqueItems": true, 126 "items": { 127 "type": "string", 128 "enum": [ 129 "default", 130 "tablet", 131 "tv", 132 "wearable", 133 "car", 134 "router" 135 ] 136 } 137 }, 138 "deliveryWithInstall": { 139 "description": "Specifies whether the .hap file is installed when the user installs the application.true: The .hap file is installed during the application installation.false: The .hap file is not installed during the application installation.This label cannot be left blank.", 140 "type": "boolean" 141 }, 142 "installationFree": { 143 "description": "Indicates whether free installation of the current hap is supported. If moduleType is feature, this item label is mandatory, else this item label is optional.", 144 "type": "boolean" 145 }, 146 "virtualMachine": { 147 "description": "Identify the type of target virtual machine currently running hap.", 148 "type": "string", 149 "enum": [ 150 "ark", 151 "default" 152 ], 153 "default": "default" 154 }, 155 "uiSyntax": { 156 "description": "Indicates the syntax type of JS Component.Default is hml", 157 "type": "string", 158 "enum": [ 159 "js", 160 "ets", 161 "hml" 162 ], 163 "default": "js" 164 }, 165 "pages": { 166 "description": "Used to list the information of each page in JS Component.", 167 "type": "string", 168 "pattern": "^[$]profile:[0-9a-zA-Z_.]+$", 169 "maxLength": 255 170 }, 171 "metadata": { 172 "description": "Indicates the metadata of the module.", 173 "type": "array", 174 "items": { 175 "type": "object", 176 "propertyNames": { 177 "enum": [ 178 "name", 179 "value", 180 "resource" 181 ] 182 }, 183 "properties": { 184 "name": { 185 "description": "Indicates the key of a data element. The value is a string with a maximum of 255 bytes.", 186 "type": "string", 187 "maxLength": 255 188 }, 189 "value": { 190 "description": "Indicates the value of a data element. The value is a string with a maximum of 255 bytes.", 191 "type": "string", 192 "maxLength": 255 193 }, 194 "resource": { 195 "description": "Indicates the resource of a data element.", 196 "type": "string", 197 "pattern": "^[$]profile:[0-9a-zA-Z_.]+$", 198 "maxLength": 255 199 } 200 } 201 } 202 }, 203 "abilities": { 204 "description": "Indicates all abilities in the current module. The value is an array of objects, each of which represents an ability.This label can be left blank by default,and indicates no capability exists in the current module.", 205 "type": "array", 206 "items": { 207 "type": "object", 208 "required": [ 209 "name", 210 "srcEntrance" 211 ], 212 "propertyNames": { 213 "enum": [ 214 "priority", 215 "name", 216 "srcEntrance", 217 "launchType", 218 "description", 219 "icon", 220 "label", 221 "permissions", 222 "metadata", 223 "visible", 224 "skills", 225 "backgroundModes", 226 "continuable" 227 ] 228 }, 229 "properties": { 230 "priority": { 231 "description": "Indicates the priority of the ability.Only for system application.This field is used for implicit query.Range from 0 to 10, default value is 0.", 232 "type": "integer", 233 "minimum": 0, 234 "maximum": 10 235 }, 236 "name": { 237 "description": "Indicates the name of the ability.", 238 "type": "string", 239 "maxLength": 127 240 }, 241 "srcEntrance": { 242 "description": "Indicates the js code path corresponding to the ability.", 243 "type": "string", 244 "maxLength": 127 245 }, 246 "launchType": { 247 "description": "Indicates the boot mode of ability.", 248 "type": "string", 249 "enum": [ 250 "standard", 251 "singleton", 252 "specified" 253 ], 254 "default": "standard" 255 }, 256 "description": { 257 "description": "Describes the ability.", 258 "type": "string", 259 "maxLength": 255 260 }, 261 "icon": { 262 "description": "Indicates the index to the ability icon file, in the format of \"$media:ability_icon\".This label can be left blank by default.", 263 "type": "string", 264 "pattern": "^[$]media:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 265 }, 266 "label": { 267 "description": "Indicates the ability name visible to users. The tag value is set to the resource index of this name to support multiple languages.", 268 "type": "string", 269 "maxLength": 255, 270 "pattern": "^[$]string:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 271 }, 272 "permissions": { 273 "description": "Indicates the permissions required for abilities of another application to call the current ability, generally in the format of a reverse domain name. The value can be either the permissions predefined in the OS or those customized by your application. If a custom permission is used, the value must be the same as the name value of a specific permission defined in the definePermissions attribute.", 274 "type": "array", 275 "uniqueItems": true, 276 "items": { 277 "type": "string", 278 "maxLength": 255 279 } 280 }, 281 "metadata": { 282 "description": "Indicates the metadata of the ability.", 283 "type": "array", 284 "items": { 285 "type": "object", 286 "propertyNames": { 287 "enum": [ 288 "name", 289 "value", 290 "resource" 291 ] 292 }, 293 "properties": { 294 "name": { 295 "description": "Indicates the key of a data element. The value is a string with a maximum of 255 bytes.", 296 "type": "string", 297 "maxLength": 255 298 }, 299 "value": { 300 "description": "Indicates the value of a data element. The value is a string with a maximum of 255 bytes.", 301 "type": "string", 302 "maxLength": 255 303 }, 304 "resource": { 305 "description": "Indicates the resource of a data element.", 306 "type": "string", 307 "pattern": "^[$]profile:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$", 308 "maxLength": 255 309 } 310 } 311 } 312 }, 313 "visible": { 314 "description": "Specifies whether the ability can be called by other applications.The \"true\" indicates the ability can be called by other applications.The \"false\" indicates the ability cannot be called by other applications.This tag is optional. The default value is false.", 315 "type": "boolean", 316 "default": false 317 }, 318 "skills": { 319 "description": "Indicates the types of the intent that can be accepted by the ability.", 320 "type": "array", 321 "items": { 322 "type": "object", 323 "uniqueItems": true, 324 "propertyNames": { 325 "enum": [ 326 "actions", 327 "entities", 328 "uris" 329 ] 330 }, 331 "properties": { 332 "actions": { 333 "description": "Indicates the actions of the intent that can be accepted by the ability. The value can have one or multiple actions predefined in the system.", 334 "type": "array", 335 "uniqueItems": true, 336 "items": { 337 "type": "string" 338 } 339 }, 340 "entities": { 341 "description": "Indicates the entities of the intent that can be accepted by the ability, such as video and Home application. The value can have one or multiple entities either predefined in the system or be customized.", 342 "type": "array", 343 "items": { 344 "type": "string" 345 }, 346 "uniqueItems": true 347 }, 348 "uris": { 349 "description": "This tag identifies the collection of data specifications to be added to the Intent filter.", 350 "type": "array", 351 "items": { 352 "anyOf": [ 353 { 354 "type": "object", 355 "propertyNames": { 356 "enum": [ 357 "scheme", 358 "host", 359 "port", 360 "pathStartWith", 361 "path", 362 "pathRegex", 363 "type" 364 ] 365 }, 366 "required": [ 367 "scheme" 368 ], 369 "properties": { 370 "scheme": { 371 "description": "This label is a string type.", 372 "type": "string" 373 }, 374 "host": { 375 "description": "This label is a string type.", 376 "type": "string" 377 }, 378 "port": { 379 "description": "This label is a string type.", 380 "type": "string" 381 }, 382 "pathStartWith": { 383 "description": "This label is a string type.", 384 "type": "string" 385 }, 386 "path": { 387 "description": "This label is a string type.", 388 "type": "string" 389 }, 390 "pathRegex": { 391 "description": "This label is a string type.", 392 "type": "string" 393 }, 394 "type": { 395 "description": "This label is a string type.", 396 "type": "string" 397 } 398 } 399 }, 400 { 401 "type": "object", 402 "propertyNames": { 403 "enum": [ 404 "type" 405 ] 406 }, 407 "properties": { 408 "type": { 409 "description": "This label is a string type.", 410 "type": "string" 411 } 412 } 413 } 414 ] 415 } 416 } 417 } 418 } 419 }, 420 "backgroundModes": { 421 "description": "Indicates the background service addressing a specific usage scenario. This attribute is dedicated to the abilities using the Service template. You can assign multiple background service types to a specific ability using the Service template.", 422 "type": "array", 423 "uniqueItems": true, 424 "items": { 425 "type": "string", 426 "enum": [ 427 "dataTransfer", 428 "audioPlayback", 429 "audioRecording", 430 "location", 431 "bluetoothInteraction", 432 "multiDeviceConnection", 433 "wifiInteraction", 434 "voip", 435 "taskKeeping" 436 ] 437 } 438 }, 439 "continuable": { 440 "description": "Identifies whether the ability can be migrated. The default value is false.", 441 "type": "boolean" 442 } 443 } 444 } 445 }, 446 "extensionAbilities": { 447 "description": "Indicates all extensionAbilities in the current module.", 448 "type": "array", 449 "items": { 450 "type": "object", 451 "if": { 452 "properties": { 453 "type": { 454 "const": "dataShare" 455 } 456 } 457 }, 458 "then": { 459 "required": [ 460 "name", 461 "srcEntrance", 462 "type", 463 "uri" 464 ] 465 }, 466 "else": { 467 "required": [ 468 "name", 469 "srcEntrance", 470 "type" 471 ] 472 }, 473 "propertyNames": { 474 "enum": [ 475 "priority", 476 "name", 477 "srcEntrance", 478 "icon", 479 "label", 480 "description", 481 "type", 482 "permissions", 483 "uri", 484 "readPermission", 485 "writePermission", 486 "visible", 487 "skills", 488 "metadata" 489 ] 490 }, 491 "properties": { 492 "priority": { 493 "description": "Indicates the priority of the ability.Only for system application.This field is used for implicit query.Range from 0 to 10, default value is 0.", 494 "type": "integer", 495 "minimum": 0, 496 "maximum": 10 497 }, 498 "name": { 499 "description": "Indicates the name of the extension.", 500 "type": "string", 501 "maxLength": 127 502 }, 503 "srcEntrance": { 504 "description": "Indicates the js code path corresponding to the extension.", 505 "type": "string", 506 "maxLength": 127 507 }, 508 "icon": { 509 "description": "Indicates the index to the extension icon file.If the extension is configured as MainElement, the tag must be configured", 510 "type": "string", 511 "pattern": "^[$]media:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 512 }, 513 "label": { 514 "description": "Indicates the extension name visible to users. The tag value is set to the resource index of this name to support multiple languages.", 515 "type": "string", 516 "maxLength": 255, 517 "pattern": "^[$]string:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 518 }, 519 "description": { 520 "description": "Describes the extension. The value can be a string or a resource index to descriptions in multiple languages.This label can be left blank by default.", 521 "type": "string", 522 "maxLength": 255 523 }, 524 "type": { 525 "description": "Indicates the type of the extension.", 526 "type": "string", 527 "enum": [ 528 "form", 529 "workScheduler", 530 "inputMethod", 531 "service", 532 "accessibility", 533 "dataShare", 534 "fileShare", 535 "staticSubscriber", 536 "wallpaper" 537 ] 538 }, 539 "permissions": { 540 "description": "Indicates the permissions required for extensionAbilities of another application to call the current extension.", 541 "type": "array", 542 "uniqueItems": true, 543 "items": { 544 "type": "string", 545 "maxLength": 255 546 } 547 }, 548 "uri": { 549 "description": "Identifies the provided uri data for current extension.", 550 "type": "string", 551 "maxLength": 255 552 }, 553 "readPermission": { 554 "description": "Indicates the readPermission required for extensionAbilities of another application to call the current extension.", 555 "type": "string", 556 "maxLength": 255 557 }, 558 "writePermission": { 559 "description": "Indicates the writePermission required for extensionAbilities of another application to call the current extension.", 560 "type": "string", 561 "maxLength": 255 562 }, 563 "visible": { 564 "description": "Specifies whether the extension can be called by other applications.", 565 "type": "boolean", 566 "default": false 567 }, 568 "skills": { 569 "description": "Indicates the types of the intent that can be accepted by the extension.", 570 "type": "array", 571 "uniqueItems": true, 572 "items": { 573 "type": "object", 574 "propertyNames": { 575 "enum": [ 576 "actions", 577 "entities", 578 "uris" 579 ] 580 }, 581 "properties": { 582 "actions": { 583 "description": "Indicates the actions of the intent that can be accepted by the extension. The value can have one or multiple actions predefined in the system.", 584 "type": "array", 585 "uniqueItems": true, 586 "items": { 587 "type": "string" 588 } 589 }, 590 "entities": { 591 "description": "Indicates the entities of the intent that can be accepted by the extension, such as video and Home application. The value can have one or multiple entities either predefined in the system or be customized.", 592 "type": "array", 593 "uniqueItems": true, 594 "items": { 595 "type": "string" 596 } 597 }, 598 "uris": { 599 "description": "This tag identifies the collection of data specifications to be added to the Intent filter.", 600 "type": "array", 601 "uniqueItems": true, 602 "items": { 603 "anyOf": [ 604 { 605 "type": "object", 606 "propertyNames": { 607 "enum": [ 608 "scheme", 609 "host", 610 "port", 611 "pathStartWith", 612 "path", 613 "pathRegex", 614 "type" 615 ] 616 }, 617 "required": [ 618 "scheme" 619 ], 620 "properties": { 621 "scheme": { 622 "description": "This label is a string type.", 623 "type": "string" 624 }, 625 "host": { 626 "description": "This label is a string type.", 627 "type": "string" 628 }, 629 "port": { 630 "description": "This label is a string type.", 631 "type": "string" 632 }, 633 "pathStartWith": { 634 "description": "This label is a string type.", 635 "type": "string" 636 }, 637 "path": { 638 "description": "This label is a string type.", 639 "type": "string" 640 }, 641 "pathRegex": { 642 "description": "This label is a string type.", 643 "type": "string" 644 }, 645 "type": { 646 "description": "This label is a string type.", 647 "type": "string" 648 } 649 } 650 }, 651 { 652 "type": "object", 653 "propertyNames": { 654 "enum": [ 655 "type" 656 ] 657 }, 658 "properties": { 659 "type": { 660 "description": "This label is a string type.", 661 "type": "string" 662 } 663 } 664 } 665 ] 666 } 667 } 668 } 669 } 670 }, 671 "metadata": { 672 "description": "Indicates the metadata of the extension.", 673 "type": "array", 674 "items": { 675 "type": "object", 676 "propertyNames": { 677 "enum": [ 678 "name", 679 "value", 680 "resource" 681 ] 682 }, 683 "properties": { 684 "name": { 685 "description": "Indicates the key of a data element. The value is a string with a maximum of 255 bytes.", 686 "type": "string", 687 "maxLength": 255 688 }, 689 "value": { 690 "description": "Indicates the value of a data element. The value is a string with a maximum of 255 bytes.", 691 "type": "string", 692 "maxLength": 255 693 }, 694 "resource": { 695 "description": "Indicates the resource of a data element.", 696 "type": "string", 697 "pattern": "^[$]profile:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$", 698 "maxLength": 255 699 } 700 } 701 } 702 } 703 } 704 } 705 }, 706 "definePermissions": { 707 "description": "Indicates the permissions defined by the application.", 708 "type": "array", 709 "uniqueItems": true, 710 "items": { 711 "type": "object", 712 "propertyNames": { 713 "enum": [ 714 "name", 715 "grantMode", 716 "availableLevel", 717 "provisionEnable", 718 "distributedSceneEnable", 719 "label", 720 "description" 721 ] 722 }, 723 "required": [ 724 "name" 725 ], 726 "properties": { 727 "name": { 728 "description": "Specifies the permission name. The value is a character string.", 729 "type": "string" 730 }, 731 "grantMode": { 732 "description": "This tag identifies the permission granting mode.", 733 "type": "string", 734 "enum": [ 735 "system_grant", 736 "user_grant" 737 ], 738 "default": "system_grant" 739 }, 740 "availableLevel": { 741 "description": "This tag identifies the permission level.", 742 "type": "string", 743 "enum": [ 744 "system_core", 745 "system_basic", 746 "normal" 747 ], 748 "default": "normal" 749 }, 750 "provisionEnable": { 751 "description": "Specifies whether to support the certificate method to apply for permission.", 752 "type": "boolean", 753 "default": true 754 }, 755 "distributedSceneEnable": { 756 "description": "Specifies whether to support the use of this permission in distributed scenarios.", 757 "type": "boolean", 758 "default": false 759 }, 760 "label": { 761 "description": "This tag identifies the short description of the permission.", 762 "type": "string", 763 "pattern": "^[$]string:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 764 }, 765 "description": { 766 "description": "This tag indicates the detailed description of the permission.", 767 "type": "string" 768 } 769 } 770 } 771 }, 772 "requestPermissions": { 773 "description": "Indicates the permissions that the application applies for from the system before its running.This label can be left blank by default.", 774 "type": "array", 775 "items": { 776 "type": "object", 777 "propertyNames": { 778 "enum": [ 779 "name", 780 "reason", 781 "usedScene" 782 ] 783 }, 784 "required": [ 785 "name" 786 ], 787 "properties": { 788 "name": { 789 "description": "Specifies the permission name to be used.", 790 "type": "string" 791 }, 792 "reason": { 793 "description": "Describe the reason for applying for the permission.", 794 "type": "string", 795 "pattern": "^[$]string:[0-9a-zA-Z_.]+|(?=.*[{])(?=.*[}])[0-9a-zA-Z_.{}]+$" 796 }, 797 "usedScene": { 798 "description": "This section describes the scenarios and timing of permission usage.", 799 "type": "object", 800 "propertyNames": { 801 "enum": [ 802 "abilities", 803 "when" 804 ] 805 }, 806 "properties": { 807 "abilities": { 808 "description": "This tag identifies the abilities that need the permission.", 809 "type": "array", 810 "uniqueItems": true, 811 "items": { 812 "type": "string" 813 } 814 }, 815 "when": { 816 "description": "This tag identifies the time when the permission is used.", 817 "type": "string", 818 "enum": [ 819 "inuse", 820 "always" 821 ] 822 } 823 } 824 } 825 } 826 } 827 }, 828 "testRunner": { 829 "description": "This tag is used for configure the test properties.", 830 "type":"object", 831 "required": [ 832 "name", 833 "srcPath" 834 ], 835 "propertyNames": { 836 "enum": [ 837 "name", 838 "srcPath" 839 ] 840 }, 841 "properties":{ 842 "name": { 843 "description": "Indicates the name of testRunner, The value is a string with a maximum of 255 bytes", 844 "type": "string", 845 "maxLength": 255 846 }, 847 "srcPath": { 848 "description": "Indicates the srcPath testRunner, The value is a string with a maximum of 255 bytes", 849 "type": "string", 850 "maxLength": 255 851 } 852 } 853 } 854 } 855 } 856 } 857}