@capillarytech/creatives-library 8.0.315 → 8.0.316-alpha.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "8.0.315",
4
+ "version": "8.0.316-alpha.1",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Test suite for getSchema
3
+ */
4
+ import getSchema from '../getSchema';
5
+
6
+ describe('getSchema', () => {
7
+ it('should return a promise when called', () => {
8
+ const result = getSchema('sms');
9
+ expect(result instanceof Promise).toBe(true);
10
+ });
11
+
12
+ it('should return SMS schema when channel is "sms"', () => {
13
+ const result = getSchema('sms');
14
+ return result.then((module) => {
15
+ expect(module).toBeDefined();
16
+ });
17
+ });
18
+
19
+ it('should return SMS schema when channel is "SMS" (uppercase)', () => {
20
+ const result = getSchema('SMS');
21
+ return result.then((module) => {
22
+ expect(module).toBeDefined();
23
+ });
24
+ });
25
+
26
+ it('should return EMAIL schema when channel is "email"', () => {
27
+ const result = getSchema('email');
28
+ return result.then((module) => {
29
+ expect(module).toBeDefined();
30
+ });
31
+ });
32
+
33
+ it('should return EMAIL schema when channel is "EMAIL" (uppercase)', () => {
34
+ const result = getSchema('EMAIL');
35
+ return result.then((module) => {
36
+ expect(module).toBeDefined();
37
+ });
38
+ });
39
+
40
+ it('should return MOBILE_PUSH schema when channel is "mobile_push"', () => {
41
+ const result = getSchema('mobile_push');
42
+ return result.then((module) => {
43
+ expect(module).toBeDefined();
44
+ });
45
+ });
46
+
47
+ it('should return MOBILE_PUSH schema when channel is "MOBILE_PUSH" (uppercase)', () => {
48
+ const result = getSchema('MOBILE_PUSH');
49
+ return result.then((module) => {
50
+ expect(module).toBeDefined();
51
+ });
52
+ });
53
+
54
+ it('should return WECHAT schema when channel is "wechat"', () => {
55
+ const result = getSchema('wechat');
56
+ return result.then((module) => {
57
+ expect(module).toBeDefined();
58
+ });
59
+ });
60
+
61
+ it('should return WECHAT schema when channel is "WECHAT" (uppercase)', () => {
62
+ const result = getSchema('WECHAT');
63
+ return result.then((module) => {
64
+ expect(module).toBeDefined();
65
+ });
66
+ });
67
+
68
+ it('should return SMS schema (default) when channel is unknown', () => {
69
+ const result = getSchema('unknown_channel');
70
+ return result.then((module) => {
71
+ expect(module).toBeDefined();
72
+ });
73
+ });
74
+
75
+ it('should return SMS schema (default) when channel is "whatsapp"', () => {
76
+ const result = getSchema('whatsapp');
77
+ return result.then((module) => {
78
+ expect(module).toBeDefined();
79
+ });
80
+ });
81
+
82
+ it('should handle mixed case channel names', () => {
83
+ const result = getSchema('SmS');
84
+ return result.then((module) => {
85
+ expect(module).toBeDefined();
86
+ });
87
+ });
88
+
89
+ it('should handle whitespace in channel names', () => {
90
+ const result = getSchema(' sms ');
91
+ return result.then((module) => {
92
+ expect(module).toBeDefined();
93
+ });
94
+ });
95
+ });
package/utils/common.js CHANGED
@@ -16,6 +16,7 @@ import {
16
16
  REGISTRATION_CUSTOM_FIELD,
17
17
  JP_LOCALE_HIDE_FEATURE,
18
18
  ENABLE_CUSTOMER_BARCODE_TAG,
19
+ AI_CONTENT_BOT_DISABLED,
19
20
  BADGES_UI_ENABLED,
20
21
  BADGES_ENROLL,
21
22
  EMAIL_UNSUBSCRIBE_TAG_MANDATORY,
@@ -126,6 +127,11 @@ export const hasCustomerBarcodeFeatureEnabled = Auth.hasFeatureAccess.bind(
126
127
  ENABLE_CUSTOMER_BARCODE_TAG,
127
128
  );
128
129
 
130
+ export const isAiContentBotDisabled = Auth.hasFeatureAccess.bind(
131
+ null,
132
+ AI_CONTENT_BOT_DISABLED,
133
+ );
134
+
129
135
  // Note: The "EMAIL_UNSUBSCRIBE_TAG_MANDATORY" feature flag determines if the Unsubscribe tag in email is optional.
130
136
  // When this flag is enabled for an org, the Unsubscribe tag is NOT mandatory in the email flow.
131
137
  // This is as per the requirement in the tech doc: