@ductape/sdk 0.0.3-beta7 → 0.0.3-beta9
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/api/services/productsApi.service.js +1 -1
- package/dist/api/services/productsApi.service.js.map +1 -1
- package/dist/logs/logs.service.js +0 -1
- package/dist/logs/logs.service.js.map +1 -1
- package/dist/processor/services/processor.service.js +7 -2
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/products/services/products.service.d.ts +31 -31
- package/dist/products/services/products.service.js +36 -21
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/test/test.logs.js +6 -6
- package/dist/test/test.logs.js.map +1 -1
- package/dist/types/inputs.types.d.ts +2 -0
- package/dist/types/inputs.types.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { IActionDataParserInput, IActionRequest, ICreateProductsBuilder, IFeatur
|
|
|
4
4
|
import { IProductNotification, INotificationEnv, IProductNotificationTemplate, IProductMessageBroker, IProductMessageBrokerTopic } from '../../types/processor.types';
|
|
5
5
|
import { IParsedSample } from '../../types/inputs.types';
|
|
6
6
|
export interface IProductsBuilderService {
|
|
7
|
-
fetchThirdPartyAppByAccessTag(access_tag: string): Promise<IApp & IVersion>;
|
|
7
|
+
fetchThirdPartyAppByAccessTag(access_tag: string): Promise<(IApp & IVersion) | null>;
|
|
8
8
|
createProduct(data: ICreateProductsBuilder): Promise<void>;
|
|
9
9
|
updateProduct(data: Partial<IProduct>): Promise<void>;
|
|
10
10
|
initializeProduct(product_id: string): Promise<void>;
|
|
@@ -12,46 +12,46 @@ export interface IProductsBuilderService {
|
|
|
12
12
|
initializeProductByTag(tag: string): Promise<void>;
|
|
13
13
|
createEnv(data: Partial<IProductEnv>): Promise<void>;
|
|
14
14
|
updateEnv(slug: string, data: Partial<IProductEnv>): Promise<void>;
|
|
15
|
-
fetchEnv(slug: string): IProductEnv;
|
|
15
|
+
fetchEnv(slug: string): IProductEnv | null;
|
|
16
16
|
fetchEnvs(): Array<IProductEnv>;
|
|
17
17
|
createFunction(data: Partial<IProductFunction>): Promise<void>;
|
|
18
18
|
updateFunction(tag: string, data: Partial<IProductFunction>): Promise<void>;
|
|
19
|
-
fetchFunction(tag: string): IProductFunction;
|
|
19
|
+
fetchFunction(tag: string): IProductFunction | null;
|
|
20
20
|
fetchFunctions(): Array<IProductFunction>;
|
|
21
21
|
createCache(data: Partial<IProductCache>, throwErrorIfExists?: boolean): Promise<void>;
|
|
22
22
|
updateCache(tag: string, data: Partial<IProductCache>): Promise<void>;
|
|
23
|
-
fetchCache(tag: string): IProductCache;
|
|
23
|
+
fetchCache(tag: string): IProductCache | null;
|
|
24
24
|
fetchCaches(): Array<IProductCache>;
|
|
25
25
|
createStorage(data: Partial<IProductStorage>): Promise<void>;
|
|
26
26
|
updateStorage(tag: string, data: Partial<IProductStorage>): Promise<void>;
|
|
27
|
-
fetchStorage(tag: string): IProductStorage;
|
|
27
|
+
fetchStorage(tag: string): IProductStorage | null;
|
|
28
28
|
fetchStorages(): Array<IProductStorage>;
|
|
29
29
|
createNotification(data: Partial<IProductNotification>): Promise<void>;
|
|
30
30
|
updateNotification(tag: string, data: Partial<IProductNotification>): Promise<void>;
|
|
31
|
-
fetchNotification(tag: string): IProductNotification | INotificationEnv;
|
|
31
|
+
fetchNotification(tag: string): IProductNotification | INotificationEnv | null;
|
|
32
32
|
fetchNotifications(): Array<IProductNotification>;
|
|
33
33
|
createMessageBroker(data: Partial<IProductMessageBroker>): Promise<void>;
|
|
34
34
|
updateMessageBroker(tag: string, data: Partial<IProductMessageBroker>): Promise<void>;
|
|
35
|
-
fetchMessageBroker(tag: string): IProductMessageBroker;
|
|
35
|
+
fetchMessageBroker(tag: string): IProductMessageBroker | null;
|
|
36
36
|
fetchMessageBrokers(): Array<IProductMessageBroker>;
|
|
37
37
|
createMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>): Promise<void>;
|
|
38
38
|
updateMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>): Promise<void>;
|
|
39
|
-
fetchMessageBrokerTopic(tag: string): IProductMessageBrokerTopic;
|
|
39
|
+
fetchMessageBrokerTopic(tag: string): IProductMessageBrokerTopic | null;
|
|
40
40
|
fetchMessageBrokerTopics(messageBrokerTag: string): Array<IProductMessageBrokerTopic>;
|
|
41
41
|
createQuota(data: Partial<IProductQuota>): Promise<void>;
|
|
42
42
|
updateQuota(tag: string, data: Partial<IProductQuota>): Promise<void>;
|
|
43
|
-
fetchQuota(tag: string): IProductQuota;
|
|
43
|
+
fetchQuota(tag: string): IProductQuota | null;
|
|
44
44
|
fetchQuotas(): Array<IProductQuota>;
|
|
45
45
|
createFallback(data: Partial<IProductFallback>): Promise<void>;
|
|
46
46
|
updateFallback(tag: string, data: Partial<IProductFallback>): Promise<void>;
|
|
47
|
-
fetchFallback(tag: string): IProductFallback;
|
|
47
|
+
fetchFallback(tag: string): IProductFallback | null;
|
|
48
48
|
fetchFallbacks(): Array<IProductFallback>;
|
|
49
49
|
createNotificationMessage(data: Partial<IProductNotificationTemplate>): Promise<void>;
|
|
50
50
|
updateNotificationMessage(data: Partial<IProductNotificationTemplate>): Promise<void>;
|
|
51
|
-
fetchNotificationMessage(tag: string): IProductNotificationTemplate;
|
|
51
|
+
fetchNotificationMessage(tag: string): IProductNotificationTemplate | null;
|
|
52
52
|
fetchNotificationMessages(notificationTag: string): Array<IProductNotificationTemplate>;
|
|
53
53
|
updateApp(tag: string, data: Partial<IProductApp>): Promise<void>;
|
|
54
|
-
fetchApp(tag: string): IProductApp;
|
|
54
|
+
fetchApp(tag: string): IProductApp | null;
|
|
55
55
|
fetchApps(): Array<IProductApp>;
|
|
56
56
|
addApp(app: IProductApp, throwErrorIfExists?: boolean): Promise<void>;
|
|
57
57
|
createFeature(data: Partial<IProductFeature>, throwErrorIfExists?: boolean): Promise<void>;
|
|
@@ -60,15 +60,15 @@ export interface IProductsBuilderService {
|
|
|
60
60
|
fetchFeatures(): Array<IProductFeature>;
|
|
61
61
|
createDatabase(data: Partial<IProductDatabase>, throwErrorIfExists?: boolean): Promise<void>;
|
|
62
62
|
updateDatabase(tag: string, data: Partial<IProductDatabase>): Promise<void>;
|
|
63
|
-
fetchDatabase(tag: string): IProductDatabase;
|
|
63
|
+
fetchDatabase(tag: string): IProductDatabase | null;
|
|
64
64
|
fetchDatabases(): Array<IProductDatabase>;
|
|
65
65
|
createDatabaseAction(data: Partial<IProductDatabaseAction>, throwErrorIfExists?: boolean): Promise<void>;
|
|
66
66
|
updateDatabaseAction(data: Partial<IProductDatabaseAction>): Promise<void>;
|
|
67
|
-
fetchDatabaseAction(tag: string): IProductDatabaseAction;
|
|
67
|
+
fetchDatabaseAction(tag: string): IProductDatabaseAction | null;
|
|
68
68
|
fetchDatabaseActions(databaseTag: string): Array<IProductDatabaseAction>;
|
|
69
69
|
createDatabaseMigration(data: Partial<IProductDatabaseMigration>, throwErrorIfExists?: boolean): Promise<void>;
|
|
70
70
|
updateDatabaseMigration(data: Partial<IProductDatabaseMigration>): Promise<void>;
|
|
71
|
-
fetchDatabaseMigration(tag: string): IProductDatabaseMigration;
|
|
71
|
+
fetchDatabaseMigration(tag: string): IProductDatabaseMigration | null;
|
|
72
72
|
fetchDatabaseMigrations(databaseTag: string): Array<IProductDatabaseMigration>;
|
|
73
73
|
createJob(data: Partial<IProductJobs>, throwErrorIfExists?: boolean): Promise<void>;
|
|
74
74
|
updateJob(tag: string, data: Partial<IProductJobs>): Promise<void>;
|
|
@@ -108,30 +108,30 @@ export default class ProductsBuilderService implements IProductsBuilderService {
|
|
|
108
108
|
fetchProduct(): IProduct;
|
|
109
109
|
createMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>, throwErrorIfExists?: boolean): Promise<void>;
|
|
110
110
|
updateMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>): Promise<void>;
|
|
111
|
-
fetchMessageBrokerTopic(tag: string, throwErrorIfExists?: boolean): IProductMessageBrokerTopic;
|
|
111
|
+
fetchMessageBrokerTopic(tag: string, throwErrorIfExists?: boolean): IProductMessageBrokerTopic | null;
|
|
112
112
|
fetchMessageBrokerTopics(messageBrokerTag: string): Array<IProductMessageBrokerTopic>;
|
|
113
113
|
validateQuotaFallbackInputAndOutput(data: Partial<IProductQuota> | Partial<IProductFallback>): Promise<void>;
|
|
114
114
|
validateQuotaFallbackInput(option: IQuotaOptions | IFallbackOptions, input: Record<string, IFeatureInput>): Promise<void>;
|
|
115
115
|
validateQuotaFallbackOutput(option: IQuotaOptions | IFallbackOptions, pastResponse: Record<string, unknown> | null, input: Record<string, IFeatureInput>): Promise<void>;
|
|
116
116
|
createQuota(data: Partial<IProductQuota>): Promise<void>;
|
|
117
117
|
updateQuota(tag: string, data: Partial<IProductQuota>): Promise<void>;
|
|
118
|
-
fetchQuota(tag: string): IProductQuota;
|
|
118
|
+
fetchQuota(tag: string): IProductQuota | null;
|
|
119
119
|
fetchQuotas(): Array<IProductQuota>;
|
|
120
120
|
createFallback(data: Partial<IProductFallback>): Promise<void>;
|
|
121
121
|
updateFallback(tag: string, data: Partial<IProductFallback>): Promise<void>;
|
|
122
|
-
fetchFallback(tag: string): IProductFallback;
|
|
122
|
+
fetchFallback(tag: string): IProductFallback | null;
|
|
123
123
|
fetchFallbacks(): Array<IProductFallback>;
|
|
124
124
|
createEnv(data: IProductEnv, throwErrorIfExists?: boolean): Promise<void>;
|
|
125
125
|
updateEnv(slug: string, data: Partial<IProductEnv>): Promise<void>;
|
|
126
126
|
fetchEnvs(): IProductEnv[];
|
|
127
|
-
fetchEnv(slug: string, throwErrorIfExists?: boolean): IProductEnv;
|
|
127
|
+
fetchEnv(slug: string, throwErrorIfExists?: boolean): IProductEnv | null;
|
|
128
128
|
createMessageBroker(data: Partial<IProductMessageBroker>, throwErrorIfExists?: boolean): Promise<void>;
|
|
129
129
|
updateMessageBroker(tag: string, data: Partial<IProductMessageBroker>): Promise<void>;
|
|
130
|
-
fetchMessageBroker(tag: string, throwErrorIfExists?: boolean): IProductMessageBroker;
|
|
130
|
+
fetchMessageBroker(tag: string, throwErrorIfExists?: boolean): IProductMessageBroker | null;
|
|
131
131
|
fetchMessageBrokers(): Array<IProductMessageBroker>;
|
|
132
132
|
createStorage(data: Partial<IProductStorage>, throwErrorIfExists?: boolean): Promise<void>;
|
|
133
133
|
updateStorage(tag: string, data: Partial<IProductStorage>): Promise<void>;
|
|
134
|
-
fetchStorage(tag: string, throwErrorIfExists?: boolean): IProductStorage;
|
|
134
|
+
fetchStorage(tag: string, throwErrorIfExists?: boolean): IProductStorage | null;
|
|
135
135
|
fetchStorages(): Array<IProductStorage>;
|
|
136
136
|
private validateAppData;
|
|
137
137
|
private validateVariablesSchema;
|
|
@@ -143,18 +143,18 @@ export default class ProductsBuilderService implements IProductsBuilderService {
|
|
|
143
143
|
fetchAppWebhooks(access_tag: string): Promise<Array<IAppWebhook>>;
|
|
144
144
|
updateApp(access_tag: string, data: Partial<IProductApp>): Promise<void>;
|
|
145
145
|
fetchApps(): Array<IProductApp>;
|
|
146
|
-
fetchApp(tag: string, throwErrorIfExists?: boolean): IProductApp;
|
|
146
|
+
fetchApp(tag: string, throwErrorIfExists?: boolean): IProductApp | null;
|
|
147
147
|
createFunction(data: Partial<IProductFunction>, throwErrorIfExists?: boolean): Promise<void>;
|
|
148
148
|
updateFunction(tag: string, data: Partial<IProductFunction>): Promise<void>;
|
|
149
149
|
fetchFunctions(): Array<IProductFunction>;
|
|
150
|
-
fetchFunction(tag: string): IProductFunction;
|
|
150
|
+
fetchFunction(tag: string): IProductFunction | null;
|
|
151
151
|
createCache(data: Partial<IProductCache>, throwErrorIfExists?: boolean): Promise<void>;
|
|
152
152
|
updateCache(tag: string, data: Partial<IProductCache>): Promise<void>;
|
|
153
|
-
fetchCache(tag: string, throwErrorIfExists?: boolean): IProductCache;
|
|
153
|
+
fetchCache(tag: string, throwErrorIfExists?: boolean): IProductCache | null;
|
|
154
154
|
fetchCaches(): Array<IProductCache>;
|
|
155
155
|
createNotification(data: Partial<IProductNotification>, throwErrorIfExists?: boolean): Promise<void>;
|
|
156
156
|
createNotificationMessage(data: Partial<IProductNotificationTemplate>, throwErrorIfExists?: boolean): Promise<void>;
|
|
157
|
-
fetchNotificationMessage(tag: string, throwErrorIfExists?: boolean): IProductNotificationTemplate;
|
|
157
|
+
fetchNotificationMessage(tag: string, throwErrorIfExists?: boolean): IProductNotificationTemplate | null;
|
|
158
158
|
fetchNotificationMessages(notificationTag: string, throwErrorIfExists?: boolean): Array<IProductNotificationTemplate>;
|
|
159
159
|
updateNotificationMessage(data: Partial<IProductNotificationTemplate>): Promise<void>;
|
|
160
160
|
updateNotification(tag: string, data: Partial<IProductNotification>): Promise<void>;
|
|
@@ -195,31 +195,31 @@ export default class ProductsBuilderService implements IProductsBuilderService {
|
|
|
195
195
|
parseInputString(payload: IParseInputStringInput, meta: IParseInputStringMetaData): Promise<void>;
|
|
196
196
|
compareInputWithExpectedInput(datapoint: IParsedSample, found_input: IParsedSample, value: string): void;
|
|
197
197
|
extractStages(input: string): Array<string>;
|
|
198
|
-
fetchSequenceEvent(sequence: IFeatureSequence, event: string): IFeatureEvent;
|
|
198
|
+
fetchSequenceEvent(sequence: IFeatureSequence, event: string): IFeatureEvent | null;
|
|
199
199
|
fetchPriorSequence(meta: IParseInputStringMetaData, stage: string): IFeatureSequence;
|
|
200
200
|
validateActionKeyPlacement(data: IParseActionEventInput): IParsedSample;
|
|
201
201
|
fetchThirdPartyAppByAccessTag(access_tag: string): Promise<IApp & IVersion>;
|
|
202
202
|
fetchThirdPartyAppActionByTag(actions: Array<IAppAction>, action_tag: string): IAppAction;
|
|
203
203
|
createFeature(data: Partial<IProductFeature>, throwErrorIfExists?: boolean): Promise<void>;
|
|
204
204
|
updateFeature(tag: string, data: Partial<IProductFeature>): Promise<void>;
|
|
205
|
-
fetchFeature(tag: string, throwErrorIfExists?: boolean): IProductFeature;
|
|
205
|
+
fetchFeature(tag: string, throwErrorIfExists?: boolean): IProductFeature | null;
|
|
206
206
|
fetchFeatures(): Array<IProductFeature>;
|
|
207
207
|
createDatabase(data: Partial<IProductDatabase>, throwErrorIfExists?: boolean): Promise<void>;
|
|
208
208
|
updateDatabase(tag: string, data: Partial<IProductDatabase>): Promise<void>;
|
|
209
|
-
fetchDatabase(tag: string, throwErrorIfExists?: boolean): IProductDatabase;
|
|
209
|
+
fetchDatabase(tag: string, throwErrorIfExists?: boolean): IProductDatabase | null;
|
|
210
210
|
fetchDatabases(): Array<IProductDatabase>;
|
|
211
211
|
createDatabaseAction(data: Partial<IProductDatabaseAction>, throwErrorIfExists?: boolean): Promise<void>;
|
|
212
|
-
fetchDatabaseAction(tag: string, throwErrorIfExists?: boolean): IProductDatabaseAction;
|
|
212
|
+
fetchDatabaseAction(tag: string, throwErrorIfExists?: boolean): IProductDatabaseAction | null;
|
|
213
213
|
updateDatabaseAction(data: Partial<IProductDatabaseAction>): Promise<void>;
|
|
214
214
|
fetchDatabaseActions(databaseTag: string): Array<IProductDatabaseAction>;
|
|
215
215
|
createDatabaseMigration(data: Partial<IProductDatabaseMigration>, throwErrorIfExists?: boolean): Promise<void>;
|
|
216
216
|
updateDatabaseMigration(data: Partial<IProductDatabaseMigration>): Promise<void>;
|
|
217
|
-
fetchDatabaseMigration(tag: string, throwError?: boolean): IProductDatabaseMigration;
|
|
217
|
+
fetchDatabaseMigration(tag: string, throwError?: boolean): IProductDatabaseMigration | null;
|
|
218
218
|
fetchDatabaseMigrations(databaseTag: string): Array<IProductDatabaseMigration>;
|
|
219
219
|
validateJobEvent(data: Partial<IProductJobs>): Promise<void>;
|
|
220
220
|
createJob(data: Partial<IProductJobs>, throwErrorIfExists?: boolean): Promise<void>;
|
|
221
221
|
updateJob(tag: string, data: Partial<IProductJobs>): Promise<void>;
|
|
222
|
-
fetchJob(tag: string, throwError?: boolean): IProductJobs;
|
|
222
|
+
fetchJob(tag: string, throwError?: boolean): IProductJobs | null;
|
|
223
223
|
fetchJobs(): Array<IProductJobs>;
|
|
224
224
|
private getUserAccess;
|
|
225
225
|
}
|
|
@@ -599,7 +599,7 @@ class ProductsBuilderService {
|
|
|
599
599
|
if (data.tag && this.fetchMessageBroker(data.tag)) {
|
|
600
600
|
throw new Error(`tag ${tag} is in use`); // TODO: also check on the backend
|
|
601
601
|
}
|
|
602
|
-
console.log(
|
|
602
|
+
console.log('2', data.envs);
|
|
603
603
|
data.envs = data.envs.map((env) => {
|
|
604
604
|
const exists = this.fetchEnv(env.slug);
|
|
605
605
|
if (!exists) {
|
|
@@ -654,7 +654,6 @@ class ProductsBuilderService {
|
|
|
654
654
|
throw new Error(`Message Broker ${tag} not found`);
|
|
655
655
|
if (messageBroker) {
|
|
656
656
|
messageBroker.envs.map((broker) => {
|
|
657
|
-
console.log("THOMPSON!!!", this.fetchProduct().private_key);
|
|
658
657
|
if (typeof broker.config === 'string') {
|
|
659
658
|
broker.config = JSON.parse((0, processor_utils_1.decrypt)(String(broker.config), this.fetchProduct().private_key));
|
|
660
659
|
}
|
|
@@ -1056,8 +1055,7 @@ class ProductsBuilderService {
|
|
|
1056
1055
|
}
|
|
1057
1056
|
fetchFunction(tag) {
|
|
1058
1057
|
const func = this.product.functions.find((data) => data.tag === tag);
|
|
1059
|
-
if (!func)
|
|
1060
|
-
throw new Error(`Function ${tag} not found`);
|
|
1058
|
+
// if (!func) throw new Error(`Function ${tag} not found`);
|
|
1061
1059
|
return func;
|
|
1062
1060
|
}
|
|
1063
1061
|
async createCache(data, throwErrorIfExists = false) {
|
|
@@ -1469,7 +1467,7 @@ class ProductsBuilderService {
|
|
|
1469
1467
|
await this.validateActionDataInput(data, func, event.input, event_index, sequence_index);
|
|
1470
1468
|
}
|
|
1471
1469
|
async checkAndValidateDBActionDataInput(data, sequence_index, event, event_index) {
|
|
1472
|
-
console.log(
|
|
1470
|
+
console.log('EVENTY', event.event);
|
|
1473
1471
|
const { filterData, data: dbData, filterTemplate, template } = this.fetchDatabaseAction(event.event);
|
|
1474
1472
|
await this.validateDBActionDataInput(data, { filterData, data: dbData, template, filter: filterTemplate }, event.input, event_index, sequence_index);
|
|
1475
1473
|
}
|
|
@@ -1609,7 +1607,11 @@ class ProductsBuilderService {
|
|
|
1609
1607
|
const _a = event_input.email, { recipients } = _a, email = __rest(_a, ["recipients"]);
|
|
1610
1608
|
await this.validateActionInputData({
|
|
1611
1609
|
obj: email.subject,
|
|
1612
|
-
sample: {
|
|
1610
|
+
sample: {
|
|
1611
|
+
type: enums_1.InputsTypes.JSON,
|
|
1612
|
+
sample: '',
|
|
1613
|
+
data: action.email.filter((value) => value.parent_key === 'subject'),
|
|
1614
|
+
},
|
|
1613
1615
|
event_index,
|
|
1614
1616
|
sequence_index,
|
|
1615
1617
|
feature: data,
|
|
@@ -1618,7 +1620,11 @@ class ProductsBuilderService {
|
|
|
1618
1620
|
}, true);
|
|
1619
1621
|
await this.validateActionInputData({
|
|
1620
1622
|
obj: email.template,
|
|
1621
|
-
sample: {
|
|
1623
|
+
sample: {
|
|
1624
|
+
type: enums_1.InputsTypes.JSON,
|
|
1625
|
+
sample: '',
|
|
1626
|
+
data: action.email.filter((value) => value.parent_key === 'template'),
|
|
1627
|
+
},
|
|
1622
1628
|
event_index,
|
|
1623
1629
|
sequence_index,
|
|
1624
1630
|
feature: data,
|
|
@@ -1630,7 +1636,11 @@ class ProductsBuilderService {
|
|
|
1630
1636
|
const _b = event_input.push_notification, { device_tokens } = _b, push_notification = __rest(_b, ["device_tokens"]);
|
|
1631
1637
|
await this.validateActionInputData({
|
|
1632
1638
|
obj: push_notification.body,
|
|
1633
|
-
sample: {
|
|
1639
|
+
sample: {
|
|
1640
|
+
type: enums_1.InputsTypes.JSON,
|
|
1641
|
+
sample: '',
|
|
1642
|
+
data: action.notification.filter((value) => value.parent_key === 'body'),
|
|
1643
|
+
},
|
|
1634
1644
|
event_index,
|
|
1635
1645
|
sequence_index,
|
|
1636
1646
|
feature: data,
|
|
@@ -1638,10 +1648,14 @@ class ProductsBuilderService {
|
|
|
1638
1648
|
indexes: Object.assign(Object.assign({}, indexes), { parent_key: 'body', level: 1 }),
|
|
1639
1649
|
}, true);
|
|
1640
1650
|
if (push_notification.data) {
|
|
1641
|
-
console.log(
|
|
1651
|
+
console.log('JUMANJI', push_notification.data);
|
|
1642
1652
|
await this.validateActionInputData({
|
|
1643
1653
|
obj: push_notification.data,
|
|
1644
|
-
sample: {
|
|
1654
|
+
sample: {
|
|
1655
|
+
type: enums_1.InputsTypes.JSON,
|
|
1656
|
+
sample: '',
|
|
1657
|
+
data: action.notification.filter((value) => value.parent_key === 'data'),
|
|
1658
|
+
},
|
|
1645
1659
|
event_index,
|
|
1646
1660
|
sequence_index,
|
|
1647
1661
|
feature: data,
|
|
@@ -1652,7 +1666,11 @@ class ProductsBuilderService {
|
|
|
1652
1666
|
if (push_notification.title)
|
|
1653
1667
|
await this.validateActionInputData({
|
|
1654
1668
|
obj: push_notification.title,
|
|
1655
|
-
sample: {
|
|
1669
|
+
sample: {
|
|
1670
|
+
type: enums_1.InputsTypes.JSON,
|
|
1671
|
+
sample: '',
|
|
1672
|
+
data: action.notification.filter((value) => value.parent_key === 'title'),
|
|
1673
|
+
},
|
|
1656
1674
|
event_index,
|
|
1657
1675
|
sequence_index,
|
|
1658
1676
|
feature: data,
|
|
@@ -1917,7 +1935,7 @@ class ProductsBuilderService {
|
|
|
1917
1935
|
//console.log(payload)
|
|
1918
1936
|
return;
|
|
1919
1937
|
}
|
|
1920
|
-
if (
|
|
1938
|
+
if (this.isQuotaFallbackInput && (0, string_utils_1.startsWithAny)(value, ['$Sequence{', '$Response{'])) {
|
|
1921
1939
|
throw new Error(`Value ${value} cannot be a $Sequence or $Response value when defining Quota & Fallback input`);
|
|
1922
1940
|
}
|
|
1923
1941
|
if (value.startsWith('$Input{')) {
|
|
@@ -2246,14 +2264,11 @@ class ProductsBuilderService {
|
|
|
2246
2264
|
enums_1.DataTypes.NUMBER_STRING,
|
|
2247
2265
|
enums_1.DataTypes.INTEGER,
|
|
2248
2266
|
];
|
|
2249
|
-
const dateTypes = [
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
(strTypes.includes(found_input.type) || strTypes.includes(datapoint.type)));
|
|
2255
|
-
const dateException = ((datapoint.type === enums_1.DataTypes.INTEGER || found_input.type === enums_1.DataTypes.INTEGER) &&
|
|
2256
|
-
(dateTypes.includes(found_input.type) || dateTypes.includes(datapoint.type)));
|
|
2267
|
+
const dateTypes = [enums_1.DataTypes.DATE, enums_1.DataTypes.DATE_STRING];
|
|
2268
|
+
const strException = (datapoint.type === enums_1.DataTypes.STRING || found_input.type === enums_1.DataTypes.STRING) &&
|
|
2269
|
+
(strTypes.includes(found_input.type) || strTypes.includes(datapoint.type));
|
|
2270
|
+
const dateException = (datapoint.type === enums_1.DataTypes.INTEGER || found_input.type === enums_1.DataTypes.INTEGER) &&
|
|
2271
|
+
(dateTypes.includes(found_input.type) || dateTypes.includes(datapoint.type));
|
|
2257
2272
|
if (datapoint.type !== found_input.type && !strException && !dateException) {
|
|
2258
2273
|
//console.log("STR EXCEPTION", strException, found_input.type, datapoint.type)
|
|
2259
2274
|
throw new Error(`${value} is required to be ${datapoint.type} not ${found_input.type}`);
|
|
@@ -2288,7 +2303,7 @@ class ProductsBuilderService {
|
|
|
2288
2303
|
);
|
|
2289
2304
|
});
|
|
2290
2305
|
if (!datapoint) {
|
|
2291
|
-
console.log(
|
|
2306
|
+
console.log('VALIDATE', data.key, data.value, actionData, indexes);
|
|
2292
2307
|
throw new Error(`Key ${data.key} not found for ${data.type} for sequence ${sequence.tag} event ${sequence.events[data.event_index].event}`);
|
|
2293
2308
|
}
|
|
2294
2309
|
return datapoint;
|