proto.io 0.0.187 → 0.0.189

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 (44) hide show
  1. package/dist/adapters/file/database.d.ts +2 -2
  2. package/dist/adapters/file/database.js +2 -2
  3. package/dist/adapters/file/database.mjs +2 -2
  4. package/dist/adapters/file/filesystem.d.ts +2 -2
  5. package/dist/adapters/file/google-cloud-storage.d.ts +2 -2
  6. package/dist/adapters/storage/progres.d.ts +1 -1
  7. package/dist/adapters/storage/progres.js +3 -3
  8. package/dist/adapters/storage/progres.mjs +3 -3
  9. package/dist/client.d.ts +3 -3
  10. package/dist/client.js +2 -2
  11. package/dist/client.mjs +3 -3
  12. package/dist/index.d.ts +3 -3
  13. package/dist/index.js +13 -8
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +14 -9
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/internals/{index-CEgTPv9-.mjs → index-BAbXyJEC.mjs} +227 -227
  18. package/dist/internals/{index-CEgTPv9-.mjs.map → index-BAbXyJEC.mjs.map} +1 -1
  19. package/dist/internals/{index-fdvea17W.d.ts → index-BDHXW8gd.d.ts} +2 -1
  20. package/dist/internals/index-BDHXW8gd.d.ts.map +1 -0
  21. package/dist/internals/{index-wofihxjH.d.ts → index-BfsVioOA.d.ts} +2 -2
  22. package/dist/internals/index-BfsVioOA.d.ts.map +1 -0
  23. package/dist/internals/{index-DBuC2OsV.js → index-COOeeeBE.js} +2 -2
  24. package/dist/internals/{index-DBuC2OsV.js.map → index-COOeeeBE.js.map} +1 -1
  25. package/dist/internals/{index-BszoCthH.js → index-Dej3GgVf.js} +2 -2
  26. package/dist/internals/index-Dej3GgVf.js.map +1 -0
  27. package/dist/internals/{index-PN4p9vcR.js → index-M-VqTiz9.js} +227 -227
  28. package/dist/internals/{index-PN4p9vcR.js.map → index-M-VqTiz9.js.map} +1 -1
  29. package/dist/internals/{index-MPHIZrIu.mjs → index-ikHjpb6F.mjs} +2 -2
  30. package/dist/internals/{index-MPHIZrIu.mjs.map → index-ikHjpb6F.mjs.map} +1 -1
  31. package/dist/internals/{index-B1FyA93S.mjs → index-j8PFq8Ci.mjs} +2 -2
  32. package/dist/internals/index-j8PFq8Ci.mjs.map +1 -0
  33. package/dist/internals/{index-DSxxREND.d.ts → index-z8mWupzT.d.ts} +2 -2
  34. package/dist/internals/index-z8mWupzT.d.ts.map +1 -0
  35. package/dist/internals/{random-Bfm98f9v.js → random-CObICDCy.js} +3 -3
  36. package/dist/internals/{random-Bfm98f9v.js.map → random-CObICDCy.js.map} +1 -1
  37. package/dist/internals/{random-D6jBS4Q9.mjs → random-uHM4KXoV.mjs} +3 -3
  38. package/dist/internals/{random-D6jBS4Q9.mjs.map → random-uHM4KXoV.mjs.map} +1 -1
  39. package/package.json +1 -1
  40. package/dist/internals/index-B1FyA93S.mjs.map +0 -1
  41. package/dist/internals/index-BszoCthH.js.map +0 -1
  42. package/dist/internals/index-DSxxREND.d.ts.map +0 -1
  43. package/dist/internals/index-fdvea17W.d.ts.map +0 -1
  44. package/dist/internals/index-wofihxjH.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { prototypes, asyncStream, isBinaryData, isReadableStream, isBlob, base64ToBuffer, iterableToStream } from '@o2ter/utils-js';
2
2
  import { P as PVK } from './private-CNw40LZ7.mjs';
3
3
  import _ from 'lodash';
4
- import { T as TObject, e as decodeUpdateOp } from './index-B1FyA93S.mjs';
4
+ import { T as TObject, e as decodeUpdateOp } from './index-j8PFq8Ci.mjs';
5
5
  import axios from 'axios';
6
6
  import { XSRF_COOKIE_NAME, XSRF_HEADER_NAME } from '@o2ter/server-js/dist/const';
7
7
  import { io } from 'socket.io-client';
@@ -527,7 +527,7 @@ const AUTH_COOKIE_KEY = 'x-proto-auth';
527
527
  const PROTO_NOTY_MSG = 'PROTO_NOTY_MSG';
528
528
 
529
529
  //
530
- // user.ts
530
+ // file.ts
531
531
  //
532
532
  // The MIT License
533
533
  // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
@@ -550,14 +550,45 @@ const PROTO_NOTY_MSG = 'PROTO_NOTY_MSG';
550
550
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
551
551
  // THE SOFTWARE.
552
552
  //
553
- class TUser extends TObject {
553
+ /**
554
+ * Class representing a file.
555
+ */
556
+ class TFile extends TObject {
554
557
  constructor(attributes) {
555
- super('User', attributes);
558
+ super('File', attributes);
559
+ }
560
+ /**
561
+ * Gets the filename of the file.
562
+ * @returns The filename.
563
+ */
564
+ get filename() {
565
+ return this.get('filename');
566
+ }
567
+ /**
568
+ * Gets the size of the file.
569
+ * @returns The size of the file.
570
+ */
571
+ get size() {
572
+ return this.get('size');
573
+ }
574
+ /**
575
+ * Gets the type of the file.
576
+ * @returns The type of the file.
577
+ */
578
+ get type() {
579
+ return this.get('type');
580
+ }
581
+ /**
582
+ * Gets the token of the file.
583
+ * @returns The token of the file.
584
+ */
585
+ get token() {
586
+ return this.get('token');
556
587
  }
557
588
  }
558
589
 
559
590
  //
560
- // role.ts
591
+ // job.ts
561
592
  //
562
593
  // The MIT License
563
594
  // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
@@ -581,52 +612,59 @@ class TUser extends TObject {
581
612
  // THE SOFTWARE.
582
613
  //
583
614
  /**
584
- * Class representing a Role.
615
+ * Class representing a Job.
585
616
  * @extends TObject
586
617
  */
587
- class TRole extends TObject {
618
+ class TJob extends TObject {
588
619
  constructor(attributes) {
589
- super('Role', attributes);
620
+ super('_Job', attributes);
590
621
  }
591
622
  /**
592
- * Get the name of the role.
593
- * @return {string | undefined} The name of the role.
623
+ * Get the name of the job.
624
+ * @return {string} The name of the job.
594
625
  */
595
626
  get name() {
596
627
  return this.get('name');
597
628
  }
598
629
  /**
599
- * Get the users associated with the role.
600
- * @return {TUser[]} The users associated with the role.
630
+ * Get the data of the job.
631
+ * @return {TValue | undefined} The data of the job.
601
632
  */
602
- get users() {
603
- return this.get('users') ?? [];
633
+ get data() {
634
+ return this.get('data');
604
635
  }
605
636
  /**
606
- * Set the users associated with the role.
607
- * @param {TUser[]} value - The users to associate with the role.
637
+ * Get the user associated with the job.
638
+ * @return {TUser | undefined} The user associated with the job.
608
639
  */
609
- set users(value) {
610
- this.set('users', value);
640
+ get user() {
641
+ return this.get('user');
611
642
  }
612
643
  /**
613
- * Get the roles associated with the role.
614
- * @return {TRole[]} The roles associated with the role.
644
+ * Get the error of the job.
645
+ * @return {TValue | undefined} The error of the job.
615
646
  */
616
- get roles() {
617
- return this.get('roles') ?? [];
647
+ get error() {
648
+ return this.get('error');
618
649
  }
619
650
  /**
620
- * Set the roles associated with the role.
621
- * @param {TRole[]} value - The roles to associate with the role.
651
+ * Get the start time of the job.
652
+ * @return {Date | undefined} The start time of the job.
622
653
  */
623
- set roles(value) {
624
- this.set('roles', value);
654
+ get startedAt() {
655
+ return this.get('startedAt');
656
+ }
657
+ /**
658
+ * Get the completion time of the job.
659
+ * @return {Date | undefined} The completion time of the job.
660
+ */
661
+ get completedAt() {
662
+ return this.get('completedAt');
625
663
  }
626
664
  }
627
665
 
628
666
  //
629
- // file.ts
667
+ // role.ts
630
668
  //
631
669
  // The MIT License
632
670
  // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
@@ -650,44 +688,52 @@ class TRole extends TObject {
650
688
  // THE SOFTWARE.
651
689
  //
652
690
  /**
653
- * Class representing a file.
691
+ * Class representing a Role.
692
+ * @extends TObject
654
693
  */
655
- class TFile extends TObject {
694
+ class TRole extends TObject {
656
695
  constructor(attributes) {
657
- super('File', attributes);
696
+ super('Role', attributes);
658
697
  }
659
698
  /**
660
- * Gets the filename of the file.
661
- * @returns The filename.
699
+ * Get the name of the role.
700
+ * @return {string | undefined} The name of the role.
662
701
  */
663
- get filename() {
664
- return this.get('filename');
702
+ get name() {
703
+ return this.get('name');
665
704
  }
666
705
  /**
667
- * Gets the size of the file.
668
- * @returns The size of the file.
706
+ * Get the users associated with the role.
707
+ * @return {TUser[]} The users associated with the role.
669
708
  */
670
- get size() {
671
- return this.get('size');
709
+ get users() {
710
+ return this.get('users') ?? [];
672
711
  }
673
712
  /**
674
- * Gets the type of the file.
675
- * @returns The type of the file.
713
+ * Set the users associated with the role.
714
+ * @param {TUser[]} value - The users to associate with the role.
676
715
  */
677
- get type() {
678
- return this.get('type');
716
+ set users(value) {
717
+ this.set('users', value);
679
718
  }
680
719
  /**
681
- * Gets the token of the file.
682
- * @returns The token of the file.
720
+ * Get the roles associated with the role.
721
+ * @return {TRole[]} The roles associated with the role.
683
722
  */
684
- get token() {
685
- return this.get('token');
723
+ get roles() {
724
+ return this.get('roles') ?? [];
725
+ }
726
+ /**
727
+ * Set the roles associated with the role.
728
+ * @param {TRole[]} value - The roles to associate with the role.
729
+ */
730
+ set roles(value) {
731
+ this.set('roles', value);
686
732
  }
687
733
  }
688
734
 
689
735
  //
690
- // job.ts
736
+ // user.ts
691
737
  //
692
738
  // The MIT License
693
739
  // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
@@ -710,55 +756,9 @@ class TFile extends TObject {
710
756
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
711
757
  // THE SOFTWARE.
712
758
  //
713
- /**
714
- * Class representing a Job.
715
- * @extends TObject
716
- */
717
- class TJob extends TObject {
759
+ class TUser extends TObject {
718
760
  constructor(attributes) {
719
- super('_Job', attributes);
720
- }
721
- /**
722
- * Get the name of the job.
723
- * @return {string} The name of the job.
724
- */
725
- get name() {
726
- return this.get('name');
727
- }
728
- /**
729
- * Get the data of the job.
730
- * @return {TValue | undefined} The data of the job.
731
- */
732
- get data() {
733
- return this.get('data');
734
- }
735
- /**
736
- * Get the user associated with the job.
737
- * @return {TUser | undefined} The user associated with the job.
738
- */
739
- get user() {
740
- return this.get('user');
741
- }
742
- /**
743
- * Get the error of the job.
744
- * @return {TValue | undefined} The error of the job.
745
- */
746
- get error() {
747
- return this.get('error');
748
- }
749
- /**
750
- * Get the start time of the job.
751
- * @return {Date | undefined} The start time of the job.
752
- */
753
- get startedAt() {
754
- return this.get('startedAt');
755
- }
756
- /**
757
- * Get the completion time of the job.
758
- * @return {Date | undefined} The completion time of the job.
759
- */
760
- get completedAt() {
761
- return this.get('completedAt');
761
+ super('User', attributes);
762
762
  }
763
763
  }
764
764
 
@@ -819,6 +819,137 @@ const TObjectTypes = {
819
819
  //
820
820
  const isObjKey = (key, obj) => key in obj;
821
821
 
822
+ //
823
+ // codec.ts
824
+ //
825
+ // The MIT License
826
+ // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
827
+ //
828
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
829
+ // of this software and associated documentation files (the "Software"), to deal
830
+ // in the Software without restriction, including without limitation the rights
831
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
832
+ // copies of the Software, and to permit persons to whom the Software is
833
+ // furnished to do so, subject to the following conditions:
834
+ //
835
+ // The above copyright notice and this permission notice shall be included in
836
+ // all copies or substantial portions of the Software.
837
+ //
838
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
839
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
840
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
841
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
842
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
843
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
844
+ // THE SOFTWARE.
845
+ //
846
+ const encodeEJSON = (x, stack, options) => {
847
+ if (_.isNil(x) || _.isNumber(x) || _.isBoolean(x) || _.isString(x))
848
+ return x ?? null;
849
+ if (_.isDate(x))
850
+ return { $date: x.valueOf() };
851
+ if (_.isRegExp(x))
852
+ return { $regex: x.source, $options: x.flags };
853
+ if (x instanceof BigInt)
854
+ return { $integer: x.toString() };
855
+ if (x instanceof Decimal)
856
+ return { $decimal: x.toString() };
857
+ const found = _.indexOf(stack, x);
858
+ if (found !== -1)
859
+ return { $ref: found };
860
+ if (_.isArray(x))
861
+ return x.map(v => encodeEJSON(v, [...stack, x], options));
862
+ if (x instanceof TObject) {
863
+ const attributes = options.objAttrs ? _.pick(x.attributes, ...options.objAttrs) : x.attributes;
864
+ return {
865
+ $object: {
866
+ className: x.className,
867
+ attributes: _.mapValues(attributes, v => encodeEJSON(v, [...stack, x], options)),
868
+ }
869
+ };
870
+ }
871
+ const props = _.uniq(_.flatMap([x, ...prototypes(x)], x => Object.getOwnPropertyNames(x)));
872
+ return _.transform(_.pick(x, props), (r, v, k) => {
873
+ if (_.isFunction(v))
874
+ return;
875
+ r[k.startsWith('$') ? `$${k}` : k] = encodeEJSON(v, [...stack, x], options);
876
+ }, {});
877
+ };
878
+ const decodeEJSON = (x, stack, options) => {
879
+ if (_.isNil(x) || _.isNumber(x) || _.isBoolean(x) || _.isString(x))
880
+ return x ?? null;
881
+ if (_.isArray(x)) {
882
+ return _.transform(x, (r, v) => {
883
+ r.push(decodeEJSON(v, [...stack, r], options));
884
+ }, []);
885
+ }
886
+ if (!_.isNil(x.$date))
887
+ return new Date(x.$date);
888
+ if (!_.isNil(x.$regex))
889
+ return new RegExp(x.$regex, x.$options || '');
890
+ if (!_.isNil(x.$integer))
891
+ return BigInt(x.$integer);
892
+ if (!_.isNil(x.$decimal))
893
+ return new Decimal(x.$decimal);
894
+ if (!_.isNil(x.$ref))
895
+ return stack[x.$ref];
896
+ if (!_.isNil(x.$object)) {
897
+ const { className, attributes } = x.$object;
898
+ const _attributes = (self) => _.mapValues(options.objAttrs ? _.pick(attributes, ...options.objAttrs) : attributes, v => decodeEJSON(v, [...stack, self], options));
899
+ return isObjKey(className, TObjectTypes) ? new TObjectTypes[className](_attributes) : new TObject(className, _attributes);
900
+ }
901
+ return _.transform(x, (r, v, k) => {
902
+ if (_.isString(k))
903
+ r[k.startsWith('$') ? k.substring(1) : k] = decodeEJSON(v, [...stack, r], options);
904
+ }, {});
905
+ };
906
+ const serialize = (x, options) => JSON.stringify(encodeEJSON(x, [], options ?? {}), undefined, options?.space);
907
+ const deserialize = (buffer, options) => decodeEJSON(JSON.parse(buffer), [], options ?? {});
908
+
909
+ //
910
+ // index.ts
911
+ //
912
+ // The MIT License
913
+ // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
914
+ //
915
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
916
+ // of this software and associated documentation files (the "Software"), to deal
917
+ // in the Software without restriction, including without limitation the rights
918
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
919
+ // copies of the Software, and to permit persons to whom the Software is
920
+ // furnished to do so, subject to the following conditions:
921
+ //
922
+ // The above copyright notice and this permission notice shall be included in
923
+ // all copies or substantial portions of the Software.
924
+ //
925
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
926
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
927
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
928
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
929
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
930
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931
+ // THE SOFTWARE.
932
+ //
933
+ const classExtends = (x) => x;
934
+ const isQuery = (x) => {
935
+ return x instanceof TQuery;
936
+ };
937
+ const isObject = (x) => {
938
+ return x instanceof TObject;
939
+ };
940
+ const isUser = (x) => {
941
+ return x instanceof TUser;
942
+ };
943
+ const isRole = (x) => {
944
+ return x instanceof TRole;
945
+ };
946
+ const isFile = (x) => {
947
+ return x instanceof TFile;
948
+ };
949
+ const isJob = (x) => {
950
+ return x instanceof TJob;
951
+ };
952
+
822
953
  //
823
954
  // methods.ts
824
955
  //
@@ -966,137 +1097,6 @@ const applyObjectMethods = (object, proto) => {
966
1097
  return Object.defineProperties(object, _props);
967
1098
  };
968
1099
 
969
- //
970
- // codec.ts
971
- //
972
- // The MIT License
973
- // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
974
- //
975
- // Permission is hereby granted, free of charge, to any person obtaining a copy
976
- // of this software and associated documentation files (the "Software"), to deal
977
- // in the Software without restriction, including without limitation the rights
978
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
979
- // copies of the Software, and to permit persons to whom the Software is
980
- // furnished to do so, subject to the following conditions:
981
- //
982
- // The above copyright notice and this permission notice shall be included in
983
- // all copies or substantial portions of the Software.
984
- //
985
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
986
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
987
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
988
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
989
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
990
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
991
- // THE SOFTWARE.
992
- //
993
- const encodeEJSON = (x, stack, options) => {
994
- if (_.isNil(x) || _.isNumber(x) || _.isBoolean(x) || _.isString(x))
995
- return x ?? null;
996
- if (_.isDate(x))
997
- return { $date: x.valueOf() };
998
- if (_.isRegExp(x))
999
- return { $regex: x.source, $options: x.flags };
1000
- if (x instanceof BigInt)
1001
- return { $integer: x.toString() };
1002
- if (x instanceof Decimal)
1003
- return { $decimal: x.toString() };
1004
- const found = _.indexOf(stack, x);
1005
- if (found !== -1)
1006
- return { $ref: found };
1007
- if (_.isArray(x))
1008
- return x.map(v => encodeEJSON(v, [...stack, x], options));
1009
- if (x instanceof TObject) {
1010
- const attributes = options.objAttrs ? _.pick(x.attributes, ...options.objAttrs) : x.attributes;
1011
- return {
1012
- $object: {
1013
- className: x.className,
1014
- attributes: _.mapValues(attributes, v => encodeEJSON(v, [...stack, x], options)),
1015
- }
1016
- };
1017
- }
1018
- const props = _.uniq(_.flatMap([x, ...prototypes(x)], x => Object.getOwnPropertyNames(x)));
1019
- return _.transform(_.pick(x, props), (r, v, k) => {
1020
- if (_.isFunction(v))
1021
- return;
1022
- r[k.startsWith('$') ? `$${k}` : k] = encodeEJSON(v, [...stack, x], options);
1023
- }, {});
1024
- };
1025
- const decodeEJSON = (x, stack, options) => {
1026
- if (_.isNil(x) || _.isNumber(x) || _.isBoolean(x) || _.isString(x))
1027
- return x ?? null;
1028
- if (_.isArray(x)) {
1029
- return _.transform(x, (r, v) => {
1030
- r.push(decodeEJSON(v, [...stack, r], options));
1031
- }, []);
1032
- }
1033
- if (!_.isNil(x.$date))
1034
- return new Date(x.$date);
1035
- if (!_.isNil(x.$regex))
1036
- return new RegExp(x.$regex, x.$options || '');
1037
- if (!_.isNil(x.$integer))
1038
- return BigInt(x.$integer);
1039
- if (!_.isNil(x.$decimal))
1040
- return new Decimal(x.$decimal);
1041
- if (!_.isNil(x.$ref))
1042
- return stack[x.$ref];
1043
- if (!_.isNil(x.$object)) {
1044
- const { className, attributes } = x.$object;
1045
- const _attributes = (self) => _.mapValues(options.objAttrs ? _.pick(attributes, ...options.objAttrs) : attributes, v => decodeEJSON(v, [...stack, self], options));
1046
- return isObjKey(className, TObjectTypes) ? new TObjectTypes[className](_attributes) : new TObject(className, _attributes);
1047
- }
1048
- return _.transform(x, (r, v, k) => {
1049
- if (_.isString(k))
1050
- r[k.startsWith('$') ? k.substring(1) : k] = decodeEJSON(v, [...stack, r], options);
1051
- }, {});
1052
- };
1053
- const serialize = (x, options) => JSON.stringify(encodeEJSON(x, [], options ?? {}), undefined, options?.space);
1054
- const deserialize = (buffer, options) => decodeEJSON(JSON.parse(buffer), [], options ?? {});
1055
-
1056
- //
1057
- // index.ts
1058
- //
1059
- // The MIT License
1060
- // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
1061
- //
1062
- // Permission is hereby granted, free of charge, to any person obtaining a copy
1063
- // of this software and associated documentation files (the "Software"), to deal
1064
- // in the Software without restriction, including without limitation the rights
1065
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1066
- // copies of the Software, and to permit persons to whom the Software is
1067
- // furnished to do so, subject to the following conditions:
1068
- //
1069
- // The above copyright notice and this permission notice shall be included in
1070
- // all copies or substantial portions of the Software.
1071
- //
1072
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1073
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1074
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1075
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1076
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1077
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1078
- // THE SOFTWARE.
1079
- //
1080
- const classExtends = (x) => x;
1081
- const isQuery = (x) => {
1082
- return x instanceof TQuery;
1083
- };
1084
- const isObject = (x) => {
1085
- return x instanceof TObject;
1086
- };
1087
- const isUser = (x) => {
1088
- return x instanceof TUser;
1089
- };
1090
- const isRole = (x) => {
1091
- return x instanceof TRole;
1092
- };
1093
- const isFile = (x) => {
1094
- return x instanceof TFile;
1095
- };
1096
- const isJob = (x) => {
1097
- return x instanceof TJob;
1098
- };
1099
-
1100
1100
  //
1101
1101
  // proto.ts
1102
1102
  //
@@ -1884,4 +1884,4 @@ class ProtoClient extends ProtoType {
1884
1884
  }
1885
1885
 
1886
1886
  export { AUTH_COOKIE_KEY as A, MASTER_USER_HEADER_NAME as M, PROTO_NOTY_MSG as P, TQuery as T, UPLOAD_TOKEN_HEADER_NAME as U, MASTER_PASS_HEADER_NAME as a, TUser as b, ProtoType as c, deserialize as d, ProtoClient as e, classExtends as f, isObject as g, isUser as h, isQuery as i, isRole as j, isFile as k, isJob as l, serialize as s };
1887
- //# sourceMappingURL=index-CEgTPv9-.mjs.map
1887
+ //# sourceMappingURL=index-BAbXyJEC.mjs.map