@openlettermarketing/olc-react-sdk 0.0.34 → 0.0.35

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.
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  interface AppProps {
3
3
  secretKey: string;
4
- returnRoute?: string | null;
5
4
  platformName?: string | null;
6
5
  createTemplateRoute?: string | null;
7
6
  templateBuilderRoute?: string | null;
8
7
  styles?: any;
9
8
  olcTemplate?: Record<string, any>;
9
+ onReturnAndNavigate?: () => void;
10
10
  onGetOneTemplate?: (payload: any) => Promise<any>;
11
11
  onGetTemplates?: (payload: any) => Promise<any>;
12
12
  onGetCustomFields?: () => Promise<any>;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import './styles.scss';
3
3
  interface CreateTemplateProps {
4
- returnRoute?: string | null;
4
+ onReturnAndNavigate?: () => void;
5
5
  createTemplateRoute?: string | null;
6
6
  }
7
7
  declare const CreateTemplate: React.FC<CreateTemplateProps>;
@@ -14,10 +14,10 @@ import './styles.scss';
14
14
  */
15
15
  interface TemplateBuilderProps {
16
16
  store: StoreType;
17
- returnRoute?: string | null;
18
17
  platformName?: string | null;
19
18
  createTemplateRoute?: string | null;
20
19
  olcTemplate?: Record<string, any>;
20
+ onReturnAndNavigate?: () => void;
21
21
  onGetCustomFields?: () => Promise<any>;
22
22
  onGetOneTemplate?: (payload: any) => Promise<any>;
23
23
  onGetTemplates?: (payload: any) => Promise<any>;
@@ -2,9 +2,9 @@ import React from 'react';
2
2
  import './styles.scss';
3
3
  interface TopNavigationProps {
4
4
  store: any;
5
- returnRoute?: string | null;
6
5
  createTemplateRoute?: string | null;
7
6
  isStoreUpdated: boolean;
7
+ onReturnAndNavigate?: () => void;
8
8
  onSubmit?: (payload: any) => Promise<any>;
9
9
  }
10
10
  declare const TopNavigation: React.FC<TopNavigationProps>;
@@ -10,10 +10,10 @@ interface TemplateBuilderProps {
10
10
  basicAuthUsername: string;
11
11
  basicAuthPassword: string;
12
12
  platformName?: string | null;
13
- returnRoute?: string | null;
14
13
  createTemplateRoute?: string | null;
15
14
  templateBuilderRoute?: string | null;
16
15
  olcTemplate?: Record<string, any>;
16
+ onReturnAndNavigate?: () => void;
17
17
  onGetOneTemplate?: (payload: any) => Promise<any>;
18
18
  onGetTemplates?: (payload: any) => Promise<any>;
19
19
  onGetCustomFields?: () => Promise<any>;
@@ -22,5 +22,5 @@ interface TemplateBuilderProps {
22
22
  root?: CustomCSSProperties;
23
23
  };
24
24
  }
25
- declare const TemplateBuilder: ({ container, secretKey, basicAuthUsername, basicAuthPassword, platformName, returnRoute, createTemplateRoute, templateBuilderRoute, olcTemplate, onGetOneTemplate, onGetTemplates, onGetCustomFields, onSubmit, styles, }: TemplateBuilderProps) => void;
25
+ declare const TemplateBuilder: ({ container, secretKey, basicAuthUsername, basicAuthPassword, platformName, onReturnAndNavigate, createTemplateRoute, templateBuilderRoute, olcTemplate, onGetOneTemplate, onGetTemplates, onGetCustomFields, onSubmit, styles, }: TemplateBuilderProps) => void;
26
26
  export default TemplateBuilder;
@@ -7,21 +7,7 @@ import { AppDispatch } from '../store';
7
7
  * @throws {Error} - If an error occurs during the upload process.
8
8
  */
9
9
  declare const uploadTemplate: (templateFormData: FormData) => Promise<unknown>;
10
- /**
11
- * Creates a template using the provided data.
12
- *
13
- * @param {object} data - The data needed to create the template.
14
- * @returns {Promise<object>} - A promise that resolves to the response from the successful request or the error response if an error occurs.
15
- */
16
- declare const createTemplate: (data: object) => Promise<unknown>;
17
- /**
18
- * Update a template using the provided data.
19
- *
20
- * @param {number} id - The ID of the template to update.
21
- * @param {object} data - The data needed to create the template.
22
- * @returns {Promise<object>} - A promise that resolves to the response from the successful request or the error response if an error occurs.
23
- */
24
- declare const updateTemplate: (id: number, data: object) => Promise<unknown>;
10
+ declare const getAllTemplatesByTab: (payload: any) => Promise<any>;
25
11
  /**
26
12
  * Loads form data to the store.
27
13
  *
@@ -88,4 +74,4 @@ declare const searchAndAdvanceChange: (name: string, value: any) => (dispatch: A
88
74
  * @throws {object} - The error response if there is an error.
89
75
  */
90
76
  declare const getAllTemplateCategories: () => Promise<any>;
91
- export { uploadTemplate, createTemplate, updateTemplate, searchAndAdvanceChange, clearAllTemplates, selectProduct, selectPostCard, clearTemplateFields, loadFormDataToStore, uploadFile, downloadProof, getAllTemplateCategories };
77
+ export { uploadTemplate, getAllTemplatesByTab, searchAndAdvanceChange, clearAllTemplates, selectProduct, selectPostCard, clearTemplateFields, loadFormDataToStore, uploadFile, downloadProof, getAllTemplateCategories };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openlettermarketing/olc-react-sdk",
3
3
  "private": false,
4
- "version": "0.0.34",
4
+ "version": "0.0.35",
5
5
  "type": "module",
6
6
  "description": "Simplify template builder integration for any product.",
7
7
  "main": "build/index.js",