@blocklet/constant 1.16.21 → 1.16.22-beta-079a9053

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 (4) hide show
  1. package/index.d.ts +945 -0
  2. package/index.js +6 -6
  3. package/package.json +7 -6
  4. package/index.ts +0 -332
package/index.d.ts ADDED
@@ -0,0 +1,945 @@
1
+ // Generated by dts-bundle-generator v9.2.3
2
+
3
+ export declare const SUPPORTED_LANGUAGES: {
4
+ en: {
5
+ name: string;
6
+ nativeName: string;
7
+ };
8
+ es: {
9
+ name: string;
10
+ nativeName: string;
11
+ };
12
+ zh: {
13
+ name: string;
14
+ nativeName: string;
15
+ };
16
+ "zh-TW": {
17
+ name: string;
18
+ nativeName: string;
19
+ };
20
+ fr: {
21
+ name: string;
22
+ nativeName: string;
23
+ };
24
+ it: {
25
+ name: string;
26
+ nativeName: string;
27
+ };
28
+ ja: {
29
+ name: string;
30
+ nativeName: string;
31
+ };
32
+ ko: {
33
+ name: string;
34
+ nativeName: string;
35
+ };
36
+ pt: {
37
+ name: string;
38
+ nativeName: string;
39
+ };
40
+ ru: {
41
+ name: string;
42
+ nativeName: string;
43
+ };
44
+ ar: {
45
+ name: string;
46
+ nativeName: string;
47
+ };
48
+ de: {
49
+ name: string;
50
+ nativeName: string;
51
+ };
52
+ mn: {
53
+ name: string;
54
+ nativeName: string;
55
+ };
56
+ hi: {
57
+ name: string;
58
+ nativeName: string;
59
+ };
60
+ bn: {
61
+ name: string;
62
+ nativeName: string;
63
+ };
64
+ vi: {
65
+ name: string;
66
+ nativeName: string;
67
+ };
68
+ tr: {
69
+ name: string;
70
+ nativeName: string;
71
+ };
72
+ te: {
73
+ name: string;
74
+ nativeName: string;
75
+ };
76
+ ur: {
77
+ name: string;
78
+ nativeName: string;
79
+ };
80
+ mr: {
81
+ name: string;
82
+ nativeName: string;
83
+ };
84
+ pa: {
85
+ name: string;
86
+ nativeName: string;
87
+ };
88
+ aa: {
89
+ name: string;
90
+ nativeName: string;
91
+ };
92
+ ab: {
93
+ name: string;
94
+ nativeName: string;
95
+ };
96
+ ae: {
97
+ name: string;
98
+ nativeName: string;
99
+ };
100
+ af: {
101
+ name: string;
102
+ nativeName: string;
103
+ };
104
+ ak: {
105
+ name: string;
106
+ nativeName: string;
107
+ };
108
+ am: {
109
+ name: string;
110
+ nativeName: string;
111
+ };
112
+ an: {
113
+ name: string;
114
+ nativeName: string;
115
+ };
116
+ as: {
117
+ name: string;
118
+ nativeName: string;
119
+ };
120
+ av: {
121
+ name: string;
122
+ nativeName: string;
123
+ };
124
+ ay: {
125
+ name: string;
126
+ nativeName: string;
127
+ };
128
+ az: {
129
+ name: string;
130
+ nativeName: string;
131
+ };
132
+ ba: {
133
+ name: string;
134
+ nativeName: string;
135
+ };
136
+ be: {
137
+ name: string;
138
+ nativeName: string;
139
+ };
140
+ bg: {
141
+ name: string;
142
+ nativeName: string;
143
+ };
144
+ bi: {
145
+ name: string;
146
+ nativeName: string;
147
+ };
148
+ bm: {
149
+ name: string;
150
+ nativeName: string;
151
+ };
152
+ bo: {
153
+ name: string;
154
+ nativeName: string;
155
+ };
156
+ br: {
157
+ name: string;
158
+ nativeName: string;
159
+ };
160
+ bs: {
161
+ name: string;
162
+ nativeName: string;
163
+ };
164
+ ca: {
165
+ name: string;
166
+ nativeName: string;
167
+ };
168
+ ce: {
169
+ name: string;
170
+ nativeName: string;
171
+ };
172
+ ch: {
173
+ name: string;
174
+ nativeName: string;
175
+ };
176
+ co: {
177
+ name: string;
178
+ nativeName: string;
179
+ };
180
+ cr: {
181
+ name: string;
182
+ nativeName: string;
183
+ };
184
+ cs: {
185
+ name: string;
186
+ nativeName: string;
187
+ };
188
+ cu: {
189
+ name: string;
190
+ nativeName: string;
191
+ };
192
+ cv: {
193
+ name: string;
194
+ nativeName: string;
195
+ };
196
+ cy: {
197
+ name: string;
198
+ nativeName: string;
199
+ };
200
+ da: {
201
+ name: string;
202
+ nativeName: string;
203
+ };
204
+ dv: {
205
+ name: string;
206
+ nativeName: string;
207
+ };
208
+ dz: {
209
+ name: string;
210
+ nativeName: string;
211
+ };
212
+ ee: {
213
+ name: string;
214
+ nativeName: string;
215
+ };
216
+ el: {
217
+ name: string;
218
+ nativeName: string;
219
+ };
220
+ eo: {
221
+ name: string;
222
+ nativeName: string;
223
+ };
224
+ et: {
225
+ name: string;
226
+ nativeName: string;
227
+ };
228
+ eu: {
229
+ name: string;
230
+ nativeName: string;
231
+ };
232
+ fa: {
233
+ name: string;
234
+ nativeName: string;
235
+ };
236
+ ff: {
237
+ name: string;
238
+ nativeName: string;
239
+ };
240
+ fi: {
241
+ name: string;
242
+ nativeName: string;
243
+ };
244
+ fj: {
245
+ name: string;
246
+ nativeName: string;
247
+ };
248
+ fo: {
249
+ name: string;
250
+ nativeName: string;
251
+ };
252
+ fy: {
253
+ name: string;
254
+ nativeName: string;
255
+ };
256
+ ga: {
257
+ name: string;
258
+ nativeName: string;
259
+ };
260
+ gd: {
261
+ name: string;
262
+ nativeName: string;
263
+ };
264
+ gl: {
265
+ name: string;
266
+ nativeName: string;
267
+ };
268
+ gn: {
269
+ name: string;
270
+ nativeName: string;
271
+ };
272
+ gu: {
273
+ name: string;
274
+ nativeName: string;
275
+ };
276
+ gv: {
277
+ name: string;
278
+ nativeName: string;
279
+ };
280
+ ha: {
281
+ name: string;
282
+ nativeName: string;
283
+ };
284
+ he: {
285
+ name: string;
286
+ nativeName: string;
287
+ };
288
+ ho: {
289
+ name: string;
290
+ nativeName: string;
291
+ };
292
+ hr: {
293
+ name: string;
294
+ nativeName: string;
295
+ };
296
+ ht: {
297
+ name: string;
298
+ nativeName: string;
299
+ };
300
+ hu: {
301
+ name: string;
302
+ nativeName: string;
303
+ };
304
+ hy: {
305
+ name: string;
306
+ nativeName: string;
307
+ };
308
+ hz: {
309
+ name: string;
310
+ nativeName: string;
311
+ };
312
+ ia: {
313
+ name: string;
314
+ nativeName: string;
315
+ };
316
+ id: {
317
+ name: string;
318
+ nativeName: string;
319
+ };
320
+ ie: {
321
+ name: string;
322
+ nativeName: string;
323
+ };
324
+ ig: {
325
+ name: string;
326
+ nativeName: string;
327
+ };
328
+ ii: {
329
+ name: string;
330
+ nativeName: string;
331
+ };
332
+ ik: {
333
+ name: string;
334
+ nativeName: string;
335
+ };
336
+ io: {
337
+ name: string;
338
+ nativeName: string;
339
+ };
340
+ is: {
341
+ name: string;
342
+ nativeName: string;
343
+ };
344
+ iu: {
345
+ name: string;
346
+ nativeName: string;
347
+ };
348
+ jv: {
349
+ name: string;
350
+ nativeName: string;
351
+ };
352
+ ka: {
353
+ name: string;
354
+ nativeName: string;
355
+ };
356
+ kg: {
357
+ name: string;
358
+ nativeName: string;
359
+ };
360
+ ki: {
361
+ name: string;
362
+ nativeName: string;
363
+ };
364
+ kj: {
365
+ name: string;
366
+ nativeName: string;
367
+ };
368
+ kk: {
369
+ name: string;
370
+ nativeName: string;
371
+ };
372
+ kl: {
373
+ name: string;
374
+ nativeName: string;
375
+ };
376
+ km: {
377
+ name: string;
378
+ nativeName: string;
379
+ };
380
+ kn: {
381
+ name: string;
382
+ nativeName: string;
383
+ };
384
+ kr: {
385
+ name: string;
386
+ nativeName: string;
387
+ };
388
+ ks: {
389
+ name: string;
390
+ nativeName: string;
391
+ };
392
+ ku: {
393
+ name: string;
394
+ nativeName: string;
395
+ };
396
+ kv: {
397
+ name: string;
398
+ nativeName: string;
399
+ };
400
+ kw: {
401
+ name: string;
402
+ nativeName: string;
403
+ };
404
+ ky: {
405
+ name: string;
406
+ nativeName: string;
407
+ };
408
+ la: {
409
+ name: string;
410
+ nativeName: string;
411
+ };
412
+ lb: {
413
+ name: string;
414
+ nativeName: string;
415
+ };
416
+ lg: {
417
+ name: string;
418
+ nativeName: string;
419
+ };
420
+ li: {
421
+ name: string;
422
+ nativeName: string;
423
+ };
424
+ ln: {
425
+ name: string;
426
+ nativeName: string;
427
+ };
428
+ lo: {
429
+ name: string;
430
+ nativeName: string;
431
+ };
432
+ lt: {
433
+ name: string;
434
+ nativeName: string;
435
+ };
436
+ lu: {
437
+ name: string;
438
+ nativeName: string;
439
+ };
440
+ lv: {
441
+ name: string;
442
+ nativeName: string;
443
+ };
444
+ mg: {
445
+ name: string;
446
+ nativeName: string;
447
+ };
448
+ mh: {
449
+ name: string;
450
+ nativeName: string;
451
+ };
452
+ mi: {
453
+ name: string;
454
+ nativeName: string;
455
+ };
456
+ mk: {
457
+ name: string;
458
+ nativeName: string;
459
+ };
460
+ ml: {
461
+ name: string;
462
+ nativeName: string;
463
+ };
464
+ ms: {
465
+ name: string;
466
+ nativeName: string;
467
+ };
468
+ mt: {
469
+ name: string;
470
+ nativeName: string;
471
+ };
472
+ my: {
473
+ name: string;
474
+ nativeName: string;
475
+ };
476
+ na: {
477
+ name: string;
478
+ nativeName: string;
479
+ };
480
+ nb: {
481
+ name: string;
482
+ nativeName: string;
483
+ };
484
+ nd: {
485
+ name: string;
486
+ nativeName: string;
487
+ };
488
+ ne: {
489
+ name: string;
490
+ nativeName: string;
491
+ };
492
+ ng: {
493
+ name: string;
494
+ nativeName: string;
495
+ };
496
+ nl: {
497
+ name: string;
498
+ nativeName: string;
499
+ };
500
+ nn: {
501
+ name: string;
502
+ nativeName: string;
503
+ };
504
+ no: {
505
+ name: string;
506
+ nativeName: string;
507
+ };
508
+ nr: {
509
+ name: string;
510
+ nativeName: string;
511
+ };
512
+ nv: {
513
+ name: string;
514
+ nativeName: string;
515
+ };
516
+ ny: {
517
+ name: string;
518
+ nativeName: string;
519
+ };
520
+ oc: {
521
+ name: string;
522
+ nativeName: string;
523
+ };
524
+ oj: {
525
+ name: string;
526
+ nativeName: string;
527
+ };
528
+ om: {
529
+ name: string;
530
+ nativeName: string;
531
+ };
532
+ or: {
533
+ name: string;
534
+ nativeName: string;
535
+ };
536
+ os: {
537
+ name: string;
538
+ nativeName: string;
539
+ };
540
+ pi: {
541
+ name: string;
542
+ nativeName: string;
543
+ };
544
+ pl: {
545
+ name: string;
546
+ nativeName: string;
547
+ };
548
+ ps: {
549
+ name: string;
550
+ nativeName: string;
551
+ };
552
+ qu: {
553
+ name: string;
554
+ nativeName: string;
555
+ };
556
+ rm: {
557
+ name: string;
558
+ nativeName: string;
559
+ };
560
+ rn: {
561
+ name: string;
562
+ nativeName: string;
563
+ };
564
+ ro: {
565
+ name: string;
566
+ nativeName: string;
567
+ };
568
+ rw: {
569
+ name: string;
570
+ nativeName: string;
571
+ };
572
+ sa: {
573
+ name: string;
574
+ nativeName: string;
575
+ };
576
+ sc: {
577
+ name: string;
578
+ nativeName: string;
579
+ };
580
+ sd: {
581
+ name: string;
582
+ nativeName: string;
583
+ };
584
+ se: {
585
+ name: string;
586
+ nativeName: string;
587
+ };
588
+ sg: {
589
+ name: string;
590
+ nativeName: string;
591
+ };
592
+ si: {
593
+ name: string;
594
+ nativeName: string;
595
+ };
596
+ sk: {
597
+ name: string;
598
+ nativeName: string;
599
+ };
600
+ sl: {
601
+ name: string;
602
+ nativeName: string;
603
+ };
604
+ sm: {
605
+ name: string;
606
+ nativeName: string;
607
+ };
608
+ sn: {
609
+ name: string;
610
+ nativeName: string;
611
+ };
612
+ so: {
613
+ name: string;
614
+ nativeName: string;
615
+ };
616
+ sq: {
617
+ name: string;
618
+ nativeName: string;
619
+ };
620
+ sr: {
621
+ name: string;
622
+ nativeName: string;
623
+ };
624
+ ss: {
625
+ name: string;
626
+ nativeName: string;
627
+ };
628
+ st: {
629
+ name: string;
630
+ nativeName: string;
631
+ };
632
+ su: {
633
+ name: string;
634
+ nativeName: string;
635
+ };
636
+ sv: {
637
+ name: string;
638
+ nativeName: string;
639
+ };
640
+ sw: {
641
+ name: string;
642
+ nativeName: string;
643
+ };
644
+ ta: {
645
+ name: string;
646
+ nativeName: string;
647
+ };
648
+ tg: {
649
+ name: string;
650
+ nativeName: string;
651
+ };
652
+ th: {
653
+ name: string;
654
+ nativeName: string;
655
+ };
656
+ ti: {
657
+ name: string;
658
+ nativeName: string;
659
+ };
660
+ tk: {
661
+ name: string;
662
+ nativeName: string;
663
+ };
664
+ tl: {
665
+ name: string;
666
+ nativeName: string;
667
+ };
668
+ tn: {
669
+ name: string;
670
+ nativeName: string;
671
+ };
672
+ to: {
673
+ name: string;
674
+ nativeName: string;
675
+ };
676
+ ts: {
677
+ name: string;
678
+ nativeName: string;
679
+ };
680
+ tt: {
681
+ name: string;
682
+ nativeName: string;
683
+ };
684
+ tw: {
685
+ name: string;
686
+ nativeName: string;
687
+ };
688
+ ty: {
689
+ name: string;
690
+ nativeName: string;
691
+ };
692
+ ug: {
693
+ name: string;
694
+ nativeName: string;
695
+ };
696
+ uk: {
697
+ name: string;
698
+ nativeName: string;
699
+ };
700
+ uz: {
701
+ name: string;
702
+ nativeName: string;
703
+ };
704
+ ve: {
705
+ name: string;
706
+ nativeName: string;
707
+ };
708
+ vo: {
709
+ name: string;
710
+ nativeName: string;
711
+ };
712
+ wa: {
713
+ name: string;
714
+ nativeName: string;
715
+ };
716
+ wo: {
717
+ name: string;
718
+ nativeName: string;
719
+ };
720
+ xh: {
721
+ name: string;
722
+ nativeName: string;
723
+ };
724
+ yi: {
725
+ name: string;
726
+ nativeName: string;
727
+ };
728
+ yo: {
729
+ name: string;
730
+ nativeName: string;
731
+ };
732
+ za: {
733
+ name: string;
734
+ nativeName: string;
735
+ };
736
+ zu: {
737
+ name: string;
738
+ nativeName: string;
739
+ };
740
+ };
741
+ export declare const baseLanguages: {
742
+ code: string;
743
+ name: string;
744
+ }[];
745
+ export type StringNumberObject = {
746
+ [key: string]: number;
747
+ };
748
+ export declare const BlockletStatus: Readonly<{
749
+ added: 0;
750
+ downloading: 1;
751
+ downloaded: 2;
752
+ installing: 3;
753
+ installed: 4;
754
+ starting: 5;
755
+ running: 6;
756
+ stopping: 7;
757
+ stopped: 8;
758
+ error: 9;
759
+ upgrading: 10;
760
+ restarting: 11;
761
+ corrupted: 12;
762
+ waiting: 13;
763
+ deleted: 14;
764
+ }>;
765
+ export declare const BLOCKLET_CONTROLLER_STATUS: {
766
+ normal: number;
767
+ suspended: number;
768
+ };
769
+ export declare const SUSPENDED_REASON: {
770
+ expired: string;
771
+ };
772
+ export declare const fromBlockletStatus: (v: number | string) => string;
773
+ export declare const toBlockletStatus: (v: number | string) => string;
774
+ export declare const BlockletSource: StringNumberObject;
775
+ export declare const fromBlockletSource: (v: number | string) => string;
776
+ export declare const toBlockletSource: (v: number | string) => string;
777
+ export declare const BlockletGroup: Readonly<{
778
+ static: "static";
779
+ dapp: "dapp";
780
+ starter: false;
781
+ gateway: "gateway";
782
+ pack: "pack";
783
+ }>;
784
+ export declare const BLOCKLET_GROUPS: string[];
785
+ export declare const BlockletEvents: Readonly<{
786
+ added: "blocklet.added";
787
+ downloadFailed: "blocklet.downloadFailed";
788
+ installed: "blocklet.installed";
789
+ installFailed: "blocklet.installFailed";
790
+ upgraded: "blocklet.upgraded";
791
+ removed: "blocklet.removed";
792
+ started: "blocklet.started";
793
+ startFailed: "blocklet.startFailed";
794
+ stopped: "blocklet.stopped";
795
+ reloaded: "blocklet.reloaded";
796
+ statusChange: "blocklet.statusChange";
797
+ dataCleaned: "blocklet.dataCleaned";
798
+ componentInstalled: "blocklet.componentInstalled";
799
+ componentInstallFailed: "blocklet.componentInstallFailed";
800
+ componentUpgraded: "blocklet.componentUpgraded";
801
+ componentUpgradeFailed: "blocklet.componentUpgradeFailed";
802
+ componentRemoved: "blocklet.componentRemoved";
803
+ backupProgress: "blocklet.backupProgress";
804
+ restoreProgress: "blocklet.restoreProgress";
805
+ downloadBundleProgress: "blocklet.downloadBundleProgress";
806
+ updated: "blocklet.updated";
807
+ domainStatus: "blocklet.domainStatus";
808
+ storeChange: "blocklet.storeChange";
809
+ appDidChanged: "blocklet.appDidChanged";
810
+ purchaseChange: "blocklet.purchaseChange";
811
+ certError: "blocklet.certError";
812
+ certIssued: "blocklet.certIssued";
813
+ spaceConnected: "blocklet.spaceConnected";
814
+ nftConsumed: "blocklet.nftConsumed";
815
+ }>;
816
+ export declare const BlockletInternalEvents: Readonly<{
817
+ appConfigChanged: "blocklet.appConfigChanged";
818
+ appSettingChanged: "blocklet.appSettingChanged";
819
+ componentInstalled: "blocklet._componentInstalled";
820
+ componentUpgraded: "blocklet._componentUpgraded";
821
+ componentUpdated: "blocklet._componentUpdated";
822
+ componentStarted: "blocklet._componentStarted";
823
+ componentStopped: "blocklet._componentStopped";
824
+ componentRemoved: "blocklet._componentRemoved";
825
+ componentConfigChanged: "blocklet._componentConfigChanged";
826
+ componentsUpdated: "blocklet.componentsUpdated";
827
+ }>;
828
+ export declare const BLOCKLET_PLATFORMS: string[];
829
+ export declare const BLOCKLET_ARCHITECTURES: string[];
830
+ export declare const BLOCKLET_MODES: Readonly<{
831
+ PRODUCTION: "production";
832
+ DEVELOPMENT: "development";
833
+ }>;
834
+ export declare const BLOCKLET_FACTORY_SHARES: {
835
+ developer: number;
836
+ store: number;
837
+ };
838
+ export declare const BLOCKLET_INTERFACE_TYPE_WEB = "web";
839
+ export declare const BLOCKLET_INTERFACE_TYPE_SERVICE = "service";
840
+ export declare const BLOCKLET_INTERFACE_TYPE_WELLKNOWN = "wellknown";
841
+ export declare const BLOCKLET_INTERFACE_TYPES: string[];
842
+ export declare const BLOCKLET_INTERFACE_PUBLIC = "publicUrl";
843
+ export declare const BLOCKLET_INTERFACE_WELLKNOWN = "wellknownUrl";
844
+ export declare const BLOCKLET_UI_INTERFACES: string[];
845
+ export declare const BLOCKLET_STANDARD_INTERFACES: string[];
846
+ export declare const BLOCKLET_INTERFACE_PROTOCOL_HTTP = "http";
847
+ export declare const BLOCKLET_INTERFACE_PROTOCOL_TCP = "tcp";
848
+ export declare const BLOCKLET_INTERFACE_PROTOCOL_UDP = "udp";
849
+ export declare const BLOCKLET_INTERFACE_PROTOCOLS: string[];
850
+ export declare const BLOCKLET_DYNAMIC_PATH_PREFIX = "*";
851
+ export declare const BLOCKLET_DEFAULT_PORT_NAME = "BLOCKLET_PORT";
852
+ export declare const BLOCKLET_DEFAULT_PATH_REWRITE = "/";
853
+ export declare const BLOCKLET_RELEASE_FOLDER = ".blocklet/release";
854
+ export declare const BLOCKLET_RELEASE_FILE = "blocklet.json";
855
+ export declare const BLOCKLET_BUNDLE_FOLDER = ".blocklet/bundle";
856
+ export declare const BLOCKLET_RELEASE_FOLDER_NAME = "release";
857
+ export declare const BLOCKLET_BUNDLE_FOLDER_NAME = "bundle";
858
+ export declare const BLOCKLET_BUNDLE_FILE = "blocklet.zip";
859
+ export declare const BLOCKLET_ENTRY_FILE = "blocklet.js";
860
+ export declare const BLOCKLET_META_FILE = "blocklet.yml";
861
+ export declare const BLOCKLET_META_FILE_ALT = "blocklet.yaml";
862
+ export declare const BLOCKLET_PREFERENCE_FILE = "blocklet.prefs.json";
863
+ export declare const BLOCKLET_PREFERENCE_PREFIX = "prefs.";
864
+ export declare const BLOCKLET_RESOURCE_DIR = "resources";
865
+ export declare const PROJECT: {
866
+ DIR: string;
867
+ RELEASE_DIR: string;
868
+ RESOURCE_DIR: string;
869
+ ASSET_DIR: string;
870
+ TYPES: {
871
+ resource: string;
872
+ pack: string;
873
+ };
874
+ RELEASE_STATUS: {
875
+ draft: string;
876
+ published: string;
877
+ };
878
+ MAX_NOTE_LENGTH: number;
879
+ MAX_INTRO_LENGTH: number;
880
+ };
881
+ export declare const BLOCKLET_DEFAULT_VERSION = "1.0.0";
882
+ export declare const BLOCKLET_UPLOADS_DIR = "__uploads";
883
+ export declare const BLOCKLET_LATEST_SPEC_VERSION = "1.2.8";
884
+ export declare const BLOCKLET_LATEST_REQUIREMENT_SERVER = ">=1.7.0";
885
+ export declare const BLOCKLET_LATEST_REQUIREMENT_ABTNODE = ">=1.5.15";
886
+ export declare const BLOCKLET_CONFIGURABLE_KEY: {
887
+ BLOCKLET_CLUSTER_SIZE: string;
888
+ BLOCKLET_APP_NAME: string;
889
+ BLOCKLET_APP_DESCRIPTION: string;
890
+ BLOCKLET_APP_SK: string;
891
+ BLOCKLET_APP_LOGO: string;
892
+ BLOCKLET_APP_LOGO_SQUARE: string;
893
+ BLOCKLET_APP_LOGO_RECT: string;
894
+ BLOCKLET_APP_LOGO_FAVICON: string;
895
+ BLOCKLET_APP_URL: string;
896
+ BLOCKLET_APP_LANGUAGES: string;
897
+ BLOCKLET_PASSPORT_COLOR: string;
898
+ BLOCKLET_WALLET_TYPE: string;
899
+ BLOCKLET_DELETABLE: string;
900
+ BLOCKLET_APP_COPYRIGHT_OWNER: string;
901
+ BLOCKLET_APP_COPYRIGHT_YEAR: string;
902
+ BLOCKLET_APP_SPACE_ENDPOINT: string;
903
+ BLOCKLET_APP_SPACES_URL: string;
904
+ BLOCKLET_APP_BACKUP_ENDPOINT: string;
905
+ BLOCKLET_APP_CHAIN_HOST: string;
906
+ BLOCKLET_APP_CHAIN_TYPE: string;
907
+ BLOCKLET_APP_CHAIN_ID: string;
908
+ COMPONENT_ACCESS_WHO: string;
909
+ };
910
+ export declare const BLOCKLET_APP_SPACE_ENDPOINTS: {
911
+ REQUIRED: string;
912
+ OPTIONAL: string;
913
+ };
914
+ export declare const CHAIN_INFO_CONFIG: {
915
+ CHAIN_TYPE: string[];
916
+ CHAIN_ID: string[];
917
+ CHAIN_HOST: string[];
918
+ };
919
+ export declare const RESTORE_PROGRESS_STATUS: {
920
+ waiting: number;
921
+ start: number;
922
+ importData: number;
923
+ downloading: number;
924
+ importDataSuccess: number;
925
+ installing: number;
926
+ completed: number;
927
+ error: number;
928
+ };
929
+ export declare const CHAIN_PROP_MAP: {
930
+ BLOCKLET_APP_CHAIN_HOST: string;
931
+ BLOCKLET_APP_CHAIN_ID: string;
932
+ BLOCKLET_APP_CHAIN_TYPE: string;
933
+ };
934
+ export declare const CHAIN_PROP_MAP_REVERSE: {};
935
+ export declare const LOGIN_PROVIDER: {
936
+ AUTH0: string;
937
+ WALLET: string;
938
+ NFT: string;
939
+ };
940
+ export declare const APP_CONFIG_DIR = "/.config";
941
+ export declare const APP_CONFIG_FILE_PATH = "/.config/config.json";
942
+ export declare const COMPONENT_ENV_FILE_NAME = "env";
943
+ export declare const MAX_TITLE_LENGTH = 40;
944
+
945
+ export {};
package/index.js CHANGED
@@ -16,9 +16,9 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // index.ts
20
- var constant_exports = {};
21
- __export(constant_exports, {
19
+ // lib/index.ts
20
+ var lib_exports = {};
21
+ __export(lib_exports, {
22
22
  APP_CONFIG_DIR: () => APP_CONFIG_DIR,
23
23
  APP_CONFIG_FILE_PATH: () => APP_CONFIG_FILE_PATH,
24
24
  BLOCKLET_APP_SPACE_ENDPOINTS: () => BLOCKLET_APP_SPACE_ENDPOINTS,
@@ -82,9 +82,9 @@ __export(constant_exports, {
82
82
  toBlockletSource: () => toBlockletSource,
83
83
  toBlockletStatus: () => toBlockletStatus
84
84
  });
85
- module.exports = __toCommonJS(constant_exports);
85
+ module.exports = __toCommonJS(lib_exports);
86
86
 
87
- // languages.ts
87
+ // lib/languages.ts
88
88
  var SUPPORTED_LANGUAGES = {
89
89
  en: {
90
90
  name: "English",
@@ -842,7 +842,7 @@ var baseLanguages = [
842
842
  ];
843
843
  var languages_default = SUPPORTED_LANGUAGES;
844
844
 
845
- // index.ts
845
+ // lib/index.ts
846
846
  var fromEntry = (entries) => (v) => {
847
847
  const match = Object.entries(entries).find((x) => x[1] === Number(v));
848
848
  return match ? match[0] : "unknown";
package/package.json CHANGED
@@ -3,22 +3,22 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.21",
6
+ "version": "1.16.22-beta-079a9053",
7
7
  "description": "Blocklet constants",
8
8
  "main": "index.js",
9
9
  "type": "commonjs",
10
- "types": "index.ts",
10
+ "types": "index.d.ts",
11
11
  "files": [
12
12
  "index.js",
13
- "index.ts"
13
+ "index.d.ts"
14
14
  ],
15
15
  "scripts": {
16
- "lint": "eslint tests index.ts",
16
+ "lint": "eslint tests lib",
17
17
  "lint:fix": "npm run lint -- --fix",
18
18
  "test": "NODE_ENV=test node tools/jest.js",
19
19
  "coverage": "npm run test -- --coverage",
20
20
  "clean": "rm -f index.d.ts index.js",
21
- "build": "npm run clean && npx esbuild index.ts --bundle --outfile=index.js --platform=node --format=cjs"
21
+ "build": "npm run clean && npx dts-bundle-generator -o index.d.ts lib/index.ts && npx esbuild lib/index.ts --bundle --outfile=index.js --platform=node --format=cjs"
22
22
  },
23
23
  "author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
24
24
  "license": "Apache-2.0",
@@ -28,11 +28,12 @@
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
+ "dts-bundle-generator": "^9.2.3",
31
32
  "eslint": "^8.25.0",
32
33
  "jest": "^27.5.1",
33
34
  "prettier": "^2.7.1",
34
35
  "ts-jest": "^27.1.5",
35
36
  "typescript": "^5.0.4"
36
37
  },
37
- "gitHead": "e4b7651a0e73161cd47ea4f75e84dd6d39c8a990"
38
+ "gitHead": "012ceb3aa8270b79d3a6935e6f1de2f5b9a50348"
38
39
  }
package/index.ts DELETED
@@ -1,332 +0,0 @@
1
- import SUPPORTED_LANGUAGES, { baseLanguages } from './languages';
2
-
3
- export { SUPPORTED_LANGUAGES, baseLanguages };
4
-
5
- /* eslint-disable @typescript-eslint/indent */
6
- type StringNumberObject = { [key: string]: number };
7
-
8
- const fromEntry =
9
- (entries: StringNumberObject) =>
10
- (v: number | string): string => {
11
- const match = Object.entries(entries).find((x) => x[1] === Number(v));
12
- return match ? match[0] : 'unknown';
13
- };
14
-
15
- // deprecated: toEntry is same as fromEntry
16
- const toEntry =
17
- (entries: StringNumberObject) =>
18
- (v: number | string): string =>
19
- Object.keys(entries).find((x) => entries[x] === Number(v));
20
-
21
- // Blocklet Status
22
-
23
- export const BlockletStatus = Object.freeze({
24
- added: 0,
25
- downloading: 1,
26
- downloaded: 2, // Deprecated
27
- installing: 3,
28
- installed: 4,
29
- starting: 5,
30
- running: 6,
31
- stopping: 7,
32
- stopped: 8,
33
- error: 9,
34
- upgrading: 10,
35
- restarting: 11, // Deprecated
36
- corrupted: 12,
37
- waiting: 13,
38
- deleted: 14,
39
- });
40
-
41
- export const BLOCKLET_CONTROLLER_STATUS = {
42
- normal: 0,
43
- suspended: 10,
44
- };
45
-
46
- export const SUSPENDED_REASON = {
47
- expired: 'expired',
48
- };
49
-
50
- export const fromBlockletStatus = fromEntry(BlockletStatus);
51
- export const toBlockletStatus = toEntry(BlockletStatus); // deprecated
52
-
53
- // Blocklet Source
54
-
55
- export const BlockletSource: StringNumberObject = Object.freeze({
56
- // Installed from Blocklet Store
57
- registry: 0,
58
-
59
- // Installed from local development source folder
60
- local: 1,
61
-
62
- // Installed from uploading bundle directly
63
- upload: 2,
64
-
65
- // Installed from a url (similar to Blocklet Store)
66
- url: 3,
67
-
68
- // Installed by custom creation
69
- custom: 4,
70
- });
71
-
72
- export const fromBlockletSource = fromEntry(BlockletSource);
73
- export const toBlockletSource = toEntry(BlockletSource); // deprecated
74
-
75
- // Blocklet Group(Type)
76
-
77
- export const BlockletGroup = Object.freeze({
78
- // Only static website
79
- // The website is served by by Blocklet Server at runtime
80
- static: 'static',
81
-
82
- // The runtime instance is provided by its own backend server
83
- dapp: 'dapp',
84
-
85
- starter: false, // deprecated
86
-
87
- // This type is used to combine other component blocklets
88
- // No instance will be spawned at runtime
89
- gateway: 'gateway',
90
-
91
- // This type is used to pack other blocklets
92
- // No instance will be spawned at runtime
93
- // The difference is that a pack is a component in an app, whereas a gateway is an app itself.
94
- pack: 'pack',
95
- });
96
-
97
- export const BLOCKLET_GROUPS = ['dapp', 'static', 'gateway', 'pack'];
98
-
99
- // Blocklet Events
100
-
101
- export const BlockletEvents = Object.freeze({
102
- // status updated
103
- added: 'blocklet.added',
104
- downloadFailed: 'blocklet.downloadFailed',
105
- installed: 'blocklet.installed',
106
- installFailed: 'blocklet.installFailed',
107
- upgraded: 'blocklet.upgraded', // only for internal use (refresh router)
108
- removed: 'blocklet.removed',
109
- started: 'blocklet.started',
110
- startFailed: 'blocklet.startFailed',
111
- stopped: 'blocklet.stopped',
112
- reloaded: 'blocklet.reloaded', // Deprecated
113
- statusChange: 'blocklet.statusChange',
114
- dataCleaned: 'blocklet.dataCleaned',
115
- componentInstalled: 'blocklet.componentInstalled',
116
- componentInstallFailed: 'blocklet.componentInstallFailed',
117
- componentUpgraded: 'blocklet.componentUpgraded',
118
- componentUpgradeFailed: 'blocklet.componentUpgradeFailed',
119
- componentRemoved: 'blocklet.componentRemoved',
120
-
121
- // 备份还原进度
122
- backupProgress: 'blocklet.backupProgress',
123
- restoreProgress: 'blocklet.restoreProgress',
124
-
125
- downloadBundleProgress: 'blocklet.downloadBundleProgress',
126
-
127
- // state updated
128
- updated: 'blocklet.updated',
129
- domainStatus: 'blocklet.domainStatus',
130
- storeChange: 'blocklet.storeChange',
131
- appDidChanged: 'blocklet.appDidChanged',
132
-
133
- // purchase
134
- purchaseChange: 'blocklet.purchaseChange',
135
-
136
- // cert
137
- certError: 'blocklet.certError',
138
- certIssued: 'blocklet.certIssued',
139
-
140
- // did-space
141
- spaceConnected: 'blocklet.spaceConnected',
142
-
143
- // install by nft
144
- nftConsumed: 'blocklet.nftConsumed',
145
- });
146
-
147
- export const BlockletInternalEvents = Object.freeze({
148
- appConfigChanged: 'blocklet.appConfigChanged',
149
- appSettingChanged: 'blocklet.appSettingChanged',
150
-
151
- componentInstalled: 'blocklet._componentInstalled',
152
- componentUpgraded: 'blocklet._componentUpgraded',
153
- componentUpdated: 'blocklet._componentUpdated',
154
- componentStarted: 'blocklet._componentStarted',
155
- componentStopped: 'blocklet._componentStopped',
156
- componentRemoved: 'blocklet._componentRemoved',
157
- componentConfigChanged: 'blocklet._componentConfigChanged',
158
-
159
- componentsUpdated: 'blocklet.componentsUpdated', // deprecated, for backward compatibility
160
- });
161
-
162
- export const BLOCKLET_PLATFORMS = ['aix', 'darwin', 'freebsd', 'linux', 'openbsd', 'sunos', 'win32'];
163
- export const BLOCKLET_ARCHITECTURES = [
164
- 'arm',
165
- 'arm64',
166
- 'ia32',
167
- 'mips',
168
- 'mipsel',
169
- 'ppc',
170
- 'ppc64',
171
- 's390',
172
- 's390x',
173
- 'x32',
174
- 'x64',
175
- ];
176
-
177
- export const BLOCKLET_MODES = Object.freeze({
178
- PRODUCTION: 'production',
179
- DEVELOPMENT: 'development',
180
- });
181
-
182
- export const BLOCKLET_FACTORY_SHARES = { developer: 0.7, store: 0.3 };
183
-
184
- // Blocklet Interface
185
-
186
- export const BLOCKLET_INTERFACE_TYPE_WEB = 'web';
187
- export const BLOCKLET_INTERFACE_TYPE_SERVICE = 'service';
188
-
189
- // Wellknown interface declares an sub-interface under web interface
190
- // The path of the wellknown interface must starts with /.well-known, e.g. /.well-known/acme-challenge)
191
- // The wellknown interface can be mounted to every endpoint of the abtnode and all blocklets on the abtnode
192
- export const BLOCKLET_INTERFACE_TYPE_WELLKNOWN = 'wellknown';
193
- export const BLOCKLET_INTERFACE_TYPES = [
194
- BLOCKLET_INTERFACE_TYPE_WEB,
195
- BLOCKLET_INTERFACE_TYPE_SERVICE,
196
- BLOCKLET_INTERFACE_TYPE_WELLKNOWN,
197
- ];
198
-
199
- export const BLOCKLET_INTERFACE_PUBLIC = 'publicUrl';
200
- export const BLOCKLET_INTERFACE_WELLKNOWN = 'wellknownUrl'; // Deprecated
201
- export const BLOCKLET_UI_INTERFACES = [BLOCKLET_INTERFACE_PUBLIC];
202
- export const BLOCKLET_STANDARD_INTERFACES = [BLOCKLET_INTERFACE_PUBLIC, BLOCKLET_INTERFACE_WELLKNOWN];
203
-
204
- export const BLOCKLET_INTERFACE_PROTOCOL_HTTP = 'http';
205
- export const BLOCKLET_INTERFACE_PROTOCOL_TCP = 'tcp';
206
- export const BLOCKLET_INTERFACE_PROTOCOL_UDP = 'udp';
207
- export const BLOCKLET_INTERFACE_PROTOCOLS = [
208
- BLOCKLET_INTERFACE_PROTOCOL_TCP,
209
- BLOCKLET_INTERFACE_PROTOCOL_UDP,
210
- BLOCKLET_INTERFACE_PROTOCOL_HTTP,
211
- ];
212
-
213
- export const BLOCKLET_DYNAMIC_PATH_PREFIX = '*';
214
- export const BLOCKLET_DEFAULT_PORT_NAME = 'BLOCKLET_PORT';
215
- export const BLOCKLET_DEFAULT_PATH_REWRITE = '/';
216
-
217
- // bundle
218
- export const BLOCKLET_RELEASE_FOLDER = '.blocklet/release';
219
- export const BLOCKLET_RELEASE_FILE = 'blocklet.json';
220
- export const BLOCKLET_BUNDLE_FOLDER = '.blocklet/bundle';
221
- export const BLOCKLET_RELEASE_FOLDER_NAME = 'release';
222
- export const BLOCKLET_BUNDLE_FOLDER_NAME = 'bundle';
223
- export const BLOCKLET_BUNDLE_FILE = 'blocklet.zip';
224
- export const BLOCKLET_ENTRY_FILE = 'blocklet.js';
225
- export const BLOCKLET_META_FILE = 'blocklet.yml';
226
- export const BLOCKLET_META_FILE_ALT = 'blocklet.yaml';
227
- export const BLOCKLET_PREFERENCE_FILE = 'blocklet.prefs.json';
228
- export const BLOCKLET_PREFERENCE_PREFIX = 'prefs.';
229
- export const BLOCKLET_RESOURCE_DIR = 'resources';
230
-
231
- // project
232
- export const PROJECT = {
233
- DIR: '.projects',
234
- RELEASE_DIR: 'releases',
235
- RESOURCE_DIR: 'resource',
236
- ASSET_DIR: 'assets',
237
- TYPES: {
238
- resource: 'resource',
239
- pack: 'pack',
240
- },
241
- RELEASE_STATUS: {
242
- draft: 'draft',
243
- published: 'published',
244
- },
245
- MAX_NOTE_LENGTH: 1000,
246
- MAX_INTRO_LENGTH: 3000,
247
- };
248
-
249
- export const BLOCKLET_DEFAULT_VERSION = '1.0.0';
250
-
251
- export const BLOCKLET_UPLOADS_DIR = '__uploads';
252
-
253
- export const BLOCKLET_LATEST_SPEC_VERSION = '1.2.8';
254
- export const BLOCKLET_LATEST_REQUIREMENT_SERVER = '>=1.7.0';
255
- export const BLOCKLET_LATEST_REQUIREMENT_ABTNODE = '>=1.5.15'; // Deprecated
256
-
257
- export const BLOCKLET_CONFIGURABLE_KEY = {
258
- // APP Config Key that start with BLOCKLET_ cannot set to child component
259
- BLOCKLET_CLUSTER_SIZE: 'BLOCKLET_CLUSTER_SIZE',
260
- BLOCKLET_APP_NAME: 'BLOCKLET_APP_NAME',
261
- BLOCKLET_APP_DESCRIPTION: 'BLOCKLET_APP_DESCRIPTION',
262
- BLOCKLET_APP_SK: 'BLOCKLET_APP_SK',
263
- BLOCKLET_APP_LOGO: 'BLOCKLET_APP_LOGO', // deprecated
264
- BLOCKLET_APP_LOGO_SQUARE: 'BLOCKLET_APP_LOGO_SQUARE',
265
- BLOCKLET_APP_LOGO_RECT: 'BLOCKLET_APP_LOGO_RECT',
266
- BLOCKLET_APP_LOGO_FAVICON: 'BLOCKLET_APP_LOGO_FAVICON',
267
- BLOCKLET_APP_URL: 'BLOCKLET_APP_URL',
268
- BLOCKLET_APP_LANGUAGES: 'BLOCKLET_APP_LANGUAGES',
269
- BLOCKLET_PASSPORT_COLOR: 'BLOCKLET_PASSPORT_COLOR',
270
- BLOCKLET_WALLET_TYPE: 'BLOCKLET_WALLET_TYPE', // deprecated
271
- BLOCKLET_DELETABLE: 'BLOCKLET_DELETABLE',
272
- BLOCKLET_APP_COPYRIGHT_OWNER: 'BLOCKLET_APP_COPYRIGHT_OWNER',
273
- BLOCKLET_APP_COPYRIGHT_YEAR: 'BLOCKLET_APP_COPYRIGHT_YEAR',
274
-
275
- // 应用使用 DID Spaces 存储 文件/nft 的时候使用的环境变量
276
- BLOCKLET_APP_SPACE_ENDPOINT: 'BLOCKLET_APP_SPACE_ENDPOINT',
277
- BLOCKLET_APP_SPACES_URL: 'BLOCKLET_APP_SPACES_URL',
278
-
279
- // 应用使用 DID Spaces 备份的时候使用的环境变量
280
- BLOCKLET_APP_BACKUP_ENDPOINT: 'BLOCKLET_APP_BACKUP_ENDPOINT',
281
-
282
- BLOCKLET_APP_CHAIN_HOST: 'BLOCKLET_APP_CHAIN_HOST',
283
- BLOCKLET_APP_CHAIN_TYPE: 'BLOCKLET_APP_CHAIN_TYPE',
284
- BLOCKLET_APP_CHAIN_ID: 'BLOCKLET_APP_CHAIN_ID',
285
-
286
- // Component Key
287
- COMPONENT_ACCESS_WHO: 'COMPONENT_ACCESS_WHO',
288
- };
289
-
290
- export const BLOCKLET_APP_SPACE_ENDPOINTS = {
291
- REQUIRED: 'required',
292
- OPTIONAL: 'optional',
293
- };
294
-
295
- export const CHAIN_INFO_CONFIG = {
296
- CHAIN_TYPE: ['type', 'arcblock'],
297
- CHAIN_ID: ['id', 'none'],
298
- CHAIN_HOST: ['host', 'none'],
299
- };
300
-
301
- export const RESTORE_PROGRESS_STATUS = {
302
- waiting: 0,
303
- start: 10,
304
- importData: 20,
305
- downloading: 30,
306
- importDataSuccess: 40,
307
- installing: 50,
308
- completed: 60,
309
- error: 70,
310
- };
311
-
312
- export const CHAIN_PROP_MAP = {
313
- BLOCKLET_APP_CHAIN_HOST: 'CHAIN_HOST',
314
- BLOCKLET_APP_CHAIN_ID: 'CHAIN_ID',
315
- BLOCKLET_APP_CHAIN_TYPE: 'CHAIN_TYPE',
316
- };
317
-
318
- export const CHAIN_PROP_MAP_REVERSE = Object.keys(CHAIN_PROP_MAP).reduce((acc, key) => {
319
- acc[CHAIN_PROP_MAP[key]] = key;
320
- return acc;
321
- }, {});
322
-
323
- export const LOGIN_PROVIDER = {
324
- AUTH0: 'auth0',
325
- WALLET: 'wallet',
326
- NFT: 'nft',
327
- };
328
-
329
- export const APP_CONFIG_DIR = '/.config';
330
- export const APP_CONFIG_FILE_PATH = '/.config/config.json';
331
- export const COMPONENT_ENV_FILE_NAME = 'env';
332
- export const MAX_TITLE_LENGTH = 40;