proto.io 0.0.216 → 0.0.218

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 (52) 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 +2 -2
  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 +5 -3
  8. package/dist/adapters/storage/progres.js +511 -148
  9. package/dist/adapters/storage/progres.js.map +1 -1
  10. package/dist/adapters/storage/progres.mjs +511 -148
  11. package/dist/adapters/storage/progres.mjs.map +1 -1
  12. package/dist/client.d.ts +3 -3
  13. package/dist/client.js +2 -8
  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 +28 -34
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +29 -29
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/internals/{base-BO3ZP6EF.d.ts → base-CqeIQTE9.d.ts} +2 -2
  23. package/dist/internals/base-CqeIQTE9.d.ts.map +1 -0
  24. package/dist/internals/{chunk-DDkLpKXp.d.ts → chunk-CLKTwfRe.d.ts} +3 -3
  25. package/dist/internals/chunk-CLKTwfRe.d.ts.map +1 -0
  26. package/dist/internals/{index-B8TESzd9.js → index-CLKTEIj0.js} +2 -2
  27. package/dist/internals/index-CLKTEIj0.js.map +1 -0
  28. package/dist/internals/{index-DF2AfSGK.mjs → index-CZ5fKgiJ.mjs} +159 -166
  29. package/dist/internals/index-CZ5fKgiJ.mjs.map +1 -0
  30. package/dist/internals/{index-CYhA8SU8.d.ts → index-Ci8d33k-.d.ts} +3 -9
  31. package/dist/internals/index-Ci8d33k-.d.ts.map +1 -0
  32. package/dist/internals/{index-HdMgLYtD.d.ts → index-DQHWdslW.d.ts} +59 -22
  33. package/dist/internals/index-DQHWdslW.d.ts.map +1 -0
  34. package/dist/internals/{index-BzDsTt4R.mjs → index-gWcE22mf.mjs} +2 -2
  35. package/dist/internals/index-gWcE22mf.mjs.map +1 -0
  36. package/dist/internals/{index-DfnPpl1I.js → index-xHeu-AjT.js} +158 -171
  37. package/dist/internals/index-xHeu-AjT.js.map +1 -0
  38. package/dist/internals/{validator-BBjOdLiT.js → validator-B5yHpyvb.js} +743 -36
  39. package/dist/internals/validator-B5yHpyvb.js.map +1 -0
  40. package/dist/internals/{validator-LNgZGT_l.mjs → validator-DX2nXeQo.mjs} +736 -35
  41. package/dist/internals/validator-DX2nXeQo.mjs.map +1 -0
  42. package/package.json +2 -2
  43. package/dist/internals/base-BO3ZP6EF.d.ts.map +0 -1
  44. package/dist/internals/chunk-DDkLpKXp.d.ts.map +0 -1
  45. package/dist/internals/index-B8TESzd9.js.map +0 -1
  46. package/dist/internals/index-BzDsTt4R.mjs.map +0 -1
  47. package/dist/internals/index-CYhA8SU8.d.ts.map +0 -1
  48. package/dist/internals/index-DF2AfSGK.mjs.map +0 -1
  49. package/dist/internals/index-DfnPpl1I.js.map +0 -1
  50. package/dist/internals/index-HdMgLYtD.d.ts.map +0 -1
  51. package/dist/internals/validator-BBjOdLiT.js.map +0 -1
  52. package/dist/internals/validator-LNgZGT_l.mjs.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-BzDsTt4R.mjs';
4
+ import { T as TObject, e as decodeUpdateOp } from './index-gWcE22mf.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
  //
@@ -1082,10 +1075,10 @@ const applyObjectMethods = (object, proto) => {
1082
1075
  url: {
1083
1076
  get() {
1084
1077
  const filename = this.filename;
1085
- if (_.isNil(this.objectId) || _.isNil(filename))
1078
+ if (_.isNil(this.id) || _.isNil(filename))
1086
1079
  return;
1087
1080
  const endpoint = proto[PVK].options.endpoint;
1088
- const path = `files/${this.objectId}/${encodeURIComponent(filename)}`;
1081
+ const path = `files/${this.id}/${encodeURIComponent(filename)}`;
1089
1082
  return endpoint.endsWith('/') ? `${endpoint}${path}` : `${endpoint}/${path}`;
1090
1083
  }
1091
1084
  },
@@ -1113,7 +1106,7 @@ const applyObjectMethods = (object, proto) => {
1113
1106
  },
1114
1107
  fetchWithInclude: {
1115
1108
  async value(keys, options) {
1116
- const fetched = await query().equalTo('_id', this.objectId).includes(keys).first(options);
1109
+ const fetched = await query().equalTo('_id', this.id).includes(keys).first(options);
1117
1110
  if (!fetched)
1118
1111
  throw Error('Unable to fetch document');
1119
1112
  this[PVK].attributes = fetched.attributes;
@@ -1126,13 +1119,13 @@ const applyObjectMethods = (object, proto) => {
1126
1119
  if (options?.cascadeSave !== false) {
1127
1120
  for (const update of _.values(mutated)) {
1128
1121
  const [, value] = decodeUpdateOp(update);
1129
- if (value instanceof TObject && (_.isNil(value.objectId) || value.isDirty))
1122
+ if (value instanceof TObject && (_.isNil(value.id) || value.isDirty))
1130
1123
  await value.save(options);
1131
1124
  }
1132
1125
  }
1133
- if (this.objectId) {
1126
+ if (this.id) {
1134
1127
  const updated = await query()
1135
- .equalTo('_id', this.objectId)
1128
+ .equalTo('_id', this.id)
1136
1129
  .includes(...this.keys())
1137
1130
  .updateOne(this[PVK].mutated, options);
1138
1131
  if (!updated)
@@ -1153,7 +1146,7 @@ const applyObjectMethods = (object, proto) => {
1153
1146
  destroy: {
1154
1147
  async value(options) {
1155
1148
  const deleted = await query()
1156
- .equalTo('_id', this.objectId)
1149
+ .equalTo('_id', this.id)
1157
1150
  .includes(...this.keys())
1158
1151
  .deleteOne(options);
1159
1152
  if (!deleted)
@@ -1237,11 +1230,11 @@ class ProtoType {
1237
1230
  /**
1238
1231
  * Creates a new object.
1239
1232
  * @param className - The name of the class to create.
1240
- * @param objectId - The ID of the object to create.
1233
+ * @param id - The ID of the object to create.
1241
1234
  * @returns The created object.
1242
1235
  */
1243
- Object(className, objectId) {
1244
- const attrs = objectId ? { _id: objectId } : {};
1236
+ Object(className, id) {
1237
+ const attrs = id ? { _id: id } : {};
1245
1238
  const obj = isObjKey(className, TObjectTypes) ? new TObjectTypes[className](attrs) : new TObject(className, attrs);
1246
1239
  return this.rebind(obj);
1247
1240
  }
@@ -1562,7 +1555,7 @@ class Service {
1562
1555
  const objects = deserialize(JSON.stringify(data));
1563
1556
  for (const [id, { callback }] of _.entries(queries)) {
1564
1557
  const keys = _.keys(_.pickBy(ids, v => _.includes(v, id)));
1565
- callback(_.filter(objects, x => _.includes(keys, x.objectId)));
1558
+ callback(_.filter(objects, x => _.includes(keys, x.id)));
1566
1559
  }
1567
1560
  });
1568
1561
  socket.on('connect', register);
@@ -1724,7 +1717,7 @@ class ProtoClientInternal {
1724
1717
  });
1725
1718
  }
1726
1719
  async setPassword(user, password, options) {
1727
- if (!user.objectId)
1720
+ if (!user.id)
1728
1721
  throw Error('Invalid user');
1729
1722
  if (_.isEmpty(password))
1730
1723
  throw Error('Invalid password');
@@ -1732,20 +1725,20 @@ class ProtoClientInternal {
1732
1725
  await this.service.request({
1733
1726
  method: 'post',
1734
1727
  baseURL: this.options.endpoint,
1735
- url: `user/${user.objectId}/password`,
1728
+ url: `user/${user.id}/password`,
1736
1729
  data: serialize({ password }, serializeOpts),
1737
1730
  responseType: 'text',
1738
1731
  ...opts,
1739
1732
  });
1740
1733
  }
1741
1734
  async unsetPassword(user, options) {
1742
- if (!user.objectId)
1735
+ if (!user.id)
1743
1736
  throw Error('Invalid user');
1744
1737
  const { serializeOpts, ...opts } = options ?? {};
1745
1738
  await this.service.request({
1746
1739
  method: 'post',
1747
1740
  baseURL: this.options.endpoint,
1748
- url: `user/${user.objectId}/password`,
1741
+ url: `user/${user.id}/password`,
1749
1742
  responseType: 'text',
1750
1743
  ...opts,
1751
1744
  });
@@ -1763,7 +1756,7 @@ class ProtoClientInternal {
1763
1756
  }
1764
1757
  async updateFile(proto, object, options) {
1765
1758
  const updated = await proto.Query(object.className)
1766
- .equalTo('_id', object.objectId)
1759
+ .equalTo('_id', object.id)
1767
1760
  .includes(...object.keys())
1768
1761
  .updateOne(object[PVK].mutated, options);
1769
1762
  if (updated) {
@@ -1814,11 +1807,11 @@ class ProtoClientInternal {
1814
1807
  return object;
1815
1808
  }
1816
1809
  async saveFile(proto, object, options) {
1817
- return object.objectId ? this.updateFile(proto, object, options) : this.createFile(proto, object, options);
1810
+ return object.id ? this.updateFile(proto, object, options) : this.createFile(proto, object, options);
1818
1811
  }
1819
1812
  async deleteFile(proto, object, options) {
1820
1813
  const deleted = await proto.Query(object.className)
1821
- .equalTo('_id', object.objectId)
1814
+ .equalTo('_id', object.id)
1822
1815
  .deleteOne(options);
1823
1816
  if (deleted) {
1824
1817
  object[PVK].attributes = deleted.attributes;
@@ -1836,7 +1829,7 @@ class ProtoClientInternal {
1836
1829
  const res = await this.service.request({
1837
1830
  method: 'get',
1838
1831
  baseURL: this.options.endpoint,
1839
- url: `files/${object.objectId}/${encodeURIComponent(filename)}`,
1832
+ url: `files/${object.id}/${encodeURIComponent(filename)}`,
1840
1833
  responseType: 'stream',
1841
1834
  headers: {
1842
1835
  'Content-Type': 'multipart/form-data',
@@ -1900,14 +1893,14 @@ class ProtoClientInternal {
1900
1893
  };
1901
1894
  }
1902
1895
  refs(proto, object, options) {
1903
- if (!object.objectId)
1896
+ if (!object.id)
1904
1897
  throw Error('Invalid object');
1905
1898
  const request = async () => {
1906
1899
  const { serializeOpts, ...opts } = options ?? {};
1907
1900
  const res = await this.service.request({
1908
1901
  method: 'get',
1909
1902
  baseURL: this.options.endpoint,
1910
- url: `classes/${encodeURIComponent(object.className)}/${object.objectId}/refs`,
1903
+ url: `classes/${encodeURIComponent(object.className)}/${object.id}/refs`,
1911
1904
  serializeOpts: {
1912
1905
  objAttrs: TObject.defaultReadonlyKeys,
1913
1906
  },
@@ -1955,13 +1948,13 @@ class ProtoClient extends ProtoType {
1955
1948
  return new ProtoClientQuery(className, this, {});
1956
1949
  }
1957
1950
  Relation(object, key) {
1958
- const objectId = object.objectId;
1959
- if (!objectId)
1951
+ const id = object.id;
1952
+ if (!id)
1960
1953
  throw Error('Invalid object');
1961
1954
  return new ProtoClientRelationQuery(this, {
1962
1955
  relatedBy: {
1963
1956
  className: object.className,
1964
- objectId,
1957
+ id,
1965
1958
  key,
1966
1959
  },
1967
1960
  });
@@ -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-DF2AfSGK.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-CZ5fKgiJ.mjs.map