@blocklet/constant 1.16.23-beta-f85576a6 → 1.16.23-beta-aeb9f5bd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +7 -0
  2. package/index.js +41 -0
  3. package/package.json +5 -5
package/index.d.ts CHANGED
@@ -825,6 +825,13 @@ export declare const BlockletInternalEvents: Readonly<{
825
825
  componentConfigChanged: "blocklet._componentConfigChanged";
826
826
  componentsUpdated: "blocklet.componentsUpdated";
827
827
  }>;
828
+ export declare const TeamEvents: Readonly<{
829
+ userAdded: "user.added";
830
+ userRemoved: "user.removed";
831
+ userUpdated: "user.updated";
832
+ userProfileUpdated: "user.profile.updated";
833
+ userPermissionUpdated: "user.permission.updated";
834
+ }>;
828
835
  export declare const BLOCKLET_PLATFORMS: string[];
829
836
  export declare const BLOCKLET_ARCHITECTURES: string[];
830
837
  export declare const BLOCKLET_MODES: Readonly<{
package/index.js CHANGED
@@ -77,6 +77,7 @@ __export(lib_exports, {
77
77
  RESTORE_PROGRESS_STATUS: () => RESTORE_PROGRESS_STATUS,
78
78
  SUPPORTED_LANGUAGES: () => languages_default,
79
79
  SUSPENDED_REASON: () => SUSPENDED_REASON,
80
+ TeamEvents: () => TeamEvents,
80
81
  baseLanguages: () => baseLanguages,
81
82
  fromBlockletSource: () => fromBlockletSource,
82
83
  fromBlockletStatus: () => fromBlockletStatus,
@@ -853,6 +854,7 @@ var BlockletStatus = Object.freeze({
853
854
  added: 0,
854
855
  downloading: 1,
855
856
  downloaded: 2,
857
+ // Deprecated
856
858
  installing: 3,
857
859
  installed: 4,
858
860
  starting: 5,
@@ -862,6 +864,7 @@ var BlockletStatus = Object.freeze({
862
864
  error: 9,
863
865
  upgrading: 10,
864
866
  restarting: 11,
867
+ // Deprecated
865
868
  corrupted: 12,
866
869
  waiting: 13,
867
870
  deleted: 14
@@ -876,33 +879,50 @@ var SUSPENDED_REASON = {
876
879
  var fromBlockletStatus = fromEntry(BlockletStatus);
877
880
  var toBlockletStatus = toEntry(BlockletStatus);
878
881
  var BlockletSource = Object.freeze({
882
+ // Installed from Blocklet Store
879
883
  registry: 0,
884
+ // Installed from local development source folder
880
885
  local: 1,
886
+ // Installed from uploading bundle directly
881
887
  upload: 2,
888
+ // Installed from a url (similar to Blocklet Store)
882
889
  url: 3,
890
+ // Installed by custom creation
883
891
  custom: 4
884
892
  });
885
893
  var fromBlockletSource = fromEntry(BlockletSource);
886
894
  var toBlockletSource = toEntry(BlockletSource);
887
895
  var BlockletGroup = Object.freeze({
896
+ // Only static website
897
+ // The website is served by by Blocklet Server at runtime
888
898
  static: "static",
899
+ // The runtime instance is provided by its own backend server
889
900
  dapp: "dapp",
890
901
  starter: false,
902
+ // deprecated
903
+ // This type is used to combine other component blocklets
904
+ // No instance will be spawned at runtime
891
905
  gateway: "gateway",
906
+ // This type is used to pack other blocklets
907
+ // No instance will be spawned at runtime
908
+ // The difference is that a pack is a component in an app, whereas a gateway is an app itself.
892
909
  pack: "pack"
893
910
  });
894
911
  var BLOCKLET_GROUPS = ["dapp", "static", "gateway", "pack"];
895
912
  var BlockletEvents = Object.freeze({
913
+ // status updated
896
914
  added: "blocklet.added",
897
915
  downloadFailed: "blocklet.downloadFailed",
898
916
  installed: "blocklet.installed",
899
917
  installFailed: "blocklet.installFailed",
900
918
  upgraded: "blocklet.upgraded",
919
+ // only for internal use (refresh router)
901
920
  removed: "blocklet.removed",
902
921
  started: "blocklet.started",
903
922
  startFailed: "blocklet.startFailed",
904
923
  stopped: "blocklet.stopped",
905
924
  reloaded: "blocklet.reloaded",
925
+ // Deprecated
906
926
  statusChange: "blocklet.statusChange",
907
927
  dataCleaned: "blocklet.dataCleaned",
908
928
  componentInstalled: "blocklet.componentInstalled",
@@ -910,17 +930,23 @@ var BlockletEvents = Object.freeze({
910
930
  componentUpgraded: "blocklet.componentUpgraded",
911
931
  componentUpgradeFailed: "blocklet.componentUpgradeFailed",
912
932
  componentRemoved: "blocklet.componentRemoved",
933
+ // 备份还原进度
913
934
  backupProgress: "blocklet.backupProgress",
914
935
  restoreProgress: "blocklet.restoreProgress",
915
936
  downloadBundleProgress: "blocklet.downloadBundleProgress",
937
+ // state updated
916
938
  updated: "blocklet.updated",
917
939
  domainStatus: "blocklet.domainStatus",
918
940
  storeChange: "blocklet.storeChange",
919
941
  appDidChanged: "blocklet.appDidChanged",
942
+ // purchase
920
943
  purchaseChange: "blocklet.purchaseChange",
944
+ // cert
921
945
  certError: "blocklet.certError",
922
946
  certIssued: "blocklet.certIssued",
947
+ // did-space
923
948
  spaceConnected: "blocklet.spaceConnected",
949
+ // install by nft
924
950
  nftConsumed: "blocklet.nftConsumed"
925
951
  });
926
952
  var BlockletInternalEvents = Object.freeze({
@@ -934,6 +960,14 @@ var BlockletInternalEvents = Object.freeze({
934
960
  componentRemoved: "blocklet._componentRemoved",
935
961
  componentConfigChanged: "blocklet._componentConfigChanged",
936
962
  componentsUpdated: "blocklet.componentsUpdated"
963
+ // deprecated, for backward compatibility
964
+ });
965
+ var TeamEvents = Object.freeze({
966
+ userAdded: "user.added",
967
+ userRemoved: "user.removed",
968
+ userUpdated: "user.updated",
969
+ userProfileUpdated: "user.profile.updated",
970
+ userPermissionUpdated: "user.permission.updated"
937
971
  });
938
972
  var BLOCKLET_PLATFORMS = ["aix", "darwin", "freebsd", "linux", "openbsd", "sunos", "win32"];
939
973
  var BLOCKLET_ARCHITECTURES = [
@@ -1011,11 +1045,13 @@ var BLOCKLET_LATEST_SPEC_VERSION = "1.2.8";
1011
1045
  var BLOCKLET_LATEST_REQUIREMENT_SERVER = ">=1.7.0";
1012
1046
  var BLOCKLET_LATEST_REQUIREMENT_ABTNODE = ">=1.5.15";
1013
1047
  var BLOCKLET_CONFIGURABLE_KEY = {
1048
+ // APP Config Key that start with BLOCKLET_ cannot set to child component
1014
1049
  BLOCKLET_CLUSTER_SIZE: "BLOCKLET_CLUSTER_SIZE",
1015
1050
  BLOCKLET_APP_NAME: "BLOCKLET_APP_NAME",
1016
1051
  BLOCKLET_APP_DESCRIPTION: "BLOCKLET_APP_DESCRIPTION",
1017
1052
  BLOCKLET_APP_SK: "BLOCKLET_APP_SK",
1018
1053
  BLOCKLET_APP_LOGO: "BLOCKLET_APP_LOGO",
1054
+ // deprecated
1019
1055
  BLOCKLET_APP_LOGO_SQUARE: "BLOCKLET_APP_LOGO_SQUARE",
1020
1056
  BLOCKLET_APP_LOGO_RECT: "BLOCKLET_APP_LOGO_RECT",
1021
1057
  BLOCKLET_APP_LOGO_FAVICON: "BLOCKLET_APP_LOGO_FAVICON",
@@ -1023,15 +1059,19 @@ var BLOCKLET_CONFIGURABLE_KEY = {
1023
1059
  BLOCKLET_APP_LANGUAGES: "BLOCKLET_APP_LANGUAGES",
1024
1060
  BLOCKLET_PASSPORT_COLOR: "BLOCKLET_PASSPORT_COLOR",
1025
1061
  BLOCKLET_WALLET_TYPE: "BLOCKLET_WALLET_TYPE",
1062
+ // deprecated
1026
1063
  BLOCKLET_DELETABLE: "BLOCKLET_DELETABLE",
1027
1064
  BLOCKLET_APP_COPYRIGHT_OWNER: "BLOCKLET_APP_COPYRIGHT_OWNER",
1028
1065
  BLOCKLET_APP_COPYRIGHT_YEAR: "BLOCKLET_APP_COPYRIGHT_YEAR",
1066
+ // 应用使用 DID Spaces 存储 文件/nft 的时候使用的环境变量
1029
1067
  BLOCKLET_APP_SPACE_ENDPOINT: "BLOCKLET_APP_SPACE_ENDPOINT",
1030
1068
  BLOCKLET_APP_SPACES_URL: "BLOCKLET_APP_SPACES_URL",
1069
+ // 应用使用 DID Spaces 备份的时候使用的环境变量
1031
1070
  BLOCKLET_APP_BACKUP_ENDPOINT: "BLOCKLET_APP_BACKUP_ENDPOINT",
1032
1071
  BLOCKLET_APP_CHAIN_HOST: "BLOCKLET_APP_CHAIN_HOST",
1033
1072
  BLOCKLET_APP_CHAIN_TYPE: "BLOCKLET_APP_CHAIN_TYPE",
1034
1073
  BLOCKLET_APP_CHAIN_ID: "BLOCKLET_APP_CHAIN_ID",
1074
+ // Component Key
1035
1075
  COMPONENT_ACCESS_WHO: "COMPONENT_ACCESS_WHO"
1036
1076
  };
1037
1077
  var BLOCKLET_APP_SPACE_ENDPOINTS = {
@@ -1132,6 +1172,7 @@ var MAX_TITLE_LENGTH = 40;
1132
1172
  RESTORE_PROGRESS_STATUS,
1133
1173
  SUPPORTED_LANGUAGES,
1134
1174
  SUSPENDED_REASON,
1175
+ TeamEvents,
1135
1176
  baseLanguages,
1136
1177
  fromBlockletSource,
1137
1178
  fromBlockletStatus,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.23-beta-f85576a6",
6
+ "version": "1.16.23-beta-aeb9f5bd",
7
7
  "description": "Blocklet constants",
8
8
  "main": "index.js",
9
9
  "type": "commonjs",
@@ -24,16 +24,16 @@
24
24
  "license": "Apache-2.0",
25
25
  "devDependencies": {
26
26
  "@arcblock/eslint-config-ts": "^0.2.4",
27
- "@types/jest": "^29.2.0",
27
+ "@types/jest": "^29.5.11",
28
28
  "@types/node": "^18.11.0",
29
29
  "@typescript-eslint/eslint-plugin": "^5.40.1",
30
30
  "@typescript-eslint/parser": "^5.40.1",
31
31
  "dts-bundle-generator": "^9.2.3",
32
32
  "eslint": "^8.25.0",
33
- "jest": "^27.5.1",
33
+ "jest": "^29.7.0",
34
34
  "prettier": "^2.7.1",
35
- "ts-jest": "^27.1.5",
35
+ "ts-jest": "^29.1.1",
36
36
  "typescript": "^5.0.4"
37
37
  },
38
- "gitHead": "bac83a74944b4cef3ccb386277023caf0e1d5cd4"
38
+ "gitHead": "418cacd970d373aecc8706f8992e57369d394577"
39
39
  }