@techextensor/tab-sdk 0.0.50 → 0.0.52

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.
@@ -22,7 +22,7 @@ export declare class AnalyticsService {
22
22
  * @param payload The screen performance payload containing the statistics to be inserted.
23
23
  * @returns A promise that resolves to a common API response containing the result of the insertion.
24
24
  */
25
- insertScreenPerformance(payload: ScreenPerformancePayload): Promise<CommonApiResponse>;
25
+ insertScreenPerformance(payload: ScreenPerformancePayload, headers?: any): Promise<CommonApiResponse>;
26
26
  static ɵfac: i0.ɵɵFactoryDeclaration<AnalyticsService, never>;
27
27
  static ɵprov: i0.ɵɵInjectableDeclaration<AnalyticsService>;
28
28
  }
@@ -17,7 +17,7 @@ export declare class FileService {
17
17
  * @param mediaId The ID of the media file to remove.
18
18
  * @returns A promise that resolves to a common API response.
19
19
  */
20
- removeMediaFile(mediaId: string): Promise<CommonApiResponse>;
20
+ removeMediaFile(mediaId: string, headers?: any): Promise<CommonApiResponse>;
21
21
  /**
22
22
  * Processes an FTP URL and returns a processed URL.
23
23
  *
@@ -1,4 +1,5 @@
1
1
  import { APISelectQuery, CommonApiResponse, DeletePayload, GetPayload, InsertPayload, UpdatePayload, ImprotDataPayload, RcordHistoryPayload, SearchDataPayload, executeStoredProcedurePayload } from '@techextensor/tab-core-utility';
2
+ import { CrudOptions } from '../interface/crud.interface';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class CrudService {
4
5
  private readonly _tabCrudService;
@@ -15,34 +16,34 @@ export declare class CrudService {
15
16
  * Inserts a record into the database using the provided payload.
16
17
  *
17
18
  * @param payload - The payload containing information to insert the record.
18
- * @param headers - Optional headers to pass to the server.
19
+ * @param optionsOrHeaders - Optional CrudOptions object with headers and notify config, or legacy headers object.
19
20
  * @returns A promise that resolves to a common API response containing the inserted record.
20
21
  */
21
- insert(payload: InsertPayload, headers?: any): Promise<CommonApiResponse>;
22
+ insert(payload: InsertPayload, optionsOrHeaders?: CrudOptions): Promise<CommonApiResponse>;
22
23
  /**
23
- * Inserts multiple records into the database using the provided payload.
24
- *
25
- * @param payload - The payload containing information to insert multiple records.
26
- * @param headers - Optional headers to pass to the server.
27
- * @returns A promise that resolves to a common API response containing the inserted records.
28
- */
29
- bulkInsert(payload: InsertPayload, headers?: any): Promise<CommonApiResponse>;
24
+ * Inserts multiple records into the database using the provided payload.
25
+ *
26
+ * @param payload - The payload containing information to insert multiple records.
27
+ * @param optionsOrHeaders - Optional CrudOptions object with headers and notify config, or legacy headers object.
28
+ * @returns A promise that resolves to a common API response containing the inserted records.
29
+ */
30
+ bulkInsert(payload: InsertPayload, optionsOrHeaders?: CrudOptions): Promise<CommonApiResponse>;
30
31
  /**
31
32
  * Updates a record in the database using the provided payload.
32
33
  *
33
34
  * @param payload - The payload containing information to update the record.
34
- * @param headers - Optional headers to pass to the server.
35
+ * @param optionsOrHeaders - Optional CrudOptions object with headers and notify config, or legacy headers object.
35
36
  * @returns A promise that resolves to a common API response containing the updated record.
36
37
  */
37
- update(payload: UpdatePayload, headers?: any): Promise<CommonApiResponse>;
38
+ update(payload: UpdatePayload, optionsOrHeaders?: CrudOptions): Promise<CommonApiResponse>;
38
39
  /**
39
40
  * Deletes a record from the database using the provided payload.
40
41
  *
41
42
  * @param payload - The payload containing information to delete the record.
42
- * @param headers - Optional headers to pass to the server.
43
+ * @param optionsOrHeaders - Optional CrudOptions object with headers and notify config, or legacy headers object.
43
44
  * @returns A promise that resolves to a common API response containing the deleted record.
44
45
  */
45
- delete(payload: DeletePayload, headers?: any): Promise<CommonApiResponse>;
46
+ delete(payload: DeletePayload, optionsOrHeaders?: CrudOptions): Promise<CommonApiResponse>;
46
47
  /**
47
48
  * Executes a stored procedure using the provided payload.
48
49
  *
@@ -58,7 +59,7 @@ export declare class CrudService {
58
59
  * @param parameters - Optional parameters to pass to the select query.
59
60
  * @returns A promise that resolves to a common API response containing the result of executing the select query.
60
61
  */
61
- executeSelectQuery(selectQueryId: string, parameters?: any, additionalConfig?: any): Promise<CommonApiResponse>;
62
+ executeSelectQuery(selectQueryId: string, parameters?: any, additionalConfig?: any, headers?: any): Promise<CommonApiResponse>;
62
63
  /**
63
64
  * Executes a select query using the provided select query data.
64
65
  *
@@ -66,12 +67,11 @@ export declare class CrudService {
66
67
  * @param parameters - Optional parameters to pass to the select query.
67
68
  * @returns A promise that resolves to a common API response containing the result of executing the select query.
68
69
  */
69
- executeSelectExecutor(data: APISelectQuery, parameters?: any): Promise<CommonApiResponse>;
70
+ executeSelectExecutor(data: APISelectQuery, parameters?: any, headers?: any): Promise<CommonApiResponse>;
70
71
  /**
71
72
  * Gets the search data using the provided search query and limit.
72
73
  *
73
- * @param searchQuery - The search query to search for.
74
- * @param limit - The number of records to limit the results to.
74
+ * @param payload - The payload containing search query and limit.
75
75
  * @param parameters - Optional parameters to pass to the search query.
76
76
  * @returns A promise that resolves to a common API response containing the search data.
77
77
  */
@@ -79,18 +79,24 @@ export declare class CrudService {
79
79
  /**
80
80
  * Retrieves the history of records for a specified app object.
81
81
  *
82
- * @param appObjectId - The ID of the app object to retrieve the record history for.
83
- * @param recordIds - An array of record IDs to retrieve the history for.
82
+ * @param payload - The payload containing app object ID and record IDs.
84
83
  * @returns A promise that resolves to a common API response containing the record history.
85
84
  */
86
- getRecordHistory(payload: RcordHistoryPayload): Promise<CommonApiResponse>;
85
+ getRecordHistory(payload: RcordHistoryPayload, headers?: any): Promise<CommonApiResponse>;
87
86
  /**
88
87
  * Imports data into the database.
89
88
  *
90
- * @param data - The data to import.
89
+ * @param payload - The data to import.
91
90
  * @returns A promise that resolves to a common API response containing the result of importing the data.
92
91
  */
93
92
  import(payload: ImprotDataPayload): Promise<any>;
93
+ /**
94
+ * Handles notification display after a CRUD operation.
95
+ *
96
+ * Default behavior: auto-shows success toast with operation-specific message.
97
+ * When skipDefaultToast is true, no toast is shown — caller handles it via TabSdk.ui.showSuccess().
98
+ */
99
+ private handleNotification;
94
100
  static ɵfac: i0.ɵɵFactoryDeclaration<CrudService, never>;
95
101
  static ɵprov: i0.ɵɵInjectableDeclaration<CrudService>;
96
102
  }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * CRUD operation types used internally by the SDK
3
+ * to determine default success messages and notification behavior.
4
+ */
5
+ export declare enum CrudOperationType {
6
+ Insert = "insert",
7
+ Update = "update",
8
+ Delete = "delete",
9
+ ProcessRequest = "processRequest"
10
+ }
11
+ /**
12
+ * Default success messages shown after each CRUD operation.
13
+ */
14
+ export declare const CRUD_DEFAULT_SUCCESS_MESSAGES: Record<CrudOperationType, string>;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Extended options for CRUD operations.
3
+ * Pass as the second argument to TabSdk.crud.insert/update/delete.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * // Default behavior — auto success toast
8
+ * await TabSdk.crud.insert({ ... });
9
+ *
10
+ * // Skip default toast (silent operation or custom message)
11
+ * await TabSdk.crud.delete(payload, { skipDefaultToast: true });
12
+ *
13
+ * // Skip default toast and show custom message
14
+ * const res = await TabSdk.crud.delete(payload, { skipDefaultToast: true });
15
+ * if (res.IsSuccess) {
16
+ * TabSdk.ui.showSuccess({ message: 'Settings removed' });
17
+ * }
18
+ * ```
19
+ */
20
+ export interface CrudOptions {
21
+ /** Optional HTTP headers to pass to the server */
22
+ headers?: any;
23
+ /** When true, suppresses the default success toast. Use TabSdk.ui.showSuccess() for custom messages. */
24
+ skipDefaultToast?: boolean;
25
+ }
@@ -1,4 +1,5 @@
1
1
  import { BuildFormComponentType, CommonApiResponse, GetScreenConfig, ProcessRequestPayload, TemplateParsePayload } from '@techextensor/tab-core-utility';
2
+ import { CrudOptions } from '../interface/crud.interface';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class FormService {
4
5
  private readonly _tabFormioService;
@@ -23,9 +24,10 @@ export declare class FormService {
23
24
  * Processes a request using the provided request payload.
24
25
  *
25
26
  * @param requestPayload The payload to be processed.
27
+ * @param options - Optional CrudOptions object with headers and notify config.
26
28
  * @returns A promise of the response from the server.
27
29
  */
28
- processRequest(requestPayload: ProcessRequestPayload): Promise<CommonApiResponse>;
30
+ processRequest(requestPayload: ProcessRequestPayload, options?: CrudOptions): Promise<CommonApiResponse>;
29
31
  /**
30
32
  * Builds Form.io components for the specified app object ID and type.
31
33
  *
@@ -42,6 +44,11 @@ export declare class FormService {
42
44
  * @returns A promise of the response from the server.
43
45
  */
44
46
  parseTemplate(requestPayload: TemplateParsePayload, onFailedParseOnServer?: boolean): Promise<CommonApiResponse>;
47
+ /**
48
+ * Handles notification display after a process request operation.
49
+ * Default: auto-shows success toast. When skipDefaultToast is true, no toast is shown.
50
+ */
51
+ private handleNotification;
45
52
  static ɵfac: i0.ɵɵFactoryDeclaration<FormService, never>;
46
53
  static ɵprov: i0.ɵɵInjectableDeclaration<FormService>;
47
54
  }
@@ -8,14 +8,14 @@ export declare class TransitionService {
8
8
  * @param payload - The payload containing information to determine the next status.
9
9
  * @returns A promise that resolves to the common API response.
10
10
  */
11
- getNextStatus(payload: NextStatusPayload): Promise<CommonApiResponse>;
11
+ getNextStatus(payload: NextStatusPayload, headers?: any): Promise<CommonApiResponse>;
12
12
  /**
13
13
  * Updates the status of an entity based on the provided payload.
14
14
  *
15
15
  * @param payload - The payload containing information to update the status.
16
16
  * @returns A promise that resolves to the common API response.
17
17
  */
18
- updateStatus(payload: UpdateStatusPayload): Promise<any>;
18
+ updateStatus(payload: UpdateStatusPayload, headers?: any): Promise<any>;
19
19
  static ɵfac: i0.ɵɵFactoryDeclaration<TransitionService, never>;
20
20
  static ɵprov: i0.ɵɵInjectableDeclaration<TransitionService>;
21
21
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@techextensor/tab-sdk",
3
- "version": "0.0.50",
3
+ "version": "0.0.52",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.15",
6
6
  "@angular/core": "^19.2.15",
7
- "@techextensor/tab-core-utility": "2.2.181"
7
+ "@techextensor/tab-core-utility": "2.2.192"
8
8
  },
9
9
  "dependencies": {
10
10
  "tslib": "^2.8.1"
package/public-api.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from './lib/tab-sdk.service';
2
2
  export * from './lib/enum/ui.enum';
3
3
  export * from './lib/enum/store.enum';
4
+ export * from './lib/enum/crud.enum';
4
5
  export * from './lib/interface/ui.interface';
5
6
  export * from './lib/interface/http.interface';
6
7
  export * from './lib/interface/state.interface';
8
+ export * from './lib/interface/crud.interface';