@fireberry/sdk 0.0.4 → 0.0.6

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 (276) hide show
  1. package/{node_modules/asynckit/LICENSE → LICENSE.md} +2 -2
  2. package/README.md +136 -37
  3. package/dist/cjs/constants/index.d.ts +18 -0
  4. package/dist/cjs/constants/index.d.ts.map +1 -0
  5. package/dist/cjs/constants/index.js +21 -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 +32 -0
  15. package/dist/cjs/fireberrySDK.client.d.ts.map +1 -0
  16. package/dist/cjs/fireberrySDK.client.js +102 -0
  17. package/dist/cjs/fireberrySDK.client.js.map +1 -0
  18. package/dist/cjs/iframeMessageManager.d.ts +13 -0
  19. package/dist/cjs/iframeMessageManager.d.ts.map +1 -0
  20. package/dist/cjs/iframeMessageManager.js +88 -0
  21. package/dist/cjs/iframeMessageManager.js.map +1 -0
  22. package/dist/cjs/types/index.d.ts +86 -0
  23. package/dist/cjs/types/index.d.ts.map +1 -0
  24. package/dist/{fireberryAPI/types.js → cjs/types/index.js} +1 -1
  25. package/dist/cjs/types/index.js.map +1 -0
  26. package/dist/esm/constants/index.d.ts +18 -0
  27. package/dist/esm/constants/index.d.ts.map +1 -0
  28. package/dist/esm/constants/index.js +18 -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 +32 -0
  39. package/dist/esm/fireberrySDK.client.d.ts.map +1 -0
  40. package/dist/esm/fireberrySDK.client.js +98 -0
  41. package/dist/esm/fireberrySDK.client.js.map +1 -0
  42. package/dist/esm/iframeMessageManager.d.ts +13 -0
  43. package/dist/esm/iframeMessageManager.d.ts.map +1 -0
  44. package/dist/esm/iframeMessageManager.js +84 -0
  45. package/dist/esm/iframeMessageManager.js.map +1 -0
  46. package/dist/esm/types/index.d.ts +86 -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 +54 -27
  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.map +0 -1
  85. package/dist/fireberrySDK.client.d.ts +0 -5
  86. package/dist/fireberrySDK.client.js +0 -13
  87. package/dist/fireberrySDK.client.js.map +0 -1
  88. package/dist/fireberrySDK.server.d.ts +0 -6
  89. package/dist/fireberrySDK.server.js +0 -12
  90. package/dist/fireberrySDK.server.js.map +0 -1
  91. package/dist/index.d.ts +0 -6
  92. package/dist/index.js +0 -25
  93. package/dist/index.js.map +0 -1
  94. package/dist/utils/axios.util.d.ts +0 -6
  95. package/dist/utils/axios.util.js +0 -24
  96. package/dist/utils/axios.util.js.map +0 -1
  97. package/dist/utils/index.d.ts +0 -2
  98. package/dist/utils/index.js +0 -19
  99. package/dist/utils/index.js.map +0 -1
  100. package/dist/utils/queryParam.util.d.ts +0 -1
  101. package/dist/utils/queryParam.util.js +0 -12
  102. package/dist/utils/queryParam.util.js.map +0 -1
  103. package/jest.config.ts +0 -10
  104. package/node_modules/asynckit/README.md +0 -233
  105. package/node_modules/asynckit/bench.js +0 -76
  106. package/node_modules/asynckit/index.js +0 -6
  107. package/node_modules/asynckit/lib/abort.js +0 -29
  108. package/node_modules/asynckit/lib/async.js +0 -34
  109. package/node_modules/asynckit/lib/defer.js +0 -26
  110. package/node_modules/asynckit/lib/iterate.js +0 -75
  111. package/node_modules/asynckit/lib/readable_asynckit.js +0 -91
  112. package/node_modules/asynckit/lib/readable_parallel.js +0 -25
  113. package/node_modules/asynckit/lib/readable_serial.js +0 -25
  114. package/node_modules/asynckit/lib/readable_serial_ordered.js +0 -29
  115. package/node_modules/asynckit/lib/state.js +0 -37
  116. package/node_modules/asynckit/lib/streamify.js +0 -141
  117. package/node_modules/asynckit/lib/terminator.js +0 -29
  118. package/node_modules/asynckit/package.json +0 -63
  119. package/node_modules/asynckit/parallel.js +0 -43
  120. package/node_modules/asynckit/serial.js +0 -17
  121. package/node_modules/asynckit/serialOrdered.js +0 -75
  122. package/node_modules/asynckit/stream.js +0 -21
  123. package/node_modules/axios/CHANGELOG.md +0 -874
  124. package/node_modules/axios/LICENSE +0 -7
  125. package/node_modules/axios/MIGRATION_GUIDE.md +0 -3
  126. package/node_modules/axios/README.md +0 -1650
  127. package/node_modules/axios/SECURITY.md +0 -6
  128. package/node_modules/axios/dist/axios.js +0 -3448
  129. package/node_modules/axios/dist/axios.js.map +0 -1
  130. package/node_modules/axios/dist/axios.min.js +0 -2
  131. package/node_modules/axios/dist/axios.min.js.map +0 -1
  132. package/node_modules/axios/dist/browser/axios.cjs +0 -3258
  133. package/node_modules/axios/dist/browser/axios.cjs.map +0 -1
  134. package/node_modules/axios/dist/esm/axios.js +0 -3281
  135. package/node_modules/axios/dist/esm/axios.js.map +0 -1
  136. package/node_modules/axios/dist/esm/axios.min.js +0 -2
  137. package/node_modules/axios/dist/esm/axios.min.js.map +0 -1
  138. package/node_modules/axios/dist/node/axios.cjs +0 -4354
  139. package/node_modules/axios/dist/node/axios.cjs.map +0 -1
  140. package/node_modules/axios/index.d.cts +0 -542
  141. package/node_modules/axios/index.d.ts +0 -559
  142. package/node_modules/axios/index.js +0 -43
  143. package/node_modules/axios/lib/adapters/README.md +0 -37
  144. package/node_modules/axios/lib/adapters/adapters.js +0 -77
  145. package/node_modules/axios/lib/adapters/http.js +0 -685
  146. package/node_modules/axios/lib/adapters/xhr.js +0 -260
  147. package/node_modules/axios/lib/axios.js +0 -89
  148. package/node_modules/axios/lib/cancel/CancelToken.js +0 -121
  149. package/node_modules/axios/lib/cancel/CanceledError.js +0 -25
  150. package/node_modules/axios/lib/cancel/isCancel.js +0 -5
  151. package/node_modules/axios/lib/core/Axios.js +0 -225
  152. package/node_modules/axios/lib/core/AxiosError.js +0 -100
  153. package/node_modules/axios/lib/core/AxiosHeaders.js +0 -298
  154. package/node_modules/axios/lib/core/InterceptorManager.js +0 -71
  155. package/node_modules/axios/lib/core/README.md +0 -8
  156. package/node_modules/axios/lib/core/buildFullPath.js +0 -21
  157. package/node_modules/axios/lib/core/dispatchRequest.js +0 -81
  158. package/node_modules/axios/lib/core/mergeConfig.js +0 -106
  159. package/node_modules/axios/lib/core/settle.js +0 -27
  160. package/node_modules/axios/lib/core/transformData.js +0 -28
  161. package/node_modules/axios/lib/defaults/index.js +0 -156
  162. package/node_modules/axios/lib/defaults/transitional.js +0 -7
  163. package/node_modules/axios/lib/env/README.md +0 -3
  164. package/node_modules/axios/lib/env/classes/FormData.js +0 -2
  165. package/node_modules/axios/lib/env/data.js +0 -1
  166. package/node_modules/axios/lib/helpers/AxiosTransformStream.js +0 -191
  167. package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -58
  168. package/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -71
  169. package/node_modules/axios/lib/helpers/README.md +0 -7
  170. package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +0 -28
  171. package/node_modules/axios/lib/helpers/bind.js +0 -7
  172. package/node_modules/axios/lib/helpers/buildURL.js +0 -63
  173. package/node_modules/axios/lib/helpers/callbackify.js +0 -16
  174. package/node_modules/axios/lib/helpers/combineURLs.js +0 -15
  175. package/node_modules/axios/lib/helpers/cookies.js +0 -42
  176. package/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -26
  177. package/node_modules/axios/lib/helpers/formDataToJSON.js +0 -95
  178. package/node_modules/axios/lib/helpers/formDataToStream.js +0 -111
  179. package/node_modules/axios/lib/helpers/fromDataURI.js +0 -53
  180. package/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -15
  181. package/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
  182. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -67
  183. package/node_modules/axios/lib/helpers/null.js +0 -2
  184. package/node_modules/axios/lib/helpers/parseHeaders.js +0 -55
  185. package/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
  186. package/node_modules/axios/lib/helpers/readBlob.js +0 -15
  187. package/node_modules/axios/lib/helpers/speedometer.js +0 -55
  188. package/node_modules/axios/lib/helpers/spread.js +0 -28
  189. package/node_modules/axios/lib/helpers/throttle.js +0 -33
  190. package/node_modules/axios/lib/helpers/toFormData.js +0 -219
  191. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -18
  192. package/node_modules/axios/lib/helpers/validator.js +0 -91
  193. package/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
  194. package/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
  195. package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -4
  196. package/node_modules/axios/lib/platform/browser/index.js +0 -13
  197. package/node_modules/axios/lib/platform/common/utils.js +0 -47
  198. package/node_modules/axios/lib/platform/index.js +0 -7
  199. package/node_modules/axios/lib/platform/node/classes/FormData.js +0 -3
  200. package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +0 -4
  201. package/node_modules/axios/lib/platform/node/index.js +0 -12
  202. package/node_modules/axios/lib/utils.js +0 -723
  203. package/node_modules/axios/package.json +0 -218
  204. package/node_modules/combined-stream/License +0 -19
  205. package/node_modules/combined-stream/Readme.md +0 -138
  206. package/node_modules/combined-stream/lib/combined_stream.js +0 -208
  207. package/node_modules/combined-stream/package.json +0 -25
  208. package/node_modules/delayed-stream/.npmignore +0 -1
  209. package/node_modules/delayed-stream/License +0 -19
  210. package/node_modules/delayed-stream/Makefile +0 -7
  211. package/node_modules/delayed-stream/Readme.md +0 -141
  212. package/node_modules/delayed-stream/lib/delayed_stream.js +0 -107
  213. package/node_modules/delayed-stream/package.json +0 -27
  214. package/node_modules/dotenv/CHANGELOG.md +0 -475
  215. package/node_modules/dotenv/LICENSE +0 -23
  216. package/node_modules/dotenv/README-es.md +0 -448
  217. package/node_modules/dotenv/README.md +0 -728
  218. package/node_modules/dotenv/config.d.ts +0 -1
  219. package/node_modules/dotenv/config.js +0 -9
  220. package/node_modules/dotenv/lib/cli-options.js +0 -11
  221. package/node_modules/dotenv/lib/env-options.js +0 -24
  222. package/node_modules/dotenv/lib/main.d.ts +0 -153
  223. package/node_modules/dotenv/lib/main.js +0 -361
  224. package/node_modules/dotenv/package.json +0 -65
  225. package/node_modules/follow-redirects/LICENSE +0 -18
  226. package/node_modules/follow-redirects/README.md +0 -155
  227. package/node_modules/follow-redirects/debug.js +0 -15
  228. package/node_modules/follow-redirects/http.js +0 -1
  229. package/node_modules/follow-redirects/https.js +0 -1
  230. package/node_modules/follow-redirects/index.js +0 -672
  231. package/node_modules/follow-redirects/package.json +0 -58
  232. package/node_modules/form-data/License +0 -19
  233. package/node_modules/form-data/README.md.bak +0 -358
  234. package/node_modules/form-data/Readme.md +0 -358
  235. package/node_modules/form-data/index.d.ts +0 -62
  236. package/node_modules/form-data/lib/browser.js +0 -2
  237. package/node_modules/form-data/lib/form_data.js +0 -501
  238. package/node_modules/form-data/lib/populate.js +0 -10
  239. package/node_modules/form-data/package.json +0 -68
  240. package/node_modules/mime-db/HISTORY.md +0 -507
  241. package/node_modules/mime-db/LICENSE +0 -23
  242. package/node_modules/mime-db/README.md +0 -100
  243. package/node_modules/mime-db/db.json +0 -8519
  244. package/node_modules/mime-db/index.js +0 -12
  245. package/node_modules/mime-db/package.json +0 -60
  246. package/node_modules/mime-types/HISTORY.md +0 -397
  247. package/node_modules/mime-types/LICENSE +0 -23
  248. package/node_modules/mime-types/README.md +0 -113
  249. package/node_modules/mime-types/index.js +0 -188
  250. package/node_modules/mime-types/package.json +0 -44
  251. package/node_modules/proxy-from-env/.eslintrc +0 -29
  252. package/node_modules/proxy-from-env/.travis.yml +0 -10
  253. package/node_modules/proxy-from-env/LICENSE +0 -20
  254. package/node_modules/proxy-from-env/README.md +0 -131
  255. package/node_modules/proxy-from-env/index.js +0 -108
  256. package/node_modules/proxy-from-env/package.json +0 -34
  257. package/node_modules/proxy-from-env/test.js +0 -483
  258. package/src/base.fireberrySDK.ts +0 -7
  259. package/src/context/context.record.test.ts +0 -47
  260. package/src/context/context.ts +0 -28
  261. package/src/context/index.ts +0 -6
  262. package/src/context/record.ts +0 -22
  263. package/src/context/user.ts +0 -15
  264. package/src/fireberry.sdk.ts +0 -14
  265. package/src/fireberryAPI/fireberryV2Api.test.ts +0 -57
  266. package/src/fireberryAPI/fireberryV2Api.ts +0 -61
  267. package/src/fireberryAPI/index.ts +0 -2
  268. package/src/fireberryAPI/types.ts +0 -10
  269. package/src/fireberrySDK.client.ts +0 -10
  270. package/src/fireberrySDK.server.ts +0 -8
  271. package/src/index.ts +0 -9
  272. package/src/utils/axios.util.ts +0 -20
  273. package/src/utils/index.ts +0 -2
  274. package/src/utils/queryParam.util.ts +0 -8
  275. package/tsconfig.json +0 -123
  276. /package/dist/{context → cjs/context}/index.js +0 -0
@@ -1,13 +0,0 @@
1
- import { FireberryV2Api } from '../fireberryAPI';
2
- import { RecordContext } from './record';
3
- import { UserContext } from './user';
4
- export declare class Context {
5
- recordId?: string;
6
- recordType?: number;
7
- user: UserContext;
8
- record: RecordContext;
9
- constructor(fireberryApi: FireberryV2Api, recordDetails?: {
10
- recordId: string;
11
- recordType: number;
12
- });
13
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Context = void 0;
4
- const utils_1 = require("../utils");
5
- const record_1 = require("./record");
6
- const user_1 = require("./user");
7
- class Context {
8
- constructor(fireberryApi, recordDetails) {
9
- const recordId = (0, utils_1.getParam)('recordId');
10
- const recordTypeParam = (0, utils_1.getParam)('recordType');
11
- const recordType = recordTypeParam ? parseInt(recordTypeParam) : undefined;
12
- this.recordId = recordId;
13
- this.recordType = recordType;
14
- this.user = new user_1.UserContext();
15
- this.record = new record_1.RecordContext(fireberryApi, {
16
- recordId: recordId || (recordDetails === null || recordDetails === void 0 ? void 0 : recordDetails.recordId),
17
- recordType: recordType || (recordDetails === null || recordDetails === void 0 ? void 0 : recordDetails.recordType),
18
- });
19
- }
20
- }
21
- exports.Context = Context;
22
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context/context.ts"],"names":[],"mappings":";;;AACA,oCAAoC;AACpC,qCAAyC;AACzC,iCAAqC;AAErC,MAAa,OAAO;IAMlB,YACE,YAA4B,EAC5B,aAAwD;QAExD,MAAM,QAAQ,GAAG,IAAA,gBAAQ,EAAC,UAAU,CAAC,CAAC;QACtC,MAAM,eAAe,GAAG,IAAA,gBAAQ,EAAC,YAAY,CAAC,CAAC;QAC/C,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAE3E,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,kBAAW,EAAkB,CAAC;QAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,sBAAa,CAAC,YAAY,EAAE;YAC5C,QAAQ,EAAE,QAAQ,KAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,CAAA;YAC7C,UAAU,EAAE,UAAU,KAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,UAAU,CAAA;SACpD,CAAC,CAAC;IACL,CAAC;CACF;AAtBD,0BAsBC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,45 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const jsdom_1 = require("jsdom");
16
- const __1 = __importDefault(require("../"));
17
- describe('SDK context', () => {
18
- it('context is undefined when not in browser', () => __awaiter(void 0, void 0, void 0, function* () {
19
- const fireberry = (0, __1.default)();
20
- expect(fireberry.context).toBeUndefined;
21
- }));
22
- it('retrieved a record', () => __awaiter(void 0, void 0, void 0, function* () {
23
- var _a, _b;
24
- const dom = new jsdom_1.JSDOM('<!DOCTYPE html><html><head></head><body></body></html>', {
25
- url: 'http://localhost?recordId=123&recordType=1&tokenId=123',
26
- });
27
- global.window = dom.window;
28
- global.window.parent = dom.window;
29
- global.document = dom.window.document;
30
- global.window.location = dom.window.location;
31
- const customFieldName = 'pcfSystemField123';
32
- const extendCustomObject = { [customFieldName]: 'test' };
33
- const fireberry = (0, __1.default)();
34
- const record = Object.assign({ createdBy: 'test', createdByName: 'test', createdOn: new Date(), modifiedBy: 'test', modifiedByName: 'test', modifiedOn: new Date(), ownerId: 'test', ownerName: 'test' }, extendCustomObject);
35
- const mockAddListener = jest.spyOn(fireberry.api, 'get');
36
- mockAddListener.mockImplementation((_recordType, _recordId) => __awaiter(void 0, void 0, void 0, function* () {
37
- return record;
38
- }));
39
- const specificFieldValue = yield ((_a = fireberry.context) === null || _a === void 0 ? void 0 : _a.record.get(customFieldName));
40
- expect(specificFieldValue).toBe(extendCustomObject[customFieldName]);
41
- const recordResult = yield ((_b = fireberry.context) === null || _b === void 0 ? void 0 : _b.record.all());
42
- expect(recordResult).toBe(record);
43
- }));
44
- });
45
- //# sourceMappingURL=context.record.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.record.test.js","sourceRoot":"","sources":["../../src/context/context.record.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iCAA8B;AAC9B,4CAA+B;AAE/B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,0CAA0C,EAAE,GAAS,EAAE;QACxD,MAAM,SAAS,GAAG,IAAA,WAAY,GAAE,CAAC;QAEjC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC;IAC1C,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,oBAAoB,EAAE,GAAS,EAAE;;QAClC,MAAM,GAAG,GAAG,IAAI,aAAK,CAAC,wDAAwD,EAAE;YAC9E,GAAG,EAAE,wDAAwD;SAC9D,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,MAAa,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,MAAa,CAAC;QACzC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtC,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;QAE7C,MAAM,eAAe,GAAG,mBAAmB,CAAC;QAC5C,MAAM,kBAAkB,GAAG,EAAE,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QACzD,MAAM,SAAS,GAAG,IAAA,WAAY,GAAE,CAAC;QAEjC,MAAM,MAAM,mBACV,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,IAAI,IAAI,EAAE,EACrB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,IAAI,IAAI,EAAE,EACtB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,IACd,kBAAkB,CACtB,CAAC;QAEF,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzD,eAAe,CAAC,kBAAkB,CAAC,CAAO,WAAmB,EAAE,SAAiB,EAAE,EAAE;YAClF,OAAO,MAAM,CAAC;QAChB,CAAC,CAAA,CAAC,CAAC;QAEH,MAAM,kBAAkB,GAAG,MAAM,CAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA,CAAC;QAChF,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC;QAErE,MAAM,YAAY,GAAG,MAAM,CAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,MAAM,CAAC,GAAG,EAAE,CAAA,CAAC;QAC3D,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export * from './context';
2
- export type CurrentRecordDetails = Partial<{
3
- recordType: number;
4
- recordId: string;
5
- }>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B"}
@@ -1,9 +0,0 @@
1
- import { CurrentRecordDetails } from '.';
2
- import { BusinessObject, FireberryV2Api } from '../fireberryAPI';
3
- export declare class RecordContext {
4
- private fireberryApi;
5
- private currentRecord;
6
- constructor(fireberryApi: FireberryV2Api, currentRecord: CurrentRecordDetails);
7
- get(fieldName: string): Promise<any>;
8
- all(): Promise<BusinessObject & any>;
9
- }
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.RecordContext = void 0;
13
- class RecordContext {
14
- constructor(fireberryApi, currentRecord) {
15
- this.fireberryApi = fireberryApi;
16
- this.currentRecord = currentRecord;
17
- }
18
- get(fieldName) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- return (yield this.all())[fieldName];
21
- });
22
- }
23
- all() {
24
- return __awaiter(this, void 0, void 0, function* () {
25
- if (!this.currentRecord.recordId || !this.currentRecord.recordType) {
26
- throw new Error('Record context is not set. Please set the recordId and recordType before calling this method.');
27
- }
28
- return yield this.fireberryApi.get(this.currentRecord.recordType, this.currentRecord.recordId);
29
- });
30
- }
31
- }
32
- exports.RecordContext = RecordContext;
33
- //# sourceMappingURL=record.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/context/record.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAa,aAAa;IACxB,YACU,YAA4B,EAC5B,aAAmC;QADnC,iBAAY,GAAZ,YAAY,CAAgB;QAC5B,kBAAa,GAAb,aAAa,CAAsB;IAC1C,CAAC;IAEE,GAAG,CAAC,SAAiB;;YACzB,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;QACvC,CAAC;KAAA;IAEK,GAAG;;YACP,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;gBACnE,MAAM,IAAI,KAAK,CACb,+FAA+F,CAChG,CAAC;YACJ,CAAC;YACD,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QACjG,CAAC;KAAA;CACF;AAlBD,sCAkBC"}
@@ -1,5 +0,0 @@
1
- export declare class UserContext {
2
- constructor();
3
- get(_fieldName: string): Promise<void>;
4
- all(): Promise<void>;
5
- }
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.UserContext = void 0;
13
- class UserContext {
14
- constructor() { }
15
- get(_fieldName) {
16
- return __awaiter(this, void 0, void 0, function* () {
17
- throw new Error('Not implemented');
18
- });
19
- }
20
- all() {
21
- return __awaiter(this, void 0, void 0, function* () {
22
- throw new Error('Not implemented');
23
- });
24
- }
25
- }
26
- exports.UserContext = UserContext;
27
- //# sourceMappingURL=user.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/context/user.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,MAAa,WAAW;IAEtB,gBAAuD,CAAC;IAGlD,GAAG,CAAC,UAAkB;;YAC1B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACrC,CAAC;KAAA;IAEK,GAAG;;YACP,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACrC,CAAC;KAAA;CACF;AAZD,kCAYC"}
@@ -1,4 +0,0 @@
1
- import { FireberryClientSDK } from './fireberrySDK.client';
2
- import { FireberryServerSDK } from './fireberrySDK.server';
3
- declare const _default: () => FireberryClientSDK | FireberryServerSDK;
4
- export default _default;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const fireberryAPI_1 = require("./fireberryAPI");
4
- const fireberrySDK_client_1 = require("./fireberrySDK.client");
5
- const fireberrySDK_server_1 = require("./fireberrySDK.server");
6
- const utils_1 = require("./utils");
7
- exports.default = () => {
8
- const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
9
- const tokenId = (0, utils_1.getParam)('tokenId');
10
- const api = new fireberryAPI_1.FireberryV2Api({ tokenId });
11
- return isBrowser ? new fireberrySDK_client_1.FireberryClientSDK(api) : new fireberrySDK_server_1.FireberryServerSDK(api);
12
- };
13
- //# sourceMappingURL=fireberry.sdk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fireberry.sdk.js","sourceRoot":"","sources":["../src/fireberry.sdk.ts"],"names":[],"mappings":";;AAAA,iDAAgD;AAChD,+DAA2D;AAC3D,+DAA2D;AAC3D,mCAAmC;AAEnC,kBAAe,GAAG,EAAE;IAClB,MAAM,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,WAAW,CAAC;IAE1F,MAAM,OAAO,GAAG,IAAA,gBAAQ,EAAC,SAAS,CAAC,CAAC;IAEpC,MAAM,GAAG,GAAG,IAAI,6BAAc,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAE5C,OAAO,SAAS,CAAC,CAAC,CAAC,IAAI,wCAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,wCAAkB,CAAC,GAAG,CAAC,CAAC;AAC/E,CAAC,CAAC"}
@@ -1,17 +0,0 @@
1
- import { Config } from '..';
2
- import { AxiosFireberryAPI } from '../utils';
3
- import { BusinessObject } from './types';
4
- export declare class FireberryV2Api extends AxiosFireberryAPI {
5
- constructor(config: Config);
6
- create<TReq, TRes extends TReq & BusinessObject>(recordType: number, data: TReq): Promise<{
7
- _id: string;
8
- } & TRes>;
9
- update<TReq, TRes extends TReq & BusinessObject>(recordType: number, id: string, data: Record<string, any>): Promise<TRes & {
10
- _id: string;
11
- }>;
12
- delete(recordType: number, id: string): Promise<{
13
- success: boolean;
14
- }>;
15
- get<T extends BusinessObject>(recordType: number, recordId: string): Promise<T>;
16
- query(fields: string[], recordType: number, query: string, shouldShowRealValues?: boolean): Promise<import("axios").AxiosResponse<any, any>>;
17
- }
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.FireberryV2Api = void 0;
13
- const utils_1 = require("../utils");
14
- class FireberryV2Api extends utils_1.AxiosFireberryAPI {
15
- constructor(config) {
16
- super(config);
17
- }
18
- create(recordType, data) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- const newRecord = yield this.api.post(`api/v2/record/${recordType}`, data);
21
- const { _id, record } = newRecord.data;
22
- return Object.assign({ _id }, record);
23
- });
24
- }
25
- update(recordType, id, data) {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- const updatedRecord = yield this.api.put(`api/v2/record/${recordType}/${id}`, data);
28
- return Object.assign(Object.assign({}, updatedRecord.data.record), { _id: id });
29
- });
30
- }
31
- delete(recordType, id) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return (yield this.api.delete(`api/record/${recordType}/${id}`)).data;
34
- });
35
- }
36
- get(recordType, recordId) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- return (yield this.api.get(`/api/v2/record/${recordType}/${recordId}/getrecord`)).data;
39
- });
40
- }
41
- query(fields_1, recordType_1, query_1) {
42
- return __awaiter(this, arguments, void 0, function* (fields, recordType, query, shouldShowRealValues = false) {
43
- const payload = {
44
- recordType: recordType,
45
- fields,
46
- query,
47
- show_real_value: shouldShowRealValues ? 1 : 0,
48
- };
49
- return yield this.api.post('/api/query', payload);
50
- });
51
- }
52
- }
53
- exports.FireberryV2Api = FireberryV2Api;
54
- //# sourceMappingURL=fireberryV2Api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fireberryV2Api.js","sourceRoot":"","sources":["../../src/fireberryAPI/fireberryV2Api.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,oCAA6C;AAG7C,MAAa,cAAe,SAAQ,yBAAiB;IACnD,YAAY,MAAc;QACxB,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IASK,MAAM,CAA2C,UAAkB,EAAE,IAAU;;YACnF,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CACnC,iBAAiB,UAAU,EAAE,EAC7B,IAAI,CACL,CAAC;YACF,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC;YACvC,uBAAS,GAAG,IAAK,MAAM,EAAG;QAC5B,CAAC;KAAA;IAEK,MAAM,CACV,UAAkB,EAClB,EAAU,EACV,IAAyB;;YAEzB,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CACtC,iBAAiB,UAAU,IAAI,EAAE,EAAE,EACnC,IAAI,CACL,CAAC;YACF,uCAAY,aAAa,CAAC,IAAI,CAAC,MAAM,KAAE,GAAG,EAAE,EAAE,IAAG;QACnD,CAAC;KAAA;IAEK,MAAM,CAAC,UAAkB,EAAE,EAAU;;YACzC,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAuB,cAAc,UAAU,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9F,CAAC;KAAA;IAQK,GAAG,CAA2B,UAAkB,EAAE,QAAgB;;YACtE,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAI,kBAAkB,UAAU,IAAI,QAAQ,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5F,CAAC;KAAA;IAEK,KAAK;6DAAC,MAAgB,EAAE,UAAkB,EAAE,KAAa,EAAE,oBAAoB,GAAG,KAAK;YAC3F,MAAM,OAAO,GAAG;gBACd,UAAU,EAAE,UAAU;gBACtB,MAAM;gBACN,KAAK;gBACL,eAAe,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAC9C,CAAC;YACF,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC;KAAA;CACF;AAxDD,wCAwDC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,56 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const dotenv_1 = require("dotenv");
16
- const jsdom_1 = require("jsdom");
17
- const __1 = __importDefault(require("../"));
18
- describe('api', () => {
19
- beforeAll(() => {
20
- (0, dotenv_1.configDotenv)({ path: '.env.test' });
21
- const dom = new jsdom_1.JSDOM('<!DOCTYPE html><html><head></head><body></body></html>', {
22
- url: `http://localhost?recordId=123&recordType=1&tokenId=${process.env.TEST_TOKEN_ID}`,
23
- });
24
- global.window = dom.window;
25
- global.window.parent = dom.window;
26
- global.document = dom.window.document;
27
- global.window.location = dom.window.location;
28
- });
29
- it('should create a new record, get it, update it and delete it', () => __awaiter(void 0, void 0, void 0, function* () {
30
- const recordType = 1;
31
- const fireberry = (0, __1.default)();
32
- const newRecordData = {
33
- accountname: `sdk Test ${new Date().toISOString()}`,
34
- accountnumber: '123456',
35
- };
36
- const newRecordCreated = yield fireberry.api.create(recordType, newRecordData);
37
- const id = newRecordCreated._id;
38
- const fieldWithDefaultValue = newRecordCreated.pcfsystemfield106;
39
- expect(newRecordCreated).toMatchObject(newRecordData);
40
- expect(fieldWithDefaultValue).toBe('Default Test Value');
41
- const newRecordRetrieved = yield fireberry.api.get(recordType, id);
42
- expect(newRecordRetrieved).toMatchObject(newRecordData);
43
- const updatePayload = {
44
- telephone1: '050000000',
45
- emailaddress1: 'example@email.com',
46
- parentaccountid: 'B6B99205-112D-48F5-A6FA-4E8F649A1F14',
47
- };
48
- const updatedRecord = yield fireberry.api.update(recordType, id, updatePayload);
49
- expect(updatedRecord).toMatchObject(Object.assign(Object.assign({}, newRecordData), updatePayload));
50
- expect(updatedRecord._id).toBe(id);
51
- yield fireberry.api.delete(recordType, id);
52
- const deletedRecordRetrieved = yield fireberry.api.get(recordType, id);
53
- expect(deletedRecordRetrieved).toBeNull();
54
- }));
55
- });
56
- //# sourceMappingURL=fireberryV2Api.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fireberryV2Api.test.js","sourceRoot":"","sources":["../../src/fireberryAPI/fireberryV2Api.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mCAAsC;AACtC,iCAA8B;AAC9B,4CAA+B;AAG/B,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;IACnB,SAAS,CAAC,GAAG,EAAE;QACb,IAAA,qBAAY,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;QACpC,MAAM,GAAG,GAAG,IAAI,aAAK,CAAC,wDAAwD,EAAE;YAC9E,GAAG,EAAE,sDAAsD,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE;SACvF,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,MAAa,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,MAAa,CAAC;QACzC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtC,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE,GAAS,EAAE;QAC3E,MAAM,UAAU,GAAG,CAAC,CAAC;QACrB,MAAM,SAAS,GAAG,IAAA,WAAY,GAAE,CAAC;QAEjC,MAAM,aAAa,GAAG;YACpB,WAAW,EAAE,YAAY,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE;YACnD,aAAa,EAAE,QAAQ;SACxB,CAAC;QAEF,MAAM,gBAAgB,GAAG,MAAM,SAAS,CAAC,GAAG,CAAC,MAAM,CAGjD,UAAU,EAAE,aAAa,CAAC,CAAC;QAE7B,MAAM,EAAE,GAAG,gBAAgB,CAAC,GAAG,CAAC;QAChC,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,iBAAiB,CAAC;QAEjE,MAAM,CAAC,gBAAgB,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QACtD,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QAEzD,MAAM,kBAAkB,GAAG,MAAM,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACnE,MAAM,CAAC,kBAAkB,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAExD,MAAM,aAAa,GAAG;YACpB,UAAU,EAAE,WAAW;YACvB,aAAa,EAAE,mBAAmB;YAClC,eAAe,EAAE,sCAAsC;SACxD,CAAC;QAEF,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,EAAE,aAAa,CAAC,CAAC;QAEhF,MAAM,CAAC,aAAa,CAAC,CAAC,aAAa,iCAAM,aAAa,GAAK,aAAa,EAAG,CAAC;QAC5E,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEnC,MAAM,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAE3C,MAAM,sBAAsB,GAAG,MAAM,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACvE,MAAM,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5C,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export { FireberryV2Api } from './fireberryV2Api';
2
- export * from './types';
@@ -1,21 +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
- exports.FireberryV2Api = void 0;
18
- var fireberryV2Api_1 = require("./fireberryV2Api");
19
- Object.defineProperty(exports, "FireberryV2Api", { enumerable: true, get: function () { return fireberryV2Api_1.FireberryV2Api; } });
20
- __exportStar(require("./types"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fireberryAPI/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,0CAAwB"}
@@ -1,10 +0,0 @@
1
- export type BusinessObject = {
2
- createdBy: string;
3
- createdByName: string;
4
- createdOn: Date;
5
- ownerId: string;
6
- ownerName: string;
7
- modifiedBy: string;
8
- modifiedByName: string;
9
- modifiedOn: Date;
10
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/fireberryAPI/types.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import { FireberrySDK } from './base.fireberrySDK';
2
- import { FireberryV2Api } from './fireberryAPI';
3
- export declare class FireberryClientSDK extends FireberrySDK {
4
- constructor(api: FireberryV2Api);
5
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FireberryClientSDK = void 0;
4
- const base_fireberrySDK_1 = require("./base.fireberrySDK");
5
- const context_1 = require("./context");
6
- class FireberryClientSDK extends base_fireberrySDK_1.FireberrySDK {
7
- constructor(api) {
8
- super(api);
9
- this.context = new context_1.Context(this.api);
10
- }
11
- }
12
- exports.FireberryClientSDK = FireberryClientSDK;
13
- //# sourceMappingURL=fireberrySDK.client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fireberrySDK.client.js","sourceRoot":"","sources":["../src/fireberrySDK.client.ts"],"names":[],"mappings":";;;AAAA,2DAAmD;AACnD,uCAAoC;AAGpC,MAAa,kBAAmB,SAAQ,gCAAY;IAClD,YAAY,GAAmB;QAC7B,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,OAAO,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;CACF;AALD,gDAKC"}
@@ -1,6 +0,0 @@
1
- import { FireberrySDK } from './base.fireberrySDK';
2
- import { FireberryV2Api } from './fireberryAPI';
3
- export declare class FireberryServerSDK extends FireberrySDK {
4
- api: FireberryV2Api;
5
- constructor(api: FireberryV2Api);
6
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FireberryServerSDK = void 0;
4
- const base_fireberrySDK_1 = require("./base.fireberrySDK");
5
- class FireberryServerSDK extends base_fireberrySDK_1.FireberrySDK {
6
- constructor(api) {
7
- super(api);
8
- this.api = api;
9
- }
10
- }
11
- exports.FireberryServerSDK = FireberryServerSDK;
12
- //# sourceMappingURL=fireberrySDK.server.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fireberrySDK.server.js","sourceRoot":"","sources":["../src/fireberrySDK.server.ts"],"names":[],"mappings":";;;AAAA,2DAAmD;AAGnD,MAAa,kBAAmB,SAAQ,gCAAY;IAClD,YAAmB,GAAmB;QACpC,KAAK,CAAC,GAAG,CAAC,CAAC;QADM,QAAG,GAAH,GAAG,CAAgB;IAEtC,CAAC;CACF;AAJD,gDAIC"}
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export declare const IS_DEVELOPMENT: boolean;
2
- export { default } from './fireberry.sdk';
3
- export type Config = Partial<{
4
- tokenId?: string;
5
- }>;
6
- export * from './fireberryAPI/types';
package/dist/index.js DELETED
@@ -1,25 +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
- var __importDefault = (this && this.__importDefault) || function (mod) {
17
- return (mod && mod.__esModule) ? mod : { "default": mod };
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.default = exports.IS_DEVELOPMENT = void 0;
21
- exports.IS_DEVELOPMENT = ['development', 'test'].includes(process.env.NODE_ENV);
22
- var fireberry_sdk_1 = require("./fireberry.sdk");
23
- Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(fireberry_sdk_1).default; } });
24
- __exportStar(require("./fireberryAPI/types"), exports);
25
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAa,QAAA,cAAc,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,QAAS,CAAC,CAAC;AAEtF,iDAA0C;AAAjC,yHAAA,OAAO,OAAA;AAMhB,uDAAqC"}
@@ -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
- };