@trayio/commons 4.53.0 → 4.55.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.
@@ -61,7 +61,7 @@ class CamelCasePropertyNameCodec {
61
61
  return Object.entries(value).reduce((acc, [key, propertyValue]) => {
62
62
  if (this.isObject(propertyValue)) {
63
63
  const nestedObject = this.camelCasePropertyNameFromObjectIfPresent(propertyValue);
64
- return { ...acc, [key]: nestedObject };
64
+ return { ...acc, [StringExtensions_1.StringExtensions.camelCase(key)]: nestedObject };
65
65
  }
66
66
  if (Array.isArray(propertyValue)) {
67
67
  const nestedArray = this.camelCasePropertyNameFromArrayIfPresent(propertyValue);
@@ -67,4 +67,72 @@ describe('CamelCasePropertyNameCodec', () => {
67
67
  };
68
68
  expect(actualValue).toEqual(expectedValue);
69
69
  });
70
+ test('should camel case all properties names including nested and parent', () => {
71
+ const value = {
72
+ first_name: 'blah',
73
+ last_name: {
74
+ middle_name: 'blah',
75
+ },
76
+ addresses: [
77
+ {
78
+ street: 'blah street',
79
+ number: 123,
80
+ city: {
81
+ name: 'London',
82
+ province: null,
83
+ state: null,
84
+ },
85
+ notes_id: 'blah blah blah',
86
+ },
87
+ {
88
+ street: 'blah blah street',
89
+ number: 321,
90
+ city: {
91
+ name: 'New York',
92
+ province: null,
93
+ state: 'NY',
94
+ },
95
+ notes_id: null,
96
+ },
97
+ ],
98
+ phone: {
99
+ Area_Code: null,
100
+ TelephoneNumber: 1234567,
101
+ },
102
+ };
103
+ const actualValue = testCamelCasePropertyNameCodec.encode(value);
104
+ const expectedValue = {
105
+ firstName: 'blah',
106
+ lastName: {
107
+ middleName: 'blah',
108
+ },
109
+ addresses: [
110
+ {
111
+ street: 'blah street',
112
+ number: 123,
113
+ city: {
114
+ name: 'London',
115
+ province: null,
116
+ state: null,
117
+ },
118
+ notesId: 'blah blah blah',
119
+ },
120
+ {
121
+ street: 'blah blah street',
122
+ number: 321,
123
+ city: {
124
+ name: 'New York',
125
+ province: null,
126
+ state: 'NY',
127
+ },
128
+ notesId: null,
129
+ },
130
+ ],
131
+ phone: {
132
+ areaCode: null,
133
+ telephoneNumber: 1234567,
134
+ },
135
+ };
136
+ expect(actualValue).toEqual(expectedValue);
137
+ });
70
138
  });
@@ -61,7 +61,7 @@ class SnakeCasePropertyNameCodec {
61
61
  return Object.entries(value).reduce((acc, [key, propertyValue]) => {
62
62
  if (this.isObject(propertyValue)) {
63
63
  const nestedObject = this.snakeCasePropertyNameFromObjectIfPresent(propertyValue);
64
- return { ...acc, [key]: nestedObject };
64
+ return { ...acc, [StringExtensions_1.StringExtensions.snakeCase(key)]: nestedObject };
65
65
  }
66
66
  if (Array.isArray(propertyValue)) {
67
67
  const nestedArray = this.snakeCasePropertyNameFromArrayIfPresent(propertyValue);
@@ -67,4 +67,72 @@ describe('SnakeCasePropertyNameCodec', () => {
67
67
  };
68
68
  expect(actualValue).toEqual(expectedValue);
69
69
  });
70
+ test('should snake case all properties names including nested and parent', () => {
71
+ const value = {
72
+ firstName: 'blah',
73
+ LastName: {
74
+ middleName: 'blah',
75
+ },
76
+ addresses: [
77
+ {
78
+ street: 'blah street',
79
+ number: 123,
80
+ city: {
81
+ name: 'London',
82
+ province: null,
83
+ state: null,
84
+ },
85
+ notes_id: 'blah blah blah',
86
+ },
87
+ {
88
+ street: 'blah blah street',
89
+ number: 321,
90
+ city: {
91
+ name: 'New York',
92
+ province: null,
93
+ state: 'NY',
94
+ },
95
+ notesId: null,
96
+ },
97
+ ],
98
+ phone: {
99
+ Area_Code: null,
100
+ TelephoneNumber: 1234567,
101
+ },
102
+ };
103
+ const actualValue = testSnakeCasePropertyNameCodec.encode(value);
104
+ const expectedValue = {
105
+ first_name: 'blah',
106
+ last_name: {
107
+ middle_name: 'blah',
108
+ },
109
+ addresses: [
110
+ {
111
+ street: 'blah street',
112
+ number: 123,
113
+ city: {
114
+ name: 'London',
115
+ province: null,
116
+ state: null,
117
+ },
118
+ notes_id: 'blah blah blah',
119
+ },
120
+ {
121
+ street: 'blah blah street',
122
+ number: 321,
123
+ city: {
124
+ name: 'New York',
125
+ province: null,
126
+ state: 'NY',
127
+ },
128
+ notes_id: null,
129
+ },
130
+ ],
131
+ phone: {
132
+ area_code: null,
133
+ telephone_number: 1234567,
134
+ },
135
+ };
136
+ expect(actualValue).toEqual(expectedValue);
137
+ });
70
138
  });
@@ -4,42 +4,14 @@ import { TaskEither } from 'fp-ts/TaskEither';
4
4
  import * as t from 'io-ts';
5
5
  import { Option } from 'fp-ts/lib/Option';
6
6
  import { DynamicObject } from '../dynamictype/DynamicType';
7
- export declare enum FileContentType {
8
- Text = "text/plain",
9
- Html = "text/html",
10
- Css = "text/css",
11
- Javascript = "application/javascript",
12
- Xml = "application/xml",
13
- Pdf = "application/pdf",
14
- Zip = "application/zip",
15
- Gif = "image/gif",
16
- Jpeg = "image/jpeg",
17
- Jpg = "image/jpg",
18
- Png = "image/png",
19
- Svg = "image/svg+xml",
20
- Bmp = "image/bmp",
21
- Webp = "image/webp",
22
- Ico = "image/x-icon",
23
- Tiff = "image/tiff",
24
- Heic = "image/heic",
25
- Heif = "image/heif",
26
- AudioMidi = "audio/midi",
27
- AudioMpeg = "audio/mpeg",
28
- AudioWebm = "audio/webm",
29
- AudioOgg = "audio/ogg",
30
- AudioWav = "audio/wav",
31
- VideoWebm = "video/webm",
32
- VideoOgg = "video/ogg",
33
- VideoMp4 = "video/mp4"
34
- }
35
7
  export interface FileContentTypeCheckerInterface {
36
- isFileContentType(value: unknown): value is FileContentType;
8
+ isFileContentType(value: unknown): value is string;
37
9
  }
38
10
  export declare const FileContentTypeChecker: FileContentTypeCheckerInterface;
39
11
  export type FileMetadata = {
40
12
  name: string;
41
13
  size?: number;
42
- contentType?: FileContentType;
14
+ contentType?: string;
43
15
  };
44
16
  export declare const fileMetadataDescriptor: t.Type<FileMetadata, unknown>;
45
17
  export declare const fileDescriptorDescriptor: t.Type<FileDescriptor, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file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;CACjB,CAAC;AAEF,MAAM,WAAW,WAAW;IAC3B,KAAK,CACJ,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,GACjC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC3B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1D,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACxD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAClD,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CAC3D"}
package/dist/file/File.js CHANGED
@@ -23,86 +23,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.FileDescriptor = exports.fileDescriptorDescriptor = exports.fileMetadataDescriptor = exports.FileContentTypeChecker = exports.FileContentType = void 0;
26
+ exports.FileDescriptor = exports.fileDescriptorDescriptor = exports.fileMetadataDescriptor = exports.FileContentTypeChecker = void 0;
27
27
  const t = __importStar(require("io-ts"));
28
- var FileContentType;
29
- (function (FileContentType) {
30
- FileContentType["Text"] = "text/plain";
31
- FileContentType["Html"] = "text/html";
32
- FileContentType["Css"] = "text/css";
33
- FileContentType["Javascript"] = "application/javascript";
34
- FileContentType["Xml"] = "application/xml";
35
- FileContentType["Pdf"] = "application/pdf";
36
- FileContentType["Zip"] = "application/zip";
37
- // Image types
38
- FileContentType["Gif"] = "image/gif";
39
- FileContentType["Jpeg"] = "image/jpeg";
40
- FileContentType["Jpg"] = "image/jpg";
41
- FileContentType["Png"] = "image/png";
42
- FileContentType["Svg"] = "image/svg+xml";
43
- FileContentType["Bmp"] = "image/bmp";
44
- FileContentType["Webp"] = "image/webp";
45
- FileContentType["Ico"] = "image/x-icon";
46
- FileContentType["Tiff"] = "image/tiff";
47
- FileContentType["Heic"] = "image/heic";
48
- FileContentType["Heif"] = "image/heif";
49
- // Audio types
50
- FileContentType["AudioMidi"] = "audio/midi";
51
- FileContentType["AudioMpeg"] = "audio/mpeg";
52
- FileContentType["AudioWebm"] = "audio/webm";
53
- FileContentType["AudioOgg"] = "audio/ogg";
54
- FileContentType["AudioWav"] = "audio/wav";
55
- // Video types
56
- FileContentType["VideoWebm"] = "video/webm";
57
- FileContentType["VideoOgg"] = "video/ogg";
58
- FileContentType["VideoMp4"] = "video/mp4";
59
- })(FileContentType || (exports.FileContentType = FileContentType = {}));
28
+ const mime = __importStar(require("mime-types"));
60
29
  exports.FileContentTypeChecker = {
61
30
  isFileContentType(value) {
62
31
  if (typeof value !== 'string') {
63
32
  return false;
64
33
  }
65
34
  const lowerCaseValue = value.toLowerCase();
66
- return Object.values(FileContentType)
67
- .map((contentType) => contentType.toLowerCase())
68
- .includes(lowerCaseValue);
35
+ return mime.contentType(lowerCaseValue) !== false;
69
36
  },
70
37
  };
71
- const contentTypeDescriptor = t.union([
72
- t.literal(FileContentType.Text),
73
- t.literal(FileContentType.Html),
74
- t.literal(FileContentType.Css),
75
- t.literal(FileContentType.Javascript),
76
- t.literal(FileContentType.Xml),
77
- t.literal(FileContentType.Gif),
78
- t.literal(FileContentType.Jpeg),
79
- t.literal(FileContentType.Jpg),
80
- t.literal(FileContentType.Png),
81
- t.literal(FileContentType.Svg),
82
- t.literal(FileContentType.Pdf),
83
- t.literal(FileContentType.Zip),
84
- t.literal(FileContentType.Bmp),
85
- t.literal(FileContentType.Webp),
86
- t.literal(FileContentType.Ico),
87
- t.literal(FileContentType.Tiff),
88
- t.literal(FileContentType.Heic),
89
- t.literal(FileContentType.Heif),
90
- t.literal(FileContentType.AudioMidi),
91
- t.literal(FileContentType.AudioMpeg),
92
- t.literal(FileContentType.AudioWebm),
93
- t.literal(FileContentType.AudioOgg),
94
- t.literal(FileContentType.AudioWav),
95
- t.literal(FileContentType.VideoWebm),
96
- t.literal(FileContentType.VideoOgg),
97
- t.literal(FileContentType.VideoMp4),
98
- ]);
99
38
  exports.fileMetadataDescriptor = t.intersection([
100
39
  t.type({
101
40
  name: t.string,
102
41
  }),
103
42
  t.partial({
104
43
  size: t.number,
105
- contentType: contentTypeDescriptor,
44
+ contentType: t.string,
106
45
  }),
107
46
  ]);
108
47
  exports.fileDescriptorDescriptor = t.type({
@@ -55,17 +55,7 @@ export declare enum HttpContentType {
55
55
  OctetStream = "application/octet-stream",
56
56
  FormUrlEncoded = "application/x-www-form-urlencoded",
57
57
  MultipartRequestBody = "multipart/form-data",
58
- Text = "text/plain",
59
- Html = "text/html",
60
- Css = "text/css",
61
- Javascript = "application/javascript",
62
- Xml = "application/xml",
63
- Gif = "image/gif",
64
- Jpeg = "image/jpeg",
65
- Png = "image/png",
66
- Svg = "image/svg+xml",
67
- Pdf = "application/pdf",
68
- Zip = "application/zip"
58
+ Text = "text/plain"
69
59
  }
70
60
  export declare enum HttpHeader {
71
61
  Authorization = "Authorization",
@@ -1 +1 @@
1
- {"version":3,"file":"Http.d.ts","sourceRoot":"","sources":["../../src/http/Http.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,CAAC,MAAM,kBAAkB,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EACN,IAAI,EAGJ,WAAW,EACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAgB3D,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAEhD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,eAA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B;IAC5B,aAAa,6BAA6B;IAC1C,SAAS,eAAe;IACxB,aAAa,mBAAmB;IAChC,kBAAkB,wBAAwB;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACpC,MAAM,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,WAAW,CAAC;CAC3D;AAED,eAAO,MAAM,WAAW,EAAE,oBASzB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACpC,GAAG,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IACvE,kBAAkB,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/D,iBAAiB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,WAAW,CAAC;IAC3D,eAAe,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,aAAa,CAAC;CACzD;AAED,eAAO,MAAM,WAAW,EAAE,oBAyIzB,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACxD,mBAAmB,EACnB,eAAe,CAIf,CAAC;AAEF,eAAO,MAAM,eAAe,SACrB,eAAe,qCAEkC,CAAC"}
package/dist/http/Http.js CHANGED
@@ -82,16 +82,6 @@ var HttpContentType;
82
82
  HttpContentType["FormUrlEncoded"] = "application/x-www-form-urlencoded";
83
83
  HttpContentType["MultipartRequestBody"] = "multipart/form-data";
84
84
  HttpContentType["Text"] = "text/plain";
85
- HttpContentType["Html"] = "text/html";
86
- HttpContentType["Css"] = "text/css";
87
- HttpContentType["Javascript"] = "application/javascript";
88
- HttpContentType["Xml"] = "application/xml";
89
- HttpContentType["Gif"] = "image/gif";
90
- HttpContentType["Jpeg"] = "image/jpeg";
91
- HttpContentType["Png"] = "image/png";
92
- HttpContentType["Svg"] = "image/svg+xml";
93
- HttpContentType["Pdf"] = "application/pdf";
94
- HttpContentType["Zip"] = "application/zip";
95
85
  })(HttpContentType || (exports.HttpContentType = HttpContentType = {}));
96
86
  var HttpHeader;
97
87
  (function (HttpHeader) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trayio/commons",
3
- "version": "4.53.0",
3
+ "version": "4.55.0",
4
4
  "description": "Extensions to the standard/core libraries and basic features",
5
5
  "exports": {
6
6
  "./*": "./dist/*.js"
@@ -15,6 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@types/formidable": "3.4.5",
18
+ "@types/mime-types": "^2.1.4",
18
19
  "@types/node": "18.11.9",
19
20
  "@types/uuid": "9.0.2",
20
21
  "ajv": "^8.12.0",
@@ -28,6 +29,7 @@
28
29
  "io-ts-reporters": "2.0.1",
29
30
  "io-ts-types": "0.5.19",
30
31
  "lodash": "4.17.21",
32
+ "mime-types": "^2.1.35",
31
33
  "monocle-ts": "2.3.13",
32
34
  "newtype-ts": "0.3.5",
33
35
  "uuid": "9.0.0",