Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/auto-bump-magicbell-1739167634.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'magicbell': minor
---

Automatic minor version bump for changes in `magicbell`.
5 changes: 5 additions & 0 deletions .changeset/auto-bump-project-client-1739167634.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@magicbell/project-client': minor
---

Automatic minor version bump for changes in `@magicbell/project-client`.
5 changes: 5 additions & 0 deletions .changeset/auto-bump-user-client-1739167634.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@magicbell/user-client': minor
---

Automatic minor version bump for changes in `@magicbell/user-client`.
8 changes: 4 additions & 4 deletions packages/in-app/src/components/internal/webpush.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export class WebPushClient {
if (!activeSubscription?.endpoint) return false;
return (
tokens.data?.data
?.filter((x) => !x.metadata?.discardedAt)
?.filter((x) => !x.discardedAt)
.some((subscription) => {
return subscription.data?.endpoint === activeSubscription.endpoint;
return subscription.endpoint === activeSubscription.endpoint;
}) ?? false
);
}
Expand Down Expand Up @@ -92,9 +92,9 @@ export class WebPushClient {
void this.#client.channels
.getWebPushTokens()
.then(({ data }) => {
const token = data?.data?.find((token) => token.data?.endpoint === endpoint);
const token = data?.data?.find((token) => token.endpoint === endpoint);
if (!token) return;
return this.#client.channels.discardWebPushToken(String(token.metadata?.id));
return this.#client.channels.discardWebPushToken(String(token.id));
})
.catch(() => void 0);

Expand Down
2 changes: 1 addition & 1 deletion packages/magicbell/src/schemas/users/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export const ListUsersNotificationsResponseSchema = {

properties: {
user: {
nullable: false,
type: 'object',
nullable: false,
additionalProperties: false,

properties: {
Expand Down
37 changes: 16 additions & 21 deletions packages/project-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Welcome to the Client SDK documentation. This guide will help you get started wi

## About the API

OpenAPI 3.1.0 Specification for MagicBell API.
OpenAPI 3.0.3 Specification for MagicBell API.

## Table of Contents

Expand Down Expand Up @@ -106,6 +106,7 @@ The SDK provides various services to interact with the API.
| [EventsService](documentation/services/EventsService.md) |
| [IntegrationsService](documentation/services/IntegrationsService.md) |
| [JwtService](documentation/services/JwtService.md) |
| [UsersService](documentation/services/UsersService.md) |

</details>

Expand All @@ -120,21 +121,20 @@ The SDK includes several models that represent the data structures used in API r
| :------------------------------------------------------------------------------------------- | :---------- |
| [ArrayOfBroadcasts](documentation/models/ArrayOfBroadcasts.md) | |
| [Broadcast](documentation/models/Broadcast.md) | |
| [ProjectDeliveryConfig](documentation/models/ProjectDeliveryConfig.md) | |
| [CategoryDeliveryConfig](documentation/models/CategoryDeliveryConfig.md) | |
| [ArrayOfMetadataApnsTokens](documentation/models/ArrayOfMetadataApnsTokens.md) | |
| [MetadataApnsToken](documentation/models/MetadataApnsToken.md) | |
| [ArrayOfApnsTokenResponses](documentation/models/ArrayOfApnsTokenResponses.md) | |
| [ApnsTokenResponse](documentation/models/ApnsTokenResponse.md) | |
| [DiscardResult](documentation/models/DiscardResult.md) | |
| [ArrayOfMetadataExpoTokens](documentation/models/ArrayOfMetadataExpoTokens.md) | |
| [MetadataExpoToken](documentation/models/MetadataExpoToken.md) | |
| [ArrayOfMetadataFcmTokens](documentation/models/ArrayOfMetadataFcmTokens.md) | |
| [MetadataFcmToken](documentation/models/MetadataFcmToken.md) | |
| [ArrayOfMetadataSlackTokens](documentation/models/ArrayOfMetadataSlackTokens.md) | |
| [MetadataSlackToken](documentation/models/MetadataSlackToken.md) | |
| [ArrayOfMetadataTeamsTokens](documentation/models/ArrayOfMetadataTeamsTokens.md) | |
| [MetadataTeamsToken](documentation/models/MetadataTeamsToken.md) | |
| [ArrayOfMetadataWebPushTokens](documentation/models/ArrayOfMetadataWebPushTokens.md) | |
| [MetadataWebPushToken](documentation/models/MetadataWebPushToken.md) | |
| [ArrayOfExpoTokenResponses](documentation/models/ArrayOfExpoTokenResponses.md) | |
| [ExpoTokenResponse](documentation/models/ExpoTokenResponse.md) | |
| [ArrayOfFcmTokenResponses](documentation/models/ArrayOfFcmTokenResponses.md) | |
| [FcmTokenResponse](documentation/models/FcmTokenResponse.md) | |
| [ArrayOfSlackTokenResponses](documentation/models/ArrayOfSlackTokenResponses.md) | |
| [SlackTokenResponse](documentation/models/SlackTokenResponse.md) | |
| [ArrayOfTeamsTokenResponses](documentation/models/ArrayOfTeamsTokenResponses.md) | |
| [TeamsTokenResponse](documentation/models/TeamsTokenResponse.md) | |
| [ArrayOfWebPushTokenResponses](documentation/models/ArrayOfWebPushTokenResponses.md) | |
| [WebPushTokenResponse](documentation/models/WebPushTokenResponse.md) | |
| [ArrayOfEvents](documentation/models/ArrayOfEvents.md) | |
| [ArrayOfIntegrationObjects](documentation/models/ArrayOfIntegrationObjects.md) | |
| [ArrayOfApnsConfigObjects](documentation/models/ArrayOfApnsConfigObjects.md) | |
Expand Down Expand Up @@ -171,14 +171,8 @@ The SDK includes several models that represent the data structures used in API r
| [AccessToken](documentation/models/AccessToken.md) | |
| [DiscardTokenResponse](documentation/models/DiscardTokenResponse.md) | |
| [CreateUserTokenRequest](documentation/models/CreateUserTokenRequest.md) | |
| [ArrayOfUsers](documentation/models/ArrayOfUsers.md) | |
| [Links](documentation/models/Links.md) | |
| [ApnsToken](documentation/models/ApnsToken.md) | |
| [TokenMetadata](documentation/models/TokenMetadata.md) | |
| [ExpoToken](documentation/models/ExpoToken.md) | |
| [FcmToken](documentation/models/FcmToken.md) | |
| [SlackToken](documentation/models/SlackToken.md) | |
| [TeamsToken](documentation/models/TeamsToken.md) | |
| [WebPushToken](documentation/models/WebPushToken.md) | |
| [Event](documentation/models/Event.md) | |
| [IntegrationObject](documentation/models/IntegrationObject.md) | |
| [ApnsConfigObject](documentation/models/ApnsConfigObject.md) | |
Expand All @@ -197,5 +191,6 @@ The SDK includes several models that represent the data structures used in API r
| [TwilioConfigObject](documentation/models/TwilioConfigObject.md) | |
| [WebpushConfigObject](documentation/models/WebpushConfigObject.md) | |
| [FetchTokensResponseToken](documentation/models/FetchTokensResponseToken.md) | |
| [User](documentation/models/User.md) | |

</details>
20 changes: 0 additions & 20 deletions packages/project-client/documentation/models/ApnsToken.md

This file was deleted.

24 changes: 24 additions & 0 deletions packages/project-client/documentation/models/ApnsTokenResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ApnsTokenResponse

**Properties**

| Name | Type | Required | Description |
| :------------- | :------------------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| createdAt | string | ✅ | |
| deviceToken | string | ✅ | |
| id | string | ✅ | |
| appId | string | ❌ | (Optional) The bundle identifier of the application that is registering this token. Use this field to override the default identifier specified in the projects APNs integration. |
| discardedAt | string | ❌ | |
| installationId | ApnsTokenResponseInstallationId | ❌ | (Optional) The APNs environment the token is registered for. If none is provided we assume the token is used in `production`. |
| updatedAt | string | ❌ | |

# ApnsTokenResponseInstallationId

(Optional) The APNs environment the token is registered for. If none is provided we assume the token is used in `production`.

**Properties**

| Name | Type | Required | Description |
| :---------- | :----- | :------- | :------------ |
| DEVELOPMENT | string | ✅ | "development" |
| PRODUCTION | string | ✅ | "production" |
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ArrayOfMetadataApnsTokens
# ArrayOfApnsTokenResponses

**Properties**

| Name | Type | Required | Description |
| :---- | :------------------ | :------- | :---------- |
| data | MetadataApnsToken[] | ❌ | |
| data | ApnsTokenResponse[] | ❌ | |
| links | Links | ❌ | |
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ArrayOfMetadataApnsTokens
# ArrayOfExpoTokenResponses

**Properties**

| Name | Type | Required | Description |
| :---- | :------------------ | :------- | :---------- |
| data | MetadataApnsToken[] | ❌ | |
| data | ExpoTokenResponse[] | ❌ | |
| links | Links | ❌ | |
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ArrayOfMetadataFcmTokens
# ArrayOfFcmTokenResponses

**Properties**

| Name | Type | Required | Description |
| :---- | :----------------- | :------- | :---------- |
| data | MetadataFcmToken[] | ❌ | |
| data | FcmTokenResponse[] | ❌ | |
| links | Links | ❌ | |

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ArrayOfMetadataSlackTokens
# ArrayOfSlackTokenResponses

**Properties**

| Name | Type | Required | Description |
| :---- | :------------------- | :------- | :---------- |
| data | MetadataSlackToken[] | ❌ | |
| data | SlackTokenResponse[] | ❌ | |
| links | Links | ❌ | |
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ArrayOfMetadataTeamsTokens
# ArrayOfTeamsTokenResponses

**Properties**

| Name | Type | Required | Description |
| :---- | :------------------- | :------- | :---------- |
| data | MetadataTeamsToken[] | ❌ | |
| data | TeamsTokenResponse[] | ❌ | |
| links | Links | ❌ | |
8 changes: 8 additions & 0 deletions packages/project-client/documentation/models/ArrayOfUsers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ArrayOfUsers

**Properties**

| Name | Type | Required | Description |
| :---- | :----- | :------- | :---------- |
| data | User[] | ❌ | |
| links | Links | ❌ | |
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ArrayOfMetadataWebPushTokens
# ArrayOfWebPushTokenResponses

**Properties**

| Name | Type | Required | Description |
| :---- | :--------------------- | :------- | :---------- |
| data | MetadataWebPushToken[] | ❌ | |
| data | WebPushTokenResponse[] | ❌ | |
| links | Links | ❌ | |
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,21 @@

| Name | Type | Required | Description |
| :------- | :------------------------------- | :------- | :---------- |
| category | string | ✅ | |
| channels | CategoryDeliveryConfigChannels[] | ✅ | |
| key | string | ✅ | |
| disabled | boolean | ❌ | |

# CategoryDeliveryConfigChannels

**Properties**

| Name | Type | Required | Description |
| :------- | :--------------- | :------- | :---------- |
| channel | ChannelsChannel2 | ✅ | |
| delay | number | ❌ | |
| disabled | boolean | ❌ | |
| if | string | ❌ | |
| priority | number | ❌ | |
| Name | Type | Required | Description |
| :------ | :------ | :------- | :---------- |
| channel | Channel | ✅ | |
| delay | number | ❌ | |
| if | string | ❌ | |

# ChannelsChannel2
# Channel

**Properties**

Expand All @@ -32,3 +30,4 @@
| MOBILE_PUSH | string | ✅ | "mobile_push" |
| TEAMS | string | ✅ | "teams" |
| EMAIL | string | ✅ | "email" |
| SMS | string | ✅ | "sms" |
7 changes: 0 additions & 7 deletions packages/project-client/documentation/models/ExpoToken.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# TokenMetadata
# ExpoTokenResponse

**Properties**

| Name | Type | Required | Description |
| :---------- | :----- | :------- | :---------- |
| createdAt | string | ✅ | |
| deviceToken | string | ✅ | |
| id | string | ✅ | |
| discardedAt | string | ❌ | |
| updatedAt | string | ❌ | |
17 changes: 0 additions & 17 deletions packages/project-client/documentation/models/FcmToken.md

This file was deleted.

21 changes: 21 additions & 0 deletions packages/project-client/documentation/models/FcmTokenResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# FcmTokenResponse

**Properties**

| Name | Type | Required | Description |
| :------------- | :----------------------------- | :------- | :---------- |
| createdAt | string | ✅ | |
| deviceToken | string | ✅ | |
| id | string | ✅ | |
| discardedAt | string | ❌ | |
| installationId | FcmTokenResponseInstallationId | ❌ | |
| updatedAt | string | ❌ | |

# FcmTokenResponseInstallationId

**Properties**

| Name | Type | Required | Description |
| :---------- | :----- | :------- | :------------ |
| DEVELOPMENT | string | ✅ | "development" |
| PRODUCTION | string | ✅ | "production" |

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading