bukazu-portal-react 3.3.3 → 3.3.4

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 (184) hide show
  1. package/build/index.css +1 -1
  2. package/build/portal.es.js +19931 -20259
  3. package/build/portal.umd.js +80 -82
  4. package/package.json +9 -7
  5. package/.env.development +0 -1
  6. package/.eslintrc +0 -25
  7. package/.github/dependabot.yml +0 -11
  8. package/.github/workflows/node.js.yml +0 -31
  9. package/.github/workflows/npm-publish.yml +0 -33
  10. package/.nvmrc +0 -1
  11. package/.prettierrc +0 -6
  12. package/.vscode/settings.json +0 -24
  13. package/CHANGELOG.MD +0 -93
  14. package/babel.config.json +0 -6
  15. package/calendar.html +0 -16
  16. package/coverage/clover.xml +0 -28
  17. package/coverage/coverage-final.json +0 -2
  18. package/coverage/lcov-report/base.css +0 -224
  19. package/coverage/lcov-report/block-navigation.js +0 -87
  20. package/coverage/lcov-report/favicon.png +0 -0
  21. package/coverage/lcov-report/helper.ts.html +0 -142
  22. package/coverage/lcov-report/index.html +0 -116
  23. package/coverage/lcov-report/prettify.css +0 -1
  24. package/coverage/lcov-report/prettify.js +0 -2
  25. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  26. package/coverage/lcov-report/sorter.js +0 -196
  27. package/coverage/lcov.info +0 -36
  28. package/cypress/e2e/.examples/actions.spec.js +0 -299
  29. package/cypress/e2e/.examples/aliasing.spec.js +0 -39
  30. package/cypress/e2e/.examples/assertions.spec.js +0 -177
  31. package/cypress/e2e/.examples/connectors.spec.js +0 -97
  32. package/cypress/e2e/.examples/cookies.spec.js +0 -77
  33. package/cypress/e2e/.examples/cypress_api.spec.js +0 -202
  34. package/cypress/e2e/.examples/files.spec.js +0 -89
  35. package/cypress/e2e/.examples/local_storage.spec.js +0 -52
  36. package/cypress/e2e/.examples/location.spec.js +0 -32
  37. package/cypress/e2e/.examples/misc.spec.js +0 -104
  38. package/cypress/e2e/.examples/navigation.spec.js +0 -56
  39. package/cypress/e2e/.examples/network_requests.spec.js +0 -163
  40. package/cypress/e2e/.examples/querying.spec.js +0 -114
  41. package/cypress/e2e/.examples/spies_stubs_clocks.spec.js +0 -205
  42. package/cypress/e2e/.examples/traversal.spec.js +0 -121
  43. package/cypress/e2e/.examples/utilities.spec.js +0 -110
  44. package/cypress/e2e/.examples/viewport.spec.js +0 -59
  45. package/cypress/e2e/.examples/waiting.spec.js +0 -31
  46. package/cypress/e2e/.examples/window.spec.js +0 -22
  47. package/cypress/e2e/booking.spec.js +0 -81
  48. package/cypress/e2e/calendar.spec.js +0 -21
  49. package/cypress/e2e/search.spec.js +0 -25
  50. package/cypress/fixtures/example.json +0 -5
  51. package/cypress/plugins/index.js +0 -16
  52. package/cypress/support/commands.js +0 -25
  53. package/cypress/support/commands.ts +0 -37
  54. package/cypress/support/component-index.html +0 -12
  55. package/cypress/support/component.ts +0 -39
  56. package/cypress/support/e2e.js +0 -20
  57. package/cypress.config.ts +0 -15
  58. package/dev.tsx +0 -44
  59. package/index.html +0 -15
  60. package/invalid-calendar.html +0 -16
  61. package/jest.config.js +0 -195
  62. package/postcss.config.js +0 -17
  63. package/reviews.html +0 -16
  64. package/src/_lib/SearchQueries.ts +0 -145
  65. package/src/_lib/Tracking.ts +0 -51
  66. package/src/_lib/countries/de.json +0 -998
  67. package/src/_lib/countries/en.json +0 -998
  68. package/src/_lib/countries/es.json +0 -998
  69. package/src/_lib/countries/fr.json +0 -998
  70. package/src/_lib/countries/it.json +0 -998
  71. package/src/_lib/countries/nl.json +0 -998
  72. package/src/_lib/countries.ts +0 -15
  73. package/src/_lib/date_helper.ts +0 -27
  74. package/src/_lib/queries.ts +0 -244
  75. package/src/components/App.tsx +0 -108
  76. package/src/components/AppContext.ts +0 -14
  77. package/src/components/CalendarPage/BookingForm.tsx +0 -49
  78. package/src/components/CalendarPage/Calendar.tsx +0 -49
  79. package/src/components/CalendarPage/CalendarPage.tsx +0 -43
  80. package/src/components/CalendarPage/CalendarParts/CalendarContext.tsx +0 -89
  81. package/src/components/CalendarPage/CalendarParts/CalendarHeader.tsx +0 -72
  82. package/src/components/CalendarPage/CalendarParts/DayClasses.ts +0 -113
  83. package/src/components/CalendarPage/CalendarParts/GenerateCalendar.tsx +0 -72
  84. package/src/components/CalendarPage/CalendarParts/Legend.tsx +0 -33
  85. package/src/components/CalendarPage/CalendarParts/MonthHeader.tsx +0 -15
  86. package/src/components/CalendarPage/CalendarParts/Months.tsx +0 -37
  87. package/src/components/CalendarPage/CalendarParts/RenderCells.tsx +0 -97
  88. package/src/components/CalendarPage/CalendarParts/SingleMonth.tsx +0 -72
  89. package/src/components/CalendarPage/CalendarParts/StartBooking.tsx +0 -17
  90. package/src/components/CalendarPage/CalendarParts/WeekDays.tsx +0 -27
  91. package/src/components/CalendarPage/FormCreator.tsx +0 -230
  92. package/src/components/CalendarPage/FormItems/Date.tsx +0 -61
  93. package/src/components/CalendarPage/FormItems/NumberSelect.tsx +0 -39
  94. package/src/components/CalendarPage/FormItems/Select.tsx +0 -38
  95. package/src/components/CalendarPage/FormItems/index.ts +0 -4
  96. package/src/components/CalendarPage/PriceField/Price.tsx +0 -58
  97. package/src/components/CalendarPage/PriceField/Queries.ts +0 -23
  98. package/src/components/CalendarPage/PriceField/index.tsx +0 -129
  99. package/src/components/CalendarPage/Summary/CostRow.tsx +0 -58
  100. package/src/components/CalendarPage/Summary/CostSection.tsx +0 -15
  101. package/src/components/CalendarPage/Summary/CostSummary.tsx +0 -61
  102. package/src/components/CalendarPage/Summary/Description.tsx +0 -27
  103. package/src/components/CalendarPage/Summary/InsurancesAndRequired.tsx +0 -68
  104. package/src/components/CalendarPage/Summary/Object.tsx +0 -59
  105. package/src/components/CalendarPage/Summary/OnSite.tsx +0 -36
  106. package/src/components/CalendarPage/Summary/OptionalNotOnSite.tsx +0 -43
  107. package/src/components/CalendarPage/Summary/OptionalOnSite.tsx +0 -39
  108. package/src/components/CalendarPage/Summary/Queries.ts +0 -31
  109. package/src/components/CalendarPage/Summary/RentAndDiscount.tsx +0 -30
  110. package/src/components/CalendarPage/Summary/Totals.tsx +0 -89
  111. package/src/components/CalendarPage/Summary/cost_types.d.ts +0 -31
  112. package/src/components/CalendarPage/Summary/index.tsx +0 -24
  113. package/src/components/CalendarPage/calender_types.d.ts +0 -16
  114. package/src/components/CalendarPage/formParts/AssistanceMessage.tsx +0 -60
  115. package/src/components/CalendarPage/formParts/BookingHelpers.tsx +0 -47
  116. package/src/components/CalendarPage/formParts/BookingOrOption.tsx +0 -35
  117. package/src/components/CalendarPage/formParts/CancelInsuranceText.tsx +0 -69
  118. package/src/components/CalendarPage/formParts/DefaultBookingFields.ts +0 -105
  119. package/src/components/CalendarPage/formParts/DiscountCode.tsx +0 -62
  120. package/src/components/CalendarPage/formParts/Guests.tsx +0 -77
  121. package/src/components/CalendarPage/formParts/OptionalBookingFields.tsx +0 -148
  122. package/src/components/CalendarPage/formParts/OptionalCosts.tsx +0 -103
  123. package/src/components/CalendarPage/formParts/SuccessMessage.tsx +0 -31
  124. package/src/components/CalendarPage/formParts/Validations.tsx +0 -64
  125. package/src/components/CalendarPage/formParts/discount.tsx +0 -69
  126. package/src/components/CalendarPage/formParts/form_types.d.ts +0 -38
  127. package/src/components/CalendarPage/formParts/insurances.tsx +0 -62
  128. package/src/components/CalendarPage/formParts/radioButtons.tsx +0 -66
  129. package/src/components/Error/ApiError.tsx +0 -33
  130. package/src/components/Error/IntegrationError.tsx +0 -62
  131. package/src/components/Error/index.ts +0 -4
  132. package/src/components/ErrorBoundary.tsx +0 -34
  133. package/src/components/Modal/index.tsx +0 -46
  134. package/src/components/ReviewsPage/Queries.ts +0 -26
  135. package/src/components/ReviewsPage/ReviewsPage.tsx +0 -45
  136. package/src/components/ReviewsPage/Score.tsx +0 -29
  137. package/src/components/ReviewsPage/SingleReview.tsx +0 -38
  138. package/src/components/ReviewsPage/note.tsx +0 -17
  139. package/src/components/SafeBooking.tsx +0 -96
  140. package/src/components/SearchPage/Field.tsx +0 -75
  141. package/src/components/SearchPage/Filters.tsx +0 -91
  142. package/src/components/SearchPage/Paginator.tsx +0 -63
  143. package/src/components/SearchPage/Results.tsx +0 -129
  144. package/src/components/SearchPage/SearchPage.tsx +0 -115
  145. package/src/components/SearchPage/SingleResult.tsx +0 -93
  146. package/src/components/SearchPage/filters/Categories.tsx +0 -57
  147. package/src/components/SearchPage/filters/DateFilter.tsx +0 -34
  148. package/src/components/SearchPage/filters/List.tsx +0 -80
  149. package/src/components/SearchPage/filters/NumberFilter.tsx +0 -37
  150. package/src/components/SearchPage/filters/Radio.tsx +0 -46
  151. package/src/components/SearchPage/filters/Select.tsx +0 -85
  152. package/src/components/SearchPage/filters/__tests__/helper.spec.js +0 -13
  153. package/src/components/SearchPage/filters/filter_types.d.ts +0 -25
  154. package/src/components/SearchPage/filters/helper.ts +0 -19
  155. package/src/components/icons/ArrowLeft.svg.tsx +0 -20
  156. package/src/components/icons/ArrowRight.svg.tsx +0 -16
  157. package/src/components/icons/Reload.svg.tsx +0 -23
  158. package/src/components/icons/info.svg.tsx +0 -24
  159. package/src/components/icons/loading.svg.tsx +0 -98
  160. package/src/custom.d.ts +0 -10
  161. package/src/index.tsx +0 -104
  162. package/src/locales/de.json +0 -137
  163. package/src/locales/en.json +0 -137
  164. package/src/locales/es.json +0 -132
  165. package/src/locales/fr.json +0 -132
  166. package/src/locales/it.json +0 -128
  167. package/src/locales/nl.json +0 -138
  168. package/src/styles/calendar.css +0 -317
  169. package/src/styles/datepicker.css +0 -6
  170. package/src/styles/field.css +0 -105
  171. package/src/styles/filters.css +0 -92
  172. package/src/styles/form.css +0 -219
  173. package/src/styles/main.css +0 -80
  174. package/src/styles/modal.css +0 -79
  175. package/src/styles/pagination.css +0 -92
  176. package/src/styles/price-overview.css +0 -111
  177. package/src/styles/result.css +0 -142
  178. package/src/styles/results.css +0 -50
  179. package/src/styles/reviews.css +0 -90
  180. package/src/styles/success.css +0 -9
  181. package/src/types.d.ts +0 -91
  182. package/tmp/cache/vite/last-build-production.json +0 -7
  183. package/tsconfig.json +0 -17
  184. package/vite.config.ts +0 -31
package/jest.config.js DELETED
@@ -1,195 +0,0 @@
1
- /*
2
- * For a detailed explanation regarding each configuration property, visit:
3
- * https://jestjs.io/docs/configuration
4
- */
5
-
6
- module.exports = {
7
- // All imported modules in your tests should be mocked automatically
8
- // automock: false,
9
-
10
- // Stop running tests after `n` failures
11
- // bail: 0,
12
-
13
- // The directory where Jest should store its cached dependency information
14
- // cacheDirectory: "/tmp/jest_rs",
15
-
16
- // Automatically clear mock calls, instances, contexts and results before every test
17
- clearMocks: true,
18
-
19
- // Indicates whether the coverage information should be collected while executing the test
20
- collectCoverage: true,
21
-
22
- // An array of glob patterns indicating a set of files for which coverage information should be collected
23
- // collectCoverageFrom: undefined,
24
-
25
- // The directory where Jest should output its coverage files
26
- coverageDirectory: "coverage",
27
-
28
- // An array of regexp pattern strings used to skip coverage collection
29
- // coveragePathIgnorePatterns: [
30
- // "/node_modules/"
31
- // ],
32
-
33
- // Indicates which provider should be used to instrument code for coverage
34
- coverageProvider: "v8",
35
-
36
- // A list of reporter names that Jest uses when writing coverage reports
37
- // coverageReporters: [
38
- // "json",
39
- // "text",
40
- // "lcov",
41
- // "clover"
42
- // ],
43
-
44
- // An object that configures minimum threshold enforcement for coverage results
45
- // coverageThreshold: undefined,
46
-
47
- // A path to a custom dependency extractor
48
- // dependencyExtractor: undefined,
49
-
50
- // Make calling deprecated APIs throw helpful error messages
51
- // errorOnDeprecated: false,
52
-
53
- // The default configuration for fake timers
54
- // fakeTimers: {
55
- // "enableGlobally": false
56
- // },
57
-
58
- // Force coverage collection from ignored files using an array of glob patterns
59
- // forceCoverageMatch: [],
60
-
61
- // A path to a module which exports an async function that is triggered once before all test suites
62
- // globalSetup: undefined,
63
-
64
- // A path to a module which exports an async function that is triggered once after all test suites
65
- // globalTeardown: undefined,
66
-
67
- // A set of global variables that need to be available in all test environments
68
- // globals: {},
69
-
70
- // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
71
- // maxWorkers: "50%",
72
-
73
- // An array of directory names to be searched recursively up from the requiring module's location
74
- // moduleDirectories: [
75
- // "node_modules"
76
- // ],
77
-
78
- // An array of file extensions your modules use
79
- // moduleFileExtensions: [
80
- // "js",
81
- // "mjs",
82
- // "cjs",
83
- // "jsx",
84
- // "ts",
85
- // "tsx",
86
- // "json",
87
- // "node"
88
- // ],
89
-
90
- // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
91
- // moduleNameMapper: {},
92
-
93
- // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
94
- // modulePathIgnorePatterns: [],
95
-
96
- // Activates notifications for test results
97
- // notify: false,
98
-
99
- // An enum that specifies notification mode. Requires { notify: true }
100
- // notifyMode: "failure-change",
101
-
102
- // A preset that is used as a base for Jest's configuration
103
- // preset: undefined,
104
-
105
- // Run tests from one or more projects
106
- // projects: undefined,
107
-
108
- // Use this configuration option to add custom reporters to Jest
109
- // reporters: undefined,
110
-
111
- // Automatically reset mock state before every test
112
- // resetMocks: false,
113
-
114
- // Reset the module registry before running each individual test
115
- // resetModules: false,
116
-
117
- // A path to a custom resolver
118
- // resolver: undefined,
119
-
120
- // Automatically restore mock state and implementation before every test
121
- // restoreMocks: false,
122
-
123
- // The root directory that Jest should scan for tests and modules within
124
- // rootDir: undefined,
125
-
126
- // A list of paths to directories that Jest should use to search for files in
127
- roots: [
128
- "src"
129
- ],
130
-
131
- // Allows you to use a custom runner instead of Jest's default test runner
132
- // runner: "jest-runner",
133
-
134
- // The paths to modules that run some code to configure or set up the testing environment before each test
135
- // setupFiles: [],
136
-
137
- // A list of paths to modules that run some code to configure or set up the testing framework before each test
138
- // setupFilesAfterEnv: [],
139
-
140
- // The number of seconds after which a test is considered as slow and reported as such in the results.
141
- // slowTestThreshold: 5,
142
-
143
- // A list of paths to snapshot serializer modules Jest should use for snapshot testing
144
- // snapshotSerializers: [],
145
-
146
- // The test environment that will be used for testing
147
- // testEnvironment: "jest-environment-node",
148
-
149
- // Options that will be passed to the testEnvironment
150
- // testEnvironmentOptions: {},
151
-
152
- // Adds a location field to test results
153
- // testLocationInResults: false,
154
-
155
- // The glob patterns Jest uses to detect test files
156
- // testMatch: [
157
- // "**/__tests__/**/*.[jt]s?(x)",
158
- // "**/?(*.)+(spec|test).[tj]s?(x)"
159
- // ],
160
-
161
- // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
162
- // testPathIgnorePatterns: [
163
- // "/node_modules/"
164
- // ],
165
-
166
- // The regexp pattern or array of patterns that Jest uses to detect test files
167
- // testRegex: [],
168
-
169
- // This option allows the use of a custom results processor
170
- // testResultsProcessor: undefined,
171
-
172
- // This option allows use of a custom test runner
173
- // testRunner: "jest-circus/runner",
174
-
175
- // A map from regular expressions to paths to transformers
176
- // transform: undefined,
177
-
178
- // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
179
- // transformIgnorePatterns: [
180
- // "/node_modules/",
181
- // "\\.pnp\\.[^\\/]+$"
182
- // ],
183
-
184
- // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
185
- // unmockedModulePathPatterns: undefined,
186
-
187
- // Indicates whether each individual test should be reported during the run
188
- // verbose: undefined,
189
-
190
- // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
191
- // watchPathIgnorePatterns: [],
192
-
193
- // Whether to use watchman for file crawling
194
- // watchman: true,
195
- };
package/postcss.config.js DELETED
@@ -1,17 +0,0 @@
1
- // const postcssPresetEnv = require('postcss-preset-env');
2
-
3
- module.exports = {
4
- plugins: [
5
- require('postcss-import'),
6
- require('postcss-nested'),
7
- require('autoprefixer')
8
-
9
- // postcssPresetEnv({
10
- // /* use stage 3 features + css nesting rules */
11
- // stage: 3,
12
- // features: {
13
- // 'nesting-rules': true
14
- // }
15
- // })
16
- ]
17
- };
package/reviews.html DELETED
@@ -1,16 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Bukazu Portal</title>
6
- </head>
7
- <body>
8
- <h1>Bukazu Test Reviews</h1>
9
-
10
- <!-- <div class="bukazu-app" id="bukazu-app" portal-code="050497a0" object-code="DE0002" language='nl' filters='123'></div> -->
11
- <!-- <div class="bukazu-app" id="bukazu-app" portal-code="72902823" object-code="NL1443" language='nl' filters='123'></div> -->
12
- <div id='bukazu-app' class='bukazu-app' portal-code="7f9b7a84" object-code="NL1192" language="nl" page="reviews"></div>
13
-
14
- <script src="./dev.tsx" type="module"></script>
15
- </body>
16
- </html>
@@ -1,145 +0,0 @@
1
- import { gql } from '@apollo/client';
2
-
3
- export const HOUSES_QUERY = gql`
4
- query PortalSiteHousesQuery(
5
- $id: ID!
6
- $country_id: ID
7
- $region_id: String
8
- $city_id: String
9
- $persons_min: Int
10
- $persons_max: Int
11
- $bedrooms_min: Int
12
- $bathrooms_min: Int
13
- $arrival_date: String
14
- $no_nights: Int
15
- $properties: String
16
- $weekprice_max: Int
17
- $limit: Int
18
- $skip: Int
19
- ) {
20
- PortalSite(id: $id) {
21
- id
22
- houses(
23
- country_id: $country_id
24
- region_id: $region_id
25
- city_id: $city_id
26
- persons_min: $persons_min
27
- persons_max: $persons_max
28
- bedrooms_min: $bedrooms_min
29
- bathrooms_min: $bathrooms_min
30
- arrival_date: $arrival_date
31
- weekprice_max: $weekprice_max
32
- no_nights_min: $no_nights
33
- properties: $properties
34
- limit: $limit
35
- skip: $skip
36
- ) {
37
- id
38
- name
39
- persons
40
- bathrooms
41
- bedrooms
42
- description
43
- image_url
44
- house_url
45
- province
46
- city
47
- country_name
48
- minimum_week_price
49
- rating
50
- scoreAmount
51
- }
52
- }
53
- }
54
- `;
55
-
56
- export const HOUSES_PRICE_QUERY = gql`
57
- query PortalSiteHousesQuery(
58
- $id: ID!
59
- $country_id: ID
60
- $region_id: String
61
- $city_id: String
62
- $persons_min: Int
63
- $persons_max: Int
64
- $bedrooms_min: Int
65
- $bathrooms_min: Int
66
- $arrival_date: String
67
- $starts_at: Date!
68
- $ends_at: Date!
69
- $no_nights: Int
70
- $properties: String
71
- $weekprice_max: Int
72
- $limit: Int
73
- $skip: Int
74
- ) {
75
- PortalSite(id: $id) {
76
- houses(
77
- country_id: $country_id
78
- region_id: $region_id
79
- city_id: $city_id
80
- persons_min: $persons_min
81
- persons_max: $persons_max
82
- bedrooms_min: $bedrooms_min
83
- bathrooms_min: $bathrooms_min
84
- arrival_date: $arrival_date
85
- weekprice_max: $weekprice_max
86
- no_nights_min: $no_nights
87
- properties: $properties
88
- limit: $limit
89
- skip: $skip
90
- ) {
91
- id
92
- name
93
- persons
94
- bathrooms
95
- bedrooms
96
- description
97
- image_url
98
- house_url
99
- province
100
- city
101
- country_name
102
- minimum_week_price
103
- rating
104
- score_amount
105
- booking_price(starts_at: $starts_at, ends_at: $ends_at)
106
- }
107
- }
108
- }
109
- `;
110
-
111
- export const HOUSE_COUNT_QUERY = gql`
112
- query PortalSiteHouseCountQuery(
113
- $id: ID!
114
- $country_id: ID
115
- $region_id: String
116
- $city_id: String
117
- $persons_min: Int
118
- $persons_max: Int
119
- $bedrooms_min: Int
120
- $bathrooms_min: Int
121
- $arrival_date: String
122
- $no_nights: Int
123
- $properties: String
124
- $weekprice_max: Int
125
- ) {
126
- PortalSite(id: $id) {
127
- id
128
- houses(
129
- country_id: $country_id
130
- region_id: $region_id
131
- city_id: $city_id
132
- persons_min: $persons_min
133
- persons_max: $persons_max
134
- bedrooms_min: $bedrooms_min
135
- bathrooms_min: $bathrooms_min
136
- arrival_date: $arrival_date
137
- weekprice_max: $weekprice_max
138
- no_nights_min: $no_nights
139
- properties: $properties
140
- ) {
141
- id
142
- }
143
- }
144
- }
145
- `;
@@ -1,51 +0,0 @@
1
- export async function TrackEvent(data: any) {
2
- const cookie = getCookie('bu_portal_session');
3
-
4
- const all_data = {
5
- ...data,
6
- url: window.location.href,
7
- session_identifier: cookie
8
- }
9
- fetch("https://api.bukazu.com/tracking", {
10
- method: "POST",
11
- headers: {
12
- "Content-Type": "application/json"
13
- },
14
- body: JSON.stringify(all_data)
15
- }).then((response) => response.text())
16
- .then((data) => {
17
- setCookie('bu_portal_session', data, 14);
18
- } );
19
- }
20
-
21
- export function getSessionIdentifier() {
22
- const sessionIdentifier = getCookie('bu_portal_session');
23
- if (sessionIdentifier === '') {
24
- return null
25
- } else {
26
- return sessionIdentifier
27
- }
28
- }
29
-
30
- function setCookie(cname, cvalue, exdays) {
31
- const d = new Date();
32
- d.setTime(d.getTime() + (exdays*24*60*60*1000));
33
- let expires = "expires="+ d.toUTCString();
34
- document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
35
- }
36
-
37
- function getCookie(cname: string) {
38
- let name = cname + "=";
39
- let decodedCookie = decodeURIComponent(document.cookie);
40
- let ca = decodedCookie.split(';');
41
- for(let i = 0; i <ca.length; i++) {
42
- let c = ca[i];
43
- while (c.charAt(0) == ' ') {
44
- c = c.substring(1);
45
- }
46
- if (c.indexOf(name) == 0) {
47
- return c.substring(name.length, c.length);
48
- }
49
- }
50
- return "";
51
- }