Skip to content

Commit

Permalink
Merge pull request #19 from zendesk/victor.piolin/remove-namespace
Browse files Browse the repository at this point in the history
Remove whatsapp namespace
  • Loading branch information
Vico1993 authored Jan 23, 2025
2 parents cdec71e + 903a8ac commit dabe4ea
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
4 changes: 1 addition & 3 deletions __tests__/utils/whats-app-helper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ describe("WhatsAppHelper", () => {
status: TemplateStatus.APPROVED,
category: "category"
};
const namespaceSample = "namespace";
const componentParametersSample: ITemplateComponentParameters[] = [
{
"type": TemplateComponentTypes.body,
Expand All @@ -26,12 +25,11 @@ describe("WhatsAppHelper", () => {
];

it("should return a valid IContentTemplate", () => {
const content = convertToContent(namespaceSample, templateSample, componentParametersSample);
const content = convertToContent(templateSample, componentParametersSample);

expect(content).toStrictEqual({
"type": "template",
template: {
"namespace": namespaceSample,
name: templateSample.name,
language: {
policy: "deterministic",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zendesk/zaf-toolbox",
"version": "0.1.2",
"version": "0.2.0",
"description": "A toolbox for ZAF application built with 🩷 by Zendesk Labs",
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
Expand Down
4 changes: 0 additions & 4 deletions src/models/sunshine-conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,6 @@ export interface IContentText extends Text {
export interface IContentTemplate {
"type": "template";
template: {
/**
* WhatsApp namespace to use
*/
"namespace"?: string;
/**
* Name of the template
*/
Expand Down
2 changes: 0 additions & 2 deletions src/utils/whats-app-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import { IContentTemplate, ITemplate, ITemplateComponentParameters } from "@mode
* Convert a WhatsApp template into a valid IContent for Sunshine Conversation Api Service
*/
export function convertToContent(
namespace: string,
template: ITemplate,
componentParameters: ITemplateComponentParameters[]
): IContentTemplate {
return {
"type": "template",
template: {
namespace,
name: template.name,
language: {
policy: "deterministic",
Expand Down

0 comments on commit dabe4ea

Please sign in to comment.