@sankhyalabs/sankhyablocks 1.0.4 → 1.0.7

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.
@@ -0,0 +1,10 @@
1
+ export default class AppParameterProvider {
2
+ private resourceID;
3
+ private paramFetcher;
4
+ constructor(resourceID: string);
5
+ asString(name: string): Promise<string>;
6
+ asInteger(name: string): Promise<Number>;
7
+ asFloat(name: string): Promise<Number>;
8
+ asBoolean(name: string): Promise<boolean>;
9
+ asDate(name: string): Promise<Date>;
10
+ }
@@ -1,10 +1,13 @@
1
1
  import { DataUnit } from "@sankhyalabs/core";
2
2
  import ApplicationUtils from "@sankhyalabs/ezui/dist/types/utils/ApplicationUtils";
3
+ import AppParameterProvider from "./AppParameterProvider";
3
4
  export default class SankhyaAppProvider extends ApplicationUtils {
4
5
  private static urlParams;
5
6
  private static dataUnitByEntity;
7
+ private static _parameters;
8
+ static get parameters(): AppParameterProvider;
6
9
  static getResourceID(defaultValue?: string): string;
7
- static temOpcional(opcional: string): boolean;
10
+ static temOpcional(opcional: string, abs?: boolean): boolean;
8
11
  static getAttributeFromHTMLWrapper(attribName: string): string;
9
12
  static openApp(resourceId: string, pkObject: Map<string, any>): void;
10
13
  static getDataunit(entityName: string, useCache?: boolean): DataUnit;
@@ -4,5 +4,7 @@ export default class DataUnitFetcher {
4
4
  constructor();
5
5
  private buldTemplates;
6
6
  getDataUnit(name: string, resourceID: string): Promise<UnitMetadata>;
7
+ private normalizeMetadata;
8
+ private tryParseJson;
7
9
  static bindTo(dataUnit: DataUnit, resourceID: string): DataUnitFetcher;
8
10
  }
@@ -0,0 +1,13 @@
1
+ export default class ParametersFetcher {
2
+ private templateByQuery;
3
+ constructor();
4
+ private buldTemplates;
5
+ getParam(name: string, resourceID: string): Promise<any>;
6
+ asString(name: string, resourceID: string): Promise<string>;
7
+ asInteger(name: string, resourceID: string): Promise<Number>;
8
+ asFloat(name: string, resourceID: string): Promise<Number>;
9
+ asBoolean(name: string, resourceID: string): Promise<boolean>;
10
+ asDate(name: string, resourceID: string): Promise<Date>;
11
+ getBatchParams(names: Array<string>, resourceID: string): Promise<{}>;
12
+ private getValue;
13
+ }
@@ -2,3 +2,4 @@ import SankhyaAppProvider from "./application/SankhyaAppProvider";
2
2
  import DataUnitFetcher from "./http/fetchers/dataunit-fetcher";
3
3
  import ApplicationConfigFetcher from "./http/fetchers/application-config-fetcher";
4
4
  export { SankhyaAppProvider, DataUnitFetcher, ApplicationConfigFetcher };
5
+ export * from "@sankhyalabs/core";
File without changes
File without changes
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@sankhyalabs/sankhyablocks",
3
- "version": "1.0.4",
3
+ "version": "1.0.7",
4
4
  "description": "Projeto para integração do design system ez-ui com as regras de negocio/framework do ERP Sankhya",
5
- "main": "build/index.js",
6
- "types": "build/types/index.d.ts",
5
+ "main": "dist/index.js",
6
+ "types": "dist/types/index.d.ts",
7
7
  "scripts": {
8
8
  "start": "webpack serve --config webpack.config.demo.js",
9
9
  "build": "webpack && tsc",
10
+ "dev": "set isDev=true&& tsc && webpack",
10
11
  "build:demo": "webpack --config webpack.config.demo.js",
11
12
  "test": "jest --silent",
12
13
  "coverage": "npm run test -- --coverage",
@@ -31,6 +32,7 @@
31
32
  "@babel/plugin-transform-typescript": "^7.16.8",
32
33
  "@babel/polyfill": "^7.12.1",
33
34
  "@babel/preset-env": "^7.16.11",
35
+ "@sankhyalabs/core": "^1.0.31",
34
36
  "@types/jest": "^27.4.1",
35
37
  "@typescript-eslint/eslint-plugin": "^4.32.0",
36
38
  "@typescript-eslint/parser": "^4.33.0",
@@ -73,7 +75,6 @@
73
75
  ]
74
76
  },
75
77
  "dependencies": {
76
- "@sankhyalabs/core": "^1.0.31",
77
78
  "@sankhyalabs/ezui": "^1.1.77",
78
79
  "graphql-request": "^4.2.0"
79
80
  }
package/tsconfig.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "noImplicitAny": true,
4
- "outDir": "build/types",
4
+ "outDir": "dist/types",
5
5
  "module": "esnext",
6
6
  "target": "es5",
7
7
  "allowJs": true,