@amityco/ts-sdk 7.11.1-cc3ae7ed.0 → 7.11.1-cc6dc67b.0

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.
@@ -15,9 +15,6 @@ declare global {
15
15
  message: string;
16
16
  code: Amity.ServerError;
17
17
  };
18
- type MutationResponse = {
19
- success: boolean;
20
- };
21
18
  type Response<T> = SuccessResponse<T> | FailResponse | ErrorResponse;
22
19
  type Token = string;
23
20
  type Pagination = {
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/@types/core/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,CAAC;AAEV,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,eAAe,CAAC,CAAC,IAAI;YACxB,MAAM,EAAE,SAAS,CAAC;YAClB,IAAI,EAAE,CAAC,CAAC;SACT,CAAC;QAEF,KAAK,YAAY,GAAG;YAClB,MAAM,EAAE,MAAM,CAAC;YACf,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC;SACzB,CAAC;QAEF,KAAK,aAAa,GAAG;YACnB,MAAM,EAAE,OAAO,CAAC;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC;SACzB,CAAC;QAEF,KAAK,gBAAgB,GAAG;YACtB,OAAO,EAAE,OAAO,CAAC;SAClB,CAAC;QAEF,KAAK,QAAQ,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,aAAa,CAAC;QAErE,KAAK,KAAK,GAAG,MAAM,CAAC;QAEpB,KAAK,UAAU,GAAG;YAChB,MAAM,EAAE;gBACN,QAAQ,CAAC,EAAE,KAAK,CAAC;gBACjB,IAAI,CAAC,EAAE,KAAK,CAAC;aACd,CAAC;SACH,CAAC;QAEF,KAAK,U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K,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,KAC5C,IAAI,CAAC;YACV,GAAG,EAAE,CAAC,CAAC,SAAS,MAAM,KAAK,CAAC,UAAU,EACpC,KAAK,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,KAC7C,IAAI,CAAC;YACV,kBAAkB,EAAE,MAAM,IAAI,CAAC;YAC/B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,KAAK,CAAC,YAAY,CAAC;YAC7F,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;SACtC,CAAC;KACH;CACF"}
@@ -1,4 +1,3 @@
1
1
  export * from './createEvent';
2
2
  export * from './updateEvent';
3
- export * from './deleteEvent';
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eventRepository/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/eventRepository/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -30428,6 +30428,57 @@ const updateEvent = async (eventId, bundle) => {
30428
30428
  };
30429
30429
  /* end_public_function */
30430
30430
 
30431
+ /**
30432
+ * ```js
30433
+ * import { EventRepository } from '@amityco/ts-sdk'
30434
+ * const dispose = EventRepository.onEventCreated(event => {
30435
+ * // ...
30436
+ * })
30437
+ * ```
30438
+ *
30439
+ * Fired when a {@link Amity.Event} has been created
30440
+ *
30441
+ * @param callback The function to call when the event was fired
30442
+ * @returns an {@link Amity.Unsubscriber} function to stop listening
30443
+ *
30444
+ * @category Event Events
30445
+ */
30446
+ const onEventCreated = (callback) => createEventEventSubscriber('event.created', callback);
30447
+
30448
+ /**
30449
+ * ```js
30450
+ * import { EventRepository } from '@amityco/ts-sdk'
30451
+ * const dispose = EventRepository.onEventUpdated(event => {
30452
+ * // ...
30453
+ * })
30454
+ * ```
30455
+ *
30456
+ * Fired when a {@link Amity.Event} has been updated
30457
+ *
30458
+ * @param callback The function to call when the event was fired
30459
+ * @returns an {@link Amity.Unsubscriber} function to stop listening
30460
+ *
30461
+ * @category Event Events
30462
+ */
30463
+ const onEventUpdated = (callback) => createEventEventSubscriber('event.updated', callback);
30464
+
30465
+ /**
30466
+ * ```js
30467
+ * import { EventRepository } from '@amityco/ts-sdk'
30468
+ * const dispose = EventRepository.onEventDeleted(event => {
30469
+ * // ...
30470
+ * })
30471
+ * ```
30472
+ *
30473
+ * Fired when a {@link Amity.Event} has been deleted
30474
+ *
30475
+ * @param callback The function to call when the event was fired
30476
+ * @returns an {@link Amity.Unsubscriber} function to stop listening
30477
+ *
30478
+ * @category Event Events
30479
+ */
30480
+ const onEventDeleted = (callback) => createEventEventSubscriber('event.deleted', callback);
30481
+
30431
30482
  /* begin_public_function
30432
30483
  id: event.get
30433
30484
  */
@@ -30486,91 +30537,6 @@ getEvent$1.locally = (eventId) => {
30486
30537
  };
30487
30538
  };
30488
30539
 
30489
- /* begin_public_function
30490
- id: event.delete
30491
- */
30492
- /**
30493
- * ```js
30494
- * import { EventRepository } from '@amityco/ts-sdk'
30495
- * const { success } = await EventRepository.deleteEvent(eventId)
30496
- * ```
30497
- *
30498
- * Deletes a {@link Amity.Event}
30499
- *
30500
- * @param eventId The {@link Amity.Event} ID to delete
30501
- *
30502
- * @category Event API
30503
- * @async
30504
- */
30505
- const deleteEvent = async (eventId) => {
30506
- const client = getActiveClient();
30507
- client.log('event/deleteEvent', eventId);
30508
- const event = await getEvent$1(eventId);
30509
- await client.http.delete(`/api/v3/events/${eventId}`);
30510
- const deletedEvent = Object.assign(Object.assign({}, event.data), { isDeleted: true });
30511
- upsertInCache(['event', 'get', eventId], deletedEvent);
30512
- fireEvent('event.deleted', {
30513
- users: [],
30514
- files: [],
30515
- communities: [],
30516
- videoStreamings: [],
30517
- events: [deletedEvent],
30518
- discussionCommunities: [],
30519
- });
30520
- };
30521
- /* end_public_function */
30522
-
30523
- /**
30524
- * ```js
30525
- * import { EventRepository } from '@amityco/ts-sdk'
30526
- * const dispose = EventRepository.onEventCreated(event => {
30527
- * // ...
30528
- * })
30529
- * ```
30530
- *
30531
- * Fired when a {@link Amity.Event} has been created
30532
- *
30533
- * @param callback The function to call when the event was fired
30534
- * @returns an {@link Amity.Unsubscriber} function to stop listening
30535
- *
30536
- * @category Event Events
30537
- */
30538
- const onEventCreated = (callback) => createEventEventSubscriber('event.created', callback);
30539
-
30540
- /**
30541
- * ```js
30542
- * import { EventRepository } from '@amityco/ts-sdk'
30543
- * const dispose = EventRepository.onEventUpdated(event => {
30544
- * // ...
30545
- * })
30546
- * ```
30547
- *
30548
- * Fired when a {@link Amity.Event} has been updated
30549
- *
30550
- * @param callback The function to call when the event was fired
30551
- * @returns an {@link Amity.Unsubscriber} function to stop listening
30552
- *
30553
- * @category Event Events
30554
- */
30555
- const onEventUpdated = (callback) => createEventEventSubscriber('event.updated', callback);
30556
-
30557
- /**
30558
- * ```js
30559
- * import { EventRepository } from '@amityco/ts-sdk'
30560
- * const dispose = EventRepository.onEventDeleted(event => {
30561
- * // ...
30562
- * })
30563
- * ```
30564
- *
30565
- * Fired when a {@link Amity.Event} has been deleted
30566
- *
30567
- * @param callback The function to call when the event was fired
30568
- * @returns an {@link Amity.Unsubscriber} function to stop listening
30569
- *
30570
- * @category Event Events
30571
- */
30572
- const onEventDeleted = (callback) => createEventEventSubscriber('event.deleted', callback);
30573
-
30574
30540
  /* begin_public_function
30575
30541
  id: event.get
30576
30542
  */
@@ -30604,7 +30570,6 @@ var index = /*#__PURE__*/Object.freeze({
30604
30570
  __proto__: null,
30605
30571
  createEvent: createEvent,
30606
30572
  updateEvent: updateEvent,
30607
- deleteEvent: deleteEvent,
30608
30573
  onEventCreated: onEventCreated,
30609
30574
  onEventUpdated: onEventUpdated,
30610
30575
  onEventDeleted: onEventDeleted,
package/dist/index.esm.js CHANGED
@@ -46520,6 +46520,57 @@ const updateEvent = async (eventId, bundle) => {
46520
46520
  };
46521
46521
  /* end_public_function */
46522
46522
 
46523
+ /**
46524
+ * ```js
46525
+ * import { EventRepository } from '@amityco/ts-sdk'
46526
+ * const dispose = EventRepository.onEventCreated(event => {
46527
+ * // ...
46528
+ * })
46529
+ * ```
46530
+ *
46531
+ * Fired when a {@link Amity.Event} has been created
46532
+ *
46533
+ * @param callback The function to call when the event was fired
46534
+ * @returns an {@link Amity.Unsubscriber} function to stop listening
46535
+ *
46536
+ * @category Event Events
46537
+ */
46538
+ const onEventCreated = (callback) => createEventEventSubscriber('event.created', callback);
46539
+
46540
+ /**
46541
+ * ```js
46542
+ * import { EventRepository } from '@amityco/ts-sdk'
46543
+ * const dispose = EventRepository.onEventUpdated(event => {
46544
+ * // ...
46545
+ * })
46546
+ * ```
46547
+ *
46548
+ * Fired when a {@link Amity.Event} has been updated
46549
+ *
46550
+ * @param callback The function to call when the event was fired
46551
+ * @returns an {@link Amity.Unsubscriber} function to stop listening
46552
+ *
46553
+ * @category Event Events
46554
+ */
46555
+ const onEventUpdated = (callback) => createEventEventSubscriber('event.updated', callback);
46556
+
46557
+ /**
46558
+ * ```js
46559
+ * import { EventRepository } from '@amityco/ts-sdk'
46560
+ * const dispose = EventRepository.onEventDeleted(event => {
46561
+ * // ...
46562
+ * })
46563
+ * ```
46564
+ *
46565
+ * Fired when a {@link Amity.Event} has been deleted
46566
+ *
46567
+ * @param callback The function to call when the event was fired
46568
+ * @returns an {@link Amity.Unsubscriber} function to stop listening
46569
+ *
46570
+ * @category Event Events
46571
+ */
46572
+ const onEventDeleted = (callback) => createEventEventSubscriber('event.deleted', callback);
46573
+
46523
46574
  /* begin_public_function
46524
46575
  id: event.get
46525
46576
  */
@@ -46578,91 +46629,6 @@ getEvent$1.locally = (eventId) => {
46578
46629
  };
46579
46630
  };
46580
46631
 
46581
- /* begin_public_function
46582
- id: event.delete
46583
- */
46584
- /**
46585
- * ```js
46586
- * import { EventRepository } from '@amityco/ts-sdk'
46587
- * const { success } = await EventRepository.deleteEvent(eventId)
46588
- * ```
46589
- *
46590
- * Deletes a {@link Amity.Event}
46591
- *
46592
- * @param eventId The {@link Amity.Event} ID to delete
46593
- *
46594
- * @category Event API
46595
- * @async
46596
- */
46597
- const deleteEvent = async (eventId) => {
46598
- const client = getActiveClient();
46599
- client.log('event/deleteEvent', eventId);
46600
- const event = await getEvent$1(eventId);
46601
- await client.http.delete(`/api/v3/events/${eventId}`);
46602
- const deletedEvent = Object.assign(Object.assign({}, event.data), { isDeleted: true });
46603
- upsertInCache(['event', 'get', eventId], deletedEvent);
46604
- fireEvent('event.deleted', {
46605
- users: [],
46606
- files: [],
46607
- communities: [],
46608
- videoStreamings: [],
46609
- events: [deletedEvent],
46610
- discussionCommunities: [],
46611
- });
46612
- };
46613
- /* end_public_function */
46614
-
46615
- /**
46616
- * ```js
46617
- * import { EventRepository } from '@amityco/ts-sdk'
46618
- * const dispose = EventRepository.onEventCreated(event => {
46619
- * // ...
46620
- * })
46621
- * ```
46622
- *
46623
- * Fired when a {@link Amity.Event} has been created
46624
- *
46625
- * @param callback The function to call when the event was fired
46626
- * @returns an {@link Amity.Unsubscriber} function to stop listening
46627
- *
46628
- * @category Event Events
46629
- */
46630
- const onEventCreated = (callback) => createEventEventSubscriber('event.created', callback);
46631
-
46632
- /**
46633
- * ```js
46634
- * import { EventRepository } from '@amityco/ts-sdk'
46635
- * const dispose = EventRepository.onEventUpdated(event => {
46636
- * // ...
46637
- * })
46638
- * ```
46639
- *
46640
- * Fired when a {@link Amity.Event} has been updated
46641
- *
46642
- * @param callback The function to call when the event was fired
46643
- * @returns an {@link Amity.Unsubscriber} function to stop listening
46644
- *
46645
- * @category Event Events
46646
- */
46647
- const onEventUpdated = (callback) => createEventEventSubscriber('event.updated', callback);
46648
-
46649
- /**
46650
- * ```js
46651
- * import { EventRepository } from '@amityco/ts-sdk'
46652
- * const dispose = EventRepository.onEventDeleted(event => {
46653
- * // ...
46654
- * })
46655
- * ```
46656
- *
46657
- * Fired when a {@link Amity.Event} has been deleted
46658
- *
46659
- * @param callback The function to call when the event was fired
46660
- * @returns an {@link Amity.Unsubscriber} function to stop listening
46661
- *
46662
- * @category Event Events
46663
- */
46664
- const onEventDeleted = (callback) => createEventEventSubscriber('event.deleted', callback);
46665
-
46666
46632
  /* begin_public_function
46667
46633
  id: event.get
46668
46634
  */
@@ -46696,7 +46662,6 @@ var index = /*#__PURE__*/Object.freeze({
46696
46662
  __proto__: null,
46697
46663
  createEvent: createEvent,
46698
46664
  updateEvent: updateEvent,
46699
- deleteEvent: deleteEvent,
46700
46665
  onEventCreated: onEventCreated,
46701
46666
  onEventUpdated: onEventUpdated,
46702
46667
  onEventDeleted: onEventDeleted,