@frankieone/one-sdk 1.8.1 → 1.8.2

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 (80) hide show
  1. package/dist/cli/darwin-amd64/onesdk-cli +0 -0
  2. package/dist/cli/darwin-arm64/onesdk-cli +0 -0
  3. package/dist/cli/linux-amd64/onesdk-cli +0 -0
  4. package/dist/cli/linux-arm64/onesdk-cli +0 -0
  5. package/dist/cli/windows-amd64/onesdk-cli.exe +0 -0
  6. package/dist/commit.txt +1 -1
  7. package/dist/esm/modules/common/shared/utils/getCountryDetails.d.ts +1 -0
  8. package/dist/esm/modules/common/shared/utils/getCountryDetails.d.ts.map +1 -1
  9. package/dist/esm/modules/common/shared/utils/getCountryDetails.js +4 -0
  10. package/dist/esm/modules/common/shared/utils/getCountryDetails.js.map +1 -1
  11. package/dist/esm/modules/common/vendors/incode/startCamera.d.ts.map +1 -1
  12. package/dist/esm/modules/common/vendors/incode/startCamera.js +23 -16
  13. package/dist/esm/modules/common/vendors/incode/startCamera.js.map +1 -1
  14. package/dist/esm/modules/form/definition.d.ts +1 -0
  15. package/dist/esm/modules/form/definition.d.ts.map +1 -1
  16. package/dist/esm/modules/form/vendors/react/App.d.ts +2 -1
  17. package/dist/esm/modules/form/vendors/react/App.d.ts.map +1 -1
  18. package/dist/esm/modules/form/vendors/react/App.js +2 -1
  19. package/dist/esm/modules/form/vendors/react/App.js.map +1 -1
  20. package/dist/esm/modules/form/vendors/react/components/base/StandardDate/StandardDate.js +1 -1
  21. package/dist/esm/modules/form/vendors/react/components/base/StandardDate/StandardDate.js.map +1 -1
  22. package/dist/esm/modules/form/vendors/react/components/view/FrankieAddress/FrankieAddress.d.ts.map +1 -1
  23. package/dist/esm/modules/form/vendors/react/components/view/FrankieAddress/FrankieAddress.js.map +1 -1
  24. package/dist/esm/modules/form/vendors/react/components/view/SearchableAddress/SearchableAddress.d.ts +1 -1
  25. package/dist/esm/modules/form/vendors/react/components/view/SearchableAddress/SearchableAddress.d.ts.map +1 -1
  26. package/dist/esm/modules/form/vendors/react/components/view/SearchableAddress/SearchableAddress.js +12 -2
  27. package/dist/esm/modules/form/vendors/react/components/view/SearchableAddress/SearchableAddress.js.map +1 -1
  28. package/dist/esm/modules/form/vendors/react/features/IdSelection/manualIdSelection.config.d.ts.map +1 -1
  29. package/dist/esm/modules/form/vendors/react/features/IdSelection/manualIdSelection.config.js +3 -1
  30. package/dist/esm/modules/form/vendors/react/features/IdSelection/manualIdSelection.config.js.map +1 -1
  31. package/dist/esm/modules/form/vendors/react/features/Review/fields/passport.config.d.ts.map +1 -1
  32. package/dist/esm/modules/form/vendors/react/features/Review/fields/passport.config.js +3 -1
  33. package/dist/esm/modules/form/vendors/react/features/Review/fields/passport.config.js.map +1 -1
  34. package/dist/esm/modules/form/vendors/react/hooks/useAddressSearch.d.ts +9 -4
  35. package/dist/esm/modules/form/vendors/react/hooks/useAddressSearch.d.ts.map +1 -1
  36. package/dist/esm/modules/form/vendors/react/hooks/useAddressSearch.js +29 -78
  37. package/dist/esm/modules/form/vendors/react/hooks/useAddressSearch.js.map +1 -1
  38. package/dist/esm/modules/form/vendors/react/hooks/useEventContext.d.ts +1 -0
  39. package/dist/esm/modules/form/vendors/react/hooks/useEventContext.d.ts.map +1 -1
  40. package/dist/esm/modules/form/vendors/react/hooks/useEventContext.js.map +1 -1
  41. package/dist/esm/modules/form/vendors/react/index.d.ts.map +1 -1
  42. package/dist/esm/modules/form/vendors/react/index.js +8 -5
  43. package/dist/esm/modules/form/vendors/react/index.js.map +1 -1
  44. package/dist/esm/modules/meta.json +1 -1
  45. package/dist/esm/modules/services/google/address.const.d.ts +20 -0
  46. package/dist/esm/modules/services/google/address.const.d.ts.map +1 -0
  47. package/dist/esm/modules/services/google/address.const.js +21 -0
  48. package/dist/esm/modules/services/google/address.const.js.map +1 -0
  49. package/dist/esm/modules/services/google/autocomplete.service.d.ts +14 -0
  50. package/dist/esm/modules/services/google/autocomplete.service.d.ts.map +1 -0
  51. package/dist/esm/modules/services/google/autocomplete.service.js +43 -0
  52. package/dist/esm/modules/services/google/autocomplete.service.js.map +1 -0
  53. package/dist/esm/modules/services/google/autocompleteSuggestion.service.d.ts +13 -0
  54. package/dist/esm/modules/services/google/autocompleteSuggestion.service.d.ts.map +1 -0
  55. package/dist/esm/modules/services/google/autocompleteSuggestion.service.js +40 -0
  56. package/dist/esm/modules/services/google/autocompleteSuggestion.service.js.map +1 -0
  57. package/dist/esm/modules/services/google/geocode.service.d.ts +16 -0
  58. package/dist/esm/modules/services/google/geocode.service.d.ts.map +1 -0
  59. package/dist/esm/modules/services/google/geocode.service.js +73 -0
  60. package/dist/esm/modules/services/google/geocode.service.js.map +1 -0
  61. package/dist/esm/modules/{form/vendors/react/model → services/google}/googleAddress.model.d.ts +4 -2
  62. package/dist/esm/modules/services/google/googleAddress.model.d.ts.map +1 -0
  63. package/dist/esm/modules/services/google/googleAddress.model.js +110 -0
  64. package/dist/esm/modules/services/google/googleAddress.model.js.map +1 -0
  65. package/dist/esm/modules/services/google/googleService.types.d.ts +81 -0
  66. package/dist/esm/modules/services/google/googleService.types.d.ts.map +1 -0
  67. package/dist/esm/modules/services/google/googleService.types.js +2 -0
  68. package/dist/esm/modules/services/google/googleService.types.js.map +1 -0
  69. package/dist/esm/modules/services/google/utils.d.ts +2 -0
  70. package/dist/esm/modules/services/google/utils.d.ts.map +1 -0
  71. package/dist/esm/modules/services/google/utils.js +29 -0
  72. package/dist/esm/modules/services/google/utils.js.map +1 -0
  73. package/package.json +1 -1
  74. package/dist/esm/modules/form/vendors/react/constants/address.const.d.ts +0 -14
  75. package/dist/esm/modules/form/vendors/react/constants/address.const.d.ts.map +0 -1
  76. package/dist/esm/modules/form/vendors/react/constants/address.const.js +0 -15
  77. package/dist/esm/modules/form/vendors/react/constants/address.const.js.map +0 -1
  78. package/dist/esm/modules/form/vendors/react/model/googleAddress.model.d.ts.map +0 -1
  79. package/dist/esm/modules/form/vendors/react/model/googleAddress.model.js +0 -63
  80. package/dist/esm/modules/form/vendors/react/model/googleAddress.model.js.map +0 -1
@@ -0,0 +1,110 @@
1
+ import { Address } from '../../common/shared/models/Address.js';
2
+ import { alpha2ToAlpha3 } from '../../form/vendors/formio/transformers/countryData.js';
3
+ import { GOOGLE_ADDRESS_INFO_ENUM } from './address.const.js';
4
+ export class GoogleSearchAddress extends Address {
5
+ constructor(result, newPlaceService = false) {
6
+ var _a, _b, _c;
7
+ super();
8
+ Object.defineProperty(this, "fullAddress", {
9
+ enumerable: true,
10
+ configurable: true,
11
+ writable: true,
12
+ value: void 0
13
+ });
14
+ Object.defineProperty(this, "streetAddress", {
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true,
18
+ value: void 0
19
+ });
20
+ Object.defineProperty(this, "label", {
21
+ enumerable: true,
22
+ configurable: true,
23
+ writable: true,
24
+ value: void 0
25
+ });
26
+ Object.defineProperty(this, "value", {
27
+ enumerable: true,
28
+ configurable: true,
29
+ writable: true,
30
+ value: void 0
31
+ });
32
+ if (!result) {
33
+ return;
34
+ }
35
+ const addressComponents = result.address_components;
36
+ const getAddressComponent = (type) => {
37
+ const shortNamesList = [
38
+ GOOGLE_ADDRESS_INFO_ENUM.COUNTRY,
39
+ GOOGLE_ADDRESS_INFO_ENUM.ADMINISTRATIVE_AREA_LEVEL_1,
40
+ ];
41
+ const component = addressComponents.find((c) => c.types.includes(type));
42
+ return component
43
+ ? component[shortNamesList.includes(type) ? 'short_name' : 'long_name']
44
+ : null;
45
+ };
46
+ const getAddressComponentWithMultipleCriteria = (criteriaList) => {
47
+ let result = null;
48
+ for (const criteria of criteriaList) {
49
+ if (!result || result.trim().length === 0) {
50
+ result = getAddressComponent(criteria);
51
+ }
52
+ if (result && result.trim().length > 0) {
53
+ return result;
54
+ }
55
+ }
56
+ return null;
57
+ };
58
+ this.fullAddress = result.formatted_address;
59
+ this.buildingName = getAddressComponent(GOOGLE_ADDRESS_INFO_ENUM.PREMISE);
60
+ this.state = getAddressComponent(GOOGLE_ADDRESS_INFO_ENUM.ADMINISTRATIVE_AREA_LEVEL_1);
61
+ this.streetNumber = getAddressComponent(GOOGLE_ADDRESS_INFO_ENUM.STREET_NUMBER);
62
+ // TODO: if it required for mapping streetType then get it from the address_components
63
+ // this.streetType = getAddressComponent(ADDRESS_INFO_ENUM.ROUTE);
64
+ if (newPlaceService) {
65
+ this.suburb = getAddressComponentWithMultipleCriteria([
66
+ GOOGLE_ADDRESS_INFO_ENUM.SUBLOCALITY_LEVEL_1,
67
+ GOOGLE_ADDRESS_INFO_ENUM.ADMINISTRATIVE_AREA_LEVEL_3,
68
+ GOOGLE_ADDRESS_INFO_ENUM.ADMINISTRATIVE_AREA_LEVEL_4,
69
+ ]);
70
+ this.town = getAddressComponentWithMultipleCriteria([
71
+ GOOGLE_ADDRESS_INFO_ENUM.LOCALITY,
72
+ GOOGLE_ADDRESS_INFO_ENUM.ADMINISTRATIVE_AREA_LEVEL_2,
73
+ ]);
74
+ }
75
+ else {
76
+ this.suburb = getAddressComponent(GOOGLE_ADDRESS_INFO_ENUM.SUBLOCALITY_LEVEL_1);
77
+ this.town = getAddressComponent(GOOGLE_ADDRESS_INFO_ENUM.LOCALITY);
78
+ }
79
+ (this.country = getAddressComponent(GOOGLE_ADDRESS_INFO_ENUM.COUNTRY)),
80
+ (this.postalCode = getAddressComponent(GOOGLE_ADDRESS_INFO_ENUM.POSTAL_CODE));
81
+ this._streetName =
82
+ getAddressComponent(GOOGLE_ADDRESS_INFO_ENUM.ROUTE) ||
83
+ getAddressComponent(GOOGLE_ADDRESS_INFO_ENUM.STREET_ADDRESS);
84
+ this.streetAddress =
85
+ `${(_a = this.streetNumber) !== null && _a !== void 0 ? _a : ''} ${(_b = this._streetName) !== null && _b !== void 0 ? _b : ''}`.trim();
86
+ this.country =
87
+ ((_c = this.country) === null || _c === void 0 ? void 0 : _c.length) === 2 ? alpha2ToAlpha3(this.country) : this.country;
88
+ this.unitNumber = getAddressComponent(GOOGLE_ADDRESS_INFO_ENUM.SUB_PREMISE);
89
+ }
90
+ isVisible() {
91
+ // Minimum value to show the address in the dropdown
92
+ return (!!(this.town || this.suburb) &&
93
+ !!(this.state || this.postalCode) &&
94
+ !!this.country);
95
+ }
96
+ formattedAddress() {
97
+ var _a, _b, _c;
98
+ const outputs = [
99
+ this.streetAddress,
100
+ (_a = this.town) !== null && _a !== void 0 ? _a : this.suburb,
101
+ `${(_b = this.state) !== null && _b !== void 0 ? _b : ''} ${(_c = this.postalCode) !== null && _c !== void 0 ? _c : ''}`.trim(),
102
+ this.country,
103
+ ];
104
+ return outputs
105
+ .filter((output) => output && output.trim().length > 0)
106
+ .map((output) => output === null || output === void 0 ? void 0 : output.trim())
107
+ .join(', ');
108
+ }
109
+ }
110
+ //# sourceMappingURL=googleAddress.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"googleAddress.model.js","sourceRoot":"","sources":["../../../../../modules/services/google/googleAddress.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAEtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AA0B3D,MAAM,OAAO,mBAAoB,SAAQ,OAAO;IAK9C,YACE,MAAyC,EACzC,kBAA2B,KAAK;;QAEhC,KAAK,EAAE,CAAC;QARV;;;;;WAAoB;QACpB;;;;;WAAsB;QACtB;;;;;WAAc;QACd;;;;;WAAc;QAOZ,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO;QACT,CAAC;QAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,kBAAkB,CAAC;QACpD,MAAM,mBAAmB,GAAG,CAAC,IAA8B,EAAE,EAAE;YAC7D,MAAM,cAAc,GAA+B;gBACjD,wBAAwB,CAAC,OAAO;gBAChC,wBAAwB,CAAC,2BAA2B;aACrD,CAAC;YACF,MAAM,SAAS,GAAG,iBAAiB,CAAC,IAA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CAAC;YACjC,CAAC,CAAC,IAAI,CAAC,OAAO,CACf,CAAC;IACJ,CAAC;IAED,gBAAgB;;QACd,MAAM,OAAO,GAAG;YACd,IAAI,CAAC,aAAa;YAClB,MAAA,IAAI,CAAC,IAAI,mCAAI,IAAI,CAAC,MAAM;YACxB,GAAG,MAAA,IAAI,CAAC,KAAK,mCAAI,EAAE,IAAI,MAAA,IAAI,CAAC,UAAU,mCAAI,EAAE,EAAE,CAAC,IAAI,EAAE;YACrD,IAAI,CAAC,OAAO;SACb,CAAC;QAEF,OAAO,OAAO;aACX,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;aACtD,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAE,CAAC;aAC/B,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,81 @@
1
+ export type GoogleSuggestion = {
2
+ /**
3
+ * Contains the human-readable name for the returned result. For establishment results, this is usually the business name and address.
4
+ */
5
+ placePrediction?: {
6
+ placeId: string;
7
+ };
8
+ place_id: string;
9
+ description: string;
10
+ };
11
+ export type GoogleMapServiceStatus = {
12
+ OK: string;
13
+ ERROR: string;
14
+ INVALID_REQUEST: string;
15
+ OVER_QUERY_LIMIT: string;
16
+ REQUEST_DENIED: string;
17
+ UNKNOWN_ERROR: string;
18
+ ZERO_RESULTS: string;
19
+ };
20
+ export type GoogleMapService = {
21
+ maps: {
22
+ places: {
23
+ /** @deprecated this service is deprecated by google
24
+ * source: https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service
25
+ *
26
+ * As of March 1st, 2025, google.maps.places.AutocompleteService is not available to new customers. Please use AutocompleteSuggestion instead.
27
+ * At this time, google.maps.places.AutocompleteService is not scheduled to be discontinued,
28
+ * but AutocompleteSuggestion is recommended over google.maps.places.AutocompleteService.
29
+ * While google.maps.places.AutocompleteService will continue to receive bug fixes for any major regressions,
30
+ * existing bugs in google.maps.places.AutocompleteService will not be addressed.
31
+ * At least 12 months notice will be given before support is discontinued.
32
+ */
33
+ AutocompleteService: {
34
+ new (): {
35
+ /** @deprecated this service is deprecated by google */
36
+ getPlacePredictions: (params: {
37
+ input: string;
38
+ componentRestrictions: {
39
+ country: string[];
40
+ };
41
+ }, callback: (results: GoogleSuggestion[], status: string) => void) => void;
42
+ };
43
+ };
44
+ /**
45
+ * docs: https://developers.google.com/maps/documentation/javascript/reference/autocomplete-data#AutocompleteSuggestion
46
+ *
47
+ * This is the replacement for google.maps.places.AutocompleteService
48
+ */
49
+ AutocompleteSuggestion: {
50
+ /**
51
+ * Fetches a list of AutocompleteSuggestions.
52
+ */
53
+ fetchAutocompleteSuggestions: (autocompleteRequest: {
54
+ input: string;
55
+ includedRegionCodes: string[];
56
+ }) => Promise<{
57
+ suggestions: GoogleSuggestion[];
58
+ }>;
59
+ };
60
+ /**
61
+ * docs: https://developers.google.com/maps/documentation/javascript/reference/places-service#PlacesServiceStatus
62
+ */
63
+ PlacesServiceStatus: GoogleMapServiceStatus;
64
+ };
65
+ /**
66
+ * docs: https://developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder
67
+ */
68
+ Geocoder: {
69
+ new (): {
70
+ geocode: (request: {
71
+ placeId: string;
72
+ }, callback: (results: google.maps.GeocoderResult[], status: string) => void) => void;
73
+ };
74
+ };
75
+ /**
76
+ * docs: https://developers.google.com/maps/documentation/javascript/reference/geocoder#GeocoderStatus
77
+ */
78
+ GeocoderStatus: GoogleMapServiceStatus;
79
+ };
80
+ };
81
+ //# sourceMappingURL=googleService.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"googleService.types.d.ts","sourceRoot":"","sources":["../../../../../modules/services/google/googleService.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,eAAe,CAAC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5B,QAAQ,EAAE,CACR,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,EACrC,MAAM,EAAE,MAAM,KACX,IAAI,KACN,IAAI,CAAC;aACX,CAAC;SACH,CAAC;QAEF;;WAEG;QACH,cAAc,EAAE,sBAAsB,CAAC;KACxC,CAAC;CACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=googleService.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"googleService.types.js","sourceRoot":"","sources":["../../../../../modules/services/google/googleService.types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare const initializeGoogleMaps: (googleApiKey?: string) => Promise<void>;
2
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../modules/services/google/utils.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,oBAAoB,kBAAyB,MAAM,kBAS/D,CAAC"}
@@ -0,0 +1,29 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { loadAsyncAsset } from '../../common/index.js';
11
+ const isScriptAlreadyIncluded = (src) => {
12
+ const scripts = document.getElementsByTagName('script');
13
+ for (let i = 0; i < scripts.length; i++) {
14
+ if (scripts[i].getAttribute('src') === src) {
15
+ return true;
16
+ }
17
+ }
18
+ return false;
19
+ };
20
+ export const initializeGoogleMaps = (googleApiKey) => __awaiter(void 0, void 0, void 0, function* () {
21
+ if (!googleApiKey || googleApiKey.trim().length === 0) {
22
+ return;
23
+ }
24
+ const source = `https://maps.googleapis.com/maps/api/js?key=${googleApiKey}&loading=async&libraries=places`;
25
+ if (!isScriptAlreadyIncluded(source)) {
26
+ yield loadAsyncAsset(source, 'script');
27
+ }
28
+ });
29
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../modules/services/google/utils.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,uBAAuB,GAAG,CAAC,GAAW,EAAE,EAAE;IAC9C,MAAM,OAAO,GAAG,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACxD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;YAC3C,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAO,YAAqB,EAAE,EAAE;IAClE,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtD,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,+CAA+C,YAAY,iCAAiC,CAAC;IAC5G,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC;QACrC,MAAM,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;AACH,CAAC,CAAA,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frankieone/one-sdk",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "cliVersion": "0.0.2",
5
5
  "description": "FrankieOne OneSDK",
6
6
  "keywords": [],
@@ -1,14 +0,0 @@
1
- export declare enum ADDRESS_INFO_ENUM {
2
- PREMISE = "premise",
3
- FLOOR = "floor",
4
- SUBLOCALITY_LEVEL_1 = "sublocality_level_1",
5
- ROUTE = "route",
6
- STREET_ADDRESS = "street_address",
7
- LOCALITY = "locality",
8
- ADMINISTRATIVE_AREA_LEVEL_1 = "administrative_area_level_1",
9
- COUNTRY = "country",
10
- POSTAL_CODE = "postal_code",
11
- STREET_NUMBER = "street_number",
12
- SUB_PREMISE = "subpremise"
13
- }
14
- //# sourceMappingURL=address.const.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"address.const.d.ts","sourceRoot":"","sources":["../../../../../../../modules/form/vendors/react/constants/address.const.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,mBAAmB,wBAAwB;IAC3C,KAAK,UAAU;IACf,cAAc,mBAAmB;IACjC,QAAQ,aAAa;IACrB,2BAA2B,gCAAgC;IAC3D,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,WAAW,eAAe;CAC3B"}
@@ -1,15 +0,0 @@
1
- export var ADDRESS_INFO_ENUM;
2
- (function (ADDRESS_INFO_ENUM) {
3
- ADDRESS_INFO_ENUM["PREMISE"] = "premise";
4
- ADDRESS_INFO_ENUM["FLOOR"] = "floor";
5
- ADDRESS_INFO_ENUM["SUBLOCALITY_LEVEL_1"] = "sublocality_level_1";
6
- ADDRESS_INFO_ENUM["ROUTE"] = "route";
7
- ADDRESS_INFO_ENUM["STREET_ADDRESS"] = "street_address";
8
- ADDRESS_INFO_ENUM["LOCALITY"] = "locality";
9
- ADDRESS_INFO_ENUM["ADMINISTRATIVE_AREA_LEVEL_1"] = "administrative_area_level_1";
10
- ADDRESS_INFO_ENUM["COUNTRY"] = "country";
11
- ADDRESS_INFO_ENUM["POSTAL_CODE"] = "postal_code";
12
- ADDRESS_INFO_ENUM["STREET_NUMBER"] = "street_number";
13
- ADDRESS_INFO_ENUM["SUB_PREMISE"] = "subpremise";
14
- })(ADDRESS_INFO_ENUM || (ADDRESS_INFO_ENUM = {}));
15
- //# sourceMappingURL=address.const.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"address.const.js","sourceRoot":"","sources":["../../../../../../../modules/form/vendors/react/constants/address.const.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAYX;AAZD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,oCAAe,CAAA;IACf,gEAA2C,CAAA;IAC3C,oCAAe,CAAA;IACf,sDAAiC,CAAA;IACjC,0CAAqB,CAAA;IACrB,gFAA2D,CAAA;IAC3D,wCAAmB,CAAA;IACnB,gDAA2B,CAAA;IAC3B,oDAA+B,CAAA;IAC/B,+CAA0B,CAAA;AAC5B,CAAC,EAZW,iBAAiB,KAAjB,iBAAiB,QAY5B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"googleAddress.model.d.ts","sourceRoot":"","sources":["../../../../../../../modules/form/vendors/react/model/googleAddress.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAK/D,MAAM,WAAW,0BAA0B;IACzC,kBAAkB,EAAE;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,EAAE,CAAC;IACJ,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE;QACR,QAAQ,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;QACvC,aAAa,EAAE,MAAM,CAAC;QACtB,QAAQ,EAAE;YACR,SAAS,EAAE;gBAAE,GAAG,EAAE,MAAM,CAAC;gBAAC,GAAG,EAAE,MAAM,CAAA;aAAE,CAAC;YACxC,SAAS,EAAE;gBAAE,GAAG,EAAE,MAAM,CAAC;gBAAC,GAAG,EAAE,MAAM,CAAA;aAAE,CAAC;SACzC,CAAC;KACH,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE;QACT,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,mBAAoB,SAAQ,OAAO;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;gBACF,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc;CAsC/C"}
@@ -1,63 +0,0 @@
1
- import { Address } from '../../../../common/shared/models/Address.js';
2
- import { alpha2ToAlpha3 } from '../../formio/transformers/countryData.js';
3
- import { ADDRESS_INFO_ENUM } from '../constants/address.const.js';
4
- export class GoogleSearchAddress extends Address {
5
- constructor(result) {
6
- var _a;
7
- super();
8
- Object.defineProperty(this, "fullAddress", {
9
- enumerable: true,
10
- configurable: true,
11
- writable: true,
12
- value: void 0
13
- });
14
- Object.defineProperty(this, "streetAddress", {
15
- enumerable: true,
16
- configurable: true,
17
- writable: true,
18
- value: void 0
19
- });
20
- Object.defineProperty(this, "label", {
21
- enumerable: true,
22
- configurable: true,
23
- writable: true,
24
- value: void 0
25
- });
26
- Object.defineProperty(this, "value", {
27
- enumerable: true,
28
- configurable: true,
29
- writable: true,
30
- value: void 0
31
- });
32
- const addressComponents = result.address_components;
33
- const getAddressComponent = (type) => {
34
- const shortNamesList = [
35
- ADDRESS_INFO_ENUM.COUNTRY,
36
- ADDRESS_INFO_ENUM.ADMINISTRATIVE_AREA_LEVEL_1,
37
- ];
38
- const component = addressComponents.find((c) => c.types.includes(type));
39
- return component
40
- ? component[shortNamesList.includes(type) ? 'short_name' : 'long_name']
41
- : null;
42
- };
43
- this.fullAddress = result.formatted_address;
44
- this.buildingName = getAddressComponent(ADDRESS_INFO_ENUM.PREMISE);
45
- this.state = getAddressComponent(ADDRESS_INFO_ENUM.ADMINISTRATIVE_AREA_LEVEL_1);
46
- this.streetNumber = getAddressComponent(ADDRESS_INFO_ENUM.STREET_NUMBER);
47
- // TODO: if it required for mapping streetType then get it from the address_components
48
- // this.streetType = getAddressComponent(ADDRESS_INFO_ENUM.ROUTE);
49
- this.suburb = getAddressComponent(ADDRESS_INFO_ENUM.SUBLOCALITY_LEVEL_1);
50
- this.town = getAddressComponent(ADDRESS_INFO_ENUM.LOCALITY);
51
- (this.country = getAddressComponent(ADDRESS_INFO_ENUM.COUNTRY)),
52
- (this.postalCode = getAddressComponent(ADDRESS_INFO_ENUM.POSTAL_CODE));
53
- this._streetName =
54
- getAddressComponent(ADDRESS_INFO_ENUM.ROUTE) ||
55
- getAddressComponent(ADDRESS_INFO_ENUM.STREET_ADDRESS);
56
- this.streetAddress =
57
- `${this.streetNumber || ''} ${this._streetName || ''}`.trim();
58
- this.country =
59
- ((_a = this.country) === null || _a === void 0 ? void 0 : _a.length) === 2 ? alpha2ToAlpha3(this.country) : this.country;
60
- this.unitNumber = getAddressComponent(ADDRESS_INFO_ENUM.SUB_PREMISE);
61
- }
62
- }
63
- //# sourceMappingURL=googleAddress.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"googleAddress.model.js","sourceRoot":"","sources":["../../../../../../../modules/form/vendors/react/model/googleAddress.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AA0B/D,MAAM,OAAO,mBAAoB,SAAQ,OAAO;IAK9C,YAAY,MAAkC;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