@rws-framework/client 2.1.5 → 2.1.6

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/.bin/emerge.sh CHANGED
File without changes
package/.emerge-fast.yaml CHANGED
File without changes
File without changes
package/_rws_externals.js CHANGED
@@ -26,7 +26,6 @@ const externals = (declaredCodeBase, nodeModules, externalOptions = _defaultOpts
26
26
  const codeBase = path.resolve(declaredCodeBase);
27
27
 
28
28
  let mergeTarget = true;
29
- console.log('req', context, request, mergeTarget);
30
29
 
31
30
  if (mergeTarget) {
32
31
  //merging to output
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/client",
3
3
  "private": false,
4
- "version": "2.1.5",
4
+ "version": "2.1.6",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
7
7
  "docs": "typedoc --tsconfig ./tsconfig.json"
File without changes
File without changes
File without changes
File without changes
@@ -195,14 +195,14 @@ class ApiServiceInstance extends TheService {
195
195
  return `${this.config.get('backendUrl')}${this.config.get('apiPrefix') || ''}${apiPath}`;
196
196
  }
197
197
 
198
- async uploadFile(url: string, file: File, onProgress: (progress: number) => void, data: any = {}): Promise<UploadResponse>
198
+ async uploadFile(url: string, file: File, onProgress: (progress: number) => void, payload: any = {}): Promise<UploadResponse>
199
199
  {
200
200
  return upload(
201
201
 
202
202
  url,
203
203
  {
204
204
  file,
205
- ...data
205
+ ...payload
206
206
  },
207
207
  {
208
208
  onProgress,
@@ -216,7 +216,7 @@ class ApiServiceInstance extends TheService {
216
216
  post: <T, P extends object = object>(routeName: string, payload?: P, options?: IAPIOptions): Promise<T> => this.post(this.getBackendUrl(routeName, options?.routeParams), payload, options),
217
217
  put: <T, P extends object = object>(routeName: string, payload: P, options?: IAPIOptions): Promise<T> => this.put(this.getBackendUrl(routeName, options?.routeParams), payload, options),
218
218
  delete: <T>(routeName: string, options?: IAPIOptions): Promise<T> => this.delete(this.getBackendUrl(routeName, options?.routeParams), options),
219
- uploadFile: (routeName: string, file: File, onProgress: (progress: number) => void, options: IAPIOptions = {}): Promise<UploadResponse> => this.uploadFile(this.getBackendUrl(routeName, options?.routeParams), file, onProgress),
219
+ uploadFile: (routeName: string, file: File, onProgress: (progress: number) => void, options: IAPIOptions = {}, payload: any = {}): Promise<UploadResponse> => this.uploadFile(this.getBackendUrl(routeName, options?.routeParams), file, onProgress, payload),
220
220
  };
221
221
 
222
222
  connectToAmplify()
@@ -1,4 +1,20 @@
1
- // custom-html-loader.js
2
- module.exports = function(content) {
1
+ const path = require('path');
2
+ const fs = require('fs');
3
+
4
+ module.exports = function(content) {
5
+ const filePath = this.resourcePath;
6
+
7
+ const dirPath = path.dirname(filePath);
8
+ const tsPath = `${dirPath}/component.ts`;
9
+
10
+ fs.readFile(tsPath, { encoding: 'utf-8' }, (err, content) => {
11
+ fs.writeFileSync(tsPath, content);
12
+
13
+ if (err) {
14
+ throw new Error('Error reading file:', tsPath);
15
+ }
16
+ });
17
+
18
+
3
19
  return '';
4
20
  };
@@ -72,6 +72,7 @@ module.exports = function(content) {
72
72
 
73
73
  const tagName = decoratorData.tagName;
74
74
 
75
+
75
76
 
76
77
  try {
77
78
  if(tagName){
@@ -112,6 +113,8 @@ module.exports = function(content) {
112
113
  let template = 'const template: null = null;';
113
114
 
114
115
  if(templateExists){
116
+ this.addDependency(templatePath);
117
+
115
118
  template = `import './${templateName}.html';\nconst template: any = T.html\`${fs.readFileSync(templatePath, 'utf-8')}\`;`;
116
119
  }
117
120