@fossa-app/bridge 0.1.17 → 0.1.18

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.
Files changed (67) hide show
  1. package/dist/Models/ApiModels/EnvelopeModels.js +34 -0
  2. package/dist/Models/ApiModels/EnvelopeModels.js.map +1 -0
  3. package/dist/Models/ApiModels/EnvelopeModels.ts +42 -0
  4. package/dist/Models/ApiModels/PayloadModels.js +286 -0
  5. package/dist/Models/ApiModels/PayloadModels.js.map +1 -0
  6. package/dist/Models/ApiModels/PayloadModels.ts +326 -0
  7. package/dist/Models/ApiModels/SharedModels.js +79 -0
  8. package/dist/Models/ApiModels/SharedModels.js.map +1 -0
  9. package/dist/Models/ApiModels/SharedModels.ts +91 -0
  10. package/dist/Services/Clients/BranchClient.js +63 -0
  11. package/dist/Services/Clients/BranchClient.js.map +1 -0
  12. package/dist/Services/Clients/BranchClient.ts +78 -0
  13. package/dist/Services/Clients/CompanyClient.js +45 -0
  14. package/dist/Services/Clients/CompanyClient.js.map +1 -0
  15. package/dist/Services/Clients/CompanyClient.ts +56 -0
  16. package/dist/Services/Clients/CompanyLicenseClient.js +31 -0
  17. package/dist/Services/Clients/CompanyLicenseClient.js.map +1 -0
  18. package/dist/Services/Clients/CompanyLicenseClient.ts +41 -0
  19. package/dist/Services/Clients/CompanySettingsClient.js +45 -0
  20. package/dist/Services/Clients/CompanySettingsClient.js.map +1 -0
  21. package/dist/Services/Clients/CompanySettingsClient.ts +56 -0
  22. package/dist/Services/Clients/DepartmentClient.js +63 -0
  23. package/dist/Services/Clients/DepartmentClient.js.map +1 -0
  24. package/dist/Services/Clients/DepartmentClient.ts +78 -0
  25. package/dist/Services/Clients/EmployeeClient.js +102 -0
  26. package/dist/Services/Clients/EmployeeClient.js.map +1 -0
  27. package/dist/Services/Clients/EmployeeClient.ts +123 -0
  28. package/dist/Services/Clients/IBranchClient.js +2 -0
  29. package/dist/Services/Clients/IBranchClient.js.map +1 -0
  30. package/dist/Services/Clients/IBranchClient.ts +12 -0
  31. package/dist/Services/Clients/ICompanyClient.js +2 -0
  32. package/dist/Services/Clients/ICompanyClient.js.map +1 -0
  33. package/dist/Services/Clients/ICompanyClient.ts +10 -0
  34. package/dist/Services/Clients/ICompanyLicenseClient.js +2 -0
  35. package/dist/Services/Clients/ICompanyLicenseClient.js.map +1 -0
  36. package/dist/Services/Clients/ICompanyLicenseClient.ts +7 -0
  37. package/dist/Services/Clients/ICompanySettingsClient.js +2 -0
  38. package/dist/Services/Clients/ICompanySettingsClient.js.map +1 -0
  39. package/dist/Services/Clients/ICompanySettingsClient.ts +10 -0
  40. package/dist/Services/Clients/IDepartmentClient.js +2 -0
  41. package/dist/Services/Clients/IDepartmentClient.js.map +1 -0
  42. package/dist/Services/Clients/IDepartmentClient.ts +12 -0
  43. package/dist/Services/Clients/IEmployeeClient.js +2 -0
  44. package/dist/Services/Clients/IEmployeeClient.js.map +1 -0
  45. package/dist/Services/Clients/IEmployeeClient.ts +17 -0
  46. package/dist/Services/Clients/IIdentityClient.js +2 -0
  47. package/dist/Services/Clients/IIdentityClient.js.map +1 -0
  48. package/dist/Services/Clients/IIdentityClient.ts +6 -0
  49. package/dist/Services/Clients/ISystemLicenseClient.js +2 -0
  50. package/dist/Services/Clients/ISystemLicenseClient.js.map +1 -0
  51. package/dist/Services/Clients/ISystemLicenseClient.ts +6 -0
  52. package/dist/Services/Clients/IdentityClient.js +24 -0
  53. package/dist/Services/Clients/IdentityClient.js.map +1 -0
  54. package/dist/Services/Clients/IdentityClient.ts +32 -0
  55. package/dist/Services/Clients/SystemLicenseClient.js +24 -0
  56. package/dist/Services/Clients/SystemLicenseClient.js.map +1 -0
  57. package/dist/Services/Clients/SystemLicenseClient.ts +33 -0
  58. package/dist/Services/Endpoints.js +11 -0
  59. package/dist/Services/Endpoints.js.map +1 -0
  60. package/dist/Services/Endpoints.ts +22 -0
  61. package/dist/Services/IHttpTransport.js +2 -0
  62. package/dist/Services/IHttpTransport.js.map +1 -0
  63. package/dist/Services/IHttpTransport.ts +10 -0
  64. package/dist/Services/UrlHelpers.js +86 -0
  65. package/dist/Services/UrlHelpers.js.map +1 -0
  66. package/dist/Services/UrlHelpers.ts +107 -0
  67. package/package.json +1 -1
@@ -0,0 +1,107 @@
1
+
2
+ import { isEmpty, cons, map, tryFind, FSharpList, ofArray } from "@fable-org/fable-library-ts/List.ts";
3
+ import { value as value_2, Option } from "@fable-org/fable-library-ts/Option.ts";
4
+ import { join, substring } from "@fable-org/fable-library-ts/String.ts";
5
+ import { FSharpChoice$2_Choice2Of2, FSharpChoice$2_Choice1Of2, FSharpChoice$2_$union } from "@fable-org/fable-library-ts/Choice.ts";
6
+ import { class_type, TypeInfo } from "@fable-org/fable-library-ts/Reflection.ts";
7
+ import { float64, int32 } from "@fable-org/fable-library-ts/Int32.ts";
8
+ import { int64 } from "@fable-org/fable-library-ts/BigInt.ts";
9
+ import { decimal } from "@fable-org/fable-library-ts/Decimal.ts";
10
+ import { BasePath } from "./Endpoints.ts";
11
+ import { escapeDataString } from "@fable-org/fable-library-ts/Util.ts";
12
+ import { toString } from "@fable-org/fable-library-ts/Types.ts";
13
+
14
+ const suffixMappings: FSharpList<[string, string]> = ofArray([[".dev.localhost:4211", ".dev.localhost:5210"] as [string, string], [".test.localhost:4210", ".test.localhost:5211"] as [string, string], [".test.localhost:4211", ".test.localhost:5211"] as [string, string], [".localhost:4210", ".localhost:5210"] as [string, string]]);
15
+
16
+ export function getBackendOrigin(frontendOrigin: string): string {
17
+ const mapping: Option<[string, string]> = tryFind<[string, string]>((tupledArg: [string, string]): boolean => frontendOrigin.endsWith(tupledArg[0]), suffixMappings);
18
+ if (mapping == null) {
19
+ return frontendOrigin;
20
+ }
21
+ else {
22
+ const frontendSuffix_1: string = value_2(mapping)[0];
23
+ const backendSuffix: string = value_2(mapping)[1];
24
+ return substring(frontendOrigin, 0, frontendOrigin.length - frontendSuffix_1.length) + backendSuffix;
25
+ }
26
+ }
27
+
28
+ export class UrlPart {
29
+ readonly value: FSharpChoice$2_$union<string, any>;
30
+ constructor(value: FSharpChoice$2_$union<string, any>) {
31
+ this.value = value;
32
+ }
33
+ }
34
+
35
+ export function UrlPart_$reflection(): TypeInfo {
36
+ return class_type("Fossa.Bridge.Services.UrlHelpers.UrlPart", undefined, UrlPart);
37
+ }
38
+
39
+ export function UrlPart_$ctor_Z19415666(value: FSharpChoice$2_$union<string, any>): UrlPart {
40
+ return new UrlPart(value);
41
+ }
42
+
43
+ export function UrlPart__get_Value(_: UrlPart): FSharpChoice$2_$union<string, any> {
44
+ return _.value;
45
+ }
46
+
47
+ export function UrlPart_op_Implicit_Z721C83C5(s: string): UrlPart {
48
+ return UrlPart_$ctor_Z19415666(FSharpChoice$2_Choice1Of2<string, any>(s));
49
+ }
50
+
51
+ export function UrlPart_op_Implicit_Z6CAC3EAA(f: any): UrlPart {
52
+ return UrlPart_$ctor_Z19415666(FSharpChoice$2_Choice2Of2<string, any>(f));
53
+ }
54
+
55
+ export function UrlPart_op_Implicit_Z1FBCCD16(b: boolean): UrlPart {
56
+ return UrlPart_$ctor_Z19415666(FSharpChoice$2_Choice1Of2<string, any>(b ? "true" : "false"));
57
+ }
58
+
59
+ export function UrlPart_op_Implicit_Z524259A4(i: int32): UrlPart {
60
+ return UrlPart_$ctor_Z19415666(FSharpChoice$2_Choice2Of2<string, any>(i));
61
+ }
62
+
63
+ export function UrlPart_op_Implicit_Z524259C1(i: int64): UrlPart {
64
+ return UrlPart_$ctor_Z19415666(FSharpChoice$2_Choice2Of2<string, any>(i));
65
+ }
66
+
67
+ export function UrlPart_op_Implicit_5E38073B(f: float64): UrlPart {
68
+ return UrlPart_$ctor_Z19415666(FSharpChoice$2_Choice2Of2<string, any>(f));
69
+ }
70
+
71
+ export function UrlPart_op_Implicit_32C73145(d: decimal): UrlPart {
72
+ return UrlPart_$ctor_Z19415666(FSharpChoice$2_Choice2Of2<string, any>(d));
73
+ }
74
+
75
+ export function UrlPart_op_Implicit_244AC511(g: string): UrlPart {
76
+ return UrlPart_$ctor_Z19415666(FSharpChoice$2_Choice2Of2<string, any>(g));
77
+ }
78
+
79
+ export function UrlPart_op_Implicit_7F9DDECF(dt: Date): UrlPart {
80
+ return UrlPart_$ctor_Z19415666(FSharpChoice$2_Choice2Of2<string, any>(dt));
81
+ }
82
+
83
+ export function UrlPart_op_Implicit_Z53C0511E(dto: Date): UrlPart {
84
+ return UrlPart_$ctor_Z19415666(FSharpChoice$2_Choice2Of2<string, any>(dto));
85
+ }
86
+
87
+ export function composeRelativeUrl(relativePathSections: FSharpList<UrlPart>, queryParameters: FSharpList<[string, UrlPart]>): string {
88
+ return join("/", cons(BasePath, map<string, string>(escapeDataString, map<UrlPart, string>((section: UrlPart): string => {
89
+ const matchValue: FSharpChoice$2_$union<string, any> = UrlPart__get_Value(section);
90
+ if ((matchValue.tag as int32) === /* Choice2Of2 */ 1) {
91
+ return toString(matchValue.fields[0] as any);
92
+ }
93
+ else {
94
+ return matchValue.fields[0] as string;
95
+ }
96
+ }, relativePathSections)))) + (isEmpty(queryParameters) ? "" : ("?" + join("&", map<[string, string], string>((tupledArg_1: [string, string]): string => ((escapeDataString(tupledArg_1[0]) + "=") + escapeDataString(tupledArg_1[1])), map<[string, UrlPart], [string, string]>((tupledArg: [string, UrlPart]): [string, string] => {
97
+ const key: string = tupledArg[0];
98
+ const matchValue_1: FSharpChoice$2_$union<string, any> = UrlPart__get_Value(tupledArg[1]);
99
+ if ((matchValue_1.tag as int32) === /* Choice2Of2 */ 1) {
100
+ return [key, toString(matchValue_1.fields[0] as any)] as [string, string];
101
+ }
102
+ else {
103
+ return [key, matchValue_1.fields[0] as string] as [string, string];
104
+ }
105
+ }, queryParameters)))));
106
+ }
107
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fossa-app/bridge",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Shared Domain Models and DTOs for Fossa UI and API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",