@openmrp/sdk 0.23.0 → 0.24.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +2 -3
  2. package/package.json +1 -1
  3. package/resources/core/audit-events.d.mts +4 -4
  4. package/resources/core/audit-events.d.mts.map +1 -1
  5. package/resources/core/audit-events.d.ts +4 -4
  6. package/resources/core/audit-events.d.ts.map +1 -1
  7. package/resources/core/core.d.mts +2 -2
  8. package/resources/core/core.d.mts.map +1 -1
  9. package/resources/core/core.d.ts +2 -2
  10. package/resources/core/core.d.ts.map +1 -1
  11. package/resources/core/core.js.map +1 -1
  12. package/resources/core/core.mjs.map +1 -1
  13. package/resources/core/jobs.d.mts +1 -1
  14. package/resources/core/jobs.d.mts.map +1 -1
  15. package/resources/core/jobs.d.ts +1 -1
  16. package/resources/core/jobs.d.ts.map +1 -1
  17. package/resources/messaging/conversations/conversations.d.mts +3 -3
  18. package/resources/messaging/conversations/conversations.d.mts.map +1 -1
  19. package/resources/messaging/conversations/conversations.d.ts +3 -3
  20. package/resources/messaging/conversations/conversations.d.ts.map +1 -1
  21. package/resources/messaging/conversations/conversations.js.map +1 -1
  22. package/resources/messaging/conversations/conversations.mjs.map +1 -1
  23. package/resources/messaging/conversations/links.d.mts +2 -2
  24. package/resources/messaging/conversations/links.d.mts.map +1 -1
  25. package/resources/messaging/conversations/links.d.ts +2 -2
  26. package/resources/messaging/conversations/links.d.ts.map +1 -1
  27. package/resources/messaging/conversations/messages.d.mts +2 -2
  28. package/resources/messaging/conversations/messages.d.mts.map +1 -1
  29. package/resources/messaging/conversations/messages.d.ts +2 -2
  30. package/resources/messaging/conversations/messages.d.ts.map +1 -1
  31. package/resources/messaging/email-domains/email-domains.d.mts +17 -0
  32. package/resources/messaging/email-domains/email-domains.d.mts.map +1 -1
  33. package/resources/messaging/email-domains/email-domains.d.ts +17 -0
  34. package/resources/messaging/email-domains/email-domains.d.ts.map +1 -1
  35. package/resources/messaging/email-domains/email-domains.js.map +1 -1
  36. package/resources/messaging/email-domains/email-domains.mjs.map +1 -1
  37. package/resources/messaging/email-sender.d.mts +165 -0
  38. package/resources/messaging/email-sender.d.mts.map +1 -0
  39. package/resources/messaging/email-sender.d.ts +165 -0
  40. package/resources/messaging/email-sender.d.ts.map +1 -0
  41. package/resources/messaging/email-sender.js +65 -0
  42. package/resources/messaging/email-sender.js.map +1 -0
  43. package/resources/messaging/email-sender.mjs +61 -0
  44. package/resources/messaging/email-sender.mjs.map +1 -0
  45. package/resources/messaging/index.d.mts +1 -0
  46. package/resources/messaging/index.d.mts.map +1 -1
  47. package/resources/messaging/index.d.ts +1 -0
  48. package/resources/messaging/index.d.ts.map +1 -1
  49. package/resources/messaging/index.js +3 -1
  50. package/resources/messaging/index.js.map +1 -1
  51. package/resources/messaging/index.mjs +1 -0
  52. package/resources/messaging/index.mjs.map +1 -1
  53. package/resources/messaging/messaging.d.mts +4 -0
  54. package/resources/messaging/messaging.d.mts.map +1 -1
  55. package/resources/messaging/messaging.d.ts +4 -0
  56. package/resources/messaging/messaging.d.ts.map +1 -1
  57. package/resources/messaging/messaging.js +4 -0
  58. package/resources/messaging/messaging.js.map +1 -1
  59. package/resources/messaging/messaging.mjs +4 -0
  60. package/resources/messaging/messaging.mjs.map +1 -1
  61. package/resources/messaging/notifications/notifications.d.mts +2 -2
  62. package/resources/messaging/notifications/notifications.d.mts.map +1 -1
  63. package/resources/messaging/notifications/notifications.d.ts +2 -2
  64. package/resources/messaging/notifications/notifications.d.ts.map +1 -1
  65. package/resources/messaging/notifications/notifications.js.map +1 -1
  66. package/resources/messaging/notifications/notifications.mjs.map +1 -1
  67. package/src/resources/core/audit-events.ts +4 -0
  68. package/src/resources/core/core.ts +2 -0
  69. package/src/resources/core/jobs.ts +1 -0
  70. package/src/resources/messaging/conversations/conversations.ts +3 -0
  71. package/src/resources/messaging/conversations/links.ts +2 -0
  72. package/src/resources/messaging/conversations/messages.ts +2 -0
  73. package/src/resources/messaging/email-domains/email-domains.ts +20 -0
  74. package/src/resources/messaging/email-sender.ts +200 -0
  75. package/src/resources/messaging/index.ts +7 -0
  76. package/src/resources/messaging/messaging.ts +18 -0
  77. package/src/resources/messaging/notifications/notifications.ts +2 -0
  78. package/src/version.ts +1 -1
  79. package/version.d.mts +1 -1
  80. package/version.d.ts +1 -1
  81. package/version.js +1 -1
  82. package/version.mjs +1 -1
@@ -326,6 +326,7 @@ export interface AuditEvent {
326
326
  | 'email_log'
327
327
  | 'email_domain'
328
328
  | 'email_inbox'
329
+ | 'email_sender'
329
330
  | 'portal_domain'
330
331
  | 'dns_record'
331
332
  | 'inventory_change_log'
@@ -741,6 +742,7 @@ export interface ListObjectType {
741
742
  | 'email_log'
742
743
  | 'email_domain'
743
744
  | 'email_inbox'
745
+ | 'email_sender'
744
746
  | 'portal_domain'
745
747
  | 'dns_record'
746
748
  | 'inventory_change_log'
@@ -1144,6 +1146,7 @@ export interface AuditEventListParams {
1144
1146
  | 'email_log'
1145
1147
  | 'email_domain'
1146
1148
  | 'email_inbox'
1149
+ | 'email_sender'
1147
1150
  | 'portal_domain'
1148
1151
  | 'dns_record'
1149
1152
  | 'inventory_change_log'
@@ -1470,6 +1473,7 @@ export interface AuditEventListParams {
1470
1473
  | 'email_log'
1471
1474
  | 'email_domain'
1472
1475
  | 'email_inbox'
1476
+ | 'email_sender'
1473
1477
  | 'portal_domain'
1474
1478
  | 'dns_record'
1475
1479
  | 'inventory_change_log'
@@ -319,6 +319,7 @@ export interface Entity {
319
319
  | 'email_log'
320
320
  | 'email_domain'
321
321
  | 'email_inbox'
322
+ | 'email_sender'
322
323
  | 'portal_domain'
323
324
  | 'dns_record'
324
325
  | 'inventory_change_log'
@@ -700,6 +701,7 @@ export interface CoreRetrieveSearchParams {
700
701
  | 'email_log'
701
702
  | 'email_domain'
702
703
  | 'email_inbox'
704
+ | 'email_sender'
703
705
  | 'portal_domain'
704
706
  | 'dns_record'
705
707
  | 'inventory_change_log'
@@ -268,6 +268,7 @@ export interface Job {
268
268
  | 'email_log'
269
269
  | 'email_domain'
270
270
  | 'email_inbox'
271
+ | 'email_sender'
271
272
  | 'portal_domain'
272
273
  | 'dns_record'
273
274
  | 'inventory_change_log'
@@ -611,6 +611,7 @@ export interface CreateConversationRequest {
611
611
  | 'email_log'
612
612
  | 'email_domain'
613
613
  | 'email_inbox'
614
+ | 'email_sender'
614
615
  | 'portal_domain'
615
616
  | 'dns_record'
616
617
  | 'inventory_change_log'
@@ -1507,6 +1508,7 @@ export interface ConversationCreateParams {
1507
1508
  | 'email_log'
1508
1509
  | 'email_domain'
1509
1510
  | 'email_inbox'
1511
+ | 'email_sender'
1510
1512
  | 'portal_domain'
1511
1513
  | 'dns_record'
1512
1514
  | 'inventory_change_log'
@@ -1898,6 +1900,7 @@ export interface ConversationListParams {
1898
1900
  | 'email_log'
1899
1901
  | 'email_domain'
1900
1902
  | 'email_inbox'
1903
+ | 'email_sender'
1901
1904
  | 'portal_domain'
1902
1905
  | 'dns_record'
1903
1906
  | 'inventory_change_log'
@@ -245,6 +245,7 @@ export interface AddConversationLinkRequest {
245
245
  | 'email_log'
246
246
  | 'email_domain'
247
247
  | 'email_inbox'
248
+ | 'email_sender'
248
249
  | 'portal_domain'
249
250
  | 'dns_record'
250
251
  | 'inventory_change_log'
@@ -630,6 +631,7 @@ export interface LinkCreateParams {
630
631
  | 'email_log'
631
632
  | 'email_domain'
632
633
  | 'email_inbox'
634
+ | 'email_sender'
633
635
  | 'portal_domain'
634
636
  | 'dns_record'
635
637
  | 'inventory_change_log'
@@ -396,6 +396,7 @@ export interface SendMessageRequest {
396
396
  | 'email_log'
397
397
  | 'email_domain'
398
398
  | 'email_inbox'
399
+ | 'email_sender'
399
400
  | 'portal_domain'
400
401
  | 'dns_record'
401
402
  | 'inventory_change_log'
@@ -844,6 +845,7 @@ export interface MessageCreateParams {
844
845
  | 'email_log'
845
846
  | 'email_domain'
846
847
  | 'email_inbox'
848
+ | 'email_sender'
847
849
  | 'portal_domain'
848
850
  | 'dns_record'
849
851
  | 'inventory_change_log'
@@ -139,6 +139,26 @@ export interface EmailDomain {
139
139
  */
140
140
  domain: string;
141
141
 
142
+ /**
143
+ * The subdomain used as the envelope return path for mail sent from this domain.
144
+ *
145
+ * Publishing the two records below makes the return path match the sender address.
146
+ * Until you do, mail clients show your mail as coming from your address "via
147
+ * amazonses.com".
148
+ */
149
+ mail_from_domain: string | null;
150
+
151
+ /**
152
+ * The MX record to publish on `mail_from_domain`, for delivery of bounces and
153
+ * complaints.
154
+ */
155
+ mail_from_mx_record: string | null;
156
+
157
+ /**
158
+ * The SPF record to publish as a TXT record on `mail_from_domain`.
159
+ */
160
+ mail_from_spf_record: string | null;
161
+
142
162
  /**
143
163
  * Resource type identifier.
144
164
  */
@@ -0,0 +1,200 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+
7
+ /**
8
+ * Choose the address your order, invoice, and statement emails are sent from, on a domain you have verified.
9
+ */
10
+ export class EmailSenderResource extends APIResource {
11
+ /**
12
+ * Returns the address your order, invoice, and statement emails are sent from, or
13
+ * 404 when none is configured and that mail sends from the platform address.
14
+ *
15
+ * This endpoint requires the permission: `messaging:read`.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const emailSender =
20
+ * await client.messaging.emailSender.list();
21
+ * ```
22
+ */
23
+ list(options?: RequestOptions): APIPromise<EmailSender> {
24
+ return this._client.get('/v1/messaging/email-sender', options);
25
+ }
26
+
27
+ /**
28
+ * Sets the address your order, invoice, and statement emails are sent from,
29
+ * replacing any address already configured.
30
+ *
31
+ * The domain must be verified first. Emails about someone's OpenMRP account —
32
+ * password resets, verification, plan changes — continue to send from the platform
33
+ * address.
34
+ *
35
+ * This endpoint requires the permission: `messaging:update`.
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * const emailSender =
40
+ * await client.messaging.emailSender.update({
41
+ * email_domain_id: 'emdom_2rk3omr8vshb',
42
+ * local_part: 'orders',
43
+ * from_name: 'Acme Inc.',
44
+ * });
45
+ * ```
46
+ */
47
+ update(body: EmailSenderUpdateParams, options?: RequestOptions): APIPromise<EmailSender> {
48
+ return this._client.put('/v1/messaging/email-sender', { body, ...options });
49
+ }
50
+
51
+ /**
52
+ * Clears the configured sending address, returning your customer-facing email to
53
+ * the platform address.
54
+ *
55
+ * This endpoint requires the permission: `messaging:delete`.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const emailSender =
60
+ * await client.messaging.emailSender.delete();
61
+ * ```
62
+ */
63
+ delete(options?: RequestOptions): APIPromise<EmailSenderDeleteResponse> {
64
+ return this._client.delete('/v1/messaging/email-sender', options);
65
+ }
66
+ }
67
+
68
+ /**
69
+ * The address your order, invoice, and statement emails are sent from.
70
+ *
71
+ * Configure one on a verified email domain and your customers see mail from your
72
+ * own address instead of the platform's. Emails about someone's OpenMRP account —
73
+ * password resets, verification, plan changes — always send from the platform
74
+ * address regardless of this setting.
75
+ *
76
+ * Mail only sends from this address while the underlying domain stays verified; if
77
+ * verification lapses it falls back to the platform address rather than failing to
78
+ * send.
79
+ */
80
+ export interface EmailSender {
81
+ /**
82
+ * Email sender ID.
83
+ */
84
+ id: string;
85
+
86
+ /**
87
+ * The full sending address.
88
+ */
89
+ address: string;
90
+
91
+ /**
92
+ * Creation timestamp.
93
+ */
94
+ created_at: string;
95
+
96
+ /**
97
+ * The domain name the address sends from.
98
+ */
99
+ domain: string;
100
+
101
+ /**
102
+ * Verification status of the underlying domain.
103
+ */
104
+ domain_status: 'pending' | 'verified' | 'failed';
105
+
106
+ /**
107
+ * The verified email domain this address belongs to.
108
+ */
109
+ email_domain_id: string;
110
+
111
+ /**
112
+ * The name shown in a mail client's sender column. When unset, mail shows the bare
113
+ * address.
114
+ */
115
+ from_name: string | null;
116
+
117
+ /**
118
+ * The mailbox name before the `@`.
119
+ */
120
+ local_part: string;
121
+
122
+ /**
123
+ * Resource type identifier.
124
+ */
125
+ object: 'email_sender';
126
+
127
+ /**
128
+ * Where customer replies are delivered. When unset, replies go to the sending
129
+ * address.
130
+ */
131
+ reply_to: string | null;
132
+
133
+ /**
134
+ * Last updated timestamp.
135
+ */
136
+ updated_at: string;
137
+ }
138
+
139
+ /**
140
+ * Request to configure the address the account's customer-facing email is sent
141
+ * from.
142
+ */
143
+ export interface SetEmailSenderRequest {
144
+ /**
145
+ * The verified email domain to send from.
146
+ */
147
+ email_domain_id: string;
148
+
149
+ /**
150
+ * The mailbox name before the `@`, for example `orders`.
151
+ */
152
+ local_part: string;
153
+
154
+ /**
155
+ * The name shown in a mail client's sender column. When unset, mail shows the bare
156
+ * address.
157
+ */
158
+ from_name?: string;
159
+
160
+ /**
161
+ * Where customer replies are delivered. When unset, replies go to the sending
162
+ * address.
163
+ */
164
+ reply_to?: string;
165
+ }
166
+
167
+ export interface EmailSenderDeleteResponse {}
168
+
169
+ export interface EmailSenderUpdateParams {
170
+ /**
171
+ * The verified email domain to send from.
172
+ */
173
+ email_domain_id: string;
174
+
175
+ /**
176
+ * The mailbox name before the `@`, for example `orders`.
177
+ */
178
+ local_part: string;
179
+
180
+ /**
181
+ * The name shown in a mail client's sender column. When unset, mail shows the bare
182
+ * address.
183
+ */
184
+ from_name?: string;
185
+
186
+ /**
187
+ * Where customer replies are delivered. When unset, replies go to the sending
188
+ * address.
189
+ */
190
+ reply_to?: string;
191
+ }
192
+
193
+ export declare namespace EmailSenderResource {
194
+ export {
195
+ type EmailSender as EmailSender,
196
+ type SetEmailSenderRequest as SetEmailSenderRequest,
197
+ type EmailSenderDeleteResponse as EmailSenderDeleteResponse,
198
+ type EmailSenderUpdateParams as EmailSenderUpdateParams,
199
+ };
200
+ }
@@ -71,6 +71,13 @@ export {
71
71
  type EmailInboxRetrieveParams,
72
72
  type EmailInboxUpdateParams,
73
73
  } from './email-inboxes';
74
+ export {
75
+ EmailSenderResource,
76
+ type EmailSender,
77
+ type SetEmailSenderRequest,
78
+ type EmailSenderDeleteResponse,
79
+ type EmailSenderUpdateParams,
80
+ } from './email-sender';
74
81
  export {
75
82
  Groups,
76
83
  type CreateMessagingGroupRequest,
@@ -40,6 +40,14 @@ import {
40
40
  ListEmailInbox,
41
41
  UpdateEmailInboxRequest,
42
42
  } from './email-inboxes';
43
+ import * as EmailSenderAPI from './email-sender';
44
+ import {
45
+ EmailSender,
46
+ EmailSenderDeleteResponse,
47
+ EmailSenderResource,
48
+ EmailSenderUpdateParams,
49
+ SetEmailSenderRequest,
50
+ } from './email-sender';
43
51
  import * as PreferencesAPI from './preferences';
44
52
  import {
45
53
  ListNotificationPreference,
@@ -131,6 +139,7 @@ export class Messaging extends APIResource {
131
139
  preferences: PreferencesAPI.Preferences = new PreferencesAPI.Preferences(this._client);
132
140
  emailDomains: EmailDomainsAPI.EmailDomains = new EmailDomainsAPI.EmailDomains(this._client);
133
141
  emailInboxes: EmailInboxesAPI.EmailInboxes = new EmailInboxesAPI.EmailInboxes(this._client);
142
+ emailSender: EmailSenderAPI.EmailSenderResource = new EmailSenderAPI.EmailSenderResource(this._client);
134
143
 
135
144
  /**
136
145
  * Lists the people the caller can start a conversation with.
@@ -228,6 +237,7 @@ Messaging.Blocks = Blocks;
228
237
  Messaging.Preferences = Preferences;
229
238
  Messaging.EmailDomains = EmailDomains;
230
239
  Messaging.EmailInboxes = EmailInboxes;
240
+ Messaging.EmailSenderResource = EmailSenderResource;
231
241
 
232
242
  export declare namespace Messaging {
233
243
  export {
@@ -350,4 +360,12 @@ export declare namespace Messaging {
350
360
  type EmailInboxRetrieveParams as EmailInboxRetrieveParams,
351
361
  type EmailInboxUpdateParams as EmailInboxUpdateParams,
352
362
  };
363
+
364
+ export {
365
+ EmailSenderResource as EmailSenderResource,
366
+ type EmailSender as EmailSender,
367
+ type SetEmailSenderRequest as SetEmailSenderRequest,
368
+ type EmailSenderDeleteResponse as EmailSenderDeleteResponse,
369
+ type EmailSenderUpdateParams as EmailSenderUpdateParams,
370
+ };
353
371
  }
@@ -626,6 +626,7 @@ export interface SendNotificationRequest {
626
626
  | 'email_log'
627
627
  | 'email_domain'
628
628
  | 'email_inbox'
629
+ | 'email_sender'
629
630
  | 'portal_domain'
630
631
  | 'dns_record'
631
632
  | 'inventory_change_log'
@@ -987,6 +988,7 @@ export interface NotificationCreateParams {
987
988
  | 'email_log'
988
989
  | 'email_domain'
989
990
  | 'email_inbox'
991
+ | 'email_sender'
990
992
  | 'portal_domain'
991
993
  | 'dns_record'
992
994
  | 'inventory_change_log'
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.23.0'; // x-release-please-version
1
+ export const VERSION = '0.24.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.23.0";
1
+ export declare const VERSION = "0.24.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.23.0";
1
+ export declare const VERSION = "0.24.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.23.0'; // x-release-please-version
4
+ exports.VERSION = '0.24.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.23.0'; // x-release-please-version
1
+ export const VERSION = '0.24.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map