@limetech/lime-web-components 5.26.0 → 5.28.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [5.28.0](https://github.com/Lundalogik/lime-web-components/compare/v5.27.0...v5.28.0) (2024-03-17)
2
+
3
+
4
+ ### Features
5
+
6
+
7
+ * **limeobject:** add interface for limeobject files ([3a4f3e9](https://github.com/Lundalogik/lime-web-components/commit/3a4f3e910c5e060009877cd82f9957c765e81eaf)), closes [Lundalogik/crm-feature#3990](https://github.com/Lundalogik/crm-feature/issues/3990)
8
+
9
+ ## [5.27.0](https://github.com/Lundalogik/lime-web-components/compare/v5.26.0...v5.27.0) (2024-03-08)
10
+
11
+
12
+ ### Features
13
+
14
+
15
+ * **file upload:** export http methods for use with new file upload class in crm-components ([e39e255](https://github.com/Lundalogik/lime-web-components/commit/e39e255e34edbda658fa4c3e0bd2798eea9d95c6))
16
+
1
17
  ## [5.26.0](https://github.com/Lundalogik/lime-web-components/compare/v5.25.0...v5.26.0) (2024-03-05)
2
18
 
3
19
 
@@ -1,2 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HttpMethod = void 0;
4
+ exports.HttpMethod = {
5
+ Get: 'GET',
6
+ Post: 'POST',
7
+ Put: 'PUT',
8
+ Delete: 'DELETE',
9
+ Patch: 'PATCH',
10
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./limeobject"), exports);
5
5
  tslib_1.__exportStar(require("./error"), exports);
6
+ tslib_1.__exportStar(require("./file"), exports);
6
7
  tslib_1.__exportStar(require("./repository"), exports);
7
8
  tslib_1.__exportStar(require("./types"), exports);
8
9
  tslib_1.__exportStar(require("./decorator"), exports);
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * By default, the service will work with the JSON data format. If anything but JSON is returned from the endpoint,
5
5
  * the `responseType` property in the `options` parameter needs to be set.
6
+ *
6
7
  * @public
7
8
  * @group HTTP
8
9
  */
@@ -88,9 +89,30 @@ export interface HttpHeaders {
88
89
  * @group HTTP
89
90
  */
90
91
  export type HttpResponseType = 'text' | 'json' | 'arraybuffer' | 'blob';
92
+ /**
93
+ * Defines the HTTP methods as constants.
94
+ * Used in the UploadFile class in lime-crm-components
95
+ *
96
+ * @public
97
+ */
98
+ export declare const HttpMethod: {
99
+ readonly Get: "GET";
100
+ readonly Post: "POST";
101
+ readonly Put: "PUT";
102
+ readonly Delete: "DELETE";
103
+ readonly Patch: "PATCH";
104
+ };
105
+ /**
106
+ * Type definition for HTTP methods. It can be any of the values defined in the
107
+ * HttpMethod constant.
108
+ *
109
+ * @public
110
+ */
111
+ export type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
91
112
  /**
92
113
  * Exception thrown by {@link HttpClient} when an error occurs while sending a
93
114
  * request
115
+ *
94
116
  * @public
95
117
  */
96
118
  export interface HttpResponseError extends Error {
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/http/http.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACvB;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtD;;;;;;;OAOG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAElE;;;;;;;OAOG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,EA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O,UAAU,CAAC,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,WAAW,iBAAkB,SAAQ,KAAK;IAC5C,IAAI,EAAE,mBAAmB,CAAC;IAC1B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;CACtB"}
package/dist/http/http.js CHANGED
@@ -1 +1,13 @@
1
- export {};
1
+ /**
2
+ * Defines the HTTP methods as constants.
3
+ * Used in the UploadFile class in lime-crm-components
4
+ *
5
+ * @public
6
+ */
7
+ export const HttpMethod = {
8
+ Get: 'GET',
9
+ Post: 'POST',
10
+ Put: 'PUT',
11
+ Delete: 'DELETE',
12
+ Patch: 'PATCH',
13
+ };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Represents a file attached to a {@link LimeObject}
3
+ *
4
+ * @beta
5
+ */
6
+ export interface LimeFile {
7
+ /**
8
+ * Name of the file
9
+ */
10
+ readonly filename: string;
11
+ /**
12
+ * File extension
13
+ */
14
+ readonly extension: string;
15
+ /**
16
+ * Size in bytes of the file
17
+ */
18
+ readonly size: number;
19
+ /**
20
+ * Get a URL to the file
21
+ *
22
+ * @param type - type of URL to get
23
+ * @returns the URL to the file
24
+ */
25
+ getUrl(type: LimeFileUrlType): string | undefined;
26
+ }
27
+ /**
28
+ * Type of URL
29
+ *
30
+ * @beta
31
+ */
32
+ export type LimeFileUrlType = 'contents' | 'download' | 'edit' | 'pdf' | 'view';
33
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/limeobject/file.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACrB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAAC;CACrD;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  export * from './limeobject';
2
2
  export * from './error';
3
+ export * from './file';
3
4
  export * from './repository';
4
5
  export * from './types';
5
6
  export * from './decorator';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/limeobject/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/limeobject/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export * from './limeobject';
2
2
  export * from './error';
3
+ export * from './file';
3
4
  export * from './repository';
4
5
  export * from './types';
5
6
  export * from './decorator';
@@ -1,4 +1,5 @@
1
1
  import { LimeType } from '../limetype';
2
+ import { LimeFile } from './file';
2
3
  /**
3
4
  * A Lime object
4
5
  * @public
@@ -38,6 +39,15 @@ export interface LimeObject {
38
39
  * @returns the limetype
39
40
  */
40
41
  getLimetype(): LimeType;
42
+ /**
43
+ * Get an attached file
44
+ *
45
+ * @param name - name of the file property
46
+ *
47
+ * @returns the file if it exists, otherwise undefined
48
+ * @beta
49
+ */
50
+ getFile?(name: string): LimeFile | undefined;
41
51
  /**
42
52
  * Dynamic properties of the limeobject
43
53
  */
@@ -1 +1 @@
1
- {"version":3,"file":"limeobject.d.ts","sourceRoot":"","sources":["../../src/limeobject/limeobject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC;IAE5B;;;;OAIG;IACH,WAAW,IAAI,QAAQ,CAAC;IAExB;;OAEG;IACH,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;CAC3B"}
1
+ {"version":3,"file":"limeobject.d.ts","sourceRoot":"","sources":["../../src/limeobject/limeobject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC;IAE5B;;;;OAIG;IACH,WAAW,IAAI,QAAQ,CAAC;IAExB;;;;;;;OAOG;IACH,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IAE7C;;OAEG;IACH,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;CAC3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-web-components",
3
- "version": "5.26.0",
3
+ "version": "5.28.0",
4
4
  "description": "Lime Web Components",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -35,11 +35,11 @@
35
35
  "tslib": "^2.6.2"
36
36
  },
37
37
  "devDependencies": {
38
- "@commitlint/config-conventional": "^19.0.3",
38
+ "@commitlint/config-conventional": "^19.1.0",
39
39
  "@microsoft/api-extractor": "^7.42.3",
40
40
  "@types/jest": "^27.5.0",
41
- "@typescript-eslint/eslint-plugin": "^7.1.1",
42
- "@typescript-eslint/parser": "^7.1.1",
41
+ "@typescript-eslint/eslint-plugin": "^7.2.0",
42
+ "@typescript-eslint/parser": "^7.2.0",
43
43
  "commitizen": "^4.3.0",
44
44
  "cz-conventional-changelog": "^3.3.0",
45
45
  "eslint": "^8.57.0",
@@ -47,7 +47,7 @@
47
47
  "eslint-plugin-ban": "^1.6.0",
48
48
  "eslint-plugin-prefer-arrow": "^1.2.3",
49
49
  "eslint-plugin-prettier": "^5.1.3",
50
- "eslint-plugin-react": "^7.34.0",
50
+ "eslint-plugin-react": "^7.34.1",
51
51
  "eslint-plugin-sonarjs": "^0.24.0",
52
52
  "eslint-plugin-tsdoc": "^0.2.17",
53
53
  "jest": "^27.5.1",