@rewritetoday/types 1.0.0 → 1.0.1

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/v1/rest.d.ts CHANGED
@@ -103,7 +103,10 @@ export interface RESTGetListTemplatesQueryParams extends RESTCursorOptions {
103
103
  /** `POST https://api.rewritetoday.com/v1/templates`. */
104
104
  export type RESTPostCreateTemplateData = APIResponse<Pick<APITemplate, 'id' | 'createdAt'>>;
105
105
  /** `POST https://api.rewritetoday.com/v1/templates`. */
106
- export type RESTPostCreateTemplateBody = Pick<APITemplate, 'name' | 'i18n' | 'content' | 'variables' | 'description'>;
106
+ export interface RESTPostCreateTemplateBody extends Pick<APITemplate, 'name' | 'content' | 'variables' | 'description'> {
107
+ /** Locale-specific overrides available for the template. */
108
+ i18n?: Partial<Record<CountryCode, string>>;
109
+ }
107
110
  /** `PATCH https://api.rewritetoday.com/v1/templates/:id`. */
108
111
  export type RESTPatchUpdateTemplateData = APIResponse<null>;
109
112
  /** `PATCH https://api.rewritetoday.com/v1/templates/:id`. */
@@ -159,7 +162,7 @@ export type RESTPostSendMessageBody = {
159
162
  /** Destination number in E.164 format. */
160
163
  to: string;
161
164
  /** Optional metadata stored with the message. */
162
- tags: APIMessageTag[];
165
+ tags?: APIMessageTag[];
163
166
  /** When provided, Rewrite schedules the message for later delivery. */
164
167
  scheduledAt?: string;
165
168
  /** Optional segmentation rules for long SMS bodies. */
@@ -1,4 +1,4 @@
1
- import type { RESTCursorOptions } from './rest';
1
+ import type { RESTGetListMessagesQueryParams, RESTGetListTemplatesQueryParams, RESTGetListWebhookLogsQueryParams, RESTGetListWebhooksQueryParams } from './rest';
2
2
  export declare const API_BASE_URL = "https://api.rewritetoday.com";
3
3
  export declare const Routes: {
4
4
  otp: {
@@ -13,7 +13,7 @@ export declare const Routes: {
13
13
  /** `POST https://api.rewritetoday.com/v1/messages/batch`. */
14
14
  batch(): string;
15
15
  /** `GET https://api.rewritetoday.com/v1/messages`. */
16
- list(): string;
16
+ list(options?: RESTGetListMessagesQueryParams): string;
17
17
  /** `GET https://api.rewritetoday.com/v1/messages/:id`. */
18
18
  get(id: string): string;
19
19
  /** `POST https://api.rewritetoday.com/v1/messages/:id/cancel`. */
@@ -21,7 +21,7 @@ export declare const Routes: {
21
21
  };
22
22
  webhooks: {
23
23
  /** `GET https://api.rewritetoday.com/v1/webhooks`. */
24
- list(options?: RESTCursorOptions): string;
24
+ list(options?: RESTGetListWebhooksQueryParams): string;
25
25
  /** `POST https://api.rewritetoday.com/v1/webhooks`. */
26
26
  create(): string;
27
27
  /** `PATCH https://api.rewritetoday.com/v1/webhooks/:id`. */
@@ -31,11 +31,11 @@ export declare const Routes: {
31
31
  /** `GET https://api.rewritetoday.com/v1/webhooks/:id`. */
32
32
  get(id: string): string;
33
33
  /** `GET https://api.rewritetoday.com/v1/webhooks/:id/logs`. */
34
- logs(id: string): string;
34
+ logs(id: string, options?: RESTGetListWebhookLogsQueryParams): string;
35
35
  };
36
36
  templates: {
37
37
  /** `GET https://api.rewritetoday.com/v1/templates`. */
38
- list(options?: RESTCursorOptions): string;
38
+ list(options?: RESTGetListTemplatesQueryParams): string;
39
39
  /** `POST https://api.rewritetoday.com/v1/templates`. */
40
40
  create(): string;
41
41
  /** `PATCH https://api.rewritetoday.com/v1/templates/:id`. */
package/dist/v1/routes.js CHANGED
@@ -21,8 +21,8 @@ export const Routes = {
21
21
  return '/messages/batch';
22
22
  },
23
23
  /** `GET https://api.rewritetoday.com/v1/messages`. */
24
- list() {
25
- return '/messages';
24
+ list(options) {
25
+ return `/messages?${createCursorQuery(options)}`;
26
26
  },
27
27
  /** `GET https://api.rewritetoday.com/v1/messages/:id`. */
28
28
  get(id) {
@@ -55,8 +55,8 @@ export const Routes = {
55
55
  return `/webhooks/${id}`;
56
56
  },
57
57
  /** `GET https://api.rewritetoday.com/v1/webhooks/:id/logs`. */
58
- logs(id) {
59
- return `/webhooks/${id}/logs`;
58
+ logs(id, options) {
59
+ return `/webhooks/${id}/logs?${createCursorQuery(options)}`;
60
60
  },
61
61
  },
62
62
  templates: {
package/dist/version.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Current version of [@rewritetoday/types](https://www.npmjs.com/package/@rewritetoday/types).
3
3
  */
4
- export declare const version: "1.0.0";
4
+ export declare const version: "1.0.1";
5
5
  /**
6
6
  * Current Rewrite API version.
7
7
  */
package/dist/version.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Current version of [@rewritetoday/types](https://www.npmjs.com/package/@rewritetoday/types).
4
4
  */
5
- export const version = '1.0.0';
5
+ export const version = '1.0.1';
6
6
  /**
7
7
  * Current Rewrite API version.
8
8
  */
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0",
2
+ "version": "1.0.1",
3
3
  "name": "@rewritetoday/types",
4
4
  "description": "Official Rewrite API typings that are always up to date",
5
5
  "type": "module",