@ductape/sdk 0.0.4-v32 → 0.0.4-v34

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.
@@ -5,84 +5,88 @@ import { KeyValuePair } from '../../imports/imports.types';
5
5
  import { IProductNotification, INotificationEnv, IProductNotificationTemplate, IProductMessageBroker, IProductMessageBrokerTopic, IFileURLPayload } from '../../types/processor.types';
6
6
  import { IParsedSample } from '../../types/inputs.types';
7
7
  export interface IProductsBuilderService {
8
+ fetchPrivateKey(): string;
9
+ fetchWorkspaceId(): string;
10
+ fetchProductId(): string;
8
11
  fetchThirdPartyAppByAccessTag(access_tag: string): Promise<(IApp & IVersion) | null>;
9
12
  createProduct(data: ICreateProductsBuilder): Promise<void>;
10
13
  updateProduct(data: Partial<IProduct>): Promise<void>;
11
14
  initializeProduct(product_id: string): Promise<void>;
12
- fetchProduct(): IProduct;
15
+ fetchProduct(): Promise<IProduct>;
13
16
  initializeProductByTag(tag: string): Promise<void>;
14
17
  createEnv(data: Partial<IProductEnv>): Promise<void>;
15
18
  updateEnv(slug: string, data: Partial<IProductEnv>): Promise<void>;
16
- fetchEnv(slug: string): IProductEnv | null;
17
- fetchEnvs(): Array<IProductEnv>;
19
+ fetchEnv(slug: string): Promise<IProductEnv | null>;
20
+ fetchEnvs(): Promise<Array<IProductEnv>>;
18
21
  createSession(data: IProductSession): Promise<void>;
19
22
  updateSession(tag: string, data: Partial<IProductSession>): Promise<void>;
20
- fetchSession(tag: string): IProductSession | null;
21
- fetchSessions(): Array<IProductSession>;
23
+ fetchSession(tag: string): Promise<IProductSession | null>;
24
+ fetchSessions(): Promise<Array<IProductSession>>;
22
25
  createFunction(data: Partial<IProductFunction>): Promise<void>;
23
26
  updateFunction(tag: string, data: Partial<IProductFunction>): Promise<void>;
24
- fetchFunction(tag: string): IProductFunction | null;
25
- fetchFunctions(): Array<IProductFunction>;
27
+ fetchFunction(tag: string): Promise<IProductFunction | null>;
28
+ fetchFunctions(): Promise<Array<IProductFunction>>;
26
29
  createCache(data: Partial<IProductCache>, throwErrorIfExists?: boolean): Promise<void>;
27
30
  updateCache(tag: string, data: Partial<IProductCache>): Promise<void>;
28
- fetchCache(tag: string): IProductCache | null;
29
- fetchCaches(): Array<IProductCache>;
31
+ fetchCache(tag: string): Promise<IProductCache | null>;
32
+ fetchCaches(): Promise<Array<IProductCache>>;
30
33
  createStorage(data: Partial<IProductStorage>): Promise<void>;
31
34
  updateStorage(tag: string, data: Partial<IProductStorage>): Promise<void>;
32
- fetchStorage(tag: string): IProductStorage | null;
33
- fetchStorages(): Array<IProductStorage>;
35
+ fetchStorage(tag: string): Promise<IProductStorage | null>;
36
+ fetchStorages(): Promise<Array<IProductStorage>>;
34
37
  createNotification(data: Partial<IProductNotification>): Promise<void>;
35
38
  updateNotification(tag: string, data: Partial<IProductNotification>): Promise<void>;
36
- fetchNotification(tag: string): IProductNotification | INotificationEnv | null;
37
- fetchNotifications(): Array<IProductNotification>;
39
+ fetchNotification(tag: string): Promise<IProductNotification | INotificationEnv | null>;
40
+ fetchNotifications(): Promise<Array<IProductNotification>>;
38
41
  createMessageBroker(data: Partial<IProductMessageBroker>): Promise<void>;
39
42
  updateMessageBroker(tag: string, data: Partial<IProductMessageBroker>): Promise<void>;
40
- fetchMessageBroker(tag: string): IProductMessageBroker | null;
41
- fetchMessageBrokers(): Array<IProductMessageBroker>;
43
+ fetchMessageBroker(tag: string): Promise<IProductMessageBroker | null>;
44
+ fetchMessageBrokers(): Promise<Array<IProductMessageBroker>>;
42
45
  createMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>): Promise<void>;
43
46
  updateMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>): Promise<void>;
44
- fetchMessageBrokerTopic(tag: string): IProductMessageBrokerTopic | null;
45
- fetchMessageBrokerTopics(messageBrokerTag: string): Array<IProductMessageBrokerTopic>;
47
+ fetchMessageBrokerTopic(tag: string): Promise<IProductMessageBrokerTopic | null>;
48
+ fetchMessageBrokerTopics(messageBrokerTag: string): Promise<Array<IProductMessageBrokerTopic>>;
46
49
  createQuota(data: Partial<IProductQuota>): Promise<void>;
47
50
  updateQuota(tag: string, data: Partial<IProductQuota>): Promise<void>;
48
- fetchQuota(tag: string): IProductQuota | null;
49
- fetchQuotas(): Array<IProductQuota>;
51
+ fetchQuota(tag: string): Promise<IProductQuota | null>;
52
+ fetchQuotas(): Promise<Array<IProductQuota>>;
50
53
  createFallback(data: Partial<IProductFallback>): Promise<void>;
51
54
  updateFallback(tag: string, data: Partial<IProductFallback>): Promise<void>;
52
- fetchFallback(tag: string): IProductFallback | null;
53
- fetchFallbacks(): Array<IProductFallback>;
55
+ fetchFallback(tag: string): Promise<IProductFallback | null>;
56
+ fetchFallbacks(): Promise<Array<IProductFallback>>;
54
57
  createNotificationMessage(data: Partial<IProductNotificationTemplate>): Promise<void>;
55
58
  updateNotificationMessage(data: Partial<IProductNotificationTemplate>): Promise<void>;
56
- fetchNotificationMessage(tag: string): IProductNotificationTemplate | null;
57
- fetchNotificationMessages(notificationTag: string): Array<IProductNotificationTemplate>;
59
+ fetchNotificationMessage(tag: string): Promise<IProductNotificationTemplate | null>;
60
+ fetchNotificationMessages(notificationTag: string): Promise<Array<IProductNotificationTemplate>>;
58
61
  updateApp(tag: string, data: Partial<IProductApp>): Promise<void>;
59
- fetchApp(tag: string): IProductApp | null;
60
- fetchApps(): Array<IProductApp>;
62
+ fetchApp(tag: string): Promise<IProductApp | null>;
63
+ fetchApps(): Promise<Array<IProductApp>>;
61
64
  addApp(app: IProductApp, throwErrorIfExists?: boolean): Promise<void>;
62
65
  createFeature(data: Partial<IProductFeature>, throwErrorIfExists?: boolean): Promise<void>;
63
66
  updateFeature(tag: string, data: Partial<IProductFeature>): Promise<void>;
64
- fetchFeature(tag: string): IProductFeature;
65
- fetchFeatures(): Array<IProductFeature>;
67
+ fetchFeature(tag: string): Promise<IProductFeature>;
68
+ fetchFeatures(): Promise<Array<IProductFeature>>;
66
69
  createDatabase(data: Partial<IProductDatabase>, throwErrorIfExists?: boolean): Promise<void>;
67
70
  updateDatabase(tag: string, data: Partial<IProductDatabase>): Promise<void>;
68
- fetchDatabase(tag: string): IProductDatabase | null;
69
- fetchDatabases(): Array<IProductDatabase>;
71
+ fetchDatabase(tag: string): Promise<IProductDatabase | null>;
72
+ fetchDatabases(): Promise<Array<IProductDatabase>>;
70
73
  createDatabaseAction(data: Partial<IProductDatabaseAction>, throwErrorIfExists?: boolean): Promise<void>;
71
74
  updateDatabaseAction(data: Partial<IProductDatabaseAction>): Promise<void>;
72
- fetchDatabaseAction(tag: string): IProductDatabaseAction | null;
73
- fetchDatabaseActions(databaseTag: string): Array<IProductDatabaseAction>;
75
+ fetchDatabaseAction(tag: string): Promise<IProductDatabaseAction | null>;
76
+ fetchDatabaseActions(databaseTag: string): Promise<Array<IProductDatabaseAction>>;
74
77
  createDatabaseMigration(data: Partial<IProductDatabaseMigration>, throwErrorIfExists?: boolean): Promise<void>;
75
78
  updateDatabaseMigration(data: Partial<IProductDatabaseMigration>): Promise<void>;
76
- fetchDatabaseMigration(tag: string): IProductDatabaseMigration | null;
77
- fetchDatabaseMigrations(databaseTag: string): Array<IProductDatabaseMigration>;
79
+ fetchDatabaseMigration(tag: string): Promise<IProductDatabaseMigration | null>;
80
+ fetchDatabaseMigrations(databaseTag: string): Promise<Array<IProductDatabaseMigration>>;
78
81
  createJob(data: Partial<IProductJobs>, throwErrorIfExists?: boolean): Promise<void>;
79
82
  updateJob(tag: string, data: Partial<IProductJobs>): Promise<void>;
80
- fetchJob(tag: string): IProductJobs;
81
- fetchJobs(): Array<IProductJobs>;
83
+ fetchJob(tag: string): Promise<IProductJobs>;
84
+ fetchJobs(): Promise<Array<IProductJobs>>;
82
85
  createHealthcheck(data: Partial<IProductAppHealth>): Promise<void>;
83
86
  updateHealthcheck(tag: string, data: Partial<IProductAppHealth>): Promise<void>;
84
- fetchHealthcheck(access_tag: string, tag: string): IProductAppHealth | null;
85
- fetchHealthchecks(access_tag: string): Array<IProductAppHealth>;
87
+ fetchHealthcheck(access_tag: string, tag: string): Promise<IProductAppHealth | null>;
88
+ fetchHealthchecks(access_tag: string): Promise<Array<IProductAppHealth>>;
89
+ fetchProductHealthchecks(): Promise<Array<IProductAppHealth>>;
86
90
  createAppAccessTag(app_tag: string): Promise<IAppAccess>;
87
91
  extractStages(input: string): Array<string | number>;
88
92
  updateDataValidation(tag: string, update: Partial<IParsedSample>): Promise<boolean>;
@@ -111,10 +115,14 @@ export default class ProductsBuilderService implements IProductsBuilderService {
111
115
  private redisClient?;
112
116
  private queues;
113
117
  constructor({ workspace_id, public_key, user_id, token, env_type, redis_client, queues }: IBuilderInit);
118
+ fetchPrivateKey(): string;
119
+ fetchWorkspaceId(): string;
120
+ fetchProductId(): string;
114
121
  createHealthcheck(data: Partial<IProductAppHealth>): Promise<void>;
115
122
  updateHealthcheck(tag: string, data: Partial<IProductAppHealth>): Promise<void>;
116
- fetchHealthcheck(access_tag: string, tag: string, throwError?: boolean): IProductAppHealth | null;
117
- fetchHealthchecks(access_tag: string, throwError?: boolean): Array<IProductAppHealth>;
123
+ fetchHealthcheck(access_tag: string, tag: string, throwError?: boolean): Promise<IProductAppHealth | null>;
124
+ fetchHealthchecks(access_tag: string, throwError?: boolean): Promise<Array<IProductAppHealth>>;
125
+ fetchProductHealthchecks(): Promise<Array<IProductAppHealth>>;
118
126
  updateDataValidation(selector: string, update: Partial<IParsedSample>): Promise<boolean>;
119
127
  createProduct(data: ICreateProductsBuilder): Promise<void>;
120
128
  initializeWorkspace(subCheck?: boolean): Promise<void>;
@@ -123,15 +131,15 @@ export default class ProductsBuilderService implements IProductsBuilderService {
123
131
  updateProduct(data: Partial<IProduct>): Promise<void>;
124
132
  private createNewProduct;
125
133
  checkIfProductExists(name: string): Promise<false | IProduct>;
126
- fetchProduct(): IProduct;
134
+ fetchProduct(): Promise<IProduct>;
127
135
  createSession(data: Partial<IProductSession>, throwErrorIfExists?: boolean): Promise<void>;
128
136
  updateSession(tag: string, data: Partial<IProductSession>): Promise<void>;
129
- fetchSession(tag: string): IProductSession | null;
130
- fetchSessions(): Array<IProductSession>;
137
+ fetchSessions(version?: string): Promise<Array<IProductSession>>;
138
+ fetchSession(tag: string): Promise<IProductSession | null>;
131
139
  createMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>, throwErrorIfExists?: boolean): Promise<void>;
132
140
  updateMessageBrokerTopic(data: Partial<IProductMessageBrokerTopic>): Promise<void>;
133
- fetchMessageBrokerTopic(tag: string, throwErrorIfExists?: boolean): IProductMessageBrokerTopic | null;
134
- fetchMessageBrokerTopics(messageBrokerTag: string): Array<IProductMessageBrokerTopic>;
141
+ fetchMessageBrokerTopic(tag: string, throwErrorIfExists?: boolean): Promise<IProductMessageBrokerTopic | null>;
142
+ fetchMessageBrokerTopics(messageBrokerTag: string): Promise<Array<IProductMessageBrokerTopic>>;
135
143
  validateQuotaFallbackInputAndOutput(data: Partial<IProductQuota> | Partial<IProductFallback>, type: string): Promise<void>;
136
144
  validateQuotaFallbackInput(option: IQuotaOptions | IFallbackOptions, input: Record<string, IFeatureInput>, type: string): Promise<void>;
137
145
  checkKeyValuesInput(keyValues: Array<KeyValuePair>, input: Record<string, IFeatureInput>, type: string): void;
@@ -143,26 +151,26 @@ export default class ProductsBuilderService implements IProductsBuilderService {
143
151
  checkResponse(value: string, output: Record<string, unknown>, input: Record<string, IFeatureInput>, type: string): void;
144
152
  createQuota(data: Partial<IProductQuota>): Promise<void>;
145
153
  updateQuota(tag: string, data: Partial<IProductQuota>): Promise<void>;
146
- fetchQuota(tag: string): IProductQuota | null;
147
- fetchQuotas(): Array<IProductQuota>;
154
+ fetchQuotas(version?: string): Promise<Array<IProductQuota>>;
155
+ fetchQuota(tag: string, version?: string): Promise<IProductQuota | null>;
148
156
  createFallback(data: Partial<IProductFallback>): Promise<void>;
149
157
  updateFallback(tag: string, data: Partial<IProductFallback>): Promise<void>;
150
- fetchFallback(tag: string): IProductFallback | null;
151
- fetchFallbacks(): Array<IProductFallback>;
158
+ fetchFallbacks(version?: string): Promise<Array<IProductFallback>>;
159
+ fetchFallback(tag: string, version?: string): Promise<IProductFallback | null>;
152
160
  createEnv(data: IProductEnv, throwErrorIfExists?: boolean): Promise<void>;
153
161
  updateEnv(slug: string, data: Partial<IProductEnv>): Promise<void>;
154
- fetchEnvs(): IProductEnv[];
155
- fetchEnv(slug: string, throwErrorIfExists?: boolean): IProductEnv | null;
162
+ fetchEnvs(version?: string): Promise<Array<IProductEnv>>;
163
+ fetchEnv(slug: string): Promise<IProductEnv | null>;
156
164
  createMessageBroker(data: Partial<IProductMessageBroker>, throwErrorIfExists?: boolean): Promise<void>;
157
165
  updateMessageBroker(tag: string, data: Partial<IProductMessageBroker>): Promise<void>;
158
- fetchMessageBroker(tag: string, throwErrorIfExists?: boolean): IProductMessageBroker | null;
159
- fetchMessageBrokers(): Array<IProductMessageBroker>;
166
+ fetchMessageBrokers(version?: string): Promise<Array<IProductMessageBroker>>;
167
+ fetchMessageBroker(tag: string, version?: string): Promise<IProductMessageBroker | null>;
160
168
  fetchStorageFiles(filter: IFetchFilesPayload): Promise<Array<IFileURLPayload>>;
161
169
  fetchSessionUsers(filter: IFetchUsersPayload): Promise<Array<IFileURLPayload>>;
162
170
  createStorage(data: Partial<IProductStorage>, throwErrorIfExists?: boolean): Promise<void>;
163
171
  updateStorage(tag: string, data: Partial<IProductStorage>): Promise<void>;
164
- fetchStorage(tag: string, throwErrorIfExists?: boolean): IProductStorage | null;
165
- fetchStorages(): Array<IProductStorage>;
172
+ fetchStorages(version?: string): Promise<Array<IProductStorage>>;
173
+ fetchStorage(tag: string, version?: string): Promise<IProductStorage | null>;
166
174
  private validateAppData;
167
175
  private validateVariablesSchema;
168
176
  private validateVariablesValues;
@@ -172,24 +180,24 @@ export default class ProductsBuilderService implements IProductsBuilderService {
172
180
  addApp(app: IProductApp, throwErrorIfExists?: boolean): Promise<void>;
173
181
  fetchAppWebhooks(access_tag: string): Promise<Array<IAppWebhook>>;
174
182
  updateApp(access_tag: string, data: Partial<IProductApp>): Promise<void>;
175
- fetchApps(): Array<IProductApp>;
176
- fetchApp(tag: string, throwErrorIfExists?: boolean): IProductApp | null;
183
+ fetchApps(): Promise<Array<IProductApp>>;
184
+ fetchApp(tag: string, throwErrorIfExists?: boolean): Promise<IProductApp | null>;
177
185
  createFunction(data: Partial<IProductFunction>, throwErrorIfExists?: boolean): Promise<void>;
178
186
  updateFunction(tag: string, data: Partial<IProductFunction>): Promise<void>;
179
- fetchFunctions(): Array<IProductFunction>;
180
- fetchFunction(tag: string): IProductFunction | null;
187
+ fetchFunctions(version?: string): Promise<Array<IProductFunction>>;
188
+ fetchFunction(tag: string, version?: string): Promise<IProductFunction | null>;
181
189
  createCache(data: Partial<IProductCache>, throwErrorIfExists?: boolean): Promise<void>;
182
190
  updateCache(tag: string, data: Partial<IProductCache>): Promise<void>;
183
- fetchCache(tag: string, throwErrorIfExists?: boolean): IProductCache | null;
184
- fetchCaches(): Array<IProductCache>;
191
+ fetchCaches(version?: string): Promise<Array<IProductCache>>;
192
+ fetchCache(tag: string, version?: string): Promise<IProductCache | null>;
185
193
  createNotification(data: Partial<IProductNotification>, throwErrorIfExists?: boolean): Promise<void>;
186
194
  createNotificationMessage(data: Partial<IProductNotificationTemplate>, throwErrorIfExists?: boolean): Promise<void>;
187
- fetchNotificationMessage(tag: string, throwErrorIfExists?: boolean): IProductNotificationTemplate | null;
188
- fetchNotificationMessages(notificationTag: string, throwErrorIfExists?: boolean): Array<IProductNotificationTemplate>;
195
+ fetchNotificationMessage(tag: string, throwErrorIfExists?: boolean): Promise<IProductNotificationTemplate | null>;
196
+ fetchNotificationMessages(notificationTag: string, throwErrorIfExists?: boolean): Promise<Array<IProductNotificationTemplate>>;
189
197
  updateNotificationMessage(data: Partial<IProductNotificationTemplate>): Promise<void>;
190
198
  updateNotification(tag: string, data: Partial<IProductNotification>): Promise<void>;
191
- fetchNotification(tag: string, notification_slug?: string, throwErrorIfExists?: boolean): IProductNotification;
192
- fetchNotifications(): Array<IProductNotification>;
199
+ fetchNotifications(version?: string): Promise<Array<IProductNotification>>;
200
+ fetchNotification(tag: string, version?: string): Promise<IProductNotification | null>;
193
201
  private validateFeatureSequence;
194
202
  private validateUniqueEventTags;
195
203
  private validateFeatureData;
@@ -232,25 +240,25 @@ export default class ProductsBuilderService implements IProductsBuilderService {
232
240
  fetchThirdPartyAppActionByTag(actions: Array<IAppAction>, action_tag: string): IAppAction;
233
241
  createFeature(data: Partial<IProductFeature>, throwErrorIfExists?: boolean): Promise<void>;
234
242
  updateFeature(tag: string, data: Partial<IProductFeature>): Promise<void>;
235
- fetchFeature(tag: string, throwErrorIfExists?: boolean): IProductFeature | null;
236
- fetchFeatures(): Array<IProductFeature>;
243
+ fetchFeatures(): Promise<Array<IProductFeature>>;
244
+ fetchFeature(tag: string): Promise<IProductFeature | null>;
237
245
  createDatabase(data: Partial<IProductDatabase>, throwErrorIfExists?: boolean): Promise<void>;
238
246
  updateDatabase(tag: string, data: Partial<IProductDatabase>): Promise<void>;
239
- fetchDatabase(tag: string, throwErrorIfExists?: boolean): IProductDatabase | null;
240
- fetchDatabases(): Array<IProductDatabase>;
247
+ fetchDatabases(): Promise<Array<IProductDatabase>>;
248
+ fetchDatabase(tag: string): Promise<IProductDatabase | null>;
241
249
  createDatabaseAction(data: Partial<IProductDatabaseAction>, throwErrorIfExists?: boolean): Promise<void>;
242
- fetchDatabaseAction(tag: string, throwErrorIfExists?: boolean): IProductDatabaseAction | null;
250
+ fetchDatabaseAction(tag: string, throwErrorIfExists?: boolean): Promise<IProductDatabaseAction | null>;
243
251
  updateDatabaseAction(data: Partial<IProductDatabaseAction>): Promise<void>;
244
- fetchDatabaseActions(databaseTag: string): Array<IProductDatabaseAction>;
252
+ fetchDatabaseActions(databaseTag: string): Promise<Array<IProductDatabaseAction>>;
245
253
  createDatabaseMigration(data: Partial<IProductDatabaseMigration>, throwErrorIfExists?: boolean): Promise<void>;
246
254
  updateDatabaseMigration(data: Partial<IProductDatabaseMigration>): Promise<void>;
247
- fetchDatabaseMigration(tag: string, throwError?: boolean): IProductDatabaseMigration | null;
248
- fetchDatabaseMigrations(databaseTag: string): Array<IProductDatabaseMigration>;
255
+ fetchDatabaseMigration(tag: string, throwError?: boolean): Promise<IProductDatabaseMigration | null>;
256
+ fetchDatabaseMigrations(databaseTag: string): Promise<Array<IProductDatabaseMigration>>;
249
257
  validateJobEvent(data: Partial<IProductJobs>): Promise<void>;
250
258
  createJob(data: Partial<IProductJobs>, throwErrorIfExists?: boolean): Promise<void>;
251
259
  updateJob(tag: string, data: Partial<IProductJobs>): Promise<void>;
252
- fetchJob(tag: string, throwError?: boolean): IProductJobs | null;
253
- fetchJobs(): Array<IProductJobs>;
260
+ fetchJobs(): Promise<Array<IProductJobs>>;
261
+ fetchJob(tag: string): Promise<IProductJobs | null>;
254
262
  private getUserAccess;
255
263
  fetchSessionUser(ductape_user_id: string): Promise<any>;
256
264
  }