@signalhouse-sms/sdk 1.9.0 → 1.10.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.
- package/package.json +1 -1
- package/src/domains/Messages.js +61 -33
- package/src/domains/Rcs.js +192 -7
- package/src/domains/Registrations.js +3 -2
- package/src/domains/Templates.js +13 -4
- package/types/domains/Messages.d.ts +60 -33
- package/types/domains/Rcs.d.ts +272 -7
- package/types/domains/Registrations.d.ts +3 -2
- package/types/domains/Templates.d.ts +50 -7
|
@@ -60,7 +60,7 @@ export class Templates {
|
|
|
60
60
|
* @param {string} [params.tag] - Tag (1-60 characters)
|
|
61
61
|
* @param {RcsTemplateBody} params.body - The raw template body
|
|
62
62
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
63
|
-
* @returns {Promise<SdkResponse<
|
|
63
|
+
* @returns {Promise<SdkResponse<SavedTemplate>>} A promise that resolves to { head, version, validation } (201). The draft saves even when validation lists errors
|
|
64
64
|
*/
|
|
65
65
|
create({ groupId, name, tag, body, options }: {
|
|
66
66
|
groupId: string;
|
|
@@ -68,7 +68,7 @@ export class Templates {
|
|
|
68
68
|
tag?: string;
|
|
69
69
|
body: RcsTemplateBody;
|
|
70
70
|
options?: RequestOptions;
|
|
71
|
-
}): Promise<SdkResponse<
|
|
71
|
+
}): Promise<SdkResponse<SavedTemplate>>;
|
|
72
72
|
/**
|
|
73
73
|
* List a group's templates
|
|
74
74
|
* @async
|
|
@@ -126,7 +126,7 @@ export class Templates {
|
|
|
126
126
|
* @param {string|null} [params.tag] - New tag; null clears it, omitted leaves it unchanged
|
|
127
127
|
* @param {RcsTemplateBody} [params.body] - Full replacement body
|
|
128
128
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
129
|
-
* @returns {Promise<SdkResponse<
|
|
129
|
+
* @returns {Promise<SdkResponse<SavedTemplate>>} A promise that resolves to { head, version, validation }. The draft saves even when validation lists errors
|
|
130
130
|
*/
|
|
131
131
|
update({ templateId, groupId, name, tag, body, options }: {
|
|
132
132
|
templateId: string;
|
|
@@ -135,7 +135,7 @@ export class Templates {
|
|
|
135
135
|
tag?: string | null;
|
|
136
136
|
body?: RcsTemplateBody;
|
|
137
137
|
options?: RequestOptions;
|
|
138
|
-
}): Promise<SdkResponse<
|
|
138
|
+
}): Promise<SdkResponse<SavedTemplate>>;
|
|
139
139
|
/**
|
|
140
140
|
* Publish a template's current draft; no draft returns 409 NO_DRAFT, a draft changed mid-publish returns 409 DRAFT_CHANGED (publish again) and an incomplete draft returns 400 TEMPLATE_INVALID
|
|
141
141
|
* @async
|
|
@@ -144,13 +144,15 @@ export class Templates {
|
|
|
144
144
|
* @param {string} params.templateId - The template ID
|
|
145
145
|
* @param {string} params.groupId - The owning group
|
|
146
146
|
* @param {RequestOptions} [params.options] - Additional options for the request
|
|
147
|
-
* @returns {Promise<SdkResponse<TemplateDetail>>} A promise that resolves to { head, version } for the published version
|
|
147
|
+
* @returns {Promise<SdkResponse<TemplateDetail & { warnings: ValidationIssue[] }>>} A promise that resolves to { head, version, warnings } for the published version
|
|
148
148
|
*/
|
|
149
149
|
publish({ templateId, groupId, options }: {
|
|
150
150
|
templateId: string;
|
|
151
151
|
groupId: string;
|
|
152
152
|
options?: RequestOptions;
|
|
153
|
-
}): Promise<SdkResponse<TemplateDetail
|
|
153
|
+
}): Promise<SdkResponse<TemplateDetail & {
|
|
154
|
+
warnings: ValidationIssue[];
|
|
155
|
+
}>>;
|
|
154
156
|
/**
|
|
155
157
|
* Archive a template
|
|
156
158
|
* @async
|
|
@@ -490,6 +492,16 @@ export type ValidationResult = {
|
|
|
490
492
|
*/
|
|
491
493
|
warnings: ValidationIssue[];
|
|
492
494
|
};
|
|
495
|
+
/**
|
|
496
|
+
* What a save returns: the template, and what would stop it publishing. `validation` is null when the checks could not run.
|
|
497
|
+
*/
|
|
498
|
+
export type SavedTemplate = TemplateDetail & {
|
|
499
|
+
validation: {
|
|
500
|
+
valid: boolean;
|
|
501
|
+
errors: ValidationIssue[];
|
|
502
|
+
warnings: ValidationIssue[];
|
|
503
|
+
} | null;
|
|
504
|
+
};
|
|
493
505
|
export type MediaAsset = {
|
|
494
506
|
/**
|
|
495
507
|
* - "MED" + 10 characters
|
|
@@ -573,11 +585,42 @@ export type Capabilities = {
|
|
|
573
585
|
*/
|
|
574
586
|
mediaHeights: string[];
|
|
575
587
|
/**
|
|
576
|
-
* - Length and count limits (maxBlocks, maxTextLength, maxCarouselCards, ...)
|
|
588
|
+
* - Length and count limits (maxBlocks, maxTextLength, maxCarouselCards, maxRecipients, ...)
|
|
577
589
|
*/
|
|
578
590
|
limits: {
|
|
579
591
|
[x: string]: number;
|
|
580
592
|
};
|
|
593
|
+
/**
|
|
594
|
+
* - Per traffic type: the default time to live and its range, in seconds
|
|
595
|
+
*/
|
|
596
|
+
ttlPresets: {
|
|
597
|
+
[x: string]: {
|
|
598
|
+
seconds: number;
|
|
599
|
+
min: number;
|
|
600
|
+
max: number;
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
* - The traffic types each agent use case may send
|
|
605
|
+
*/
|
|
606
|
+
trafficByUseCase: {
|
|
607
|
+
[x: string]: string[];
|
|
608
|
+
};
|
|
609
|
+
/**
|
|
610
|
+
* - The traffic type a single-purpose agent sends when a request names none
|
|
611
|
+
*/
|
|
612
|
+
defaultTrafficByUseCase: {
|
|
613
|
+
[x: string]: string;
|
|
614
|
+
};
|
|
615
|
+
/**
|
|
616
|
+
* - How an iPhone lays out RCS content
|
|
617
|
+
*/
|
|
618
|
+
ios: {
|
|
619
|
+
cardButtonsInline: number;
|
|
620
|
+
suggestedActionsInline: number;
|
|
621
|
+
linesPerField: number;
|
|
622
|
+
charsPerLine: number;
|
|
623
|
+
};
|
|
581
624
|
/**
|
|
582
625
|
* - Upload constraints
|
|
583
626
|
*/
|