1 /**
2 * @oas [get] /admin/notifications
3 * operationId: GetNotifications
4 * summary: List Notifications
5 * description: Retrieve a list of notifications. The notifications can be filtered by fields such as `id`. The notifications can also be sorted or paginated.
6 * x-authenticated: true
7 * parameters:
8 * - name: fields
9 * in: query
10 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
11 * fields. without prefix it will replace the entire default fields.
12 * required: false
13 * schema:
14 * type: string
15 * title: fields
16 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
17 * fields. without prefix it will replace the entire default fields.
18 * externalDocs:
19 * url: "#select-fields-and-relations"
20 * - name: offset
21 * in: query
22 * description: The number of items to skip when retrieving a list.
23 * required: false
24 * schema:
25 * type: number
26 * title: offset
27 * description: The number of items to skip when retrieving a list.
28 * externalDocs:
29 * url: "#pagination"
30 * - name: limit
31 * in: query
32 * description: Limit the number of items returned in the list.
33 * required: false
34 * schema:
35 * type: number
36 * title: limit
37 * description: Limit the number of items returned in the list.
38 * externalDocs:
39 * url: "#pagination"
40 * - name: order
41 * in: query
42 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
43 * required: false
44 * schema:
45 * type: string
46 * title: order
47 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
48 * - name: q
49 * in: query
50 * description: Search term to apply on the notification's searchable properties.
51 * required: false
52 * schema:
53 * type: string
54 * title: q
55 * description: Search term to apply on the notification's searchable properties.
56 * - name: id
57 * in: query
58 * required: false
59 * schema:
60 * oneOf:
61 * - type: string
62 * title: id
63 * description: Filter by a notification ID.
64 * - type: array
65 * description: Filter by notification IDs.
66 * items:
67 * type: string
68 * title: id
69 * description: A notification ID.
70 * - name: channel
71 * in: query
72 * required: false
73 * schema:
74 * oneOf:
75 * - type: string
76 * title: channel
77 * description: Filter by a notification channel.
78 * example: email
79 * - type: array
80 * description: Filter by notification channels.
81 * items:
82 * type: string
83 * title: channel
84 * description: A notification channel.
85 * example: email
86 * - name: $and
87 * in: query
88 * required: false
89 * schema:
90 * type: array
91 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
92 * items:
93 * type: object
94 * title: $and
95 * - name: $or
96 * in: query
97 * required: false
98 * schema:
99 * type: array
100 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
101 * items:
102 * type: object
103 * title: $or
104 * - name: with_deleted
105 * in: query
106 * description: Whether to include deleted records in the result.
107 * required: false
108 * schema:
109 * type: boolean
110 * title: with_deleted
111 * description: Whether to include deleted records in the result.
112 * - name: to
113 * in: query
114 * required: false
115 * schema:
116 * oneOf:
117 * - type: string
118 * title: to
119 * description: Filter by who the notification was sent to. Set to `""` to retrieve notifications for all admin users.
120 * - type: array
121 * description: Filter by who the notification was sent to. Set to `""` to retrieve notifications for all admin users.
122 * items:
123 * type: string
124 * title: to
125 * description: Who the notification was sent to. Set to `""` to retrieve notifications for all admin users.
126 * security:
127 * - api_token: []
128 * - cookie_auth: []
129 * - jwt_token: []
130 * x-codeSamples:
131 * - lang: JavaScript
132 * label: JS SDK
133 * source: |-
134 * import Medusa from "@medusajs/js-sdk"
135 *
136 * export const sdk = new Medusa({
137 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
138 * debug: import.meta.env.DEV,
139 * auth: {
140 * type: "session",
141 * },
142 * })
143 *
144 * sdk.admin.notification.list()
145 * .then(({ notifications, count, limit, offset }) => {
146 * console.log(notifications)
147 * })
148 * - lang: Shell
149 * label: cURL
150 * source: |-
151 * curl '{backend_url}/admin/notifications' \
152 * -H 'Authorization: Bearer {jwt_token}'
153 * tags:
154 * - Notifications
155 * responses:
156 * "200":
157 * description: OK
158 * content:
159 * application/json:
160 * schema:
161 * $ref: "#/components/schemas/AdminNotificationListResponse"
162 * "400":
163 * $ref: "#/components/responses/400_error"
164 * "401":
165 * $ref: "#/components/responses/unauthorized"
166 * "404":
167 * $ref: "#/components/responses/not_found_error"
168 * "409":
169 * $ref: "#/components/responses/invalid_state_error"
170 * "422":
171 * $ref: "#/components/responses/invalid_request_error"
172 * "500":
173 * $ref: "#/components/responses/500_error"
174 *
175 */
176