@ductape/sdk 0.0.3-beta1 → 0.0.3-beta11
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/appApi.service.js +2 -2
- package/dist/api/services/appApi.service.js.map +1 -1
- package/dist/api/services/processorApi.service.d.ts +3 -1
- package/dist/api/services/processorApi.service.js +9 -0
- package/dist/api/services/processorApi.service.js.map +1 -1
- package/dist/api/services/productsApi.service.js +1 -1
- package/dist/api/services/productsApi.service.js.map +1 -1
- package/dist/api/urls.d.ts +1 -0
- package/dist/api/urls.js +2 -1
- package/dist/api/urls.js.map +1 -1
- package/dist/apps/services/app.service.d.ts +3 -3
- package/dist/apps/services/app.service.js +84 -50
- package/dist/apps/services/app.service.js.map +1 -1
- package/dist/apps/validators/joi-validators/update.appAction.validator.d.ts +2 -2
- package/dist/apps/validators/joi-validators/update.appAction.validator.js +11 -11
- package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +1 -1
- package/dist/imports/repos/postmanV21.repo.js +1 -1
- package/dist/imports/repos/postmanV21.repo.js.map +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.js +47 -4
- package/dist/index.js.map +1 -1
- package/dist/inputs/validators/inputs.validator.parse.js +1 -0
- package/dist/inputs/validators/inputs.validator.parse.js.map +1 -1
- package/dist/logs/logs.service.js +1 -1
- package/dist/logs/logs.service.js.map +1 -1
- package/dist/logs/logs.types.d.ts +1 -0
- package/dist/logs/logs.types.js.map +1 -1
- package/dist/processor/services/fallback.service.d.ts +2 -2
- package/dist/processor/services/fallback.service.js +11 -10
- package/dist/processor/services/fallback.service.js.map +1 -1
- package/dist/processor/services/processor.service.d.ts +4 -1
- package/dist/processor/services/processor.service.js +98 -19
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/processor/services/quota.service.d.ts +4 -13
- package/dist/processor/services/quota.service.js +11 -2
- package/dist/processor/services/quota.service.js.map +1 -1
- package/dist/processor/utils/storage.util.js +1 -0
- package/dist/processor/utils/storage.util.js.map +1 -1
- package/dist/products/services/products.service.d.ts +40 -32
- package/dist/products/services/products.service.js +236 -141
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/products/utils/string.utils.js +1 -0
- package/dist/products/utils/string.utils.js.map +1 -1
- package/dist/products/validators/index.d.ts +3 -1
- package/dist/products/validators/index.js +5 -1
- package/dist/products/validators/index.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +25 -18
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productFeature.validator.js +2 -0
- package/dist/products/validators/joi-validators/create.productFeature.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.js +1 -1
- package/dist/products/validators/joi-validators/create.productQuota.validator.js +2 -0
- package/dist/products/validators/joi-validators/create.productQuota.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.userAuth.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.userAuth.validator.js +47 -0
- package/dist/products/validators/joi-validators/create.userAuth.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.dataValue.validator.d.ts +1 -1
- package/dist/products/validators/joi-validators/update.dataValue.validator.js +3 -2
- package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productFeature.validator.js +2 -0
- package/dist/products/validators/joi-validators/update.productFeature.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js +2 -1
- package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productQuota.validator.js +8 -7
- package/dist/products/validators/joi-validators/update.productQuota.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.userAuth.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.userAuth.validator.js +47 -0
- package/dist/products/validators/joi-validators/update.userAuth.validator.js.map +1 -0
- package/dist/test/test.logs.js +6 -6
- package/dist/test/test.logs.js.map +1 -1
- package/dist/types/appBuilder.types.d.ts +16 -0
- package/dist/types/enums.d.ts +5 -0
- package/dist/types/enums.js +7 -1
- package/dist/types/enums.js.map +1 -1
- package/dist/types/inputs.types.d.ts +2 -0
- package/dist/types/inputs.types.js.map +1 -1
- package/dist/types/processor.types.d.ts +15 -0
- package/dist/types/processor.types.js.map +1 -1
- package/dist/types/productsBuilder.types.d.ts +14 -1
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/package.json +2 -1
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import { IQuotaOptions } from "../../types";
|
|
2
|
-
type ProviderOption = {
|
|
3
|
-
quota: number;
|
|
4
|
-
app: string;
|
|
5
|
-
action: string;
|
|
6
|
-
input: Record<string, any>;
|
|
7
|
-
output: Record<string, any>;
|
|
8
|
-
retries: number;
|
|
9
|
-
};
|
|
1
|
+
import { IFeatureEvent, ILogData, IQuotaOptions } from "../../types";
|
|
10
2
|
export default class QuotaManager {
|
|
11
3
|
private options;
|
|
12
4
|
private counters;
|
|
13
5
|
private totalQuota;
|
|
14
|
-
constructor(options:
|
|
6
|
+
constructor(options: IQuotaOptions[]);
|
|
15
7
|
private resetCounters;
|
|
16
8
|
private allQuotasReached;
|
|
17
9
|
checkProviderAvailability(provider: string): Promise<boolean>;
|
|
18
|
-
updateProviderStatus(options: IQuotaOptions[]): Promise<void>;
|
|
19
|
-
getNextProvider():
|
|
10
|
+
updateProviderStatus(options: IQuotaOptions[], callback: (event: IFeatureEvent, additional_logs: Partial<ILogData>, returnValue: boolean) => Promise<any>): Promise<void>;
|
|
11
|
+
getNextProvider(): IQuotaOptions | null;
|
|
20
12
|
incrementUsage(app: string): void;
|
|
21
13
|
}
|
|
22
|
-
export {};
|
|
@@ -24,9 +24,18 @@ class QuotaManager {
|
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
// pass function for
|
|
28
|
+
async updateProviderStatus(options, callback) {
|
|
28
29
|
for (const option of options) {
|
|
29
|
-
const
|
|
30
|
+
const event = {
|
|
31
|
+
app: option.app,
|
|
32
|
+
event: option.event,
|
|
33
|
+
type: option.type,
|
|
34
|
+
input: option.input,
|
|
35
|
+
retries: 0,
|
|
36
|
+
allow_fail: false
|
|
37
|
+
};
|
|
38
|
+
const isAvailable = await callback(event, {}, true); // or false, depending on your check logic
|
|
30
39
|
option.provider_status = isAvailable ? types_1.ProviderStatus.AVAILABLE : types_1.ProviderStatus.UNAVAILABLE;
|
|
31
40
|
option.last_available = isAvailable;
|
|
32
41
|
option.last_checked = new Date();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quota.service.js","sourceRoot":"","sources":["../../../src/processor/services/quota.service.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"quota.service.js","sourceRoot":"","sources":["../../../src/processor/services/quota.service.ts"],"names":[],"mappings":";;AAAA,uCAAqF;AAWrF,MAAqB,YAAY;IAK7B,YAAY,OAAwB;QAChC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,aAAa,EAAE,CAAC;IACzB,CAAC;IAEO,aAAa;QACjB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;IAEO,gBAAgB;QACpB,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EA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,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,mCAAI,CAAC,CAAC;YACxD,IAAI,YAAY,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;gBAC9B,OAAO,MAAM,CAAC;YAClB,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,cAAc,CAAC,GAAW;;QAC7B,MAAM,YAAY,GAAG,MAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,mCAAI,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,YAAY,GAAG,CAAC,CAAC,CAAC;IAC7C,CAAC;CAKJ;AA1ED,+BA0EC"}
|
|
@@ -39,6 +39,7 @@ async function uploadBlobToCloud({ data, destinationPath, config, }) {
|
|
|
39
39
|
if (typeof window !== 'undefined') {
|
|
40
40
|
return null; // We're in a browser, don't load the PostgreSQL handler
|
|
41
41
|
}
|
|
42
|
+
console.log("JASMINE", data);
|
|
42
43
|
const bufferData = Buffer.from(data, "base64");
|
|
43
44
|
switch (config.provider) {
|
|
44
45
|
case types_1.StorageProviders.AWS: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.util.js","sourceRoot":"","sources":["../../../src/processor/utils/storage.util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,
|
|
1
|
+
{"version":3,"file":"storage.util.js","sourceRoot":"","sources":["../../../src/processor/utils/storage.util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,8CAiEC;AAzED,uCAAkE;AAQ3D,KAAK,UAAU,iBAAiB,CAAC,EACpC,IAAI,EACJ,eAAe,EACf,MAAM,GACU;IAEhB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC,CAAC,wDAAwD;IACzE,CAAC;IAED,OAAO,CAA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,MAAM,CAAC,IAAI,CAAC,MAAO,UAA8B,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;YAExH,OAAO,QAAQ,UAAU,IAAI,eAAe,EAAE,CAAC;QACnD,CAAC;QAED,KAAK,wBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1B,MAAM,EAAE,iBAAiB,EAAE,GAAG,wDAAa,qBAAqB,GAAC,CAAC;YAClE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC,WAAY,CAAC;YAChE,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;YACnF,MAAM,eAAe,GAAG,iBAAiB,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;YAC5E,MAAM,eAAe,GAAG,eAAe,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;YAE5E,4GAA4G;YAE5G,MAAM,eAAe,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;YAC5D,OAAO,eAAe,CAAC,GAAG,CAAC;QAC/B,CAAC;QAED;YACI,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACvD,CAAC;AACL,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IApp, IAppAccess, IAppAction, IAppWebhook, IVersion } from '../../types/appBuilder.types';
|
|
2
2
|
import { IBuilderInit } from '../../types/index.types';
|
|
3
|
-
import { IActionDataParserInput, IActionRequest, ICreateProductsBuilder, IFeatureEvent, IFeatureInput, IFeatureSequence, IProduct, IProductApp, IProductCache, IProductDatabase, IProductDatabaseAction, IProductEnv, IProductFeature, IProductFunction, IProductJobs, IParseActionEventInput, IParseInputStringInput, IParseInputStringMetaData, IProductStorage, IDbActionRequest, INotificationRequest, IProductQuota, IProductFallback, IProductDatabaseMigration, IQuotaOptions, IFallbackOptions } from '../../types/productsBuilder.types';
|
|
3
|
+
import { IActionDataParserInput, IActionRequest, ICreateProductsBuilder, IFeatureEvent, IFeatureInput, IFeatureSequence, IProduct, IProductApp, IProductCache, IProductDatabase, IProductDatabaseAction, IProductEnv, IProductFeature, IProductFunction, IProductJobs, IParseActionEventInput, IParseInputStringInput, IParseInputStringMetaData, IProductStorage, IDbActionRequest, INotificationRequest, IProductQuota, IProductFallback, IProductDatabaseMigration, IQuotaOptions, IFallbackOptions, IProductSession } from '../../types/productsBuilder.types';
|
|
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,50 @@ 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
|
+
createSession(data: IProductSession): Promise<void>;
|
|
18
|
+
updateSession(tag: string, data: Partial<IProductSession>): Promise<void>;
|
|
19
|
+
fetchSession(tag: string): IProductSession | null;
|
|
20
|
+
fetchSessions(): Array<IProductSession>;
|
|
17
21
|
createFunction(data: Partial<IProductFunction>): Promise<void>;
|
|
18
22
|
updateFunction(tag: string, data: Partial<IProductFunction>): Promise<void>;
|
|
19
|
-
fetchFunction(tag: string): IProductFunction;
|
|
23
|
+
fetchFunction(tag: string): IProductFunction | null;
|
|
20
24
|
fetchFunctions(): Array<IProductFunction>;
|
|
21
25
|
createCache(data: Partial<IProductCache>, throwErrorIfExists?: boolean): Promise<void>;
|
|
22
26
|
updateCache(tag: string, data: Partial<IProductCache>): Promise<void>;
|
|
23
|
-
fetchCache(tag: string): IProductCache;
|
|
27
|
+
fetchCache(tag: string): IProductCache | null;
|
|
24
28
|
fetchCaches(): Array<IProductCache>;
|
|
25
29
|
createStorage(data: Partial<IProductStorage>): Promise<void>;
|
|
26
30
|
updateStorage(tag: string, data: Partial<IProductStorage>): Promise<void>;
|
|
27
|
-
fetchStorage(tag: string): IProductStorage;
|
|
31
|
+
fetchStorage(tag: string): IProductStorage | null;
|
|
28
32
|
fetchStorages(): Array<IProductStorage>;
|
|
29
33
|
createNotification(data: Partial<IProductNotification>): Promise<void>;
|
|
30
34
|
updateNotification(tag: string, data: Partial<IProductNotification>): Promise<void>;
|
|
31
|
-
fetchNotification(tag: string): IProductNotification | INotificationEnv;
|
|
35
|
+
fetchNotification(tag: string): IProductNotification | INotificationEnv | null;
|
|
32
36
|
fetchNotifications(): Array<IProductNotification>;
|
|
33
37
|
createMessageBroker(data: Partial<IProductMessageBroker>): Promise<void>;
|
|
34
38
|
updateMessageBroker(tag: string, data: Partial<IProductMessageBroker>): Promise<void>;
|
|
35
|
-
fetchMessageBroker(tag: string): IProductMessageBroker;
|
|
39
|
+
fetchMessageBroker(tag: string): IProductMessageBroker | null;
|
|
36
40
|
fetchMessageBrokers(): Array<IProductMessageBroker>;
|
|
37
41
|
createMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>): Promise<void>;
|
|
38
42
|
updateMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>): Promise<void>;
|
|
39
|
-
fetchMessageBrokerTopic(tag: string): IProductMessageBrokerTopic;
|
|
43
|
+
fetchMessageBrokerTopic(tag: string): IProductMessageBrokerTopic | null;
|
|
40
44
|
fetchMessageBrokerTopics(messageBrokerTag: string): Array<IProductMessageBrokerTopic>;
|
|
41
45
|
createQuota(data: Partial<IProductQuota>): Promise<void>;
|
|
42
46
|
updateQuota(tag: string, data: Partial<IProductQuota>): Promise<void>;
|
|
43
|
-
fetchQuota(tag: string): IProductQuota;
|
|
47
|
+
fetchQuota(tag: string): IProductQuota | null;
|
|
44
48
|
fetchQuotas(): Array<IProductQuota>;
|
|
45
49
|
createFallback(data: Partial<IProductFallback>): Promise<void>;
|
|
46
50
|
updateFallback(tag: string, data: Partial<IProductFallback>): Promise<void>;
|
|
47
|
-
fetchFallback(tag: string): IProductFallback;
|
|
51
|
+
fetchFallback(tag: string): IProductFallback | null;
|
|
48
52
|
fetchFallbacks(): Array<IProductFallback>;
|
|
49
53
|
createNotificationMessage(data: Partial<IProductNotificationTemplate>): Promise<void>;
|
|
50
54
|
updateNotificationMessage(data: Partial<IProductNotificationTemplate>): Promise<void>;
|
|
51
|
-
fetchNotificationMessage(tag: string): IProductNotificationTemplate;
|
|
55
|
+
fetchNotificationMessage(tag: string): IProductNotificationTemplate | null;
|
|
52
56
|
fetchNotificationMessages(notificationTag: string): Array<IProductNotificationTemplate>;
|
|
53
57
|
updateApp(tag: string, data: Partial<IProductApp>): Promise<void>;
|
|
54
|
-
fetchApp(tag: string): IProductApp;
|
|
58
|
+
fetchApp(tag: string): IProductApp | null;
|
|
55
59
|
fetchApps(): Array<IProductApp>;
|
|
56
60
|
addApp(app: IProductApp, throwErrorIfExists?: boolean): Promise<void>;
|
|
57
61
|
createFeature(data: Partial<IProductFeature>, throwErrorIfExists?: boolean): Promise<void>;
|
|
@@ -60,15 +64,15 @@ export interface IProductsBuilderService {
|
|
|
60
64
|
fetchFeatures(): Array<IProductFeature>;
|
|
61
65
|
createDatabase(data: Partial<IProductDatabase>, throwErrorIfExists?: boolean): Promise<void>;
|
|
62
66
|
updateDatabase(tag: string, data: Partial<IProductDatabase>): Promise<void>;
|
|
63
|
-
fetchDatabase(tag: string): IProductDatabase;
|
|
67
|
+
fetchDatabase(tag: string): IProductDatabase | null;
|
|
64
68
|
fetchDatabases(): Array<IProductDatabase>;
|
|
65
69
|
createDatabaseAction(data: Partial<IProductDatabaseAction>, throwErrorIfExists?: boolean): Promise<void>;
|
|
66
70
|
updateDatabaseAction(data: Partial<IProductDatabaseAction>): Promise<void>;
|
|
67
|
-
fetchDatabaseAction(tag: string): IProductDatabaseAction;
|
|
71
|
+
fetchDatabaseAction(tag: string): IProductDatabaseAction | null;
|
|
68
72
|
fetchDatabaseActions(databaseTag: string): Array<IProductDatabaseAction>;
|
|
69
73
|
createDatabaseMigration(data: Partial<IProductDatabaseMigration>, throwErrorIfExists?: boolean): Promise<void>;
|
|
70
74
|
updateDatabaseMigration(data: Partial<IProductDatabaseMigration>): Promise<void>;
|
|
71
|
-
fetchDatabaseMigration(tag: string): IProductDatabaseMigration;
|
|
75
|
+
fetchDatabaseMigration(tag: string): IProductDatabaseMigration | null;
|
|
72
76
|
fetchDatabaseMigrations(databaseTag: string): Array<IProductDatabaseMigration>;
|
|
73
77
|
createJob(data: Partial<IProductJobs>, throwErrorIfExists?: boolean): Promise<void>;
|
|
74
78
|
updateJob(tag: string, data: Partial<IProductJobs>): Promise<void>;
|
|
@@ -106,32 +110,36 @@ export default class ProductsBuilderService implements IProductsBuilderService {
|
|
|
106
110
|
private createNewProduct;
|
|
107
111
|
checkIfProductExists(name: string): Promise<false | IProduct>;
|
|
108
112
|
fetchProduct(): IProduct;
|
|
113
|
+
createSession(data: IProductSession): Promise<void>;
|
|
114
|
+
updateSession(tag: string, data: Partial<IProductSession>): Promise<void>;
|
|
115
|
+
fetchSession(tag: string): IProductSession | null;
|
|
116
|
+
fetchSessions(): Array<IProductSession>;
|
|
109
117
|
createMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>, throwErrorIfExists?: boolean): Promise<void>;
|
|
110
118
|
updateMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>): Promise<void>;
|
|
111
|
-
fetchMessageBrokerTopic(tag: string, throwErrorIfExists?: boolean): IProductMessageBrokerTopic;
|
|
119
|
+
fetchMessageBrokerTopic(tag: string, throwErrorIfExists?: boolean): IProductMessageBrokerTopic | null;
|
|
112
120
|
fetchMessageBrokerTopics(messageBrokerTag: string): Array<IProductMessageBrokerTopic>;
|
|
113
121
|
validateQuotaFallbackInputAndOutput(data: Partial<IProductQuota> | Partial<IProductFallback>): Promise<void>;
|
|
114
122
|
validateQuotaFallbackInput(option: IQuotaOptions | IFallbackOptions, input: Record<string, IFeatureInput>): Promise<void>;
|
|
115
123
|
validateQuotaFallbackOutput(option: IQuotaOptions | IFallbackOptions, pastResponse: Record<string, unknown> | null, input: Record<string, IFeatureInput>): Promise<void>;
|
|
116
124
|
createQuota(data: Partial<IProductQuota>): Promise<void>;
|
|
117
125
|
updateQuota(tag: string, data: Partial<IProductQuota>): Promise<void>;
|
|
118
|
-
fetchQuota(tag: string): IProductQuota;
|
|
126
|
+
fetchQuota(tag: string): IProductQuota | null;
|
|
119
127
|
fetchQuotas(): Array<IProductQuota>;
|
|
120
128
|
createFallback(data: Partial<IProductFallback>): Promise<void>;
|
|
121
129
|
updateFallback(tag: string, data: Partial<IProductFallback>): Promise<void>;
|
|
122
|
-
fetchFallback(tag: string): IProductFallback;
|
|
130
|
+
fetchFallback(tag: string): IProductFallback | null;
|
|
123
131
|
fetchFallbacks(): Array<IProductFallback>;
|
|
124
132
|
createEnv(data: IProductEnv, throwErrorIfExists?: boolean): Promise<void>;
|
|
125
133
|
updateEnv(slug: string, data: Partial<IProductEnv>): Promise<void>;
|
|
126
134
|
fetchEnvs(): IProductEnv[];
|
|
127
|
-
fetchEnv(slug: string, throwErrorIfExists?: boolean): IProductEnv;
|
|
135
|
+
fetchEnv(slug: string, throwErrorIfExists?: boolean): IProductEnv | null;
|
|
128
136
|
createMessageBroker(data: Partial<IProductMessageBroker>, throwErrorIfExists?: boolean): Promise<void>;
|
|
129
137
|
updateMessageBroker(tag: string, data: Partial<IProductMessageBroker>): Promise<void>;
|
|
130
|
-
fetchMessageBroker(tag: string, throwErrorIfExists?: boolean): IProductMessageBroker;
|
|
138
|
+
fetchMessageBroker(tag: string, throwErrorIfExists?: boolean): IProductMessageBroker | null;
|
|
131
139
|
fetchMessageBrokers(): Array<IProductMessageBroker>;
|
|
132
140
|
createStorage(data: Partial<IProductStorage>, throwErrorIfExists?: boolean): Promise<void>;
|
|
133
141
|
updateStorage(tag: string, data: Partial<IProductStorage>): Promise<void>;
|
|
134
|
-
fetchStorage(tag: string, throwErrorIfExists?: boolean): IProductStorage;
|
|
142
|
+
fetchStorage(tag: string, throwErrorIfExists?: boolean): IProductStorage | null;
|
|
135
143
|
fetchStorages(): Array<IProductStorage>;
|
|
136
144
|
private validateAppData;
|
|
137
145
|
private validateVariablesSchema;
|
|
@@ -143,18 +151,18 @@ export default class ProductsBuilderService implements IProductsBuilderService {
|
|
|
143
151
|
fetchAppWebhooks(access_tag: string): Promise<Array<IAppWebhook>>;
|
|
144
152
|
updateApp(access_tag: string, data: Partial<IProductApp>): Promise<void>;
|
|
145
153
|
fetchApps(): Array<IProductApp>;
|
|
146
|
-
fetchApp(tag: string, throwErrorIfExists?: boolean): IProductApp;
|
|
154
|
+
fetchApp(tag: string, throwErrorIfExists?: boolean): IProductApp | null;
|
|
147
155
|
createFunction(data: Partial<IProductFunction>, throwErrorIfExists?: boolean): Promise<void>;
|
|
148
156
|
updateFunction(tag: string, data: Partial<IProductFunction>): Promise<void>;
|
|
149
157
|
fetchFunctions(): Array<IProductFunction>;
|
|
150
|
-
fetchFunction(tag: string): IProductFunction;
|
|
158
|
+
fetchFunction(tag: string): IProductFunction | null;
|
|
151
159
|
createCache(data: Partial<IProductCache>, throwErrorIfExists?: boolean): Promise<void>;
|
|
152
160
|
updateCache(tag: string, data: Partial<IProductCache>): Promise<void>;
|
|
153
|
-
fetchCache(tag: string, throwErrorIfExists?: boolean): IProductCache;
|
|
161
|
+
fetchCache(tag: string, throwErrorIfExists?: boolean): IProductCache | null;
|
|
154
162
|
fetchCaches(): Array<IProductCache>;
|
|
155
163
|
createNotification(data: Partial<IProductNotification>, throwErrorIfExists?: boolean): Promise<void>;
|
|
156
164
|
createNotificationMessage(data: Partial<IProductNotificationTemplate>, throwErrorIfExists?: boolean): Promise<void>;
|
|
157
|
-
fetchNotificationMessage(tag: string, throwErrorIfExists?: boolean): IProductNotificationTemplate;
|
|
165
|
+
fetchNotificationMessage(tag: string, throwErrorIfExists?: boolean): IProductNotificationTemplate | null;
|
|
158
166
|
fetchNotificationMessages(notificationTag: string, throwErrorIfExists?: boolean): Array<IProductNotificationTemplate>;
|
|
159
167
|
updateNotificationMessage(data: Partial<IProductNotificationTemplate>): Promise<void>;
|
|
160
168
|
updateNotification(tag: string, data: Partial<IProductNotification>): Promise<void>;
|
|
@@ -195,31 +203,31 @@ export default class ProductsBuilderService implements IProductsBuilderService {
|
|
|
195
203
|
parseInputString(payload: IParseInputStringInput, meta: IParseInputStringMetaData): Promise<void>;
|
|
196
204
|
compareInputWithExpectedInput(datapoint: IParsedSample, found_input: IParsedSample, value: string): void;
|
|
197
205
|
extractStages(input: string): Array<string>;
|
|
198
|
-
fetchSequenceEvent(sequence: IFeatureSequence, event: string): IFeatureEvent;
|
|
206
|
+
fetchSequenceEvent(sequence: IFeatureSequence, event: string): IFeatureEvent | null;
|
|
199
207
|
fetchPriorSequence(meta: IParseInputStringMetaData, stage: string): IFeatureSequence;
|
|
200
208
|
validateActionKeyPlacement(data: IParseActionEventInput): IParsedSample;
|
|
201
209
|
fetchThirdPartyAppByAccessTag(access_tag: string): Promise<IApp & IVersion>;
|
|
202
210
|
fetchThirdPartyAppActionByTag(actions: Array<IAppAction>, action_tag: string): IAppAction;
|
|
203
211
|
createFeature(data: Partial<IProductFeature>, throwErrorIfExists?: boolean): Promise<void>;
|
|
204
212
|
updateFeature(tag: string, data: Partial<IProductFeature>): Promise<void>;
|
|
205
|
-
fetchFeature(tag: string, throwErrorIfExists?: boolean): IProductFeature;
|
|
213
|
+
fetchFeature(tag: string, throwErrorIfExists?: boolean): IProductFeature | null;
|
|
206
214
|
fetchFeatures(): Array<IProductFeature>;
|
|
207
215
|
createDatabase(data: Partial<IProductDatabase>, throwErrorIfExists?: boolean): Promise<void>;
|
|
208
216
|
updateDatabase(tag: string, data: Partial<IProductDatabase>): Promise<void>;
|
|
209
|
-
fetchDatabase(tag: string, throwErrorIfExists?: boolean): IProductDatabase;
|
|
217
|
+
fetchDatabase(tag: string, throwErrorIfExists?: boolean): IProductDatabase | null;
|
|
210
218
|
fetchDatabases(): Array<IProductDatabase>;
|
|
211
219
|
createDatabaseAction(data: Partial<IProductDatabaseAction>, throwErrorIfExists?: boolean): Promise<void>;
|
|
212
|
-
fetchDatabaseAction(tag: string, throwErrorIfExists?: boolean): IProductDatabaseAction;
|
|
220
|
+
fetchDatabaseAction(tag: string, throwErrorIfExists?: boolean): IProductDatabaseAction | null;
|
|
213
221
|
updateDatabaseAction(data: Partial<IProductDatabaseAction>): Promise<void>;
|
|
214
222
|
fetchDatabaseActions(databaseTag: string): Array<IProductDatabaseAction>;
|
|
215
223
|
createDatabaseMigration(data: Partial<IProductDatabaseMigration>, throwErrorIfExists?: boolean): Promise<void>;
|
|
216
224
|
updateDatabaseMigration(data: Partial<IProductDatabaseMigration>): Promise<void>;
|
|
217
|
-
fetchDatabaseMigration(tag: string, throwError?: boolean): IProductDatabaseMigration;
|
|
225
|
+
fetchDatabaseMigration(tag: string, throwError?: boolean): IProductDatabaseMigration | null;
|
|
218
226
|
fetchDatabaseMigrations(databaseTag: string): Array<IProductDatabaseMigration>;
|
|
219
227
|
validateJobEvent(data: Partial<IProductJobs>): Promise<void>;
|
|
220
228
|
createJob(data: Partial<IProductJobs>, throwErrorIfExists?: boolean): Promise<void>;
|
|
221
229
|
updateJob(tag: string, data: Partial<IProductJobs>): Promise<void>;
|
|
222
|
-
fetchJob(tag: string, throwError?: boolean): IProductJobs;
|
|
230
|
+
fetchJob(tag: string, throwError?: boolean): IProductJobs | null;
|
|
223
231
|
fetchJobs(): Array<IProductJobs>;
|
|
224
232
|
private getUserAccess;
|
|
225
233
|
}
|