@fireberry/sdk 0.0.3 → 0.0.5

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 (304) hide show
  1. package/{node_modules/asynckit/LICENSE → LICENSE.md} +2 -2
  2. package/README.md +85 -37
  3. package/dist/cjs/constants/index.d.ts +13 -0
  4. package/dist/cjs/constants/index.d.ts.map +1 -0
  5. package/dist/cjs/constants/index.js +16 -0
  6. package/dist/cjs/constants/index.js.map +1 -0
  7. package/dist/cjs/context/context.d.ts +7 -0
  8. package/dist/cjs/context/context.d.ts.map +1 -0
  9. package/dist/cjs/context/context.js +11 -0
  10. package/dist/cjs/context/context.js.map +1 -0
  11. package/dist/cjs/context/index.d.ts +2 -0
  12. package/dist/cjs/context/index.d.ts.map +1 -0
  13. package/dist/cjs/context/index.js.map +1 -0
  14. package/dist/cjs/fireberrySDK.client.d.ts +18 -0
  15. package/dist/cjs/fireberrySDK.client.d.ts.map +1 -0
  16. package/dist/cjs/fireberrySDK.client.js +66 -0
  17. package/dist/cjs/fireberrySDK.client.js.map +1 -0
  18. package/dist/cjs/iframeMessageManager.d.ts +12 -0
  19. package/dist/cjs/iframeMessageManager.d.ts.map +1 -0
  20. package/dist/cjs/iframeMessageManager.js +68 -0
  21. package/dist/cjs/iframeMessageManager.js.map +1 -0
  22. package/dist/cjs/types/index.d.ts +67 -0
  23. package/dist/cjs/types/index.d.ts.map +1 -0
  24. package/dist/{src/fireberryAPI/types.js → cjs/types/index.js} +1 -0
  25. package/dist/cjs/types/index.js.map +1 -0
  26. package/dist/esm/constants/index.d.ts +13 -0
  27. package/dist/esm/constants/index.d.ts.map +1 -0
  28. package/dist/esm/constants/index.js +13 -0
  29. package/dist/esm/constants/index.js.map +1 -0
  30. package/dist/esm/context/context.d.ts +7 -0
  31. package/dist/esm/context/context.d.ts.map +1 -0
  32. package/dist/esm/context/context.js +7 -0
  33. package/dist/esm/context/context.js.map +1 -0
  34. package/dist/esm/context/index.d.ts +2 -0
  35. package/dist/esm/context/index.d.ts.map +1 -0
  36. package/dist/esm/context/index.js +2 -0
  37. package/dist/esm/context/index.js.map +1 -0
  38. package/dist/esm/fireberrySDK.client.d.ts +18 -0
  39. package/dist/esm/fireberrySDK.client.d.ts.map +1 -0
  40. package/dist/esm/fireberrySDK.client.js +62 -0
  41. package/dist/esm/fireberrySDK.client.js.map +1 -0
  42. package/dist/esm/iframeMessageManager.d.ts +12 -0
  43. package/dist/esm/iframeMessageManager.d.ts.map +1 -0
  44. package/dist/esm/iframeMessageManager.js +64 -0
  45. package/dist/esm/iframeMessageManager.js.map +1 -0
  46. package/dist/esm/types/index.d.ts +67 -0
  47. package/dist/esm/types/index.d.ts.map +1 -0
  48. package/dist/esm/types/index.js +2 -0
  49. package/dist/esm/types/index.js.map +1 -0
  50. package/package.json +51 -28
  51. package/.eslintrc.json +0 -36
  52. package/.prettierrc.json +0 -7
  53. package/.vscode/settings.json +0 -35
  54. package/dist/base.fireberrySDK.d.ts +0 -7
  55. package/dist/base.fireberrySDK.js +0 -10
  56. package/dist/base.fireberrySDK.js.map +0 -1
  57. package/dist/context/context.d.ts +0 -13
  58. package/dist/context/context.js +0 -22
  59. package/dist/context/context.js.map +0 -1
  60. package/dist/context/context.record.test.d.ts +0 -1
  61. package/dist/context/context.record.test.js +0 -45
  62. package/dist/context/context.record.test.js.map +0 -1
  63. package/dist/context/index.d.ts +0 -5
  64. package/dist/context/index.js.map +0 -1
  65. package/dist/context/record.d.ts +0 -9
  66. package/dist/context/record.js +0 -33
  67. package/dist/context/record.js.map +0 -1
  68. package/dist/context/user.d.ts +0 -5
  69. package/dist/context/user.js +0 -27
  70. package/dist/context/user.js.map +0 -1
  71. package/dist/fireberry.sdk.d.ts +0 -4
  72. package/dist/fireberry.sdk.js +0 -13
  73. package/dist/fireberry.sdk.js.map +0 -1
  74. package/dist/fireberryAPI/fireberryV2Api.d.ts +0 -17
  75. package/dist/fireberryAPI/fireberryV2Api.js +0 -54
  76. package/dist/fireberryAPI/fireberryV2Api.js.map +0 -1
  77. package/dist/fireberryAPI/fireberryV2Api.test.d.ts +0 -1
  78. package/dist/fireberryAPI/fireberryV2Api.test.js +0 -56
  79. package/dist/fireberryAPI/fireberryV2Api.test.js.map +0 -1
  80. package/dist/fireberryAPI/index.d.ts +0 -2
  81. package/dist/fireberryAPI/index.js +0 -21
  82. package/dist/fireberryAPI/index.js.map +0 -1
  83. package/dist/fireberryAPI/types.d.ts +0 -10
  84. package/dist/fireberryAPI/types.js +0 -3
  85. package/dist/fireberryAPI/types.js.map +0 -1
  86. package/dist/fireberrySDK.client.d.ts +0 -5
  87. package/dist/fireberrySDK.client.js +0 -13
  88. package/dist/fireberrySDK.client.js.map +0 -1
  89. package/dist/fireberrySDK.server.d.ts +0 -6
  90. package/dist/fireberrySDK.server.js +0 -12
  91. package/dist/fireberrySDK.server.js.map +0 -1
  92. package/dist/index.d.ts +0 -6
  93. package/dist/index.js +0 -25
  94. package/dist/index.js.map +0 -1
  95. package/dist/jest.config.d.ts +0 -6
  96. package/dist/jest.config.js +0 -11
  97. package/dist/src/context/context.d.ts +0 -13
  98. package/dist/src/context/context.js +0 -21
  99. package/dist/src/context/context.record.test.d.ts +0 -1
  100. package/dist/src/context/context.record.test.js +0 -36
  101. package/dist/src/context/index.d.ts +0 -5
  102. package/dist/src/context/index.js +0 -17
  103. package/dist/src/context/record.d.ts +0 -9
  104. package/dist/src/context/record.js +0 -32
  105. package/dist/src/context/user.d.ts +0 -8
  106. package/dist/src/context/user.js +0 -31
  107. package/dist/src/fireberry.sdk.d.ts +0 -9
  108. package/dist/src/fireberry.sdk.js +0 -14
  109. package/dist/src/fireberryAPI/fireberryV2Api.d.ts +0 -14
  110. package/dist/src/fireberryAPI/fireberryV2Api.js +0 -41
  111. package/dist/src/fireberryAPI/index.d.ts +0 -2
  112. package/dist/src/fireberryAPI/index.js +0 -20
  113. package/dist/src/fireberryAPI/types.d.ts +0 -10
  114. package/dist/src/index.d.ts +0 -9
  115. package/dist/src/index.js +0 -6
  116. package/dist/src/utils/axios.util.d.ts +0 -6
  117. package/dist/src/utils/axios.util.js +0 -24
  118. package/dist/src/utils/index.d.ts +0 -2
  119. package/dist/src/utils/index.js +0 -18
  120. package/dist/src/utils/queryParam.util.d.ts +0 -1
  121. package/dist/src/utils/queryParam.util.js +0 -10
  122. package/dist/utils/axios.util.d.ts +0 -6
  123. package/dist/utils/axios.util.js +0 -24
  124. package/dist/utils/axios.util.js.map +0 -1
  125. package/dist/utils/index.d.ts +0 -2
  126. package/dist/utils/index.js +0 -19
  127. package/dist/utils/index.js.map +0 -1
  128. package/dist/utils/queryParam.util.d.ts +0 -1
  129. package/dist/utils/queryParam.util.js +0 -12
  130. package/dist/utils/queryParam.util.js.map +0 -1
  131. package/jest.config.ts +0 -10
  132. package/node_modules/asynckit/README.md +0 -233
  133. package/node_modules/asynckit/bench.js +0 -76
  134. package/node_modules/asynckit/index.js +0 -6
  135. package/node_modules/asynckit/lib/abort.js +0 -29
  136. package/node_modules/asynckit/lib/async.js +0 -34
  137. package/node_modules/asynckit/lib/defer.js +0 -26
  138. package/node_modules/asynckit/lib/iterate.js +0 -75
  139. package/node_modules/asynckit/lib/readable_asynckit.js +0 -91
  140. package/node_modules/asynckit/lib/readable_parallel.js +0 -25
  141. package/node_modules/asynckit/lib/readable_serial.js +0 -25
  142. package/node_modules/asynckit/lib/readable_serial_ordered.js +0 -29
  143. package/node_modules/asynckit/lib/state.js +0 -37
  144. package/node_modules/asynckit/lib/streamify.js +0 -141
  145. package/node_modules/asynckit/lib/terminator.js +0 -29
  146. package/node_modules/asynckit/package.json +0 -63
  147. package/node_modules/asynckit/parallel.js +0 -43
  148. package/node_modules/asynckit/serial.js +0 -17
  149. package/node_modules/asynckit/serialOrdered.js +0 -75
  150. package/node_modules/asynckit/stream.js +0 -21
  151. package/node_modules/axios/CHANGELOG.md +0 -874
  152. package/node_modules/axios/LICENSE +0 -7
  153. package/node_modules/axios/MIGRATION_GUIDE.md +0 -3
  154. package/node_modules/axios/README.md +0 -1650
  155. package/node_modules/axios/SECURITY.md +0 -6
  156. package/node_modules/axios/dist/axios.js +0 -3448
  157. package/node_modules/axios/dist/axios.js.map +0 -1
  158. package/node_modules/axios/dist/axios.min.js +0 -2
  159. package/node_modules/axios/dist/axios.min.js.map +0 -1
  160. package/node_modules/axios/dist/browser/axios.cjs +0 -3258
  161. package/node_modules/axios/dist/browser/axios.cjs.map +0 -1
  162. package/node_modules/axios/dist/esm/axios.js +0 -3281
  163. package/node_modules/axios/dist/esm/axios.js.map +0 -1
  164. package/node_modules/axios/dist/esm/axios.min.js +0 -2
  165. package/node_modules/axios/dist/esm/axios.min.js.map +0 -1
  166. package/node_modules/axios/dist/node/axios.cjs +0 -4354
  167. package/node_modules/axios/dist/node/axios.cjs.map +0 -1
  168. package/node_modules/axios/index.d.cts +0 -542
  169. package/node_modules/axios/index.d.ts +0 -559
  170. package/node_modules/axios/index.js +0 -43
  171. package/node_modules/axios/lib/adapters/README.md +0 -37
  172. package/node_modules/axios/lib/adapters/adapters.js +0 -77
  173. package/node_modules/axios/lib/adapters/http.js +0 -685
  174. package/node_modules/axios/lib/adapters/xhr.js +0 -260
  175. package/node_modules/axios/lib/axios.js +0 -89
  176. package/node_modules/axios/lib/cancel/CancelToken.js +0 -121
  177. package/node_modules/axios/lib/cancel/CanceledError.js +0 -25
  178. package/node_modules/axios/lib/cancel/isCancel.js +0 -5
  179. package/node_modules/axios/lib/core/Axios.js +0 -225
  180. package/node_modules/axios/lib/core/AxiosError.js +0 -100
  181. package/node_modules/axios/lib/core/AxiosHeaders.js +0 -298
  182. package/node_modules/axios/lib/core/InterceptorManager.js +0 -71
  183. package/node_modules/axios/lib/core/README.md +0 -8
  184. package/node_modules/axios/lib/core/buildFullPath.js +0 -21
  185. package/node_modules/axios/lib/core/dispatchRequest.js +0 -81
  186. package/node_modules/axios/lib/core/mergeConfig.js +0 -106
  187. package/node_modules/axios/lib/core/settle.js +0 -27
  188. package/node_modules/axios/lib/core/transformData.js +0 -28
  189. package/node_modules/axios/lib/defaults/index.js +0 -156
  190. package/node_modules/axios/lib/defaults/transitional.js +0 -7
  191. package/node_modules/axios/lib/env/README.md +0 -3
  192. package/node_modules/axios/lib/env/classes/FormData.js +0 -2
  193. package/node_modules/axios/lib/env/data.js +0 -1
  194. package/node_modules/axios/lib/helpers/AxiosTransformStream.js +0 -191
  195. package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -58
  196. package/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -71
  197. package/node_modules/axios/lib/helpers/README.md +0 -7
  198. package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +0 -28
  199. package/node_modules/axios/lib/helpers/bind.js +0 -7
  200. package/node_modules/axios/lib/helpers/buildURL.js +0 -63
  201. package/node_modules/axios/lib/helpers/callbackify.js +0 -16
  202. package/node_modules/axios/lib/helpers/combineURLs.js +0 -15
  203. package/node_modules/axios/lib/helpers/cookies.js +0 -42
  204. package/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -26
  205. package/node_modules/axios/lib/helpers/formDataToJSON.js +0 -95
  206. package/node_modules/axios/lib/helpers/formDataToStream.js +0 -111
  207. package/node_modules/axios/lib/helpers/fromDataURI.js +0 -53
  208. package/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -15
  209. package/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
  210. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -67
  211. package/node_modules/axios/lib/helpers/null.js +0 -2
  212. package/node_modules/axios/lib/helpers/parseHeaders.js +0 -55
  213. package/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
  214. package/node_modules/axios/lib/helpers/readBlob.js +0 -15
  215. package/node_modules/axios/lib/helpers/speedometer.js +0 -55
  216. package/node_modules/axios/lib/helpers/spread.js +0 -28
  217. package/node_modules/axios/lib/helpers/throttle.js +0 -33
  218. package/node_modules/axios/lib/helpers/toFormData.js +0 -219
  219. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -18
  220. package/node_modules/axios/lib/helpers/validator.js +0 -91
  221. package/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
  222. package/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
  223. package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -4
  224. package/node_modules/axios/lib/platform/browser/index.js +0 -13
  225. package/node_modules/axios/lib/platform/common/utils.js +0 -47
  226. package/node_modules/axios/lib/platform/index.js +0 -7
  227. package/node_modules/axios/lib/platform/node/classes/FormData.js +0 -3
  228. package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +0 -4
  229. package/node_modules/axios/lib/platform/node/index.js +0 -12
  230. package/node_modules/axios/lib/utils.js +0 -723
  231. package/node_modules/axios/package.json +0 -218
  232. package/node_modules/combined-stream/License +0 -19
  233. package/node_modules/combined-stream/Readme.md +0 -138
  234. package/node_modules/combined-stream/lib/combined_stream.js +0 -208
  235. package/node_modules/combined-stream/package.json +0 -25
  236. package/node_modules/delayed-stream/.npmignore +0 -1
  237. package/node_modules/delayed-stream/License +0 -19
  238. package/node_modules/delayed-stream/Makefile +0 -7
  239. package/node_modules/delayed-stream/Readme.md +0 -141
  240. package/node_modules/delayed-stream/lib/delayed_stream.js +0 -107
  241. package/node_modules/delayed-stream/package.json +0 -27
  242. package/node_modules/dotenv/CHANGELOG.md +0 -475
  243. package/node_modules/dotenv/LICENSE +0 -23
  244. package/node_modules/dotenv/README-es.md +0 -448
  245. package/node_modules/dotenv/README.md +0 -728
  246. package/node_modules/dotenv/config.d.ts +0 -1
  247. package/node_modules/dotenv/config.js +0 -9
  248. package/node_modules/dotenv/lib/cli-options.js +0 -11
  249. package/node_modules/dotenv/lib/env-options.js +0 -24
  250. package/node_modules/dotenv/lib/main.d.ts +0 -153
  251. package/node_modules/dotenv/lib/main.js +0 -361
  252. package/node_modules/dotenv/package.json +0 -65
  253. package/node_modules/follow-redirects/LICENSE +0 -18
  254. package/node_modules/follow-redirects/README.md +0 -155
  255. package/node_modules/follow-redirects/debug.js +0 -15
  256. package/node_modules/follow-redirects/http.js +0 -1
  257. package/node_modules/follow-redirects/https.js +0 -1
  258. package/node_modules/follow-redirects/index.js +0 -672
  259. package/node_modules/follow-redirects/package.json +0 -58
  260. package/node_modules/form-data/License +0 -19
  261. package/node_modules/form-data/README.md.bak +0 -358
  262. package/node_modules/form-data/Readme.md +0 -358
  263. package/node_modules/form-data/index.d.ts +0 -62
  264. package/node_modules/form-data/lib/browser.js +0 -2
  265. package/node_modules/form-data/lib/form_data.js +0 -501
  266. package/node_modules/form-data/lib/populate.js +0 -10
  267. package/node_modules/form-data/package.json +0 -68
  268. package/node_modules/mime-db/HISTORY.md +0 -507
  269. package/node_modules/mime-db/LICENSE +0 -23
  270. package/node_modules/mime-db/README.md +0 -100
  271. package/node_modules/mime-db/db.json +0 -8519
  272. package/node_modules/mime-db/index.js +0 -12
  273. package/node_modules/mime-db/package.json +0 -60
  274. package/node_modules/mime-types/HISTORY.md +0 -397
  275. package/node_modules/mime-types/LICENSE +0 -23
  276. package/node_modules/mime-types/README.md +0 -113
  277. package/node_modules/mime-types/index.js +0 -188
  278. package/node_modules/mime-types/package.json +0 -44
  279. package/node_modules/proxy-from-env/.eslintrc +0 -29
  280. package/node_modules/proxy-from-env/.travis.yml +0 -10
  281. package/node_modules/proxy-from-env/LICENSE +0 -20
  282. package/node_modules/proxy-from-env/README.md +0 -131
  283. package/node_modules/proxy-from-env/index.js +0 -108
  284. package/node_modules/proxy-from-env/package.json +0 -34
  285. package/node_modules/proxy-from-env/test.js +0 -483
  286. package/src/base.fireberrySDK.ts +0 -7
  287. package/src/context/context.record.test.ts +0 -47
  288. package/src/context/context.ts +0 -28
  289. package/src/context/index.ts +0 -6
  290. package/src/context/record.ts +0 -22
  291. package/src/context/user.ts +0 -15
  292. package/src/fireberry.sdk.ts +0 -14
  293. package/src/fireberryAPI/fireberryV2Api.test.ts +0 -57
  294. package/src/fireberryAPI/fireberryV2Api.ts +0 -61
  295. package/src/fireberryAPI/index.ts +0 -2
  296. package/src/fireberryAPI/types.ts +0 -10
  297. package/src/fireberrySDK.client.ts +0 -10
  298. package/src/fireberrySDK.server.ts +0 -8
  299. package/src/index.ts +0 -9
  300. package/src/utils/axios.util.ts +0 -20
  301. package/src/utils/index.ts +0 -2
  302. package/src/utils/queryParam.util.ts +0 -8
  303. package/tsconfig.json +0 -123
  304. /package/dist/{context → cjs/context}/index.js +0 -0
@@ -1,9 +0,0 @@
1
- export declare const IS_DEVELOPMENT: boolean;
2
- export { FireberrySDK } from './fireberry.sdk';
3
- export type Config = {
4
- tokenId: string;
5
- currentRecordDetails?: {
6
- recordId: string;
7
- recordType: number;
8
- };
9
- };
package/dist/src/index.js DELETED
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FireberrySDK = exports.IS_DEVELOPMENT = void 0;
4
- exports.IS_DEVELOPMENT = ['development', 'test'].includes(process.env.NODE_ENV);
5
- var fireberry_sdk_1 = require("./fireberry.sdk");
6
- Object.defineProperty(exports, "FireberrySDK", { enumerable: true, get: function () { return fireberry_sdk_1.FireberrySDK; } });
@@ -1,6 +0,0 @@
1
- import { AxiosInstance } from 'axios';
2
- import { Config } from '..';
3
- export declare abstract class AxiosFireberryAPI {
4
- protected api: AxiosInstance;
5
- constructor(config?: Config);
6
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AxiosFireberryAPI = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- const __1 = require("..");
9
- class AxiosFireberryAPI {
10
- constructor(config) {
11
- const baseURL = 'http://win-local';
12
- console.log('🚀 ~ AxiosFireberryAPI ~ constructor ~ baseURL:', baseURL);
13
- const tokenid = __1.IS_DEVELOPMENT ? config === null || config === void 0 ? void 0 : config.tokenId : undefined;
14
- this.api = axios_1.default.create({
15
- baseURL,
16
- headers: {
17
- 'Content-Type': 'application/json',
18
- tokenid,
19
- },
20
- withCredentials: true,
21
- });
22
- }
23
- }
24
- exports.AxiosFireberryAPI = AxiosFireberryAPI;
@@ -1,2 +0,0 @@
1
- export * from './axios.util';
2
- export * from './queryParam.util';
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./axios.util"), exports);
18
- __exportStar(require("./queryParam.util"), exports);
@@ -1 +0,0 @@
1
- export declare function getParam(param: string): string | undefined;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getParam = void 0;
4
- function getParam(param) {
5
- if (typeof window !== 'undefined') {
6
- const searchParams = new URLSearchParams(window.location.search);
7
- return searchParams.get(param) || undefined;
8
- }
9
- }
10
- exports.getParam = getParam;
@@ -1,6 +0,0 @@
1
- import { AxiosInstance } from 'axios';
2
- import { Config } from '..';
3
- export declare abstract class AxiosFireberryAPI {
4
- protected api: AxiosInstance;
5
- constructor(config: Config);
6
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AxiosFireberryAPI = void 0;
7
- const axios_1 = __importDefault(require("axios"));
8
- class AxiosFireberryAPI {
9
- constructor(config) {
10
- var _a;
11
- const baseURL = 'https://api.fireberry.com';
12
- const tokenid = (_a = config === null || config === void 0 ? void 0 : config.tokenId) !== null && _a !== void 0 ? _a : undefined;
13
- this.api = axios_1.default.create({
14
- baseURL,
15
- headers: {
16
- 'Content-Type': 'application/json',
17
- tokenid,
18
- },
19
- withCredentials: true,
20
- });
21
- }
22
- }
23
- exports.AxiosFireberryAPI = AxiosFireberryAPI;
24
- //# sourceMappingURL=axios.util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"axios.util.js","sourceRoot":"","sources":["../../src/utils/axios.util.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA6C;AAG7C,MAAsB,iBAAiB;IAGrC,YAAY,MAAc;;QACxB,MAAM,OAAO,GAAG,2BAA2B,CAAC;QAC5C,MAAM,OAAO,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,SAAS,CAAC;QAE7C,IAAI,CAAC,GAAG,GAAG,eAAK,CAAC,MAAM,CAAC;YACtB,OAAO;YACP,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,OAAO;aACR;YACD,eAAe,EAAE,IAAI;SACtB,CAAC,CAAC;IACL,CAAC;CACF;AAhBD,8CAgBC"}
@@ -1,2 +0,0 @@
1
- export * from './axios.util';
2
- export * from './queryParam.util';
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./axios.util"), exports);
18
- __exportStar(require("./queryParam.util"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,oDAAkC"}
@@ -1 +0,0 @@
1
- export declare function getParam(param: string): string | undefined;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getParam = void 0;
4
- function getParam(param) {
5
- if (typeof window !== 'undefined') {
6
- const searchParams = new URLSearchParams(window.location.search);
7
- return searchParams.get(param) || undefined;
8
- }
9
- return undefined;
10
- }
11
- exports.getParam = getParam;
12
- //# sourceMappingURL=queryParam.util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"queryParam.util.js","sourceRoot":"","sources":["../../src/utils/queryParam.util.ts"],"names":[],"mappings":";;;AAAA,SAAgB,QAAQ,CAAC,KAAa;IACpC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAEjE,OAAO,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC;IAC9C,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAPD,4BAOC"}
package/jest.config.ts DELETED
@@ -1,10 +0,0 @@
1
- /*
2
- * For a detailed explanation regarding each configuration property and type check, visit:
3
- * https://jestjs.io/docs/configuration
4
- */
5
-
6
- export default {
7
- moduleDirectories: ['node_modules', 'src'],
8
- preset: 'ts-jest',
9
- modulePathIgnorePatterns: ['<rootDir>/dist/'],
10
- };
@@ -1,233 +0,0 @@
1
- # asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit)
2
-
3
- Minimal async jobs utility library, with streams support.
4
-
5
- [![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit)
6
- [![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit)
7
- [![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit)
8
-
9
- [![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master)
10
- [![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit)
11
- [![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit)
12
-
13
- <!-- [![Readme](https://img.shields.io/badge/readme-tested-brightgreen.svg?style=flat)](https://www.npmjs.com/package/reamde) -->
14
-
15
- AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects.
16
- Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method.
17
-
18
- It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators.
19
-
20
- | compression | size |
21
- | :----------------- | -------: |
22
- | asynckit.js | 12.34 kB |
23
- | asynckit.min.js | 4.11 kB |
24
- | asynckit.min.js.gz | 1.47 kB |
25
-
26
-
27
- ## Install
28
-
29
- ```sh
30
- $ npm install --save asynckit
31
- ```
32
-
33
- ## Examples
34
-
35
- ### Parallel Jobs
36
-
37
- Runs iterator over provided array in parallel. Stores output in the `result` array,
38
- on the matching positions. In unlikely event of an error from one of the jobs,
39
- will terminate rest of the active jobs (if abort function is provided)
40
- and return error along with salvaged data to the main callback function.
41
-
42
- #### Input Array
43
-
44
- ```javascript
45
- var parallel = require('asynckit').parallel
46
- , assert = require('assert')
47
- ;
48
-
49
- var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
50
- , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
51
- , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
52
- , target = []
53
- ;
54
-
55
- parallel(source, asyncJob, function(err, result)
56
- {
57
- assert.deepEqual(result, expectedResult);
58
- assert.deepEqual(target, expectedTarget);
59
- });
60
-
61
- // async job accepts one element from the array
62
- // and a callback function
63
- function asyncJob(item, cb)
64
- {
65
- // different delays (in ms) per item
66
- var delay = item * 25;
67
-
68
- // pretend different jobs take different time to finish
69
- // and not in consequential order
70
- var timeoutId = setTimeout(function() {
71
- target.push(item);
72
- cb(null, item * 2);
73
- }, delay);
74
-
75
- // allow to cancel "leftover" jobs upon error
76
- // return function, invoking of which will abort this job
77
- return clearTimeout.bind(null, timeoutId);
78
- }
79
- ```
80
-
81
- More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js).
82
-
83
- #### Input Object
84
-
85
- Also it supports named jobs, listed via object.
86
-
87
- ```javascript
88
- var parallel = require('asynckit/parallel')
89
- , assert = require('assert')
90
- ;
91
-
92
- var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
93
- , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
94
- , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
95
- , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ]
96
- , target = []
97
- , keys = []
98
- ;
99
-
100
- parallel(source, asyncJob, function(err, result)
101
- {
102
- assert.deepEqual(result, expectedResult);
103
- assert.deepEqual(target, expectedTarget);
104
- assert.deepEqual(keys, expectedKeys);
105
- });
106
-
107
- // supports full value, key, callback (shortcut) interface
108
- function asyncJob(item, key, cb)
109
- {
110
- // different delays (in ms) per item
111
- var delay = item * 25;
112
-
113
- // pretend different jobs take different time to finish
114
- // and not in consequential order
115
- var timeoutId = setTimeout(function() {
116
- keys.push(key);
117
- target.push(item);
118
- cb(null, item * 2);
119
- }, delay);
120
-
121
- // allow to cancel "leftover" jobs upon error
122
- // return function, invoking of which will abort this job
123
- return clearTimeout.bind(null, timeoutId);
124
- }
125
- ```
126
-
127
- More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js).
128
-
129
- ### Serial Jobs
130
-
131
- Runs iterator over provided array sequentially. Stores output in the `result` array,
132
- on the matching positions. In unlikely event of an error from one of the jobs,
133
- will not proceed to the rest of the items in the list
134
- and return error along with salvaged data to the main callback function.
135
-
136
- #### Input Array
137
-
138
- ```javascript
139
- var serial = require('asynckit/serial')
140
- , assert = require('assert')
141
- ;
142
-
143
- var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
144
- , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
145
- , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
146
- , target = []
147
- ;
148
-
149
- serial(source, asyncJob, function(err, result)
150
- {
151
- assert.deepEqual(result, expectedResult);
152
- assert.deepEqual(target, expectedTarget);
153
- });
154
-
155
- // extended interface (item, key, callback)
156
- // also supported for arrays
157
- function asyncJob(item, key, cb)
158
- {
159
- target.push(key);
160
-
161
- // it will be automatically made async
162
- // even it iterator "returns" in the same event loop
163
- cb(null, item * 2);
164
- }
165
- ```
166
-
167
- More examples could be found in [test/test-serial-array.js](test/test-serial-array.js).
168
-
169
- #### Input Object
170
-
171
- Also it supports named jobs, listed via object.
172
-
173
- ```javascript
174
- var serial = require('asynckit').serial
175
- , assert = require('assert')
176
- ;
177
-
178
- var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
179
- , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
180
- , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
181
- , target = []
182
- ;
183
-
184
- var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
185
- , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
186
- , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
187
- , target = []
188
- ;
189
-
190
-
191
- serial(source, asyncJob, function(err, result)
192
- {
193
- assert.deepEqual(result, expectedResult);
194
- assert.deepEqual(target, expectedTarget);
195
- });
196
-
197
- // shortcut interface (item, callback)
198
- // works for object as well as for the arrays
199
- function asyncJob(item, cb)
200
- {
201
- target.push(item);
202
-
203
- // it will be automatically made async
204
- // even it iterator "returns" in the same event loop
205
- cb(null, item * 2);
206
- }
207
- ```
208
-
209
- More examples could be found in [test/test-serial-object.js](test/test-serial-object.js).
210
-
211
- _Note: Since _object_ is an _unordered_ collection of properties,
212
- it may produce unexpected results with sequential iterations.
213
- Whenever order of the jobs' execution is important please use `serialOrdered` method._
214
-
215
- ### Ordered Serial Iterations
216
-
217
- TBD
218
-
219
- For example [compare-property](compare-property) package.
220
-
221
- ### Streaming interface
222
-
223
- TBD
224
-
225
- ## Want to Know More?
226
-
227
- More examples can be found in [test folder](test/).
228
-
229
- Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions.
230
-
231
- ## License
232
-
233
- AsyncKit is licensed under the MIT license.
@@ -1,76 +0,0 @@
1
- /* eslint no-console: "off" */
2
-
3
- var asynckit = require('./')
4
- , async = require('async')
5
- , assert = require('assert')
6
- , expected = 0
7
- ;
8
-
9
- var Benchmark = require('benchmark');
10
- var suite = new Benchmark.Suite;
11
-
12
- var source = [];
13
- for (var z = 1; z < 100; z++)
14
- {
15
- source.push(z);
16
- expected += z;
17
- }
18
-
19
- suite
20
- // add tests
21
-
22
- .add('async.map', function(deferred)
23
- {
24
- var total = 0;
25
-
26
- async.map(source,
27
- function(i, cb)
28
- {
29
- setImmediate(function()
30
- {
31
- total += i;
32
- cb(null, total);
33
- });
34
- },
35
- function(err, result)
36
- {
37
- assert.ifError(err);
38
- assert.equal(result[result.length - 1], expected);
39
- deferred.resolve();
40
- });
41
- }, {'defer': true})
42
-
43
-
44
- .add('asynckit.parallel', function(deferred)
45
- {
46
- var total = 0;
47
-
48
- asynckit.parallel(source,
49
- function(i, cb)
50
- {
51
- setImmediate(function()
52
- {
53
- total += i;
54
- cb(null, total);
55
- });
56
- },
57
- function(err, result)
58
- {
59
- assert.ifError(err);
60
- assert.equal(result[result.length - 1], expected);
61
- deferred.resolve();
62
- });
63
- }, {'defer': true})
64
-
65
-
66
- // add listeners
67
- .on('cycle', function(ev)
68
- {
69
- console.log(String(ev.target));
70
- })
71
- .on('complete', function()
72
- {
73
- console.log('Fastest is ' + this.filter('fastest').map('name'));
74
- })
75
- // run async
76
- .run({ 'async': true });
@@ -1,6 +0,0 @@
1
- module.exports =
2
- {
3
- parallel : require('./parallel.js'),
4
- serial : require('./serial.js'),
5
- serialOrdered : require('./serialOrdered.js')
6
- };
@@ -1,29 +0,0 @@
1
- // API
2
- module.exports = abort;
3
-
4
- /**
5
- * Aborts leftover active jobs
6
- *
7
- * @param {object} state - current state object
8
- */
9
- function abort(state)
10
- {
11
- Object.keys(state.jobs).forEach(clean.bind(state));
12
-
13
- // reset leftover jobs
14
- state.jobs = {};
15
- }
16
-
17
- /**
18
- * Cleans up leftover job by invoking abort function for the provided job id
19
- *
20
- * @this state
21
- * @param {string|number} key - job id to abort
22
- */
23
- function clean(key)
24
- {
25
- if (typeof this.jobs[key] == 'function')
26
- {
27
- this.jobs[key]();
28
- }
29
- }
@@ -1,34 +0,0 @@
1
- var defer = require('./defer.js');
2
-
3
- // API
4
- module.exports = async;
5
-
6
- /**
7
- * Runs provided callback asynchronously
8
- * even if callback itself is not
9
- *
10
- * @param {function} callback - callback to invoke
11
- * @returns {function} - augmented callback
12
- */
13
- function async(callback)
14
- {
15
- var isAsync = false;
16
-
17
- // check if async happened
18
- defer(function() { isAsync = true; });
19
-
20
- return function async_callback(err, result)
21
- {
22
- if (isAsync)
23
- {
24
- callback(err, result);
25
- }
26
- else
27
- {
28
- defer(function nextTick_callback()
29
- {
30
- callback(err, result);
31
- });
32
- }
33
- };
34
- }
@@ -1,26 +0,0 @@
1
- module.exports = defer;
2
-
3
- /**
4
- * Runs provided function on next iteration of the event loop
5
- *
6
- * @param {function} fn - function to run
7
- */
8
- function defer(fn)
9
- {
10
- var nextTick = typeof setImmediate == 'function'
11
- ? setImmediate
12
- : (
13
- typeof process == 'object' && typeof process.nextTick == 'function'
14
- ? process.nextTick
15
- : null
16
- );
17
-
18
- if (nextTick)
19
- {
20
- nextTick(fn);
21
- }
22
- else
23
- {
24
- setTimeout(fn, 0);
25
- }
26
- }
@@ -1,75 +0,0 @@
1
- var async = require('./async.js')
2
- , abort = require('./abort.js')
3
- ;
4
-
5
- // API
6
- module.exports = iterate;
7
-
8
- /**
9
- * Iterates over each job object
10
- *
11
- * @param {array|object} list - array or object (named list) to iterate over
12
- * @param {function} iterator - iterator to run
13
- * @param {object} state - current job status
14
- * @param {function} callback - invoked when all elements processed
15
- */
16
- function iterate(list, iterator, state, callback)
17
- {
18
- // store current index
19
- var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
20
-
21
- state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
22
- {
23
- // don't repeat yourself
24
- // skip secondary callbacks
25
- if (!(key in state.jobs))
26
- {
27
- return;
28
- }
29
-
30
- // clean up jobs
31
- delete state.jobs[key];
32
-
33
- if (error)
34
- {
35
- // don't process rest of the results
36
- // stop still active jobs
37
- // and reset the list
38
- abort(state);
39
- }
40
- else
41
- {
42
- state.results[key] = output;
43
- }
44
-
45
- // return salvaged results
46
- callback(error, state.results);
47
- });
48
- }
49
-
50
- /**
51
- * Runs iterator over provided job element
52
- *
53
- * @param {function} iterator - iterator to invoke
54
- * @param {string|number} key - key/index of the element in the list of jobs
55
- * @param {mixed} item - job description
56
- * @param {function} callback - invoked after iterator is done with the job
57
- * @returns {function|mixed} - job abort function or something else
58
- */
59
- function runJob(iterator, key, item, callback)
60
- {
61
- var aborter;
62
-
63
- // allow shortcut if iterator expects only two arguments
64
- if (iterator.length == 2)
65
- {
66
- aborter = iterator(item, async(callback));
67
- }
68
- // otherwise go with full three arguments
69
- else
70
- {
71
- aborter = iterator(item, key, async(callback));
72
- }
73
-
74
- return aborter;
75
- }