@rtsdk/topia 0.17.2 → 0.17.3

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.
package/dist/index.cjs CHANGED
@@ -40004,12 +40004,14 @@ class DroppedAsset extends Asset {
40004
40004
  *
40005
40005
  * @returns {Promise<object | ResponseType>} Returns the data object or an error response.
40006
40006
  */
40007
- fetchDataObject(appPublicKey, appJWT) {
40007
+ fetchDataObject(appPublicKey, appJWT, sharedAppPublicKey, sharedAppJWT) {
40008
40008
  return __awaiter(this, void 0, void 0, function* () {
40009
40009
  try {
40010
40010
  let query = "";
40011
40011
  if (appPublicKey)
40012
40012
  query = `?appPublicKey=${appPublicKey}&appJWT=${appJWT}`;
40013
+ else if (sharedAppPublicKey)
40014
+ query = `?sharedAppPublicKey=${sharedAppPublicKey}&sharedAppJWT=${sharedAppJWT}`;
40013
40015
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets/${this.id}/data-object${query}`, this.requestOptions);
40014
40016
  this.dataObject = response.data;
40015
40017
  return response.data;
@@ -40640,12 +40642,14 @@ class Ecosystem extends SDKController {
40640
40642
  *
40641
40643
  * @returns {Promise<object | ResponseType>} Returns the data object or an error response.
40642
40644
  */
40643
- fetchDataObject(appPublicKey, appJWT) {
40645
+ fetchDataObject(appPublicKey, appJWT, sharedAppPublicKey, sharedAppJWT) {
40644
40646
  return __awaiter(this, void 0, void 0, function* () {
40645
40647
  try {
40646
40648
  let query = "";
40647
40649
  if (appPublicKey)
40648
40650
  query = `?appPublicKey=${appPublicKey}&appJWT=${appJWT}`;
40651
+ else if (sharedAppPublicKey)
40652
+ query = `?sharedAppPublicKey=${sharedAppPublicKey}&sharedAppJWT=${sharedAppJWT}`;
40649
40653
  const response = yield this.topiaPublicApi().get(`/ecosystem/data-object${query}`, this.requestOptions);
40650
40654
  this.dataObject = response.data;
40651
40655
  return response.data;
@@ -40860,11 +40864,13 @@ class World extends SDKController {
40860
40864
  * const { dataObject } = world;
40861
40865
  * ```
40862
40866
  */
40863
- this.fetchDataObject = (appPublicKey, appJWT) => __awaiter(this, void 0, void 0, function* () {
40867
+ this.fetchDataObject = (appPublicKey, appJWT, sharedAppPublicKey, sharedAppJWT) => __awaiter(this, void 0, void 0, function* () {
40864
40868
  try {
40865
40869
  let query = "";
40866
40870
  if (appPublicKey)
40867
40871
  query = `?appPublicKey=${appPublicKey}&appJWT=${appJWT}`;
40872
+ else if (sharedAppPublicKey)
40873
+ query = `?sharedAppPublicKey=${sharedAppPublicKey}&sharedAppJWT=${sharedAppJWT}`;
40868
40874
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/get-data-object${query}`, this.requestOptions);
40869
40875
  this.dataObject = response.data;
40870
40876
  return response.data;
@@ -41380,7 +41386,9 @@ class World extends SDKController {
41380
41386
  *
41381
41387
  * @example
41382
41388
  * ```ts
41383
- * await world.triggerParticle({ name: "Flame" });
41389
+ * const droppedAsset = await DroppedAsset.get(assetId, urlSlug, { credentials });
41390
+ *
41391
+ * await world.triggerParticle({ name: "Flame", duration: 5, position: droppedAsset.position });
41384
41392
  * ```
41385
41393
  *
41386
41394
  * @returns {Promise<ResponseType | string>} Returns `{ success: true }` or a message if no particleId is found.
@@ -42500,12 +42508,14 @@ class Visitor extends User {
42500
42508
  *
42501
42509
  * @returns {Promise<object | ResponseType>} Returns the data object or an error response.
42502
42510
  */
42503
- fetchDataObject(appPublicKey, appJWT) {
42511
+ fetchDataObject(appPublicKey, appJWT, sharedAppPublicKey, sharedAppJWT) {
42504
42512
  return __awaiter(this, void 0, void 0, function* () {
42505
42513
  try {
42506
42514
  let query = "";
42507
42515
  if (appPublicKey)
42508
42516
  query = `?appPublicKey=${appPublicKey}&appJWT=${appJWT}`;
42517
+ else if (sharedAppPublicKey)
42518
+ query = `?sharedAppPublicKey=${sharedAppPublicKey}&sharedAppJWT=${sharedAppJWT}`;
42509
42519
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/visitors/${this.id}/get-data-object${query}`, this.requestOptions);
42510
42520
  this.dataObject = response.data;
42511
42521
  return response.data;
package/dist/index.d.ts CHANGED
@@ -224,7 +224,7 @@ declare class DroppedAsset extends Asset implements DroppedAssetInterface {
224
224
  *
225
225
  * @returns {Promise<object | ResponseType>} Returns the data object or an error response.
226
226
  */
227
- fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
227
+ fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
228
228
  /**
229
229
  * Sets the data object for a dropped asset and assigns the response data to the instance.
230
230
  *
@@ -899,7 +899,9 @@ declare class World extends SDKController implements WorldInterface {
899
899
  *
900
900
  * @example
901
901
  * ```ts
902
- * await world.triggerParticle({ name: "Flame" });
902
+ * const droppedAsset = await DroppedAsset.get(assetId, urlSlug, { credentials });
903
+ *
904
+ * await world.triggerParticle({ name: "Flame", duration: 5, position: droppedAsset.position });
903
905
  * ```
904
906
  *
905
907
  * @returns {Promise<ResponseType | string>} Returns `{ success: true }` or a message if no particleId is found.
@@ -952,7 +954,7 @@ declare class World extends SDKController implements WorldInterface {
952
954
  * const { dataObject } = world;
953
955
  * ```
954
956
  */
955
- fetchDataObject: (appPublicKey?: string, appJWT?: string) => Promise<void | ResponseType$1>;
957
+ fetchDataObject: (appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string) => Promise<void | ResponseType$1>;
956
958
  /**
957
959
  * Sets the data object for a user. Must have valid interactive credentials from a visitor in the world.
958
960
  *
@@ -1665,7 +1667,7 @@ declare class Visitor extends User implements VisitorInterface {
1665
1667
  *
1666
1668
  * @returns {Promise<object | ResponseType>} Returns the data object or an error response.
1667
1669
  */
1668
- fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
1670
+ fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
1669
1671
  /**
1670
1672
  * Sets the data object for a visitor.
1671
1673
  *
@@ -1848,7 +1850,7 @@ type AssetOptionalInterface = {
1848
1850
  interface DroppedAssetInterface extends AssetInterface {
1849
1851
  fetchDroppedAssetById(): Promise<void | ResponseType$1>;
1850
1852
  deleteDroppedAsset(): Promise<void | ResponseType$1>;
1851
- fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
1853
+ fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
1852
1854
  setDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
1853
1855
  updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
1854
1856
  incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
@@ -2036,7 +2038,7 @@ interface UpdatePrivateZoneInterface {
2036
2038
  }
2037
2039
 
2038
2040
  interface EcosystemInterface {
2039
- fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
2041
+ fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
2040
2042
  setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
2041
2043
  updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
2042
2044
  incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
@@ -2110,7 +2112,7 @@ interface VisitorInterface extends SDKInterface {
2110
2112
  moveVisitor({ shouldTeleportVisitor, x, y }: MoveVisitorInterface): Promise<void | ResponseType$1>;
2111
2113
  fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
2112
2114
  openIframe({ link, shouldOpenInDrawer, title }: OpenIframeInterface): Promise<void | ResponseType$1>;
2113
- fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
2115
+ fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
2114
2116
  setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
2115
2117
  updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
2116
2118
  incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
@@ -2237,7 +2239,7 @@ interface WorldInterface extends SDKInterface, WorldDetailsInterface {
2237
2239
  }): Promise<object | ResponseType$1>;
2238
2240
  replaceScene(sceneId: string): Promise<void | ResponseType$1>;
2239
2241
  fireToast({ groupId, title, text }: FireToastInterface): Promise<void | ResponseType$1>;
2240
- fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
2242
+ fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
2241
2243
  setDataObject(dataObject: object | null | undefined, options: object): Promise<void | ResponseType$1>;
2242
2244
  updateDataObject(dataObject: object, options: object): Promise<void | ResponseType$1>;
2243
2245
  incrementDataObjectValue(path: string, amount: number, options: object): Promise<void | ResponseType$1>;
@@ -2408,7 +2410,7 @@ declare class Ecosystem extends SDKController {
2408
2410
  *
2409
2411
  * @returns {Promise<object | ResponseType>} Returns the data object or an error response.
2410
2412
  */
2411
- fetchDataObject(appPublicKey?: string, appJWT?: string): Promise<void | ResponseType$1>;
2413
+ fetchDataObject(appPublicKey?: string, appJWT?: string, sharedAppPublicKey?: string, sharedAppJWT?: string): Promise<void | ResponseType$1>;
2412
2414
  /**
2413
2415
  * Sets the data object for a Topia ecosystem.
2414
2416
  *
package/dist/index.js CHANGED
@@ -40002,12 +40002,14 @@ class DroppedAsset extends Asset {
40002
40002
  *
40003
40003
  * @returns {Promise<object | ResponseType>} Returns the data object or an error response.
40004
40004
  */
40005
- fetchDataObject(appPublicKey, appJWT) {
40005
+ fetchDataObject(appPublicKey, appJWT, sharedAppPublicKey, sharedAppJWT) {
40006
40006
  return __awaiter(this, void 0, void 0, function* () {
40007
40007
  try {
40008
40008
  let query = "";
40009
40009
  if (appPublicKey)
40010
40010
  query = `?appPublicKey=${appPublicKey}&appJWT=${appJWT}`;
40011
+ else if (sharedAppPublicKey)
40012
+ query = `?sharedAppPublicKey=${sharedAppPublicKey}&sharedAppJWT=${sharedAppJWT}`;
40011
40013
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets/${this.id}/data-object${query}`, this.requestOptions);
40012
40014
  this.dataObject = response.data;
40013
40015
  return response.data;
@@ -40638,12 +40640,14 @@ class Ecosystem extends SDKController {
40638
40640
  *
40639
40641
  * @returns {Promise<object | ResponseType>} Returns the data object or an error response.
40640
40642
  */
40641
- fetchDataObject(appPublicKey, appJWT) {
40643
+ fetchDataObject(appPublicKey, appJWT, sharedAppPublicKey, sharedAppJWT) {
40642
40644
  return __awaiter(this, void 0, void 0, function* () {
40643
40645
  try {
40644
40646
  let query = "";
40645
40647
  if (appPublicKey)
40646
40648
  query = `?appPublicKey=${appPublicKey}&appJWT=${appJWT}`;
40649
+ else if (sharedAppPublicKey)
40650
+ query = `?sharedAppPublicKey=${sharedAppPublicKey}&sharedAppJWT=${sharedAppJWT}`;
40647
40651
  const response = yield this.topiaPublicApi().get(`/ecosystem/data-object${query}`, this.requestOptions);
40648
40652
  this.dataObject = response.data;
40649
40653
  return response.data;
@@ -40858,11 +40862,13 @@ class World extends SDKController {
40858
40862
  * const { dataObject } = world;
40859
40863
  * ```
40860
40864
  */
40861
- this.fetchDataObject = (appPublicKey, appJWT) => __awaiter(this, void 0, void 0, function* () {
40865
+ this.fetchDataObject = (appPublicKey, appJWT, sharedAppPublicKey, sharedAppJWT) => __awaiter(this, void 0, void 0, function* () {
40862
40866
  try {
40863
40867
  let query = "";
40864
40868
  if (appPublicKey)
40865
40869
  query = `?appPublicKey=${appPublicKey}&appJWT=${appJWT}`;
40870
+ else if (sharedAppPublicKey)
40871
+ query = `?sharedAppPublicKey=${sharedAppPublicKey}&sharedAppJWT=${sharedAppJWT}`;
40866
40872
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/get-data-object${query}`, this.requestOptions);
40867
40873
  this.dataObject = response.data;
40868
40874
  return response.data;
@@ -41378,7 +41384,9 @@ class World extends SDKController {
41378
41384
  *
41379
41385
  * @example
41380
41386
  * ```ts
41381
- * await world.triggerParticle({ name: "Flame" });
41387
+ * const droppedAsset = await DroppedAsset.get(assetId, urlSlug, { credentials });
41388
+ *
41389
+ * await world.triggerParticle({ name: "Flame", duration: 5, position: droppedAsset.position });
41382
41390
  * ```
41383
41391
  *
41384
41392
  * @returns {Promise<ResponseType | string>} Returns `{ success: true }` or a message if no particleId is found.
@@ -42498,12 +42506,14 @@ class Visitor extends User {
42498
42506
  *
42499
42507
  * @returns {Promise<object | ResponseType>} Returns the data object or an error response.
42500
42508
  */
42501
- fetchDataObject(appPublicKey, appJWT) {
42509
+ fetchDataObject(appPublicKey, appJWT, sharedAppPublicKey, sharedAppJWT) {
42502
42510
  return __awaiter(this, void 0, void 0, function* () {
42503
42511
  try {
42504
42512
  let query = "";
42505
42513
  if (appPublicKey)
42506
42514
  query = `?appPublicKey=${appPublicKey}&appJWT=${appJWT}`;
42515
+ else if (sharedAppPublicKey)
42516
+ query = `?sharedAppPublicKey=${sharedAppPublicKey}&sharedAppJWT=${sharedAppJWT}`;
42507
42517
  const response = yield this.topiaPublicApi().get(`/world/${this.urlSlug}/visitors/${this.id}/get-data-object${query}`, this.requestOptions);
42508
42518
  this.dataObject = response.data;
42509
42519
  return response.data;
package/package.json CHANGED
@@ -60,5 +60,5 @@
60
60
  "yalc-push": "yarn build && yalc publish --push --dev --no-scripts"
61
61
  },
62
62
  "type": "module",
63
- "version": "0.17.02"
63
+ "version": "0.17.03"
64
64
  }