proto.io 0.0.215 → 0.0.217

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 (48) hide show
  1. package/dist/adapters/file/aliyun-oss.d.ts +3 -3
  2. package/dist/adapters/file/database.d.ts +2 -2
  3. package/dist/adapters/file/database.js +1 -1
  4. package/dist/adapters/file/database.mjs +2 -2
  5. package/dist/adapters/file/filesystem.d.ts +3 -3
  6. package/dist/adapters/file/google-cloud-storage.d.ts +3 -3
  7. package/dist/adapters/storage/progres.d.ts +8 -10
  8. package/dist/adapters/storage/progres.js +833 -451
  9. package/dist/adapters/storage/progres.js.map +1 -1
  10. package/dist/adapters/storage/progres.mjs +834 -452
  11. package/dist/adapters/storage/progres.mjs.map +1 -1
  12. package/dist/client.d.ts +3 -3
  13. package/dist/client.js +1 -7
  14. package/dist/client.js.map +1 -1
  15. package/dist/client.mjs +3 -3
  16. package/dist/client.mjs.map +1 -1
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.js +9 -16
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +11 -12
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/internals/{base-Cp5le5dC.d.ts → base-CWnOBKD5.d.ts} +2 -2
  23. package/dist/internals/base-CWnOBKD5.d.ts.map +1 -0
  24. package/dist/internals/{chunk--Vo2-p-z.d.ts → chunk-CNNSQpRF.d.ts} +3 -3
  25. package/dist/internals/chunk-CNNSQpRF.d.ts.map +1 -0
  26. package/dist/internals/{index-CZUGnb-y.d.ts → index-BRIlS3mY.d.ts} +3 -9
  27. package/dist/internals/index-BRIlS3mY.d.ts.map +1 -0
  28. package/dist/internals/{index-YLrO0f2D.d.ts → index-Bs8n7Q8f.d.ts} +60 -20
  29. package/dist/internals/index-Bs8n7Q8f.d.ts.map +1 -0
  30. package/dist/internals/{index-al1N-qi7.mjs → index-BzDsTt4R.mjs} +2 -2
  31. package/dist/internals/{index-al1N-qi7.mjs.map → index-BzDsTt4R.mjs.map} +1 -1
  32. package/dist/internals/{index-ZPbBr9Db.mjs → index-DfqABzjr.mjs} +135 -142
  33. package/dist/internals/index-DfqABzjr.mjs.map +1 -0
  34. package/dist/internals/{index-DfnPpl1I.js → index-DylUjD_1.js} +133 -146
  35. package/dist/internals/index-DylUjD_1.js.map +1 -0
  36. package/dist/internals/{validator-ChrCrz_C.mjs → validator-CEcBF4Cn.mjs} +730 -27
  37. package/dist/internals/validator-CEcBF4Cn.mjs.map +1 -0
  38. package/dist/internals/{validator-m6wY35c6.js → validator-mcBCJP4P.js} +737 -27
  39. package/dist/internals/validator-mcBCJP4P.js.map +1 -0
  40. package/package.json +1 -1
  41. package/dist/internals/base-Cp5le5dC.d.ts.map +0 -1
  42. package/dist/internals/chunk--Vo2-p-z.d.ts.map +0 -1
  43. package/dist/internals/index-CZUGnb-y.d.ts.map +0 -1
  44. package/dist/internals/index-DfnPpl1I.js.map +0 -1
  45. package/dist/internals/index-YLrO0f2D.d.ts.map +0 -1
  46. package/dist/internals/index-ZPbBr9Db.mjs.map +0 -1
  47. package/dist/internals/validator-ChrCrz_C.mjs.map +0 -1
  48. package/dist/internals/validator-m6wY35c6.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { EventIterator, 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-al1N-qi7.mjs';
4
+ import { T as TObject, e as decodeUpdateOp } from './index-BzDsTt4R.mjs';
5
5
  import axios from 'axios';
6
6
  import { A as AUTH_COOKIE_KEY, M as MASTER_USER_HEADER_NAME, b as MASTER_PASS_HEADER_NAME, U as UPLOAD_TOKEN_HEADER_NAME } from './const-Dkp7Nsv5.mjs';
7
7
  import { XSRF_COOKIE_NAME, XSRF_HEADER_NAME } from '@o2ter/server-js/dist/const';
@@ -198,6 +198,24 @@ class TQueryFilterBase {
198
198
  notContainedIn(key, value) {
199
199
  return this.filter({ [key]: { $nin: value } });
200
200
  }
201
+ /**
202
+ * Filters the query to include only documents where the specified key contains all of the specified values.
203
+ * @param key - The key to check for containing values.
204
+ * @param value - The array of values to check against.
205
+ * @returns The current instance for chaining.
206
+ */
207
+ containedBy(key, value) {
208
+ return this.filter({ [key]: { $superset: value } });
209
+ }
210
+ /**
211
+ * Filters the query to exclude documents where the specified key contains all of the specified values.
212
+ * @param key - The key to check for superset.
213
+ * @param value - The array of values to check against.
214
+ * @returns The current instance for chaining.
215
+ */
216
+ notContainedBy(key, value) {
217
+ return this.filter({ [key]: { $not: { $superset: value } } });
218
+ }
201
219
  /**
202
220
  * Filters the query to include only documents where the specified key is a subset of the specified values.
203
221
  * @param key - The key to check for subset.
@@ -600,7 +618,7 @@ class LiveQuerySubscription {
600
618
  }
601
619
 
602
620
  //
603
- // file.ts
621
+ // user.ts
604
622
  //
605
623
  // The MIT License
606
624
  // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
@@ -623,45 +641,14 @@ class LiveQuerySubscription {
623
641
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
624
642
  // THE SOFTWARE.
625
643
  //
626
- /**
627
- * Class representing a file.
628
- */
629
- class TFile extends TObject {
644
+ class TUser extends TObject {
630
645
  constructor(attributes) {
631
- super('File', attributes);
632
- }
633
- /**
634
- * Gets the filename of the file.
635
- * @returns The filename.
636
- */
637
- get filename() {
638
- return this.get('filename');
639
- }
640
- /**
641
- * Gets the size of the file.
642
- * @returns The size of the file.
643
- */
644
- get size() {
645
- return this.get('size');
646
- }
647
- /**
648
- * Gets the type of the file.
649
- * @returns The type of the file.
650
- */
651
- get type() {
652
- return this.get('type');
653
- }
654
- /**
655
- * Gets the token of the file.
656
- * @returns The token of the file.
657
- */
658
- get token() {
659
- return this.get('token');
646
+ super('User', attributes);
660
647
  }
661
648
  }
662
649
 
663
650
  //
664
- // job.ts
651
+ // role.ts
665
652
  //
666
653
  // The MIT License
667
654
  // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
@@ -685,59 +672,52 @@ class TFile extends TObject {
685
672
  // THE SOFTWARE.
686
673
  //
687
674
  /**
688
- * Class representing a Job.
675
+ * Class representing a Role.
689
676
  * @extends TObject
690
677
  */
691
- class TJob extends TObject {
678
+ class TRole extends TObject {
692
679
  constructor(attributes) {
693
- super('_Job', attributes);
680
+ super('Role', attributes);
694
681
  }
695
682
  /**
696
- * Get the name of the job.
697
- * @return {string} The name of the job.
683
+ * Get the name of the role.
684
+ * @return {string | undefined} The name of the role.
698
685
  */
699
686
  get name() {
700
687
  return this.get('name');
701
688
  }
702
689
  /**
703
- * Get the data of the job.
704
- * @return {TValue | undefined} The data of the job.
705
- */
706
- get data() {
707
- return this.get('data');
708
- }
709
- /**
710
- * Get the user associated with the job.
711
- * @return {TUser | undefined} The user associated with the job.
690
+ * Get the users associated with the role.
691
+ * @return {TUser[]} The users associated with the role.
712
692
  */
713
- get user() {
714
- return this.get('user');
693
+ get users() {
694
+ return this.get('users') ?? [];
715
695
  }
716
696
  /**
717
- * Get the error of the job.
718
- * @return {TValue | undefined} The error of the job.
697
+ * Set the users associated with the role.
698
+ * @param {TUser[]} value - The users to associate with the role.
719
699
  */
720
- get error() {
721
- return this.get('error');
700
+ set users(value) {
701
+ this.set('users', value);
722
702
  }
723
703
  /**
724
- * Get the start time of the job.
725
- * @return {Date | undefined} The start time of the job.
704
+ * Get the roles associated with the role.
705
+ * @return {TRole[]} The roles associated with the role.
726
706
  */
727
- get startedAt() {
728
- return this.get('startedAt');
707
+ get roles() {
708
+ return this.get('roles') ?? [];
729
709
  }
730
710
  /**
731
- * Get the completion time of the job.
732
- * @return {Date | undefined} The completion time of the job.
711
+ * Set the roles associated with the role.
712
+ * @param {TRole[]} value - The roles to associate with the role.
733
713
  */
734
- get completedAt() {
735
- return this.get('completedAt');
714
+ set roles(value) {
715
+ this.set('roles', value);
736
716
  }
737
717
  }
738
718
 
739
719
  //
740
- // role.ts
720
+ // file.ts
741
721
  //
742
722
  // The MIT License
743
723
  // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
@@ -761,52 +741,44 @@ class TJob extends TObject {
761
741
  // THE SOFTWARE.
762
742
  //
763
743
  /**
764
- * Class representing a Role.
765
- * @extends TObject
744
+ * Class representing a file.
766
745
  */
767
- class TRole extends TObject {
746
+ class TFile extends TObject {
768
747
  constructor(attributes) {
769
- super('Role', attributes);
770
- }
771
- /**
772
- * Get the name of the role.
773
- * @return {string | undefined} The name of the role.
774
- */
775
- get name() {
776
- return this.get('name');
748
+ super('File', attributes);
777
749
  }
778
750
  /**
779
- * Get the users associated with the role.
780
- * @return {TUser[]} The users associated with the role.
751
+ * Gets the filename of the file.
752
+ * @returns The filename.
781
753
  */
782
- get users() {
783
- return this.get('users') ?? [];
754
+ get filename() {
755
+ return this.get('filename');
784
756
  }
785
757
  /**
786
- * Set the users associated with the role.
787
- * @param {TUser[]} value - The users to associate with the role.
758
+ * Gets the size of the file.
759
+ * @returns The size of the file.
788
760
  */
789
- set users(value) {
790
- this.set('users', value);
761
+ get size() {
762
+ return this.get('size');
791
763
  }
792
764
  /**
793
- * Get the roles associated with the role.
794
- * @return {TRole[]} The roles associated with the role.
765
+ * Gets the type of the file.
766
+ * @returns The type of the file.
795
767
  */
796
- get roles() {
797
- return this.get('roles') ?? [];
768
+ get type() {
769
+ return this.get('type');
798
770
  }
799
771
  /**
800
- * Set the roles associated with the role.
801
- * @param {TRole[]} value - The roles to associate with the role.
772
+ * Gets the token of the file.
773
+ * @returns The token of the file.
802
774
  */
803
- set roles(value) {
804
- this.set('roles', value);
775
+ get token() {
776
+ return this.get('token');
805
777
  }
806
778
  }
807
779
 
808
780
  //
809
- // user.ts
781
+ // job.ts
810
782
  //
811
783
  // The MIT License
812
784
  // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
@@ -829,9 +801,55 @@ class TRole extends TObject {
829
801
  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
830
802
  // THE SOFTWARE.
831
803
  //
832
- class TUser extends TObject {
804
+ /**
805
+ * Class representing a Job.
806
+ * @extends TObject
807
+ */
808
+ class TJob extends TObject {
833
809
  constructor(attributes) {
834
- super('User', attributes);
810
+ super('_Job', attributes);
811
+ }
812
+ /**
813
+ * Get the name of the job.
814
+ * @return {string} The name of the job.
815
+ */
816
+ get name() {
817
+ return this.get('name');
818
+ }
819
+ /**
820
+ * Get the data of the job.
821
+ * @return {TValue | undefined} The data of the job.
822
+ */
823
+ get data() {
824
+ return this.get('data');
825
+ }
826
+ /**
827
+ * Get the user associated with the job.
828
+ * @return {TUser | undefined} The user associated with the job.
829
+ */
830
+ get user() {
831
+ return this.get('user');
832
+ }
833
+ /**
834
+ * Get the error of the job.
835
+ * @return {TValue | undefined} The error of the job.
836
+ */
837
+ get error() {
838
+ return this.get('error');
839
+ }
840
+ /**
841
+ * Get the start time of the job.
842
+ * @return {Date | undefined} The start time of the job.
843
+ */
844
+ get startedAt() {
845
+ return this.get('startedAt');
846
+ }
847
+ /**
848
+ * Get the completion time of the job.
849
+ * @return {Date | undefined} The completion time of the job.
850
+ */
851
+ get completedAt() {
852
+ return this.get('completedAt');
835
853
  }
836
854
  }
837
855
 
@@ -867,7 +885,7 @@ const TObjectTypes = {
867
885
  };
868
886
 
869
887
  //
870
- // utils.ts
888
+ // index.ts
871
889
  //
872
890
  // The MIT License
873
891
  // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
@@ -891,6 +909,25 @@ const TObjectTypes = {
891
909
  // THE SOFTWARE.
892
910
  //
893
911
  const isObjKey = (key, obj) => key in obj;
912
+ const classExtends = (x) => x;
913
+ const isQuery = (x) => {
914
+ return x instanceof TQuery;
915
+ };
916
+ const isObject = (x) => {
917
+ return x instanceof TObject;
918
+ };
919
+ const isUser = (x) => {
920
+ return x instanceof TUser;
921
+ };
922
+ const isRole = (x) => {
923
+ return x instanceof TRole;
924
+ };
925
+ const isFile = (x) => {
926
+ return x instanceof TFile;
927
+ };
928
+ const isJob = (x) => {
929
+ return x instanceof TJob;
930
+ };
894
931
 
895
932
  //
896
933
  // codec.ts
@@ -979,50 +1016,6 @@ const decodeEJSON = (x, stack, options) => {
979
1016
  const serialize = (x, options) => JSON.stringify(encodeEJSON(x, [], options ?? {}), undefined, options?.space);
980
1017
  const deserialize = (buffer, options) => decodeEJSON(JSON.parse(buffer), [], options ?? {});
981
1018
 
982
- //
983
- // index.ts
984
- //
985
- // The MIT License
986
- // Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.
987
- //
988
- // Permission is hereby granted, free of charge, to any person obtaining a copy
989
- // of this software and associated documentation files (the "Software"), to deal
990
- // in the Software without restriction, including without limitation the rights
991
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
992
- // copies of the Software, and to permit persons to whom the Software is
993
- // furnished to do so, subject to the following conditions:
994
- //
995
- // The above copyright notice and this permission notice shall be included in
996
- // all copies or substantial portions of the Software.
997
- //
998
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
999
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1000
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1001
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1002
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1003
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1004
- // THE SOFTWARE.
1005
- //
1006
- const classExtends = (x) => x;
1007
- const isQuery = (x) => {
1008
- return x instanceof TQuery;
1009
- };
1010
- const isObject = (x) => {
1011
- return x instanceof TObject;
1012
- };
1013
- const isUser = (x) => {
1014
- return x instanceof TUser;
1015
- };
1016
- const isRole = (x) => {
1017
- return x instanceof TRole;
1018
- };
1019
- const isFile = (x) => {
1020
- return x instanceof TFile;
1021
- };
1022
- const isJob = (x) => {
1023
- return x instanceof TJob;
1024
- };
1025
-
1026
1019
  //
1027
1020
  // methods.ts
1028
1021
  //
@@ -2025,5 +2018,5 @@ class ProtoClient extends ProtoType {
2025
2018
  }
2026
2019
  }
2027
2020
 
2028
- export { LiveQuerySubscription as L, ProtoType as P, TQuery as T, _logLevels as _, TUser as a, ProtoClient as b, classExtends as c, deserialize as d, isObject as e, isUser as f, isRole as g, isFile as h, isQuery as i, isJob as j, serialize as s };
2029
- //# sourceMappingURL=index-ZPbBr9Db.mjs.map
2021
+ export { LiveQuerySubscription as L, ProtoType as P, TQuery as T, _logLevels as _, TUser as a, ProtoClient as b, classExtends as c, deserialize as d, serialize as s };
2022
+ //# sourceMappingURL=index-DfqABzjr.mjs.map