dobo 2.38.0 → 2.39.1

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 (160) hide show
  1. package/.bootorder +0 -0
  2. package/.github/FUNDING.yml +0 -0
  3. package/.github/workflows/repo-lockdown.yml +0 -0
  4. package/.jsdoc.conf.json +0 -0
  5. package/LICENSE +0 -0
  6. package/README.md +0 -0
  7. package/docs/Dobo.html +0 -0
  8. package/docs/DoboAction.html +0 -0
  9. package/docs/DoboAdapter.html +0 -0
  10. package/docs/DoboConnection.html +0 -0
  11. package/docs/DoboFeature.html +0 -0
  12. package/docs/DoboModel.html +0 -0
  13. package/docs/data/search.json +0 -0
  14. package/docs/extend_bajo_hook-docs.js.html +0 -0
  15. package/docs/external-Tools.html +0 -0
  16. package/docs/fonts/Inconsolata-Regular.ttf +0 -0
  17. package/docs/fonts/OpenSans-Regular.ttf +0 -0
  18. package/docs/fonts/WorkSans-Bold.ttf +0 -0
  19. package/docs/global.html +0 -0
  20. package/docs/index.html +0 -0
  21. package/docs/index.js.html +0 -0
  22. package/docs/lib_factory_action.js.html +0 -0
  23. package/docs/lib_factory_adapter.js.html +0 -0
  24. package/docs/lib_factory_connection.js.html +0 -0
  25. package/docs/lib_factory_feature.js.html +0 -0
  26. package/docs/lib_factory_model.js.html +0 -0
  27. package/docs/lib_factory_model_build.js.html +0 -0
  28. package/docs/lib_factory_model_clear-record.js.html +0 -0
  29. package/docs/lib_factory_model_count-record.js.html +0 -0
  30. package/docs/lib_factory_model_create-record.js.html +0 -0
  31. package/docs/lib_factory_model_drop.js.html +0 -0
  32. package/docs/lib_factory_model_exists.js.html +0 -0
  33. package/docs/lib_factory_model_find-all-record.js.html +0 -0
  34. package/docs/lib_factory_model_find-one-record.js.html +0 -0
  35. package/docs/lib_factory_model_find-record.js.html +0 -0
  36. package/docs/lib_factory_model_get-record.js.html +0 -0
  37. package/docs/lib_factory_model_helper.js.html +0 -0
  38. package/docs/lib_factory_model_remove-record.js.html +0 -0
  39. package/docs/lib_factory_model_sanitize-body.js.html +0 -0
  40. package/docs/lib_factory_model_sanitize-fixture.js.html +0 -0
  41. package/docs/lib_factory_model_sanitize-record.js.html +0 -0
  42. package/docs/lib_factory_model_update-record.js.html +0 -0
  43. package/docs/lib_factory_model_upsert-record.js.html +0 -0
  44. package/docs/lib_factory_model_validate.js.html +0 -0
  45. package/docs/lib_helper.js.html +0 -0
  46. package/docs/module-Helper.html +0 -0
  47. package/docs/module-Helper_Model.html +0 -0
  48. package/docs/module-Hook.html +0 -0
  49. package/docs/scripts/core.js +0 -0
  50. package/docs/scripts/core.min.js +0 -0
  51. package/docs/scripts/resize.js +0 -0
  52. package/docs/scripts/search.js +0 -0
  53. package/docs/scripts/search.min.js +5 -5
  54. package/docs/scripts/third-party/Apache-License-2.0.txt +0 -0
  55. package/docs/scripts/third-party/fuse.js +0 -0
  56. package/docs/scripts/third-party/hljs-line-num-original.js +0 -0
  57. package/docs/scripts/third-party/hljs-line-num.js +0 -0
  58. package/docs/scripts/third-party/hljs-original.js +0 -0
  59. package/docs/scripts/third-party/hljs.js +0 -0
  60. package/docs/scripts/third-party/popper.js +0 -0
  61. package/docs/scripts/third-party/tippy.js +0 -0
  62. package/docs/scripts/third-party/tocbot.js +0 -0
  63. package/docs/scripts/third-party/tocbot.min.js +0 -0
  64. package/docs/static/bitcoin.jpeg +0 -0
  65. package/docs/static/home.md +0 -0
  66. package/docs/static/logo-ecosystem.png +0 -0
  67. package/docs/static/logo.png +0 -0
  68. package/docs/styles/clean-jsdoc-theme-base.css +0 -0
  69. package/docs/styles/clean-jsdoc-theme-dark.css +0 -0
  70. package/docs/styles/clean-jsdoc-theme-light.css +0 -0
  71. package/docs/styles/clean-jsdoc-theme-scrollbar.css +0 -0
  72. package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -0
  73. package/docs/styles/clean-jsdoc-theme.min.css +0 -0
  74. package/extend/bajo/hook.js +236 -236
  75. package/extend/bajo/intl/en-US.json +0 -0
  76. package/extend/bajo/intl/id.json +0 -0
  77. package/extend/bajoCli/applet/aggregate.js +0 -0
  78. package/extend/bajoCli/applet/clear-record.js +0 -0
  79. package/extend/bajoCli/applet/connection.js +0 -0
  80. package/extend/bajoCli/applet/count-record.js +0 -0
  81. package/extend/bajoCli/applet/create-record.js +0 -0
  82. package/extend/bajoCli/applet/find-record.js +0 -0
  83. package/extend/bajoCli/applet/get-record.js +0 -0
  84. package/extend/bajoCli/applet/histogram.js +0 -0
  85. package/extend/bajoCli/applet/lib/post-process.js +0 -0
  86. package/extend/bajoCli/applet/model.js +0 -0
  87. package/extend/bajoCli/applet/rebuild-model.js +0 -0
  88. package/extend/bajoCli/applet/remove-record.js +0 -0
  89. package/extend/bajoCli/applet/update-record.js +0 -0
  90. package/extend/bajoCli/applet.js +0 -0
  91. package/extend/dobo/adapter/memory.js +175 -175
  92. package/extend/dobo/feature/created-at.js +0 -0
  93. package/extend/dobo/feature/dt.js +0 -0
  94. package/extend/dobo/feature/image.js +0 -0
  95. package/extend/dobo/feature/immutable.js +0 -0
  96. package/extend/dobo/feature/removed-at.js +0 -0
  97. package/extend/dobo/feature/unique.js +0 -0
  98. package/extend/dobo/feature/updated-at.js +0 -0
  99. package/extend/waibuMpa/route/attachment/@model/@id/@field/@file.js +0 -0
  100. package/extend/waibuStatic/virtual.json +0 -0
  101. package/index.js +0 -0
  102. package/lib/factory/action.js +287 -287
  103. package/lib/factory/adapter.js +1055 -1055
  104. package/lib/factory/connection.js +109 -109
  105. package/lib/factory/feature.js +52 -52
  106. package/lib/factory/model/aggregate.js +23 -23
  107. package/lib/factory/model/build.js +25 -25
  108. package/lib/factory/model/bulk-create-record.js +36 -36
  109. package/lib/factory/model/clear-record.js +30 -30
  110. package/lib/factory/model/count-record.js +42 -42
  111. package/lib/factory/model/create-attachment.js +36 -36
  112. package/lib/factory/model/create-record.js +49 -49
  113. package/lib/factory/model/drop.js +26 -26
  114. package/lib/factory/model/exists.js +26 -26
  115. package/lib/factory/model/find-all-record.js +112 -112
  116. package/lib/factory/model/find-attachment.js +28 -28
  117. package/lib/factory/model/find-one-record.js +38 -38
  118. package/lib/factory/model/find-record.js +82 -82
  119. package/lib/factory/model/get-attachment.js +15 -15
  120. package/lib/factory/model/get-record.js +52 -52
  121. package/lib/factory/model/helper.js +575 -576
  122. package/lib/factory/model/histogram.js +23 -23
  123. package/lib/factory/model/list-attachment.js +40 -40
  124. package/lib/factory/model/load-fixtures.js +63 -63
  125. package/lib/factory/model/remove-attachment.js +24 -24
  126. package/lib/factory/model/remove-record.js +44 -44
  127. package/lib/factory/model/sanitize-body.js +57 -57
  128. package/lib/factory/model/sanitize-fixture.js +56 -56
  129. package/lib/factory/model/sanitize-record.js +80 -80
  130. package/lib/factory/model/transaction.js +15 -15
  131. package/lib/factory/model/update-attachment.js +9 -9
  132. package/lib/factory/model/update-record.js +58 -58
  133. package/lib/factory/model/upsert-record.js +71 -71
  134. package/lib/factory/model/validate.js +0 -0
  135. package/lib/factory/model.js +503 -503
  136. package/lib/helper.js +463 -463
  137. package/package.json +1 -1
  138. package/test/e2e/_run.js +12 -12
  139. package/test/e2e/e2e-factory-process.test.js +25 -25
  140. package/test/e2e/e2e-model-adapter-process.test.js +52 -52
  141. package/test/integration/aspect-01-start-connections.test.js +33 -33
  142. package/test/integration/aspect-02-query-regex.test.js +34 -34
  143. package/test/integration/aspect-03-model-adapter-flow.test.js +88 -88
  144. package/test/unit/_stub.js +244 -244
  145. package/test/unit/dobo-action.test.js +58 -58
  146. package/test/unit/dobo-connection.test.js +37 -37
  147. package/test/unit/dobo-core.test.js +136 -136
  148. package/test/unit/dobo-feature.test.js +25 -25
  149. package/test/unit/dobo-model.test.js +115 -115
  150. package/test/unit/helper-sanitize-all.test.js +40 -40
  151. package/test/unit/helper-sanitize-ref.test.js +64 -64
  152. package/wiki/APPLETS.md +0 -0
  153. package/wiki/CHANGES.md +477 -469
  154. package/wiki/CONFIG.md +0 -0
  155. package/wiki/CONTRIBUTING.md +0 -0
  156. package/wiki/DEV-GUIDE.md +0 -0
  157. package/wiki/ECOSYSTEM.md +0 -0
  158. package/wiki/GETTING-STARTED.md +0 -0
  159. package/wiki/QUERY-LANGUAGE.md +0 -0
  160. package/wiki/USER-GUIDE.md +0 -0
@@ -1,82 +1,82 @@
1
- import { getFilterAndOptions, execHook, execModelHook, execDynHook, getRefs, sanitizeQuery } from './helper.js'
2
- const action = 'findRecord'
3
-
4
- /**
5
- * @typedef TFilter
6
- * @type {Object}
7
- * @memberof DoboModel
8
- * @see Dobo#recordFind
9
- * @see Dobo#recordFindOne
10
- * @see Dobo#recordFindAll
11
- * @property {(string|Object)} [query={}] - Query definition. See {@tutorial query-language} for more
12
- * @property {number} limit - Maximum number of records to return
13
- * @property {number} page - Which page to return
14
- * @property {number} skip - Records to skip
15
- * @property {DoboModel.TSort} sort - Sort order info
16
- */
17
-
18
- /**
19
- * Finds records in the model's underlying data store that match the provided filter criteria.
20
- *
21
- * If no arguments are provided, it automatically turns into a chainable {@link DoboAction} object.
22
- * @async
23
- * @memberof DoboModel
24
- * @method
25
- * @param {DoboModel.TFilter} [filter={}] - The filter criteria to apply when finding records.
26
- * @param {DoboModel.TOptions} [opts={}] - Options object.
27
- * @returns {DoboAction|DoboModel.TResultFindRecord|Array.<DoboModel.TRecord>}
28
- * @see {@link module:Hook.beforeFindRecord}
29
- * @see {@link module:Hook.afterFindRecord}
30
- */
31
- async function findRecord (...args) {
32
- if (args.length === 0) return this.action(action, ...args)
33
- const { getDefaultValues, t } = this.app.dobo
34
- const [params = {}, opts = {}] = args
35
- const { isSet } = this.app.lib.aneka
36
- const { pick, omit, cloneDeep } = this.app.lib._
37
- const { get, set } = this.app.bajoCache ?? {}
38
- opts.dataOnly = opts.dataOnly ?? true
39
- const { dataOnly } = opts
40
- const { filter, options } = await getFilterAndOptions.call(this, params, opts, action)
41
- const { hardCap, warnings } = getDefaultValues(options)
42
- if (dataOnly) options.count = false
43
- const { noResultSanitizer } = options
44
- await execHook.call(this, 'beforeFindRecord', filter, options)
45
- await execModelHook.call(this, 'beforeFindRecord', filter, options)
46
- await execDynHook.call(this, 'beforeFindRecord', filter, options)
47
- filter.query = sanitizeQuery.call(this, filter.query)
48
- const cFilter = cloneDeep(filter)
49
- if (get) {
50
- const resp = await get({ model: this, action, filter: cFilter, options })
51
- if (resp) {
52
- resp.cached = true
53
- return dataOnly ? resp.data : resp
54
- }
55
- }
56
- let result = options.record ?? (await this.adapter._findRecord(this, filter, options)) ?? {}
57
- result.page = filter.page
58
- result.limit = filter.limit
59
- result.filter = pick(filter, ['query', 'search', 'sort'])
60
- result.warnings = result.warnings ?? []
61
- if (!options.count) result = omit(result, ['count', 'pages'])
62
- else if (options.count && result.count > hardCap) {
63
- result.warnings.push(t('hardCapWarning%s%s', result.count, hardCap))
64
- result.count = hardCap
65
- result.hardCapped = true
66
- }
67
- result.pages = options.count ? Math.ceil(result.count / filter.limit) : undefined
68
- if (!warnings) delete result.warnings
69
- if (isSet(options.refs)) await getRefs.call(this, result.data, options)
70
- if (!noResultSanitizer) {
71
- for (const idx in result.data) {
72
- result.data[idx] = await this.sanitizeRecord(result.data[idx], options)
73
- }
74
- }
75
- await execDynHook.call(this, 'afterFindRecord', filter, result, options)
76
- await execModelHook.call(this, 'afterFindRecord', filter, result, options)
77
- await execHook.call(this, 'afterFindRecord', filter, result, options)
78
- if (set) await set({ model: this, action, filter: cFilter, options, result })
79
- return dataOnly ? result.data : result
80
- }
81
-
82
- export default findRecord
1
+ import { getFilterAndOptions, execHook, execModelHook, execDynHook, getRefs, sanitizeQuery } from './helper.js'
2
+ const action = 'findRecord'
3
+
4
+ /**
5
+ * @typedef TFilter
6
+ * @type {Object}
7
+ * @memberof DoboModel
8
+ * @see Dobo#recordFind
9
+ * @see Dobo#recordFindOne
10
+ * @see Dobo#recordFindAll
11
+ * @property {(string|Object)} [query={}] - Query definition. See {@tutorial query-language} for more
12
+ * @property {number} limit - Maximum number of records to return
13
+ * @property {number} page - Which page to return
14
+ * @property {number} skip - Records to skip
15
+ * @property {DoboModel.TSort} sort - Sort order info
16
+ */
17
+
18
+ /**
19
+ * Finds records in the model's underlying data store that match the provided filter criteria.
20
+ *
21
+ * If no arguments are provided, it automatically turns into a chainable {@link DoboAction} object.
22
+ * @async
23
+ * @memberof DoboModel
24
+ * @method
25
+ * @param {DoboModel.TFilter} [filter={}] - The filter criteria to apply when finding records.
26
+ * @param {DoboModel.TOptions} [opts={}] - Options object.
27
+ * @returns {DoboAction|DoboModel.TResultFindRecord|Array.<DoboModel.TRecord>}
28
+ * @see {@link module:Hook.beforeFindRecord}
29
+ * @see {@link module:Hook.afterFindRecord}
30
+ */
31
+ async function findRecord (...args) {
32
+ if (args.length === 0) return this.action(action, ...args)
33
+ const { getDefaultValues, t } = this.app.dobo
34
+ const [params = {}, opts = {}] = args
35
+ const { isSet } = this.app.lib.aneka
36
+ const { pick, omit, cloneDeep } = this.app.lib._
37
+ const { get, set } = this.app.bajoCache ?? {}
38
+ opts.dataOnly = opts.dataOnly ?? true
39
+ const { dataOnly } = opts
40
+ const { filter, options } = await getFilterAndOptions.call(this, params, opts, action)
41
+ const { hardCap, warnings } = getDefaultValues(options)
42
+ if (dataOnly) options.count = false
43
+ const { noResultSanitizer } = options
44
+ await execHook.call(this, 'beforeFindRecord', filter, options)
45
+ await execModelHook.call(this, 'beforeFindRecord', filter, options)
46
+ await execDynHook.call(this, 'beforeFindRecord', filter, options)
47
+ filter.query = sanitizeQuery.call(this, filter.query)
48
+ const cFilter = cloneDeep(filter)
49
+ if (get) {
50
+ const resp = await get({ model: this, action, filter: cFilter, options })
51
+ if (resp) {
52
+ resp.cached = true
53
+ return dataOnly ? resp.data : resp
54
+ }
55
+ }
56
+ let result = options.record ?? (await this.adapter._findRecord(this, filter, options)) ?? {}
57
+ result.page = filter.page
58
+ result.limit = filter.limit
59
+ result.filter = pick(filter, ['query', 'search', 'sort'])
60
+ result.warnings = result.warnings ?? []
61
+ if (!options.count) result = omit(result, ['count', 'pages'])
62
+ else if (options.count && result.count > hardCap) {
63
+ result.warnings.push(t('hardCapWarning%s%s', result.count, hardCap))
64
+ result.count = hardCap
65
+ result.hardCapped = true
66
+ }
67
+ result.pages = options.count ? Math.ceil(result.count / filter.limit) : undefined
68
+ if (!warnings) delete result.warnings
69
+ if (isSet(options.refs)) await getRefs.call(this, result.data, options)
70
+ if (!noResultSanitizer) {
71
+ for (const idx in result.data) {
72
+ result.data[idx] = await this.sanitizeRecord(result.data[idx], options)
73
+ }
74
+ }
75
+ await execDynHook.call(this, 'afterFindRecord', filter, result, options)
76
+ await execModelHook.call(this, 'afterFindRecord', filter, result, options)
77
+ await execHook.call(this, 'afterFindRecord', filter, result, options)
78
+ if (set) await set({ model: this, action, filter: cFilter, options, result })
79
+ return dataOnly ? result.data : result
80
+ }
81
+
82
+ export default findRecord
@@ -1,15 +1,15 @@
1
- const action = 'getAttachment'
2
-
3
- async function getAttachment (...args) {
4
- if (!this.options.attachment) return
5
- if (args.length === 0) return this.action(action, ...args)
6
- let [id, field, file, opts = {}] = args
7
- const { find } = this.app.lib._
8
- const all = await this.findAttachment(id, opts)
9
- if (field === 'null') field = null
10
- const data = find(all, { field, file })
11
- if (!data) throw this.error('notFound', { statusCode: 404 })
12
- return data
13
- }
14
-
15
- export default getAttachment
1
+ const action = 'getAttachment'
2
+
3
+ async function getAttachment (...args) {
4
+ if (!this.options.attachment) return
5
+ if (args.length === 0) return this.action(action, ...args)
6
+ let [id, field, file, opts = {}] = args
7
+ const { find } = this.app.lib._
8
+ const all = await this.findAttachment(id, opts)
9
+ if (field === 'null') field = null
10
+ const data = find(all, { field, file })
11
+ if (!data) throw this.error('notFound', { statusCode: 404 })
12
+ return data
13
+ }
14
+
15
+ export default getAttachment
@@ -1,52 +1,52 @@
1
- import { getFilterAndOptions, execHook, execModelHook, execDynHook, getRefs } from './helper.js'
2
- const action = 'getRecord'
3
-
4
- /**
5
- * Gets a record from the model's underlying data store based on the provided ID.
6
- *
7
- * If no arguments are provided, it automatically turns into a chainable {@link DoboAction} object.
8
- * @async
9
- * @memberof DoboModel
10
- * @method
11
- * @param {string|number} id - The ID of the record to be retrieved.
12
- * @param {DoboModel.TOptions} [opts] - Options object.
13
- * @returns {DoboAction|DoboModel.TResultGetRecord|DoboModel.TRecord}
14
- * @see {@link module:Hook.beforeGetRecord}
15
- * @see {@link module:Hook.afterGetRecord}
16
- */
17
- async function getRecord (...args) {
18
- if (args.length === 0) return this.action(action, ...args)
19
- let [id, opts = {}] = args
20
- const { getDefaultValues } = this.app.dobo
21
- const { isEmpty } = this.app.lib._
22
- const { isSet } = this.app.lib.aneka
23
- const { get, set } = this.app.bajoCache ?? {}
24
- opts.dataOnly = opts.dataOnly ?? true
25
- const { dataOnly } = opts
26
- const { options } = await getFilterAndOptions.call(this, null, opts, action)
27
- const { noResultSanitizer } = options
28
- id = this.sanitizeId(id)
29
- await execHook.call(this, 'beforeGetRecord', id, options)
30
- await execModelHook.call(this, 'beforeGetRecord', id, options)
31
- await execDynHook.call(this, 'beforeGetRecord', id, options)
32
- if (get) {
33
- const resp = await get({ model: this, action, id, options })
34
- if (resp) {
35
- resp.cached = true
36
- return dataOnly ? resp.data : resp
37
- }
38
- }
39
- const result = options.record ?? (await this.adapter._getRecord(this, id, options)) ?? {}
40
- const { warnings } = getDefaultValues(options)
41
- if (!warnings) delete result.warnings
42
- if (isEmpty(result.data) && !options.throwNotFound) return dataOnly ? undefined : { data: undefined }
43
- if (isSet(options.refs)) await getRefs.call(this, [result.data], options)
44
- if (!noResultSanitizer) result.data = await this.sanitizeRecord(result.data, options)
45
- await execDynHook.call(this, 'afterGetRecord', id, result, options)
46
- await execModelHook.call(this, 'afterGetRecord', id, result, options)
47
- await execHook.call(this, 'afterGetRecord', id, result, options)
48
- if (set) await set({ model: this, action, id, options, result })
49
- return dataOnly ? result.data : result
50
- }
51
-
52
- export default getRecord
1
+ import { getFilterAndOptions, execHook, execModelHook, execDynHook, getRefs } from './helper.js'
2
+ const action = 'getRecord'
3
+
4
+ /**
5
+ * Gets a record from the model's underlying data store based on the provided ID.
6
+ *
7
+ * If no arguments are provided, it automatically turns into a chainable {@link DoboAction} object.
8
+ * @async
9
+ * @memberof DoboModel
10
+ * @method
11
+ * @param {string|number} id - The ID of the record to be retrieved.
12
+ * @param {DoboModel.TOptions} [opts] - Options object.
13
+ * @returns {DoboAction|DoboModel.TResultGetRecord|DoboModel.TRecord}
14
+ * @see {@link module:Hook.beforeGetRecord}
15
+ * @see {@link module:Hook.afterGetRecord}
16
+ */
17
+ async function getRecord (...args) {
18
+ if (args.length === 0) return this.action(action, ...args)
19
+ let [id, opts = {}] = args
20
+ const { getDefaultValues } = this.app.dobo
21
+ const { isEmpty } = this.app.lib._
22
+ const { isSet } = this.app.lib.aneka
23
+ const { get, set } = this.app.bajoCache ?? {}
24
+ opts.dataOnly = opts.dataOnly ?? true
25
+ const { dataOnly } = opts
26
+ const { options } = await getFilterAndOptions.call(this, null, opts, action)
27
+ const { noResultSanitizer } = options
28
+ id = this.sanitizeId(id)
29
+ await execHook.call(this, 'beforeGetRecord', id, options)
30
+ await execModelHook.call(this, 'beforeGetRecord', id, options)
31
+ await execDynHook.call(this, 'beforeGetRecord', id, options)
32
+ if (get) {
33
+ const resp = await get({ model: this, action, id, options })
34
+ if (resp) {
35
+ resp.cached = true
36
+ return dataOnly ? resp.data : resp
37
+ }
38
+ }
39
+ const result = options.record ?? (await this.adapter._getRecord(this, id, options)) ?? {}
40
+ const { warnings } = getDefaultValues(options)
41
+ if (!warnings) delete result.warnings
42
+ if (isEmpty(result.data) && !options.throwNotFound) return dataOnly ? undefined : { data: undefined }
43
+ if (isSet(options.refs)) await getRefs.call(this, [result.data], options)
44
+ if (!noResultSanitizer) result.data = await this.sanitizeRecord(result.data, options)
45
+ await execDynHook.call(this, 'afterGetRecord', id, result, options)
46
+ await execModelHook.call(this, 'afterGetRecord', id, result, options)
47
+ await execHook.call(this, 'afterGetRecord', id, result, options)
48
+ if (set) await set({ model: this, action, id, options, result })
49
+ return dataOnly ? result.data : result
50
+ }
51
+
52
+ export default getRecord