@8medusa/utils 2.7.0
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.
- package/dist/api-key/api-key-type.d.ts +17 -0
- package/dist/api-key/api-key-type.d.ts.map +1 -0
- package/dist/api-key/api-key-type.js +21 -0
- package/dist/api-key/api-key-type.js.map +1 -0
- package/dist/api-key/index.d.ts +2 -0
- package/dist/api-key/index.d.ts.map +1 -0
- package/dist/api-key/index.js +18 -0
- package/dist/api-key/index.js.map +1 -0
- package/dist/auth/abstract-auth-provider.d.ts +405 -0
- package/dist/auth/abstract-auth-provider.d.ts.map +1 -0
- package/dist/auth/abstract-auth-provider.js +296 -0
- package/dist/auth/abstract-auth-provider.js.map +1 -0
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +19 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/token.d.ts +5 -0
- package/dist/auth/token.d.ts.map +1 -0
- package/dist/auth/token.js +18 -0
- package/dist/auth/token.js.map +1 -0
- package/dist/bundles.d.ts +21 -0
- package/dist/bundles.d.ts.map +1 -0
- package/dist/bundles.js +47 -0
- package/dist/bundles.js.map +1 -0
- package/dist/common/alter-columns-helper.d.ts +2 -0
- package/dist/common/alter-columns-helper.d.ts.map +1 -0
- package/dist/common/alter-columns-helper.js +29 -0
- package/dist/common/alter-columns-helper.js.map +1 -0
- package/dist/common/array-difference.d.ts +4 -0
- package/dist/common/array-difference.d.ts.map +1 -0
- package/dist/common/array-difference.js +10 -0
- package/dist/common/array-difference.js.map +1 -0
- package/dist/common/array-intersection.d.ts +4 -0
- package/dist/common/array-intersection.d.ts.map +1 -0
- package/dist/common/array-intersection.js +14 -0
- package/dist/common/array-intersection.js.map +1 -0
- package/dist/common/build-query.d.ts +31 -0
- package/dist/common/build-query.d.ts.map +1 -0
- package/dist/common/build-query.js +50 -0
- package/dist/common/build-query.js.map +1 -0
- package/dist/common/build-regexp-if-valid.d.ts +2 -0
- package/dist/common/build-regexp-if-valid.d.ts.map +1 -0
- package/dist/common/build-regexp-if-valid.js +14 -0
- package/dist/common/build-regexp-if-valid.js.map +1 -0
- package/dist/common/camel-to-snake-case.d.ts +2 -0
- package/dist/common/camel-to-snake-case.d.ts.map +1 -0
- package/dist/common/camel-to-snake-case.js +6 -0
- package/dist/common/camel-to-snake-case.js.map +1 -0
- package/dist/common/container.d.ts +18 -0
- package/dist/common/container.d.ts.map +1 -0
- package/dist/common/container.js +21 -0
- package/dist/common/container.js.map +1 -0
- package/dist/common/convert-item-response-to-update-request.d.ts +6 -0
- package/dist/common/convert-item-response-to-update-request.d.ts.map +1 -0
- package/dist/common/convert-item-response-to-update-request.js +75 -0
- package/dist/common/convert-item-response-to-update-request.js.map +1 -0
- package/dist/common/create-container-like.d.ts +3 -0
- package/dist/common/create-container-like.d.ts.map +1 -0
- package/dist/common/create-container-like.js +11 -0
- package/dist/common/create-container-like.js.map +1 -0
- package/dist/common/create-psql-index-helper.d.ts +45 -0
- package/dist/common/create-psql-index-helper.d.ts.map +1 -0
- package/dist/common/create-psql-index-helper.js +73 -0
- package/dist/common/create-psql-index-helper.js.map +1 -0
- package/dist/common/deduplicate.d.ts +2 -0
- package/dist/common/deduplicate.d.ts.map +1 -0
- package/dist/common/deduplicate.js +7 -0
- package/dist/common/deduplicate.js.map +1 -0
- package/dist/common/deep-copy.d.ts +9 -0
- package/dist/common/deep-copy.d.ts.map +1 -0
- package/dist/common/deep-copy.js +71 -0
- package/dist/common/deep-copy.js.map +1 -0
- package/dist/common/deep-equal-obj.d.ts +2 -0
- package/dist/common/deep-equal-obj.d.ts.map +1 -0
- package/dist/common/deep-equal-obj.js +26 -0
- package/dist/common/deep-equal-obj.js.map +1 -0
- package/dist/common/deep-flat-map.d.ts +46 -0
- package/dist/common/deep-flat-map.d.ts.map +1 -0
- package/dist/common/deep-flat-map.js +100 -0
- package/dist/common/deep-flat-map.js.map +1 -0
- package/dist/common/deep-merge.d.ts +2 -0
- package/dist/common/deep-merge.d.ts.map +1 -0
- package/dist/common/deep-merge.js +27 -0
- package/dist/common/deep-merge.js.map +1 -0
- package/dist/common/define-config.d.ts +17 -0
- package/dist/common/define-config.d.ts.map +1 -0
- package/dist/common/define-config.js +329 -0
- package/dist/common/define-config.js.map +1 -0
- package/dist/common/dynamic-import.d.ts +13 -0
- package/dist/common/dynamic-import.d.ts.map +1 -0
- package/dist/common/dynamic-import.js +20 -0
- package/dist/common/dynamic-import.js.map +1 -0
- package/dist/common/env-editor.d.ts +38 -0
- package/dist/common/env-editor.d.ts.map +1 -0
- package/dist/common/env-editor.js +115 -0
- package/dist/common/env-editor.js.map +1 -0
- package/dist/common/errors.d.ts +68 -0
- package/dist/common/errors.d.ts.map +1 -0
- package/dist/common/errors.js +61 -0
- package/dist/common/errors.js.map +1 -0
- package/dist/common/file-system.d.ts +65 -0
- package/dist/common/file-system.d.ts.map +1 -0
- package/dist/common/file-system.js +133 -0
- package/dist/common/file-system.js.map +1 -0
- package/dist/common/filter-object-by-keys.d.ts +2 -0
- package/dist/common/filter-object-by-keys.d.ts.map +1 -0
- package/dist/common/filter-object-by-keys.js +106 -0
- package/dist/common/filter-object-by-keys.js.map +1 -0
- package/dist/common/filter-operator-map.d.ts +5 -0
- package/dist/common/filter-operator-map.d.ts.map +1 -0
- package/dist/common/filter-operator-map.js +25 -0
- package/dist/common/filter-operator-map.js.map +1 -0
- package/dist/common/flatten-object-to-key-value-pairs.d.ts +6 -0
- package/dist/common/flatten-object-to-key-value-pairs.d.ts.map +1 -0
- package/dist/common/flatten-object-to-key-value-pairs.js +267 -0
- package/dist/common/flatten-object-to-key-value-pairs.js.map +1 -0
- package/dist/common/generate-entity-id.d.ts +7 -0
- package/dist/common/generate-entity-id.d.ts.map +1 -0
- package/dist/common/generate-entity-id.js +18 -0
- package/dist/common/generate-entity-id.js.map +1 -0
- package/dist/common/get-caller-file-path.d.ts +6 -0
- package/dist/common/get-caller-file-path.d.ts.map +1 -0
- package/dist/common/get-caller-file-path.js +29 -0
- package/dist/common/get-caller-file-path.js.map +1 -0
- package/dist/common/get-config-file.d.ts +16 -0
- package/dist/common/get-config-file.d.ts.map +1 -0
- package/dist/common/get-config-file.js +33 -0
- package/dist/common/get-config-file.js.map +1 -0
- package/dist/common/get-duplicates.d.ts +2 -0
- package/dist/common/get-duplicates.d.ts.map +1 -0
- package/dist/common/get-duplicates.js +20 -0
- package/dist/common/get-duplicates.js.map +1 -0
- package/dist/common/get-iso-string-from-date.d.ts +2 -0
- package/dist/common/get-iso-string-from-date.d.ts.map +1 -0
- package/dist/common/get-iso-string-from-date.js +14 -0
- package/dist/common/get-iso-string-from-date.js.map +1 -0
- package/dist/common/get-node-version.d.ts +3 -0
- package/dist/common/get-node-version.d.ts.map +1 -0
- package/dist/common/get-node-version.js +10 -0
- package/dist/common/get-node-version.js.map +1 -0
- package/dist/common/get-resolved-plugins.d.ts +4 -0
- package/dist/common/get-resolved-plugins.d.ts.map +1 -0
- package/dist/common/get-resolved-plugins.js +121 -0
- package/dist/common/get-resolved-plugins.js.map +1 -0
- package/dist/common/get-selects-and-relations-from-object-array.d.ts +7 -0
- package/dist/common/get-selects-and-relations-from-object-array.d.ts.map +1 -0
- package/dist/common/get-selects-and-relations-from-object-array.js +50 -0
- package/dist/common/get-selects-and-relations-from-object-array.js.map +1 -0
- package/dist/common/get-set-difference.d.ts +7 -0
- package/dist/common/get-set-difference.d.ts.map +1 -0
- package/dist/common/get-set-difference.js +18 -0
- package/dist/common/get-set-difference.js.map +1 -0
- package/dist/common/graceful-shutdown-server.d.ts +7 -0
- package/dist/common/graceful-shutdown-server.d.ts.map +1 -0
- package/dist/common/graceful-shutdown-server.js +73 -0
- package/dist/common/graceful-shutdown-server.js.map +1 -0
- package/dist/common/group-by.d.ts +2 -0
- package/dist/common/group-by.d.ts.map +1 -0
- package/dist/common/group-by.js +17 -0
- package/dist/common/group-by.js.map +1 -0
- package/dist/common/handle-postgres-database-error.d.ts +9 -0
- package/dist/common/handle-postgres-database-error.d.ts.map +1 -0
- package/dist/common/handle-postgres-database-error.js +37 -0
- package/dist/common/handle-postgres-database-error.js.map +1 -0
- package/dist/common/index.d.ts +90 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +106 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/is-big-number.d.ts +3 -0
- package/dist/common/is-big-number.d.ts.map +1 -0
- package/dist/common/is-big-number.js +8 -0
- package/dist/common/is-big-number.js.map +1 -0
- package/dist/common/is-boolean.d.ts +2 -0
- package/dist/common/is-boolean.d.ts.map +1 -0
- package/dist/common/is-boolean.js +7 -0
- package/dist/common/is-boolean.js.map +1 -0
- package/dist/common/is-date.d.ts +2 -0
- package/dist/common/is-date.d.ts.map +1 -0
- package/dist/common/is-date.js +7 -0
- package/dist/common/is-date.js.map +1 -0
- package/dist/common/is-defined.d.ts +2 -0
- package/dist/common/is-defined.d.ts.map +1 -0
- package/dist/common/is-defined.js +7 -0
- package/dist/common/is-defined.js.map +1 -0
- package/dist/common/is-email.d.ts +7 -0
- package/dist/common/is-email.d.ts.map +1 -0
- package/dist/common/is-email.js +25 -0
- package/dist/common/is-email.js.map +1 -0
- package/dist/common/is-error-like.d.ts +2 -0
- package/dist/common/is-error-like.d.ts.map +1 -0
- package/dist/common/is-error-like.js +11 -0
- package/dist/common/is-error-like.js.map +1 -0
- package/dist/common/is-object.d.ts +2 -0
- package/dist/common/is-object.d.ts.map +1 -0
- package/dist/common/is-object.js +7 -0
- package/dist/common/is-object.js.map +1 -0
- package/dist/common/is-present.d.ts +2 -0
- package/dist/common/is-present.d.ts.map +1 -0
- package/dist/common/is-present.js +22 -0
- package/dist/common/is-present.js.map +1 -0
- package/dist/common/is-string.d.ts +2 -0
- package/dist/common/is-string.d.ts.map +1 -0
- package/dist/common/is-string.js +7 -0
- package/dist/common/is-string.js.map +1 -0
- package/dist/common/is-truthy.d.ts +6 -0
- package/dist/common/is-truthy.d.ts.map +1 -0
- package/dist/common/is-truthy.js +14 -0
- package/dist/common/is-truthy.js.map +1 -0
- package/dist/common/load-env.d.ts +17 -0
- package/dist/common/load-env.d.ts.map +1 -0
- package/dist/common/load-env.js +35 -0
- package/dist/common/load-env.js.map +1 -0
- package/dist/common/lower-case-first.d.ts +2 -0
- package/dist/common/lower-case-first.d.ts.map +1 -0
- package/dist/common/lower-case-first.js +7 -0
- package/dist/common/lower-case-first.js.map +1 -0
- package/dist/common/map-object-to.d.ts +23 -0
- package/dist/common/map-object-to.d.ts.map +1 -0
- package/dist/common/map-object-to.js +35 -0
- package/dist/common/map-object-to.js.map +1 -0
- package/dist/common/medusa-container.d.ts +3 -0
- package/dist/common/medusa-container.d.ts.map +1 -0
- package/dist/common/medusa-container.js +33 -0
- package/dist/common/medusa-container.js.map +1 -0
- package/dist/common/merge-metadata.d.ts +15 -0
- package/dist/common/merge-metadata.d.ts.map +1 -0
- package/dist/common/merge-metadata.js +34 -0
- package/dist/common/merge-metadata.js.map +1 -0
- package/dist/common/merge-plugin-modules.d.ts +7 -0
- package/dist/common/merge-plugin-modules.d.ts.map +1 -0
- package/dist/common/merge-plugin-modules.js +29 -0
- package/dist/common/merge-plugin-modules.js.map +1 -0
- package/dist/common/normalize-import-path-with-source.d.ts +6 -0
- package/dist/common/normalize-import-path-with-source.d.ts.map +1 -0
- package/dist/common/normalize-import-path-with-source.js +25 -0
- package/dist/common/normalize-import-path-with-source.js.map +1 -0
- package/dist/common/object-from-string-path.d.ts +46 -0
- package/dist/common/object-from-string-path.d.ts.map +1 -0
- package/dist/common/object-from-string-path.js +73 -0
- package/dist/common/object-from-string-path.js.map +1 -0
- package/dist/common/object-to-string-path.d.ts +43 -0
- package/dist/common/object-to-string-path.d.ts.map +1 -0
- package/dist/common/object-to-string-path.js +71 -0
- package/dist/common/object-to-string-path.js.map +1 -0
- package/dist/common/omit-deep.d.ts +2 -0
- package/dist/common/omit-deep.d.ts.map +1 -0
- package/dist/common/omit-deep.js +31 -0
- package/dist/common/omit-deep.js.map +1 -0
- package/dist/common/optional-numeric-serializer.d.ts +2 -0
- package/dist/common/optional-numeric-serializer.d.ts.map +1 -0
- package/dist/common/optional-numeric-serializer.js +7 -0
- package/dist/common/optional-numeric-serializer.js.map +1 -0
- package/dist/common/parse-cors-origins.d.ts +2 -0
- package/dist/common/parse-cors-origins.d.ts.map +1 -0
- package/dist/common/parse-cors-origins.js +12 -0
- package/dist/common/parse-cors-origins.js.map +1 -0
- package/dist/common/partition-array.d.ts +15 -0
- package/dist/common/partition-array.d.ts.map +1 -0
- package/dist/common/partition-array.js +29 -0
- package/dist/common/partition-array.js.map +1 -0
- package/dist/common/pick-deep.d.ts +2 -0
- package/dist/common/pick-deep.d.ts.map +1 -0
- package/dist/common/pick-deep.js +52 -0
- package/dist/common/pick-deep.js.map +1 -0
- package/dist/common/pick-value-from-object.d.ts +2 -0
- package/dist/common/pick-value-from-object.d.ts.map +1 -0
- package/dist/common/pick-value-from-object.js +28 -0
- package/dist/common/pick-value-from-object.js.map +1 -0
- package/dist/common/plurailze.d.ts +6 -0
- package/dist/common/plurailze.d.ts.map +1 -0
- package/dist/common/plurailze.js +17 -0
- package/dist/common/plurailze.js.map +1 -0
- package/dist/common/prefix-array-items.d.ts +7 -0
- package/dist/common/prefix-array-items.d.ts.map +1 -0
- package/dist/common/prefix-array-items.js +12 -0
- package/dist/common/prefix-array-items.js.map +1 -0
- package/dist/common/promise-all.d.ts +11 -0
- package/dist/common/promise-all.d.ts.map +1 -0
- package/dist/common/promise-all.js +29 -0
- package/dist/common/promise-all.js.map +1 -0
- package/dist/common/read-dir-recursive.d.ts +8 -0
- package/dist/common/read-dir-recursive.d.ts.map +1 -0
- package/dist/common/read-dir-recursive.js +46 -0
- package/dist/common/read-dir-recursive.js.map +1 -0
- package/dist/common/remote-query-object-from-string.d.ts +86 -0
- package/dist/common/remote-query-object-from-string.d.ts.map +1 -0
- package/dist/common/remote-query-object-from-string.js +137 -0
- package/dist/common/remote-query-object-from-string.js.map +1 -0
- package/dist/common/remote-query-object-to-string.d.ts +25 -0
- package/dist/common/remote-query-object-to-string.d.ts.map +1 -0
- package/dist/common/remote-query-object-to-string.js +45 -0
- package/dist/common/remote-query-object-to-string.js.map +1 -0
- package/dist/common/remove-nullisih.d.ts +2 -0
- package/dist/common/remove-nullisih.d.ts.map +1 -0
- package/dist/common/remove-nullisih.js +14 -0
- package/dist/common/remove-nullisih.js.map +1 -0
- package/dist/common/remove-undefined-properties.d.ts +2 -0
- package/dist/common/remove-undefined-properties.d.ts.map +1 -0
- package/dist/common/remove-undefined-properties.js +48 -0
- package/dist/common/remove-undefined-properties.js.map +1 -0
- package/dist/common/remove-undefined.d.ts +2 -0
- package/dist/common/remove-undefined.d.ts.map +1 -0
- package/dist/common/remove-undefined.js +9 -0
- package/dist/common/remove-undefined.js.map +1 -0
- package/dist/common/resolve-exports.d.ts +2 -0
- package/dist/common/resolve-exports.d.ts.map +1 -0
- package/dist/common/resolve-exports.js +12 -0
- package/dist/common/resolve-exports.js.map +1 -0
- package/dist/common/rules.d.ts +11 -0
- package/dist/common/rules.d.ts.map +1 -0
- package/dist/common/rules.js +15 -0
- package/dist/common/rules.js.map +1 -0
- package/dist/common/selector-constraints-to-string.d.ts +2 -0
- package/dist/common/selector-constraints-to-string.d.ts.map +1 -0
- package/dist/common/selector-constraints-to-string.js +14 -0
- package/dist/common/selector-constraints-to-string.js.map +1 -0
- package/dist/common/serialize-error.d.ts +6 -0
- package/dist/common/serialize-error.d.ts.map +1 -0
- package/dist/common/serialize-error.js +18 -0
- package/dist/common/serialize-error.js.map +1 -0
- package/dist/common/set-metadata.d.ts +10 -0
- package/dist/common/set-metadata.d.ts.map +1 -0
- package/dist/common/set-metadata.js +37 -0
- package/dist/common/set-metadata.js.map +1 -0
- package/dist/common/simple-hash.d.ts +2 -0
- package/dist/common/simple-hash.d.ts.map +1 -0
- package/dist/common/simple-hash.js +12 -0
- package/dist/common/simple-hash.js.map +1 -0
- package/dist/common/string-to-select-relation-object.d.ts +74 -0
- package/dist/common/string-to-select-relation-object.d.ts.map +1 -0
- package/dist/common/string-to-select-relation-object.js +93 -0
- package/dist/common/string-to-select-relation-object.js.map +1 -0
- package/dist/common/stringify-circular.d.ts +2 -0
- package/dist/common/stringify-circular.d.ts.map +1 -0
- package/dist/common/stringify-circular.js +49 -0
- package/dist/common/stringify-circular.js.map +1 -0
- package/dist/common/to-camel-case.d.ts +2 -0
- package/dist/common/to-camel-case.d.ts.map +1 -0
- package/dist/common/to-camel-case.js +11 -0
- package/dist/common/to-camel-case.js.map +1 -0
- package/dist/common/to-handle.d.ts +10 -0
- package/dist/common/to-handle.d.ts.map +1 -0
- package/dist/common/to-handle.js +22 -0
- package/dist/common/to-handle.js.map +1 -0
- package/dist/common/to-kebab-case.d.ts +2 -0
- package/dist/common/to-kebab-case.d.ts.map +1 -0
- package/dist/common/to-kebab-case.js +9 -0
- package/dist/common/to-kebab-case.js.map +1 -0
- package/dist/common/to-pascal-case.d.ts +2 -0
- package/dist/common/to-pascal-case.d.ts.map +1 -0
- package/dist/common/to-pascal-case.js +7 -0
- package/dist/common/to-pascal-case.js.map +1 -0
- package/dist/common/to-unix-slash.d.ts +2 -0
- package/dist/common/to-unix-slash.d.ts.map +1 -0
- package/dist/common/to-unix-slash.js +11 -0
- package/dist/common/to-unix-slash.js.map +1 -0
- package/dist/common/trim-zeros.d.ts +2 -0
- package/dist/common/trim-zeros.d.ts.map +1 -0
- package/dist/common/trim-zeros.js +17 -0
- package/dist/common/trim-zeros.js.map +1 -0
- package/dist/common/try-convert-to-number.d.ts +7 -0
- package/dist/common/try-convert-to-number.d.ts.map +1 -0
- package/dist/common/try-convert-to-number.js +10 -0
- package/dist/common/try-convert-to-number.js.map +1 -0
- package/dist/common/unflatten-object-keys.d.ts +29 -0
- package/dist/common/unflatten-object-keys.d.ts.map +1 -0
- package/dist/common/unflatten-object-keys.js +67 -0
- package/dist/common/unflatten-object-keys.js.map +1 -0
- package/dist/common/upper-case-first.d.ts +2 -0
- package/dist/common/upper-case-first.d.ts.map +1 -0
- package/dist/common/upper-case-first.js +7 -0
- package/dist/common/upper-case-first.js.map +1 -0
- package/dist/common/validate-handle.d.ts +6 -0
- package/dist/common/validate-handle.d.ts.map +1 -0
- package/dist/common/validate-handle.js +12 -0
- package/dist/common/validate-handle.js.map +1 -0
- package/dist/common/validate-module-name.d.ts +2 -0
- package/dist/common/validate-module-name.d.ts.map +1 -0
- package/dist/common/validate-module-name.js +27 -0
- package/dist/common/validate-module-name.js.map +1 -0
- package/dist/common/wrap-handler.d.ts +19 -0
- package/dist/common/wrap-handler.d.ts.map +1 -0
- package/dist/common/wrap-handler.js +36 -0
- package/dist/common/wrap-handler.js.map +1 -0
- package/dist/core-flows/events.d.ts +85 -0
- package/dist/core-flows/events.d.ts.map +1 -0
- package/dist/core-flows/events.js +88 -0
- package/dist/core-flows/events.js.map +1 -0
- package/dist/core-flows/index.d.ts +2 -0
- package/dist/core-flows/index.d.ts.map +1 -0
- package/dist/core-flows/index.js +18 -0
- package/dist/core-flows/index.js.map +1 -0
- package/dist/dal/index.d.ts +11 -0
- package/dist/dal/index.d.ts.map +1 -0
- package/dist/dal/index.js +27 -0
- package/dist/dal/index.js.map +1 -0
- package/dist/dal/mikro-orm/base-entity.d.ts +12 -0
- package/dist/dal/mikro-orm/base-entity.d.ts.map +1 -0
- package/dist/dal/mikro-orm/base-entity.js +76 -0
- package/dist/dal/mikro-orm/base-entity.js.map +1 -0
- package/dist/dal/mikro-orm/big-number-field.d.ts +5 -0
- package/dist/dal/mikro-orm/big-number-field.d.ts.map +1 -0
- package/dist/dal/mikro-orm/big-number-field.js +91 -0
- package/dist/dal/mikro-orm/big-number-field.js.map +1 -0
- package/dist/dal/mikro-orm/db-error-mapper.d.ts +2 -0
- package/dist/dal/mikro-orm/db-error-mapper.d.ts.map +1 -0
- package/dist/dal/mikro-orm/db-error-mapper.js +68 -0
- package/dist/dal/mikro-orm/db-error-mapper.js.map +1 -0
- package/dist/dal/mikro-orm/decorators/foreign-key.d.ts +2 -0
- package/dist/dal/mikro-orm/decorators/foreign-key.d.ts.map +1 -0
- package/dist/dal/mikro-orm/decorators/foreign-key.js +13 -0
- package/dist/dal/mikro-orm/decorators/foreign-key.js.map +1 -0
- package/dist/dal/mikro-orm/decorators/searchable.d.ts +2 -0
- package/dist/dal/mikro-orm/decorators/searchable.d.ts.map +1 -0
- package/dist/dal/mikro-orm/decorators/searchable.js +13 -0
- package/dist/dal/mikro-orm/decorators/searchable.js.map +1 -0
- package/dist/dal/mikro-orm/mikro-orm-create-connection.d.ts +22 -0
- package/dist/dal/mikro-orm/mikro-orm-create-connection.d.ts.map +1 -0
- package/dist/dal/mikro-orm/mikro-orm-create-connection.js +86 -0
- package/dist/dal/mikro-orm/mikro-orm-create-connection.js.map +1 -0
- package/dist/dal/mikro-orm/mikro-orm-free-text-search-filter.d.ts +19 -0
- package/dist/dal/mikro-orm/mikro-orm-free-text-search-filter.d.ts.map +1 -0
- package/dist/dal/mikro-orm/mikro-orm-free-text-search-filter.js +103 -0
- package/dist/dal/mikro-orm/mikro-orm-free-text-search-filter.js.map +1 -0
- package/dist/dal/mikro-orm/mikro-orm-repository.d.ts +69 -0
- package/dist/dal/mikro-orm/mikro-orm-repository.d.ts.map +1 -0
- package/dist/dal/mikro-orm/mikro-orm-repository.js +645 -0
- package/dist/dal/mikro-orm/mikro-orm-repository.js.map +1 -0
- package/dist/dal/mikro-orm/mikro-orm-serializer.d.ts +19 -0
- package/dist/dal/mikro-orm/mikro-orm-serializer.d.ts.map +1 -0
- package/dist/dal/mikro-orm/mikro-orm-serializer.js +243 -0
- package/dist/dal/mikro-orm/mikro-orm-serializer.js.map +1 -0
- package/dist/dal/mikro-orm/mikro-orm-soft-deletable-filter.d.ts +16 -0
- package/dist/dal/mikro-orm/mikro-orm-soft-deletable-filter.d.ts.map +1 -0
- package/dist/dal/mikro-orm/mikro-orm-soft-deletable-filter.js +18 -0
- package/dist/dal/mikro-orm/mikro-orm-soft-deletable-filter.js.map +1 -0
- package/dist/dal/mikro-orm/utils.d.ts +19 -0
- package/dist/dal/mikro-orm/utils.d.ts.map +1 -0
- package/dist/dal/mikro-orm/utils.js +142 -0
- package/dist/dal/mikro-orm/utils.js.map +1 -0
- package/dist/dal/utils.d.ts +7 -0
- package/dist/dal/utils.d.ts.map +1 -0
- package/dist/dal/utils.js +33 -0
- package/dist/dal/utils.js.map +1 -0
- package/dist/defaults/countries.d.ts +8 -0
- package/dist/defaults/countries.d.ts.map +1 -0
- package/dist/defaults/countries.js +401 -0
- package/dist/defaults/countries.js.map +1 -0
- package/dist/defaults/currencies.d.ts +11 -0
- package/dist/defaults/currencies.d.ts.map +1 -0
- package/dist/defaults/currencies.js +1086 -0
- package/dist/defaults/currencies.js.map +1 -0
- package/dist/defaults/index.d.ts +3 -0
- package/dist/defaults/index.d.ts.map +1 -0
- package/dist/defaults/index.js +19 -0
- package/dist/defaults/index.js.map +1 -0
- package/dist/dml/entity-builder.d.ts +400 -0
- package/dist/dml/entity-builder.d.ts.map +1 -0
- package/dist/dml/entity-builder.js +379 -0
- package/dist/dml/entity-builder.js.map +1 -0
- package/dist/dml/entity.d.ts +136 -0
- package/dist/dml/entity.d.ts.map +1 -0
- package/dist/dml/entity.js +203 -0
- package/dist/dml/entity.js.map +1 -0
- package/dist/dml/errors.d.ts +4 -0
- package/dist/dml/errors.d.ts.map +1 -0
- package/dist/dml/errors.js +10 -0
- package/dist/dml/errors.js.map +1 -0
- package/dist/dml/helpers/create-graphql.d.ts +8 -0
- package/dist/dml/helpers/create-graphql.d.ts.map +1 -0
- package/dist/dml/helpers/create-graphql.js +70 -0
- package/dist/dml/helpers/create-graphql.js.map +1 -0
- package/dist/dml/helpers/create-mikro-orm-entity.d.ts +27 -0
- package/dist/dml/helpers/create-mikro-orm-entity.d.ts.map +1 -0
- package/dist/dml/helpers/create-mikro-orm-entity.js +139 -0
- package/dist/dml/helpers/create-mikro-orm-entity.js.map +1 -0
- package/dist/dml/helpers/entity-builder/apply-searchable.d.ts +6 -0
- package/dist/dml/helpers/entity-builder/apply-searchable.d.ts.map +1 -0
- package/dist/dml/helpers/entity-builder/apply-searchable.js +24 -0
- package/dist/dml/helpers/entity-builder/apply-searchable.js.map +1 -0
- package/dist/dml/helpers/entity-builder/build-indexes.d.ts +3 -0
- package/dist/dml/helpers/entity-builder/build-indexes.d.ts.map +1 -0
- package/dist/dml/helpers/entity-builder/build-indexes.js +37 -0
- package/dist/dml/helpers/entity-builder/build-indexes.js.map +1 -0
- package/dist/dml/helpers/entity-builder/create-big-number-properties.d.ts +21 -0
- package/dist/dml/helpers/entity-builder/create-big-number-properties.d.ts.map +1 -0
- package/dist/dml/helpers/entity-builder/create-big-number-properties.js +27 -0
- package/dist/dml/helpers/entity-builder/create-big-number-properties.js.map +1 -0
- package/dist/dml/helpers/entity-builder/create-default-properties.d.ts +9 -0
- package/dist/dml/helpers/entity-builder/create-default-properties.d.ts.map +1 -0
- package/dist/dml/helpers/entity-builder/create-default-properties.js +12 -0
- package/dist/dml/helpers/entity-builder/create-default-properties.js.map +1 -0
- package/dist/dml/helpers/entity-builder/define-property.d.ts +9 -0
- package/dist/dml/helpers/entity-builder/define-property.d.ts.map +1 -0
- package/dist/dml/helpers/entity-builder/define-property.js +289 -0
- package/dist/dml/helpers/entity-builder/define-property.js.map +1 -0
- package/dist/dml/helpers/entity-builder/define-relationship.d.ts +49 -0
- package/dist/dml/helpers/entity-builder/define-relationship.d.ts.map +1 -0
- package/dist/dml/helpers/entity-builder/define-relationship.js +554 -0
- package/dist/dml/helpers/entity-builder/define-relationship.js.map +1 -0
- package/dist/dml/helpers/entity-builder/index.d.ts +10 -0
- package/dist/dml/helpers/entity-builder/index.d.ts.map +1 -0
- package/dist/dml/helpers/entity-builder/index.js +26 -0
- package/dist/dml/helpers/entity-builder/index.js.map +1 -0
- package/dist/dml/helpers/entity-builder/parse-entity-name.d.ts +12 -0
- package/dist/dml/helpers/entity-builder/parse-entity-name.d.ts.map +1 -0
- package/dist/dml/helpers/entity-builder/parse-entity-name.js +30 -0
- package/dist/dml/helpers/entity-builder/parse-entity-name.js.map +1 -0
- package/dist/dml/helpers/entity-builder/query-builder.d.ts +3 -0
- package/dist/dml/helpers/entity-builder/query-builder.d.ts.map +1 -0
- package/dist/dml/helpers/entity-builder/query-builder.js +66 -0
- package/dist/dml/helpers/entity-builder/query-builder.js.map +1 -0
- package/dist/dml/helpers/entity-builder/relationship-helpers.d.ts +6 -0
- package/dist/dml/helpers/entity-builder/relationship-helpers.d.ts.map +1 -0
- package/dist/dml/helpers/entity-builder/relationship-helpers.js +12 -0
- package/dist/dml/helpers/entity-builder/relationship-helpers.js.map +1 -0
- package/dist/dml/helpers/graphql-builder/get-attribute.d.ts +9 -0
- package/dist/dml/helpers/graphql-builder/get-attribute.d.ts.map +1 -0
- package/dist/dml/helpers/graphql-builder/get-attribute.js +68 -0
- package/dist/dml/helpers/graphql-builder/get-attribute.js.map +1 -0
- package/dist/dml/helpers/graphql-builder/set-relationship.d.ts +6 -0
- package/dist/dml/helpers/graphql-builder/set-relationship.d.ts.map +1 -0
- package/dist/dml/helpers/graphql-builder/set-relationship.js +43 -0
- package/dist/dml/helpers/graphql-builder/set-relationship.js.map +1 -0
- package/dist/dml/helpers/mikro-orm/apply-checks.d.ts +7 -0
- package/dist/dml/helpers/mikro-orm/apply-checks.d.ts.map +1 -0
- package/dist/dml/helpers/mikro-orm/apply-checks.js +18 -0
- package/dist/dml/helpers/mikro-orm/apply-checks.js.map +1 -0
- package/dist/dml/helpers/mikro-orm/apply-indexes.d.ts +13 -0
- package/dist/dml/helpers/mikro-orm/apply-indexes.d.ts.map +1 -0
- package/dist/dml/helpers/mikro-orm/apply-indexes.js +43 -0
- package/dist/dml/helpers/mikro-orm/apply-indexes.js.map +1 -0
- package/dist/dml/helpers/mikro-orm/build-indexes.d.ts +3 -0
- package/dist/dml/helpers/mikro-orm/build-indexes.d.ts.map +1 -0
- package/dist/dml/helpers/mikro-orm/build-indexes.js +22 -0
- package/dist/dml/helpers/mikro-orm/build-indexes.js.map +1 -0
- package/dist/dml/index.d.ts +8 -0
- package/dist/dml/index.d.ts.map +1 -0
- package/dist/dml/index.js +24 -0
- package/dist/dml/index.js.map +1 -0
- package/dist/dml/integration-tests/utils.d.ts +6 -0
- package/dist/dml/integration-tests/utils.d.ts.map +1 -0
- package/dist/dml/integration-tests/utils.js +12 -0
- package/dist/dml/integration-tests/utils.js.map +1 -0
- package/dist/dml/properties/array.d.ts +10 -0
- package/dist/dml/properties/array.d.ts.map +1 -0
- package/dist/dml/properties/array.js +17 -0
- package/dist/dml/properties/array.js.map +1 -0
- package/dist/dml/properties/autoincrement.d.ts +32 -0
- package/dist/dml/properties/autoincrement.d.ts.map +1 -0
- package/dist/dml/properties/autoincrement.js +38 -0
- package/dist/dml/properties/autoincrement.js.map +1 -0
- package/dist/dml/properties/base.d.ts +123 -0
- package/dist/dml/properties/base.d.ts.map +1 -0
- package/dist/dml/properties/base.js +166 -0
- package/dist/dml/properties/base.js.map +1 -0
- package/dist/dml/properties/big-number.d.ts +12 -0
- package/dist/dml/properties/big-number.d.ts.map +1 -0
- package/dist/dml/properties/big-number.js +21 -0
- package/dist/dml/properties/big-number.js.map +1 -0
- package/dist/dml/properties/boolean.d.ts +11 -0
- package/dist/dml/properties/boolean.d.ts.map +1 -0
- package/dist/dml/properties/boolean.js +18 -0
- package/dist/dml/properties/boolean.js.map +1 -0
- package/dist/dml/properties/computed.d.ts +22 -0
- package/dist/dml/properties/computed.d.ts.map +1 -0
- package/dist/dml/properties/computed.js +44 -0
- package/dist/dml/properties/computed.js.map +1 -0
- package/dist/dml/properties/date-time.d.ts +11 -0
- package/dist/dml/properties/date-time.d.ts.map +1 -0
- package/dist/dml/properties/date-time.js +18 -0
- package/dist/dml/properties/date-time.js.map +1 -0
- package/dist/dml/properties/enum.d.ts +19 -0
- package/dist/dml/properties/enum.d.ts.map +1 -0
- package/dist/dml/properties/enum.js +27 -0
- package/dist/dml/properties/enum.js.map +1 -0
- package/dist/dml/properties/float.d.ts +12 -0
- package/dist/dml/properties/float.d.ts.map +1 -0
- package/dist/dml/properties/float.js +21 -0
- package/dist/dml/properties/float.js.map +1 -0
- package/dist/dml/properties/id.d.ts +38 -0
- package/dist/dml/properties/id.d.ts.map +1 -0
- package/dist/dml/properties/id.js +46 -0
- package/dist/dml/properties/id.js.map +1 -0
- package/dist/dml/properties/index.d.ts +16 -0
- package/dist/dml/properties/index.d.ts.map +1 -0
- package/dist/dml/properties/index.js +32 -0
- package/dist/dml/properties/index.js.map +1 -0
- package/dist/dml/properties/json.d.ts +11 -0
- package/dist/dml/properties/json.d.ts.map +1 -0
- package/dist/dml/properties/json.js +18 -0
- package/dist/dml/properties/json.js.map +1 -0
- package/dist/dml/properties/nullable.d.ts +27 -0
- package/dist/dml/properties/nullable.d.ts.map +1 -0
- package/dist/dml/properties/nullable.js +51 -0
- package/dist/dml/properties/nullable.js.map +1 -0
- package/dist/dml/properties/number.d.ts +51 -0
- package/dist/dml/properties/number.d.ts.map +1 -0
- package/dist/dml/properties/number.js +57 -0
- package/dist/dml/properties/number.js.map +1 -0
- package/dist/dml/properties/primary-key.d.ts +22 -0
- package/dist/dml/properties/primary-key.d.ts.map +1 -0
- package/dist/dml/properties/primary-key.js +44 -0
- package/dist/dml/properties/primary-key.js.map +1 -0
- package/dist/dml/properties/text.d.ts +47 -0
- package/dist/dml/properties/text.d.ts.map +1 -0
- package/dist/dml/properties/text.js +58 -0
- package/dist/dml/properties/text.js.map +1 -0
- package/dist/dml/relations/base.d.ts +44 -0
- package/dist/dml/relations/base.d.ts.map +1 -0
- package/dist/dml/relations/base.js +68 -0
- package/dist/dml/relations/base.js.map +1 -0
- package/dist/dml/relations/belongs-to.d.ts +13 -0
- package/dist/dml/relations/belongs-to.d.ts.map +1 -0
- package/dist/dml/relations/belongs-to.js +22 -0
- package/dist/dml/relations/belongs-to.js.map +1 -0
- package/dist/dml/relations/has-many.d.ts +16 -0
- package/dist/dml/relations/has-many.d.ts.map +1 -0
- package/dist/dml/relations/has-many.js +25 -0
- package/dist/dml/relations/has-many.js.map +1 -0
- package/dist/dml/relations/has-one-fk.d.ts +23 -0
- package/dist/dml/relations/has-one-fk.d.ts.map +1 -0
- package/dist/dml/relations/has-one-fk.js +32 -0
- package/dist/dml/relations/has-one-fk.js.map +1 -0
- package/dist/dml/relations/has-one.d.ts +21 -0
- package/dist/dml/relations/has-one.d.ts.map +1 -0
- package/dist/dml/relations/has-one.js +32 -0
- package/dist/dml/relations/has-one.js.map +1 -0
- package/dist/dml/relations/index.d.ts +8 -0
- package/dist/dml/relations/index.d.ts.map +1 -0
- package/dist/dml/relations/index.js +24 -0
- package/dist/dml/relations/index.js.map +1 -0
- package/dist/dml/relations/many-to-many.d.ts +17 -0
- package/dist/dml/relations/many-to-many.d.ts.map +1 -0
- package/dist/dml/relations/many-to-many.js +26 -0
- package/dist/dml/relations/many-to-many.js.map +1 -0
- package/dist/dml/relations/nullable.d.ts +26 -0
- package/dist/dml/relations/nullable.d.ts.map +1 -0
- package/dist/dml/relations/nullable.js +47 -0
- package/dist/dml/relations/nullable.js.map +1 -0
- package/dist/event-bus/build-event-messages.d.ts +18 -0
- package/dist/event-bus/build-event-messages.d.ts.map +1 -0
- package/dist/event-bus/build-event-messages.js +32 -0
- package/dist/event-bus/build-event-messages.js.map +1 -0
- package/dist/event-bus/common-events.d.ts +9 -0
- package/dist/event-bus/common-events.d.ts.map +1 -0
- package/dist/event-bus/common-events.js +13 -0
- package/dist/event-bus/common-events.js.map +1 -0
- package/dist/event-bus/index.d.ts +22 -0
- package/dist/event-bus/index.d.ts.map +1 -0
- package/dist/event-bus/index.js +83 -0
- package/dist/event-bus/index.js.map +1 -0
- package/dist/event-bus/message-aggregator.d.ts +18 -0
- package/dist/event-bus/message-aggregator.d.ts.map +1 -0
- package/dist/event-bus/message-aggregator.js +118 -0
- package/dist/event-bus/message-aggregator.js.map +1 -0
- package/dist/event-bus/utils.d.ts +45 -0
- package/dist/event-bus/utils.d.ts.map +1 -0
- package/dist/event-bus/utils.js +52 -0
- package/dist/event-bus/utils.js.map +1 -0
- package/dist/exceptions/index.d.ts +3 -0
- package/dist/exceptions/index.d.ts.map +1 -0
- package/dist/exceptions/index.js +19 -0
- package/dist/exceptions/index.js.map +1 -0
- package/dist/exceptions/is-duplicate-error.d.ts +4 -0
- package/dist/exceptions/is-duplicate-error.d.ts.map +1 -0
- package/dist/exceptions/is-duplicate-error.js +9 -0
- package/dist/exceptions/is-duplicate-error.js.map +1 -0
- package/dist/exceptions/postgres-error.d.ts +7 -0
- package/dist/exceptions/postgres-error.d.ts.map +1 -0
- package/dist/exceptions/postgres-error.js +11 -0
- package/dist/exceptions/postgres-error.js.map +1 -0
- package/dist/feature-flags/analytics.d.ts +3 -0
- package/dist/feature-flags/analytics.d.ts.map +1 -0
- package/dist/feature-flags/analytics.js +10 -0
- package/dist/feature-flags/analytics.js.map +1 -0
- package/dist/feature-flags/index.d.ts +11 -0
- package/dist/feature-flags/index.d.ts.map +1 -0
- package/dist/feature-flags/index.js +27 -0
- package/dist/feature-flags/index.js.map +1 -0
- package/dist/feature-flags/many-to-many-inventory.d.ts +3 -0
- package/dist/feature-flags/many-to-many-inventory.d.ts.map +1 -0
- package/dist/feature-flags/many-to-many-inventory.js +10 -0
- package/dist/feature-flags/many-to-many-inventory.js.map +1 -0
- package/dist/feature-flags/medusa-v2.d.ts +3 -0
- package/dist/feature-flags/medusa-v2.d.ts.map +1 -0
- package/dist/feature-flags/medusa-v2.js +10 -0
- package/dist/feature-flags/medusa-v2.js.map +1 -0
- package/dist/feature-flags/order-editing.d.ts +3 -0
- package/dist/feature-flags/order-editing.d.ts.map +1 -0
- package/dist/feature-flags/order-editing.js +10 -0
- package/dist/feature-flags/order-editing.js.map +1 -0
- package/dist/feature-flags/product-categories.d.ts +3 -0
- package/dist/feature-flags/product-categories.d.ts.map +1 -0
- package/dist/feature-flags/product-categories.js +10 -0
- package/dist/feature-flags/product-categories.js.map +1 -0
- package/dist/feature-flags/publishable-api-keys.d.ts +3 -0
- package/dist/feature-flags/publishable-api-keys.d.ts.map +1 -0
- package/dist/feature-flags/publishable-api-keys.js +10 -0
- package/dist/feature-flags/publishable-api-keys.js.map +1 -0
- package/dist/feature-flags/sales-channels.d.ts +3 -0
- package/dist/feature-flags/sales-channels.d.ts.map +1 -0
- package/dist/feature-flags/sales-channels.js +10 -0
- package/dist/feature-flags/sales-channels.js.map +1 -0
- package/dist/feature-flags/tax-inclusive-pricing.d.ts +3 -0
- package/dist/feature-flags/tax-inclusive-pricing.d.ts.map +1 -0
- package/dist/feature-flags/tax-inclusive-pricing.js +10 -0
- package/dist/feature-flags/tax-inclusive-pricing.js.map +1 -0
- package/dist/feature-flags/utils/flag-router.d.ts +32 -0
- package/dist/feature-flags/utils/flag-router.d.ts.map +1 -0
- package/dist/feature-flags/utils/flag-router.js +67 -0
- package/dist/feature-flags/utils/flag-router.js.map +1 -0
- package/dist/feature-flags/utils/index.d.ts +2 -0
- package/dist/feature-flags/utils/index.d.ts.map +1 -0
- package/dist/feature-flags/utils/index.js +18 -0
- package/dist/feature-flags/utils/index.js.map +1 -0
- package/dist/feature-flags/workflows.d.ts +3 -0
- package/dist/feature-flags/workflows.d.ts.map +1 -0
- package/dist/feature-flags/workflows.js +10 -0
- package/dist/feature-flags/workflows.js.map +1 -0
- package/dist/file/abstract-file-provider.d.ts +160 -0
- package/dist/file/abstract-file-provider.d.ts.map +1 -0
- package/dist/file/abstract-file-provider.js +159 -0
- package/dist/file/abstract-file-provider.js.map +1 -0
- package/dist/file/index.d.ts +2 -0
- package/dist/file/index.d.ts.map +1 -0
- package/dist/file/index.js +18 -0
- package/dist/file/index.js.map +1 -0
- package/dist/fulfillment/events.d.ts +71 -0
- package/dist/fulfillment/events.d.ts.map +1 -0
- package/dist/fulfillment/events.js +24 -0
- package/dist/fulfillment/events.js.map +1 -0
- package/dist/fulfillment/geo-zone.d.ts +7 -0
- package/dist/fulfillment/geo-zone.d.ts.map +1 -0
- package/dist/fulfillment/geo-zone.js +11 -0
- package/dist/fulfillment/geo-zone.js.map +1 -0
- package/dist/fulfillment/index.d.ts +5 -0
- package/dist/fulfillment/index.d.ts.map +1 -0
- package/dist/fulfillment/index.js +21 -0
- package/dist/fulfillment/index.js.map +1 -0
- package/dist/fulfillment/provider.d.ts +394 -0
- package/dist/fulfillment/provider.d.ts.map +1 -0
- package/dist/fulfillment/provider.js +412 -0
- package/dist/fulfillment/provider.js.map +1 -0
- package/dist/fulfillment/shipping-options.d.ts +5 -0
- package/dist/fulfillment/shipping-options.d.ts.map +1 -0
- package/dist/fulfillment/shipping-options.js +9 -0
- package/dist/fulfillment/shipping-options.js.map +1 -0
- package/dist/graphql/clean-graphql.d.ts +5 -0
- package/dist/graphql/clean-graphql.d.ts.map +1 -0
- package/dist/graphql/clean-graphql.js +83 -0
- package/dist/graphql/clean-graphql.js.map +1 -0
- package/dist/graphql/extract-relations-from-graphql.d.ts +7 -0
- package/dist/graphql/extract-relations-from-graphql.d.ts.map +1 -0
- package/dist/graphql/extract-relations-from-graphql.js +36 -0
- package/dist/graphql/extract-relations-from-graphql.js.map +1 -0
- package/dist/graphql/get-fields-and-relations.d.ts +11 -0
- package/dist/graphql/get-fields-and-relations.d.ts.map +1 -0
- package/dist/graphql/get-fields-and-relations.js +36 -0
- package/dist/graphql/get-fields-and-relations.js.map +1 -0
- package/dist/graphql/graphql-parser.d.ts +16 -0
- package/dist/graphql/graphql-parser.d.ts.map +1 -0
- package/dist/graphql/graphql-parser.js +119 -0
- package/dist/graphql/graphql-parser.js.map +1 -0
- package/dist/graphql/graphql-to-fields.d.ts +60 -0
- package/dist/graphql/graphql-to-fields.d.ts.map +1 -0
- package/dist/graphql/graphql-to-fields.js +86 -0
- package/dist/graphql/graphql-to-fields.js.map +1 -0
- package/dist/graphql/graphql-to-ts-types.d.ts +10 -0
- package/dist/graphql/graphql-to-ts-types.d.ts.map +1 -0
- package/dist/graphql/graphql-to-ts-types.js +121 -0
- package/dist/graphql/graphql-to-ts-types.js.map +1 -0
- package/dist/graphql/index.d.ts +11 -0
- package/dist/graphql/index.d.ts.map +1 -0
- package/dist/graphql/index.js +30 -0
- package/dist/graphql/index.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +50 -0
- package/dist/index.js.map +1 -0
- package/dist/inventory/events.d.ts +26 -0
- package/dist/inventory/events.d.ts.map +1 -0
- package/dist/inventory/events.js +12 -0
- package/dist/inventory/events.js.map +1 -0
- package/dist/inventory/index.d.ts +2 -0
- package/dist/inventory/index.d.ts.map +1 -0
- package/dist/inventory/index.js +18 -0
- package/dist/inventory/index.js.map +1 -0
- package/dist/link/compose-link-name.d.ts +3 -0
- package/dist/link/compose-link-name.d.ts.map +1 -0
- package/dist/link/compose-link-name.js +13 -0
- package/dist/link/compose-link-name.js.map +1 -0
- package/dist/link/index.d.ts +3 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +19 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/links.d.ts +24 -0
- package/dist/link/links.d.ts.map +1 -0
- package/dist/link/links.js +29 -0
- package/dist/link/links.js.map +1 -0
- package/dist/migrations/index.d.ts +54 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +169 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/modules-sdk/build-query.d.ts +5 -0
- package/dist/modules-sdk/build-query.d.ts.map +1 -0
- package/dist/modules-sdk/build-query.js +71 -0
- package/dist/modules-sdk/build-query.js.map +1 -0
- package/dist/modules-sdk/create-pg-connection.d.ts +11 -0
- package/dist/modules-sdk/create-pg-connection.d.ts.map +1 -0
- package/dist/modules-sdk/create-pg-connection.js +32 -0
- package/dist/modules-sdk/create-pg-connection.js.map +1 -0
- package/dist/modules-sdk/decorators/context-parameter.d.ts +6 -0
- package/dist/modules-sdk/decorators/context-parameter.d.ts.map +1 -0
- package/dist/modules-sdk/decorators/context-parameter.js +15 -0
- package/dist/modules-sdk/decorators/context-parameter.js.map +1 -0
- package/dist/modules-sdk/decorators/emit-events.d.ts +9 -0
- package/dist/modules-sdk/decorators/emit-events.d.ts.map +1 -0
- package/dist/modules-sdk/decorators/emit-events.js +36 -0
- package/dist/modules-sdk/decorators/emit-events.js.map +1 -0
- package/dist/modules-sdk/decorators/index.d.ts +7 -0
- package/dist/modules-sdk/decorators/index.d.ts.map +1 -0
- package/dist/modules-sdk/decorators/index.js +23 -0
- package/dist/modules-sdk/decorators/index.js.map +1 -0
- package/dist/modules-sdk/decorators/inject-into-context.d.ts +2 -0
- package/dist/modules-sdk/decorators/inject-into-context.d.ts.map +1 -0
- package/dist/modules-sdk/decorators/inject-into-context.js +24 -0
- package/dist/modules-sdk/decorators/inject-into-context.js.map +1 -0
- package/dist/modules-sdk/decorators/inject-manager.d.ts +2 -0
- package/dist/modules-sdk/decorators/inject-manager.d.ts.map +1 -0
- package/dist/modules-sdk/decorators/inject-manager.js +49 -0
- package/dist/modules-sdk/decorators/inject-manager.js.map +1 -0
- package/dist/modules-sdk/decorators/inject-shared-context.d.ts +2 -0
- package/dist/modules-sdk/decorators/inject-shared-context.d.ts.map +1 -0
- package/dist/modules-sdk/decorators/inject-shared-context.js +21 -0
- package/dist/modules-sdk/decorators/inject-shared-context.js.map +1 -0
- package/dist/modules-sdk/decorators/inject-transaction-manager.d.ts +2 -0
- package/dist/modules-sdk/decorators/inject-transaction-manager.d.ts.map +1 -0
- package/dist/modules-sdk/decorators/inject-transaction-manager.js +51 -0
- package/dist/modules-sdk/decorators/inject-transaction-manager.js.map +1 -0
- package/dist/modules-sdk/decorators/module.d.ts +2 -0
- package/dist/modules-sdk/decorators/module.d.ts.map +1 -0
- package/dist/modules-sdk/decorators/module.js +3 -0
- package/dist/modules-sdk/decorators/module.js.map +1 -0
- package/dist/modules-sdk/define-link.d.ts +68 -0
- package/dist/modules-sdk/define-link.d.ts.map +1 -0
- package/dist/modules-sdk/define-link.js +329 -0
- package/dist/modules-sdk/define-link.js.map +1 -0
- package/dist/modules-sdk/definition.d.ts +96 -0
- package/dist/modules-sdk/definition.d.ts.map +1 -0
- package/dist/modules-sdk/definition.js +76 -0
- package/dist/modules-sdk/definition.js.map +1 -0
- package/dist/modules-sdk/event-builder-factory.d.ts +37 -0
- package/dist/modules-sdk/event-builder-factory.d.ts.map +1 -0
- package/dist/modules-sdk/event-builder-factory.js +56 -0
- package/dist/modules-sdk/event-builder-factory.js.map +1 -0
- package/dist/modules-sdk/index.d.ts +24 -0
- package/dist/modules-sdk/index.d.ts.map +1 -0
- package/dist/modules-sdk/index.js +40 -0
- package/dist/modules-sdk/index.js.map +1 -0
- package/dist/modules-sdk/joiner-config-builder.d.ts +115 -0
- package/dist/modules-sdk/joiner-config-builder.d.ts.map +1 -0
- package/dist/modules-sdk/joiner-config-builder.js +403 -0
- package/dist/modules-sdk/joiner-config-builder.js.map +1 -0
- package/dist/modules-sdk/load-module-database-config.d.ts +9 -0
- package/dist/modules-sdk/load-module-database-config.d.ts.map +1 -0
- package/dist/modules-sdk/load-module-database-config.js +80 -0
- package/dist/modules-sdk/load-module-database-config.js.map +1 -0
- package/dist/modules-sdk/loaders/container-loader-factory.d.ts +48 -0
- package/dist/modules-sdk/loaders/container-loader-factory.d.ts.map +1 -0
- package/dist/modules-sdk/loaders/container-loader-factory.js +105 -0
- package/dist/modules-sdk/loaders/container-loader-factory.js.map +1 -0
- package/dist/modules-sdk/loaders/load-models.d.ts +6 -0
- package/dist/modules-sdk/loaders/load-models.d.ts.map +1 -0
- package/dist/modules-sdk/loaders/load-models.js +36 -0
- package/dist/modules-sdk/loaders/load-models.js.map +1 -0
- package/dist/modules-sdk/loaders/mikro-orm-connection-loader-factory.d.ts +13 -0
- package/dist/modules-sdk/loaders/mikro-orm-connection-loader-factory.d.ts.map +1 -0
- package/dist/modules-sdk/loaders/mikro-orm-connection-loader-factory.js +25 -0
- package/dist/modules-sdk/loaders/mikro-orm-connection-loader-factory.js.map +1 -0
- package/dist/modules-sdk/loaders/mikro-orm-connection-loader.d.ts +22 -0
- package/dist/modules-sdk/loaders/mikro-orm-connection-loader.d.ts.map +1 -0
- package/dist/modules-sdk/loaders/mikro-orm-connection-loader.js +90 -0
- package/dist/modules-sdk/loaders/mikro-orm-connection-loader.js.map +1 -0
- package/dist/modules-sdk/medusa-internal-service.d.ts +5 -0
- package/dist/modules-sdk/medusa-internal-service.d.ts.map +1 -0
- package/dist/modules-sdk/medusa-internal-service.js +333 -0
- package/dist/modules-sdk/medusa-internal-service.js.map +1 -0
- package/dist/modules-sdk/medusa-service.d.ts +47 -0
- package/dist/modules-sdk/medusa-service.d.ts.map +1 -0
- package/dist/modules-sdk/medusa-service.js +308 -0
- package/dist/modules-sdk/medusa-service.js.map +1 -0
- package/dist/modules-sdk/migration-scripts/index.d.ts +5 -0
- package/dist/modules-sdk/migration-scripts/index.d.ts.map +1 -0
- package/dist/modules-sdk/migration-scripts/index.js +21 -0
- package/dist/modules-sdk/migration-scripts/index.js.map +1 -0
- package/dist/modules-sdk/migration-scripts/migration-down.d.ts +12 -0
- package/dist/modules-sdk/migration-scripts/migration-down.d.ts.map +1 -0
- package/dist/modules-sdk/migration-scripts/migration-down.js +53 -0
- package/dist/modules-sdk/migration-scripts/migration-down.js.map +1 -0
- package/dist/modules-sdk/migration-scripts/migration-generate.d.ts +14 -0
- package/dist/modules-sdk/migration-scripts/migration-generate.d.ts.map +1 -0
- package/dist/modules-sdk/migration-scripts/migration-generate.js +51 -0
- package/dist/modules-sdk/migration-scripts/migration-generate.js.map +1 -0
- package/dist/modules-sdk/migration-scripts/migration-up.d.ts +12 -0
- package/dist/modules-sdk/migration-scripts/migration-up.d.ts.map +1 -0
- package/dist/modules-sdk/migration-scripts/migration-up.js +50 -0
- package/dist/modules-sdk/migration-scripts/migration-up.js.map +1 -0
- package/dist/modules-sdk/migration-scripts/seed.d.ts +21 -0
- package/dist/modules-sdk/migration-scripts/seed.d.ts.map +1 -0
- package/dist/modules-sdk/migration-scripts/seed.js +38 -0
- package/dist/modules-sdk/migration-scripts/seed.js.map +1 -0
- package/dist/modules-sdk/mikro-orm-cli-config-builder.d.ts +20 -0
- package/dist/modules-sdk/mikro-orm-cli-config-builder.d.ts.map +1 -0
- package/dist/modules-sdk/mikro-orm-cli-config-builder.js +39 -0
- package/dist/modules-sdk/mikro-orm-cli-config-builder.js.map +1 -0
- package/dist/modules-sdk/module-provider-registration-key.d.ts +11 -0
- package/dist/modules-sdk/module-provider-registration-key.d.ts.map +1 -0
- package/dist/modules-sdk/module-provider-registration-key.js +15 -0
- package/dist/modules-sdk/module-provider-registration-key.js.map +1 -0
- package/dist/modules-sdk/module-provider.d.ts +10 -0
- package/dist/modules-sdk/module-provider.d.ts.map +1 -0
- package/dist/modules-sdk/module-provider.js +18 -0
- package/dist/modules-sdk/module-provider.js.map +1 -0
- package/dist/modules-sdk/module.d.ts +16 -0
- package/dist/modules-sdk/module.d.ts.map +1 -0
- package/dist/modules-sdk/module.js +40 -0
- package/dist/modules-sdk/module.js.map +1 -0
- package/dist/modules-sdk/modules-to-container-types.d.ts +10 -0
- package/dist/modules-sdk/modules-to-container-types.d.ts.map +1 -0
- package/dist/modules-sdk/modules-to-container-types.js +111 -0
- package/dist/modules-sdk/modules-to-container-types.js.map +1 -0
- package/dist/modules-sdk/query-context.d.ts +7 -0
- package/dist/modules-sdk/query-context.d.ts.map +1 -0
- package/dist/modules-sdk/query-context.js +15 -0
- package/dist/modules-sdk/query-context.js.map +1 -0
- package/dist/modules-sdk/types/links-config.d.ts +133 -0
- package/dist/modules-sdk/types/links-config.d.ts.map +1 -0
- package/dist/modules-sdk/types/links-config.js +6 -0
- package/dist/modules-sdk/types/links-config.js.map +1 -0
- package/dist/modules-sdk/types/medusa-service.d.ts +140 -0
- package/dist/modules-sdk/types/medusa-service.d.ts.map +1 -0
- package/dist/modules-sdk/types/medusa-service.js +3 -0
- package/dist/modules-sdk/types/medusa-service.js.map +1 -0
- package/dist/notification/abstract-notification-provider.d.ts +112 -0
- package/dist/notification/abstract-notification-provider.d.ts.map +1 -0
- package/dist/notification/abstract-notification-provider.js +107 -0
- package/dist/notification/abstract-notification-provider.js.map +1 -0
- package/dist/notification/common.d.ts +6 -0
- package/dist/notification/common.d.ts.map +1 -0
- package/dist/notification/common.js +10 -0
- package/dist/notification/common.js.map +1 -0
- package/dist/notification/events.d.ts +14 -0
- package/dist/notification/events.d.ts.map +1 -0
- package/dist/notification/events.js +8 -0
- package/dist/notification/events.js.map +1 -0
- package/dist/notification/index.d.ts +4 -0
- package/dist/notification/index.d.ts.map +1 -0
- package/dist/notification/index.js +20 -0
- package/dist/notification/index.js.map +1 -0
- package/dist/orchestration/index.d.ts +3 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +19 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/symbol.d.ts +11 -0
- package/dist/orchestration/symbol.d.ts.map +1 -0
- package/dist/orchestration/symbol.js +14 -0
- package/dist/orchestration/symbol.js.map +1 -0
- package/dist/orchestration/types.d.ts +33 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/orchestration/types.js +40 -0
- package/dist/orchestration/types.js.map +1 -0
- package/dist/order/index.d.ts +4 -0
- package/dist/order/index.d.ts.map +1 -0
- package/dist/order/index.js +20 -0
- package/dist/order/index.js.map +1 -0
- package/dist/order/order-change-action.d.ts +24 -0
- package/dist/order/order-change-action.d.ts.map +1 -0
- package/dist/order/order-change-action.js +28 -0
- package/dist/order/order-change-action.js.map +1 -0
- package/dist/order/order-change.d.ts +31 -0
- package/dist/order/order-change.d.ts.map +1 -0
- package/dist/order/order-change.js +36 -0
- package/dist/order/order-change.js.map +1 -0
- package/dist/order/status.d.ts +85 -0
- package/dist/order/status.d.ts.map +1 -0
- package/dist/order/status.js +92 -0
- package/dist/order/status.js.map +1 -0
- package/dist/payment/abstract-payment-provider.d.ts +518 -0
- package/dist/payment/abstract-payment-provider.d.ts.map +1 -0
- package/dist/payment/abstract-payment-provider.js +107 -0
- package/dist/payment/abstract-payment-provider.js.map +1 -0
- package/dist/payment/events.d.ts +5 -0
- package/dist/payment/events.d.ts.map +1 -0
- package/dist/payment/events.js +8 -0
- package/dist/payment/events.js.map +1 -0
- package/dist/payment/index.d.ts +6 -0
- package/dist/payment/index.d.ts.map +1 -0
- package/dist/payment/index.js +22 -0
- package/dist/payment/index.js.map +1 -0
- package/dist/payment/payment-collection.d.ts +40 -0
- package/dist/payment/payment-collection.d.ts.map +1 -0
- package/dist/payment/payment-collection.js +44 -0
- package/dist/payment/payment-collection.js.map +1 -0
- package/dist/payment/payment-session.d.ts +32 -0
- package/dist/payment/payment-session.d.ts.map +1 -0
- package/dist/payment/payment-session.js +36 -0
- package/dist/payment/payment-session.js.map +1 -0
- package/dist/payment/webhook.d.ts +37 -0
- package/dist/payment/webhook.d.ts.map +1 -0
- package/dist/payment/webhook.js +42 -0
- package/dist/payment/webhook.js.map +1 -0
- package/dist/pg/index.d.ts +22 -0
- package/dist/pg/index.d.ts.map +1 -0
- package/dist/pg/index.js +52 -0
- package/dist/pg/index.js.map +1 -0
- package/dist/pricing/builders.d.ts +10 -0
- package/dist/pricing/builders.d.ts.map +1 -0
- package/dist/pricing/builders.js +53 -0
- package/dist/pricing/builders.js.map +1 -0
- package/dist/pricing/enums.d.ts +8 -0
- package/dist/pricing/enums.d.ts.map +1 -0
- package/dist/pricing/enums.js +12 -0
- package/dist/pricing/enums.js.map +1 -0
- package/dist/pricing/events.d.ts +38 -0
- package/dist/pricing/events.d.ts.map +1 -0
- package/dist/pricing/events.js +8 -0
- package/dist/pricing/events.js.map +1 -0
- package/dist/pricing/index.d.ts +5 -0
- package/dist/pricing/index.d.ts.map +1 -0
- package/dist/pricing/index.js +21 -0
- package/dist/pricing/index.js.map +1 -0
- package/dist/pricing/price-list.d.ts +9 -0
- package/dist/pricing/price-list.d.ts.map +1 -0
- package/dist/pricing/price-list.js +14 -0
- package/dist/pricing/price-list.js.map +1 -0
- package/dist/product/events.d.ts +56 -0
- package/dist/product/events.d.ts.map +1 -0
- package/dist/product/events.js +17 -0
- package/dist/product/events.js.map +1 -0
- package/dist/product/get-variant-availability.d.ts +59 -0
- package/dist/product/get-variant-availability.d.ts.map +1 -0
- package/dist/product/get-variant-availability.js +100 -0
- package/dist/product/get-variant-availability.js.map +1 -0
- package/dist/product/index.d.ts +9 -0
- package/dist/product/index.d.ts.map +1 -0
- package/dist/product/index.js +27 -0
- package/dist/product/index.js.map +1 -0
- package/dist/promotion/index.d.ts +53 -0
- package/dist/promotion/index.d.ts.map +1 -0
- package/dist/promotion/index.js +66 -0
- package/dist/promotion/index.js.map +1 -0
- package/dist/search/abstract-service.d.ts +345 -0
- package/dist/search/abstract-service.d.ts.map +1 -0
- package/dist/search/abstract-service.js +139 -0
- package/dist/search/abstract-service.js.map +1 -0
- package/dist/search/index-types.d.ts +4 -0
- package/dist/search/index-types.d.ts.map +1 -0
- package/dist/search/index-types.js +7 -0
- package/dist/search/index-types.js.map +1 -0
- package/dist/search/index.d.ts +5 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +21 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/search-relations.d.ts +2 -0
- package/dist/search/search-relations.d.ts.map +1 -0
- package/dist/search/search-relations.js +14 -0
- package/dist/search/search-relations.js.map +1 -0
- package/dist/search/variant-keys.d.ts +2 -0
- package/dist/search/variant-keys.d.ts.map +1 -0
- package/dist/search/variant-keys.js +13 -0
- package/dist/search/variant-keys.js.map +1 -0
- package/dist/shipping/index.d.ts +6 -0
- package/dist/shipping/index.d.ts.map +1 -0
- package/dist/shipping/index.js +10 -0
- package/dist/shipping/index.js.map +1 -0
- package/dist/totals/adjustment/index.d.ts +11 -0
- package/dist/totals/adjustment/index.d.ts.map +1 -0
- package/dist/totals/adjustment/index.js +43 -0
- package/dist/totals/adjustment/index.js.map +1 -0
- package/dist/totals/big-number.d.ts +23 -0
- package/dist/totals/big-number.d.ts.map +1 -0
- package/dist/totals/big-number.js +115 -0
- package/dist/totals/big-number.js.map +1 -0
- package/dist/totals/cart/index.d.ts +38 -0
- package/dist/totals/cart/index.d.ts.map +1 -0
- package/dist/totals/cart/index.js +145 -0
- package/dist/totals/cart/index.js.map +1 -0
- package/dist/totals/create-raw-properties-from-bignumber.d.ts +5 -0
- package/dist/totals/create-raw-properties-from-bignumber.d.ts.map +1 -0
- package/dist/totals/create-raw-properties-from-bignumber.js +52 -0
- package/dist/totals/create-raw-properties-from-bignumber.js.map +1 -0
- package/dist/totals/credit-lines/index.d.ts +13 -0
- package/dist/totals/credit-lines/index.d.ts.map +1 -0
- package/dist/totals/credit-lines/index.js +42 -0
- package/dist/totals/credit-lines/index.js.map +1 -0
- package/dist/totals/index.d.ts +9 -0
- package/dist/totals/index.d.ts.map +1 -0
- package/dist/totals/index.js +25 -0
- package/dist/totals/index.js.map +1 -0
- package/dist/totals/line-item/index.d.ts +46 -0
- package/dist/totals/line-item/index.d.ts.map +1 -0
- package/dist/totals/line-item/index.js +97 -0
- package/dist/totals/line-item/index.js.map +1 -0
- package/dist/totals/math.d.ts +24 -0
- package/dist/totals/math.d.ts.map +1 -0
- package/dist/totals/math.js +99 -0
- package/dist/totals/math.js.map +1 -0
- package/dist/totals/promotion/index.d.ts +5 -0
- package/dist/totals/promotion/index.d.ts.map +1 -0
- package/dist/totals/promotion/index.js +104 -0
- package/dist/totals/promotion/index.js.map +1 -0
- package/dist/totals/shipping-method/index.d.ts +27 -0
- package/dist/totals/shipping-method/index.d.ts.map +1 -0
- package/dist/totals/shipping-method/index.js +57 -0
- package/dist/totals/shipping-method/index.js.map +1 -0
- package/dist/totals/tax/index.d.ts +15 -0
- package/dist/totals/tax/index.d.ts.map +1 -0
- package/dist/totals/tax/index.js +37 -0
- package/dist/totals/tax/index.js.map +1 -0
- package/dist/totals/transform-properties-to-bignumber.d.ts +6 -0
- package/dist/totals/transform-properties-to-bignumber.d.ts.map +1 -0
- package/dist/totals/transform-properties-to-bignumber.js +40 -0
- package/dist/totals/transform-properties-to-bignumber.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/user/events.d.ts +16 -0
- package/dist/user/events.d.ts.map +1 -0
- package/dist/user/events.js +11 -0
- package/dist/user/events.js.map +1 -0
- package/dist/user/index.d.ts +2 -0
- package/dist/user/index.d.ts.map +1 -0
- package/dist/user/index.js +18 -0
- package/dist/user/index.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,403 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.defineJoinerConfig = defineJoinerConfig;
|
|
27
|
+
exports.buildLinkableKeysFromDmlObjects = buildLinkableKeysFromDmlObjects;
|
|
28
|
+
exports.buildLinkableKeysFromMikroOrmObjects = buildLinkableKeysFromMikroOrmObjects;
|
|
29
|
+
exports.buildLinkConfigFromModelObjects = buildLinkConfigFromModelObjects;
|
|
30
|
+
exports.buildLinkConfigFromLinkableKeys = buildLinkConfigFromLinkableKeys;
|
|
31
|
+
exports.buildModelsNameToLinkableKeysMap = buildModelsNameToLinkableKeysMap;
|
|
32
|
+
const fs_1 = require("fs");
|
|
33
|
+
const path = __importStar(require("path"));
|
|
34
|
+
const path_1 = require("path");
|
|
35
|
+
const common_1 = require("../common");
|
|
36
|
+
const dml_1 = require("../dml");
|
|
37
|
+
const create_graphql_1 = require("../dml/helpers/create-graphql");
|
|
38
|
+
const primary_key_1 = require("../dml/properties/primary-key");
|
|
39
|
+
const base_1 = require("../dml/relations/base");
|
|
40
|
+
const load_models_1 = require("./loaders/load-models");
|
|
41
|
+
/**
|
|
42
|
+
* Define joiner config for a module based on the models (object representation or entities) present in the models directory. This action will be sync until
|
|
43
|
+
* we move to at least es2022 to have access to top-leve await.
|
|
44
|
+
*
|
|
45
|
+
* The aliases will be built from the entityQueryingConfig and custom aliases if provided, in case of aliases provided if the methodSuffix is not provided
|
|
46
|
+
* then it will be inferred from the entity name of the alias args.
|
|
47
|
+
*
|
|
48
|
+
* @param serviceName
|
|
49
|
+
* @param alias custom aliases will be merged with the computed aliases from the provided models. Though, if a custom alias correspond to a computed alias for the same model then the custom alias will take place. Also, note that the methodSuffix will be inferred from the entity name if not provided as part of the args.
|
|
50
|
+
* @param schema
|
|
51
|
+
* @param models
|
|
52
|
+
* @param linkableKeys
|
|
53
|
+
* @param primaryKeys
|
|
54
|
+
*/
|
|
55
|
+
function defineJoinerConfig(serviceName, { alias, schema, models, linkableKeys, primaryKeys, } = {}) {
|
|
56
|
+
let loadedModels = models;
|
|
57
|
+
if (!loadedModels) {
|
|
58
|
+
loadedModels = [];
|
|
59
|
+
let index = 1;
|
|
60
|
+
while (true) {
|
|
61
|
+
++index;
|
|
62
|
+
let fullPath = (0, common_1.getCallerFilePath)(index);
|
|
63
|
+
if (!fullPath) {
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
fullPath = (0, path_1.normalize)(fullPath);
|
|
67
|
+
const integrationTestPotentialPath = (0, path_1.normalize)("integration-tests/__tests__");
|
|
68
|
+
/**
|
|
69
|
+
* Handle integration-tests/__tests__ path based on conventional naming
|
|
70
|
+
*/
|
|
71
|
+
if (fullPath.includes(integrationTestPotentialPath)) {
|
|
72
|
+
const sourcePath = fullPath.split(integrationTestPotentialPath)[0];
|
|
73
|
+
fullPath = path.join(sourcePath, "src");
|
|
74
|
+
}
|
|
75
|
+
const srcDir = fullPath.includes("dist") ? "dist" : "src";
|
|
76
|
+
const splitPath = fullPath.split(srcDir);
|
|
77
|
+
let basePath = splitPath[0] + srcDir;
|
|
78
|
+
const potentialModulesDirPathSegment = (0, path_1.normalize)(`${srcDir}/modules/`);
|
|
79
|
+
const isMedusaProject = fullPath.includes(potentialModulesDirPathSegment);
|
|
80
|
+
if (isMedusaProject) {
|
|
81
|
+
basePath = (0, path_1.dirname)(fullPath);
|
|
82
|
+
}
|
|
83
|
+
basePath = (0, path_1.join)(basePath, "models");
|
|
84
|
+
let doesModelsDirExist = false;
|
|
85
|
+
try {
|
|
86
|
+
(0, fs_1.accessSync)(path.resolve(basePath));
|
|
87
|
+
doesModelsDirExist = true;
|
|
88
|
+
}
|
|
89
|
+
catch (e) { }
|
|
90
|
+
if (!doesModelsDirExist) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
loadedModels = (0, load_models_1.loadModels)(basePath);
|
|
94
|
+
if (loadedModels.length) {
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
const modelDefinitions = new Map(loadedModels
|
|
100
|
+
.filter((model) => !!dml_1.DmlEntity.isDmlEntity(model))
|
|
101
|
+
.map((model) => [model.name, model]));
|
|
102
|
+
const mikroOrmObjects = new Map(loadedModels
|
|
103
|
+
.filter((model) => !dml_1.DmlEntity.isDmlEntity(model))
|
|
104
|
+
.map((model) => [model.name, model]));
|
|
105
|
+
// We prioritize DML if there is any equivalent Mikro orm entities found
|
|
106
|
+
const deduplicatedLoadedModels = [...modelDefinitions.values()];
|
|
107
|
+
mikroOrmObjects.forEach((model) => {
|
|
108
|
+
if (modelDefinitions.has(model.name)) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
deduplicatedLoadedModels.push(model);
|
|
112
|
+
});
|
|
113
|
+
if (!schema) {
|
|
114
|
+
schema = (0, create_graphql_1.toGraphQLSchema)([...modelDefinitions.values()]);
|
|
115
|
+
}
|
|
116
|
+
const linkableKeysFromDml = buildLinkableKeysFromDmlObjects([
|
|
117
|
+
...modelDefinitions.values(),
|
|
118
|
+
]);
|
|
119
|
+
const linkableKeysFromMikroOrm = buildLinkableKeysFromMikroOrmObjects([
|
|
120
|
+
...mikroOrmObjects.values(),
|
|
121
|
+
]);
|
|
122
|
+
const mergedLinkableKeys = {
|
|
123
|
+
...linkableKeysFromDml,
|
|
124
|
+
...linkableKeysFromMikroOrm,
|
|
125
|
+
...linkableKeys,
|
|
126
|
+
};
|
|
127
|
+
linkableKeys = mergedLinkableKeys;
|
|
128
|
+
/**
|
|
129
|
+
* Merge custom primary keys from the joiner config with the infered primary keys
|
|
130
|
+
* from the models.
|
|
131
|
+
*
|
|
132
|
+
* TODO: Maybe worth looking into the real needs for primary keys.
|
|
133
|
+
* It can happen that we could just remove that but we need to investigate (looking at the
|
|
134
|
+
* lookups from the remote joiner to identify which entity a property refers to)
|
|
135
|
+
*/
|
|
136
|
+
primaryKeys ??= [];
|
|
137
|
+
const finalPrimaryKeys = new Set(primaryKeys);
|
|
138
|
+
if (modelDefinitions.size) {
|
|
139
|
+
const linkConfig = buildLinkConfigFromModelObjects(serviceName, Object.fromEntries(modelDefinitions));
|
|
140
|
+
Object.values(linkConfig).flatMap((entityLinkConfig) => {
|
|
141
|
+
return Object.values(entityLinkConfig)
|
|
142
|
+
.filter((linkableConfig) => (0, common_1.isObject)(linkableConfig))
|
|
143
|
+
.forEach((linkableConfig) => {
|
|
144
|
+
finalPrimaryKeys.add(linkableConfig.primaryKey);
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
primaryKeys = Array.from(finalPrimaryKeys.add("id"));
|
|
149
|
+
// TODO: In the context of DML add a validation on primary keys and linkable keys if the consumer provide them manually. follow up pr
|
|
150
|
+
return {
|
|
151
|
+
serviceName,
|
|
152
|
+
primaryKeys,
|
|
153
|
+
schema,
|
|
154
|
+
linkableKeys: linkableKeys,
|
|
155
|
+
alias: [
|
|
156
|
+
...[...(alias ?? [])].map((alias) => ({
|
|
157
|
+
name: alias.name,
|
|
158
|
+
entity: alias.entity,
|
|
159
|
+
args: {
|
|
160
|
+
methodSuffix: alias.args?.methodSuffix ?? (0, common_1.pluralize)((0, common_1.upperCaseFirst)(alias.entity)),
|
|
161
|
+
},
|
|
162
|
+
})),
|
|
163
|
+
...deduplicatedLoadedModels
|
|
164
|
+
.filter((model) => {
|
|
165
|
+
return (!alias ||
|
|
166
|
+
!alias.some((alias) => alias.entity === (0, common_1.upperCaseFirst)(model.name)));
|
|
167
|
+
})
|
|
168
|
+
.map((entity, i) => ({
|
|
169
|
+
name: [
|
|
170
|
+
`${(0, common_1.camelToSnakeCase)(entity.name).toLowerCase()}`,
|
|
171
|
+
`${(0, common_1.pluralize)((0, common_1.camelToSnakeCase)(entity.name).toLowerCase())}`,
|
|
172
|
+
],
|
|
173
|
+
entity: (0, common_1.upperCaseFirst)(entity.name),
|
|
174
|
+
args: {
|
|
175
|
+
methodSuffix: (0, common_1.pluralize)((0, common_1.upperCaseFirst)(entity.name)),
|
|
176
|
+
},
|
|
177
|
+
})),
|
|
178
|
+
],
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* From a set of DML objects, build the linkable keys
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* const user = model.define("user", {
|
|
186
|
+
* id: model.id(),
|
|
187
|
+
* name: model.text(),
|
|
188
|
+
* })
|
|
189
|
+
*
|
|
190
|
+
* const car = model.define("car", {
|
|
191
|
+
* id: model.id(),
|
|
192
|
+
* number_plate: model.text().primaryKey(),
|
|
193
|
+
* test: model.text(),
|
|
194
|
+
* })
|
|
195
|
+
*
|
|
196
|
+
* const linkableKeys = buildLinkableKeysFromDmlObjects([user, car])
|
|
197
|
+
*
|
|
198
|
+
* // output:
|
|
199
|
+
* // {
|
|
200
|
+
* // user_id: 'User',
|
|
201
|
+
* // car_number_plate: 'Car',
|
|
202
|
+
* // }
|
|
203
|
+
*
|
|
204
|
+
* @param models
|
|
205
|
+
*/
|
|
206
|
+
function buildLinkableKeysFromDmlObjects(models) {
|
|
207
|
+
const linkableKeys = {};
|
|
208
|
+
for (const model of models) {
|
|
209
|
+
if (!dml_1.DmlEntity.isDmlEntity(model)) {
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
const schema = model.schema;
|
|
213
|
+
const primaryKeys = [];
|
|
214
|
+
for (const [property, value] of Object.entries(schema)) {
|
|
215
|
+
if (base_1.BaseRelationship.isRelationship(value)) {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
const parsedProperty = value.parse(property);
|
|
219
|
+
if (primary_key_1.PrimaryKeyModifier.isPrimaryKeyModifier(value)) {
|
|
220
|
+
const linkableKeyName = parsedProperty.dataType.options?.linkable ??
|
|
221
|
+
`${(0, common_1.camelToSnakeCase)(model.name).toLowerCase()}_${property}`;
|
|
222
|
+
primaryKeys.push(linkableKeyName);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (primaryKeys.length) {
|
|
226
|
+
primaryKeys.forEach((primaryKey) => {
|
|
227
|
+
linkableKeys[primaryKey] = (0, common_1.upperCaseFirst)(model.name);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return linkableKeys;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Build linkable keys from MikroORM objects
|
|
235
|
+
* @deprecated
|
|
236
|
+
* @param models
|
|
237
|
+
*/
|
|
238
|
+
function buildLinkableKeysFromMikroOrmObjects(models) {
|
|
239
|
+
return models.reduce((acc, entity) => {
|
|
240
|
+
acc[`${(0, common_1.camelToSnakeCase)(entity.name).toLowerCase()}_id`] = entity.name;
|
|
241
|
+
return acc;
|
|
242
|
+
}, {});
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Build entities name to linkable keys map
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* const user = model.define("user", {
|
|
249
|
+
* id: model.id(),
|
|
250
|
+
* name: model.text(),
|
|
251
|
+
* })
|
|
252
|
+
*
|
|
253
|
+
* const car = model.define("car", {
|
|
254
|
+
* id: model.id(),
|
|
255
|
+
* number_plate: model.text().primaryKey(),
|
|
256
|
+
* test: model.text(),
|
|
257
|
+
* })
|
|
258
|
+
*
|
|
259
|
+
* const links = buildLinkConfigFromModelObjects('userService', { user, car })
|
|
260
|
+
*
|
|
261
|
+
* // output:
|
|
262
|
+
* // {
|
|
263
|
+
* // user: {
|
|
264
|
+
* // id: {
|
|
265
|
+
* // serviceName: 'userService', // The name of the module service it originate from
|
|
266
|
+
* // field: 'user', // The field name of the entity, the query field is inferred from it as kebab cased singular/plural
|
|
267
|
+
* // linkable: 'user_id', // The linkable key
|
|
268
|
+
* // primaryKey: 'id' // The primary key if refers to in the original object representation, it will be used to be passed to the filters of the corresponding public service method
|
|
269
|
+
* // },
|
|
270
|
+
* // toJSON() { ... }
|
|
271
|
+
* // },
|
|
272
|
+
* // car: {
|
|
273
|
+
* // number_plate: {
|
|
274
|
+
* // serviceName: 'userService',
|
|
275
|
+
* // field: 'car',
|
|
276
|
+
* // linkable: 'car_number_plate',
|
|
277
|
+
* // primaryKey: 'number_plate'
|
|
278
|
+
* // },
|
|
279
|
+
* // toJSON() { ... }
|
|
280
|
+
* // }
|
|
281
|
+
* // }
|
|
282
|
+
*
|
|
283
|
+
* @param serviceName
|
|
284
|
+
* @param models
|
|
285
|
+
*/
|
|
286
|
+
function buildLinkConfigFromModelObjects(serviceName, models, linkableKeys = {}) {
|
|
287
|
+
// In case some models have been provided to a custom joiner config, the linkable will be limited
|
|
288
|
+
// to that set of models. We dont want to expose models that should not be linkable.
|
|
289
|
+
const linkableModels = Object.values(linkableKeys);
|
|
290
|
+
const linkConfig = {};
|
|
291
|
+
for (const model of Object.values(models) ?? []) {
|
|
292
|
+
const classLikeModelName = (0, common_1.upperCaseFirst)(model.name);
|
|
293
|
+
if (!dml_1.DmlEntity.isDmlEntity(model) ||
|
|
294
|
+
(linkableModels.length && !linkableModels.includes(classLikeModelName))) {
|
|
295
|
+
continue;
|
|
296
|
+
}
|
|
297
|
+
const schema = model.schema;
|
|
298
|
+
/**
|
|
299
|
+
* When using a linkable, if a specific linkable property is not specified, the toJSON
|
|
300
|
+
* function will be called and return the first linkable available for this model.
|
|
301
|
+
*/
|
|
302
|
+
const modelLinkConfig = (linkConfig[(0, common_1.lowerCaseFirst)(model.name)] ??= {
|
|
303
|
+
toJSON: function () {
|
|
304
|
+
const linkables = Object.entries(this)
|
|
305
|
+
.filter(([name]) => name !== "toJSON")
|
|
306
|
+
.map(([, object]) => object);
|
|
307
|
+
return linkables[0];
|
|
308
|
+
},
|
|
309
|
+
});
|
|
310
|
+
/**
|
|
311
|
+
* Build all linkable properties for the model
|
|
312
|
+
*/
|
|
313
|
+
for (const [property, value] of Object.entries(schema)) {
|
|
314
|
+
if (base_1.BaseRelationship.isRelationship(value)) {
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
const parsedProperty = value.parse(property);
|
|
318
|
+
if (primary_key_1.PrimaryKeyModifier.isPrimaryKeyModifier(value) ||
|
|
319
|
+
dml_1.IdProperty.isIdProperty(value)) {
|
|
320
|
+
const linkableKeyName = parsedProperty.dataType.options?.linkable ??
|
|
321
|
+
`${(0, common_1.camelToSnakeCase)(model.name).toLowerCase()}_${property}`;
|
|
322
|
+
modelLinkConfig[property] = {
|
|
323
|
+
linkable: linkableKeyName,
|
|
324
|
+
primaryKey: property,
|
|
325
|
+
serviceName,
|
|
326
|
+
field: (0, common_1.lowerCaseFirst)(model.name),
|
|
327
|
+
entity: classLikeModelName,
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* If the joiner config specify some custom linkable keys, we merge them with the
|
|
334
|
+
* existing linkable keys infered from the model above.
|
|
335
|
+
*/
|
|
336
|
+
for (const [linkableKey, modelName] of Object.entries(linkableKeys) ?? []) {
|
|
337
|
+
const snakeCasedModelName = (0, common_1.camelToSnakeCase)((0, common_1.toCamelCase)(modelName));
|
|
338
|
+
// Linkable keys by default are prepared with snake cased model name _id
|
|
339
|
+
// So to be able to compare only the property we have to remove the first part
|
|
340
|
+
const inferredReferenceProperty = linkableKey.replace(`${snakeCasedModelName}_`, "");
|
|
341
|
+
linkConfig[(0, common_1.lowerCaseFirst)(modelName)] ??= {
|
|
342
|
+
toJSON: function () {
|
|
343
|
+
const linkables = Object.entries(this)
|
|
344
|
+
.filter(([name]) => name !== "toJSON")
|
|
345
|
+
.map(([, object]) => object);
|
|
346
|
+
return linkables[0];
|
|
347
|
+
},
|
|
348
|
+
};
|
|
349
|
+
if (linkConfig[(0, common_1.lowerCaseFirst)(modelName)][inferredReferenceProperty]) {
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
linkConfig[(0, common_1.lowerCaseFirst)(modelName)][inferredReferenceProperty] = {
|
|
353
|
+
linkable: linkableKey,
|
|
354
|
+
primaryKey: inferredReferenceProperty,
|
|
355
|
+
serviceName,
|
|
356
|
+
field: (0, common_1.lowerCaseFirst)(modelName),
|
|
357
|
+
entity: (0, common_1.upperCaseFirst)(modelName),
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
return linkConfig;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* @deprecated temporary supports for mikro orm entities to get the linkable available from the module export while waiting for the migration to DML
|
|
364
|
+
*
|
|
365
|
+
* @param serviceName
|
|
366
|
+
* @param linkableKeys
|
|
367
|
+
*/
|
|
368
|
+
function buildLinkConfigFromLinkableKeys(serviceName, linkableKeys) {
|
|
369
|
+
const linkConfig = {};
|
|
370
|
+
for (const [linkable, modelName] of Object.entries(linkableKeys)) {
|
|
371
|
+
const kebabCasedModelName = (0, common_1.camelToSnakeCase)((0, common_1.toCamelCase)(modelName));
|
|
372
|
+
const inferredReferenceProperty = linkable.replace(`${kebabCasedModelName}_`, "");
|
|
373
|
+
const keyName = (0, common_1.lowerCaseFirst)(modelName);
|
|
374
|
+
const config = {
|
|
375
|
+
linkable: linkable,
|
|
376
|
+
primaryKey: inferredReferenceProperty,
|
|
377
|
+
serviceName,
|
|
378
|
+
field: keyName,
|
|
379
|
+
entity: (0, common_1.upperCaseFirst)(modelName),
|
|
380
|
+
};
|
|
381
|
+
linkConfig[keyName] ??= {
|
|
382
|
+
toJSON: () => config,
|
|
383
|
+
};
|
|
384
|
+
linkConfig[keyName][inferredReferenceProperty] = config;
|
|
385
|
+
}
|
|
386
|
+
return linkConfig;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Reversed map from linkableKeys to entity name to linkable keys
|
|
390
|
+
* @param linkableKeys
|
|
391
|
+
*/
|
|
392
|
+
function buildModelsNameToLinkableKeysMap(linkableKeys) {
|
|
393
|
+
const entityLinkableKeysMap = {};
|
|
394
|
+
Object.entries(linkableKeys).forEach(([key, value]) => {
|
|
395
|
+
entityLinkableKeysMap[value] ??= [];
|
|
396
|
+
entityLinkableKeysMap[value].push({
|
|
397
|
+
mapTo: key,
|
|
398
|
+
valueFrom: key.split("_").pop(),
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
return entityLinkableKeysMap;
|
|
402
|
+
}
|
|
403
|
+
//# sourceMappingURL=joiner-config-builder.js.map
|
|
@@ -0,0 +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AE,GAAG;YACV,SAAS,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG;SACjC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,OAAO,qBAAqB,CAAA;AAC9B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ModulesSdkTypes } from "@8medusa/types";
|
|
2
|
+
/**
|
|
3
|
+
* Load the config for the database connection. The options can be retrieved
|
|
4
|
+
* e.g through PRODUCT_* (e.g PRODUCT_DATABASE_URL) or * (e.g DATABASE_URL) environment variables or the options object.
|
|
5
|
+
* @param options
|
|
6
|
+
* @param moduleName
|
|
7
|
+
*/
|
|
8
|
+
export declare function loadDatabaseConfig(moduleName: string, options?: ModulesSdkTypes.ModuleServiceInitializeOptions, silent?: boolean): Pick<ModulesSdkTypes.ModuleServiceInitializeOptions["database"], "clientUrl" | "schema" | "driverOptions" | "debug">;
|
|
9
|
+
//# sourceMappingURL=load-module-database-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-module-database-config.d.ts","sourceRoot":"","sources":["../../src/modules-sdk/load-module-database-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAyDhD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,eAAe,CAAC,8BAA8B,EACxD,MAAM,GAAE,OAAe,GACtB,IAAI,CACL,eAAe,CAAC,8BAA8B,CAAC,UAAU,CAAC,EAC1D,WAAW,GAAG,QAAQ,GAAG,eAAe,GAAG,OAAO,CACnD,CAsCA"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadDatabaseConfig = loadDatabaseConfig;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
function getEnv(key, moduleName) {
|
|
6
|
+
const value = process.env[`${moduleName.toUpperCase()}_${key}`] ??
|
|
7
|
+
process.env[`MEDUSA_${key}`] ??
|
|
8
|
+
process.env[`${key}`];
|
|
9
|
+
return value ?? "";
|
|
10
|
+
}
|
|
11
|
+
function isModuleServiceInitializeOptions(obj) {
|
|
12
|
+
return !!obj?.database;
|
|
13
|
+
}
|
|
14
|
+
function getDefaultDriverOptions(clientUrl) {
|
|
15
|
+
const localOptions = {
|
|
16
|
+
connection: {
|
|
17
|
+
ssl: false,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const remoteOptions = {
|
|
21
|
+
connection: {
|
|
22
|
+
ssl: {
|
|
23
|
+
rejectUnauthorized: false,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
if (clientUrl) {
|
|
28
|
+
return clientUrl.match(/localhost|127\.0\.0\.1|ssl_mode=(disable|false)/i)
|
|
29
|
+
? localOptions
|
|
30
|
+
: remoteOptions;
|
|
31
|
+
}
|
|
32
|
+
return process.env.NODE_ENV?.match(/prod/i)
|
|
33
|
+
? remoteOptions
|
|
34
|
+
: process.env.NODE_ENV?.match(/dev/i)
|
|
35
|
+
? localOptions
|
|
36
|
+
: {};
|
|
37
|
+
}
|
|
38
|
+
function getDatabaseUrl(config) {
|
|
39
|
+
const { clientUrl, host, port, user, password, database } = config.database;
|
|
40
|
+
if (host) {
|
|
41
|
+
return `postgres://${user}:${password}@${host}:${port}/${database}`;
|
|
42
|
+
}
|
|
43
|
+
return clientUrl;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Load the config for the database connection. The options can be retrieved
|
|
47
|
+
* e.g through PRODUCT_* (e.g PRODUCT_DATABASE_URL) or * (e.g DATABASE_URL) environment variables or the options object.
|
|
48
|
+
* @param options
|
|
49
|
+
* @param moduleName
|
|
50
|
+
*/
|
|
51
|
+
function loadDatabaseConfig(moduleName, options, silent = false) {
|
|
52
|
+
const clientUrl = options?.database?.clientUrl ?? getEnv("DATABASE_URL", moduleName);
|
|
53
|
+
const poolEnvConfig = getEnv("DATABASE_POOL", moduleName);
|
|
54
|
+
const database = {
|
|
55
|
+
clientUrl,
|
|
56
|
+
schema: getEnv("DATABASE_SCHEMA", moduleName) ?? "public",
|
|
57
|
+
driverOptions: JSON.parse(getEnv("DATABASE_DRIVER_OPTIONS", moduleName) ||
|
|
58
|
+
JSON.stringify(getDefaultDriverOptions(clientUrl))),
|
|
59
|
+
pool: poolEnvConfig ? JSON.parse(poolEnvConfig) : undefined,
|
|
60
|
+
debug: false,
|
|
61
|
+
connection: undefined,
|
|
62
|
+
};
|
|
63
|
+
if (isModuleServiceInitializeOptions(options)) {
|
|
64
|
+
database.clientUrl = getDatabaseUrl({
|
|
65
|
+
database: { ...options.database, clientUrl },
|
|
66
|
+
});
|
|
67
|
+
database.schema = options.database.schema ?? database.schema;
|
|
68
|
+
database.driverOptions =
|
|
69
|
+
options.database.driverOptions ??
|
|
70
|
+
getDefaultDriverOptions(database.clientUrl);
|
|
71
|
+
database.pool = options.database.pool ?? database.pool;
|
|
72
|
+
database.debug = options.database.debug ?? database.debug;
|
|
73
|
+
database.connection = options.database.connection;
|
|
74
|
+
}
|
|
75
|
+
if (!database.clientUrl && !silent && !database.connection) {
|
|
76
|
+
throw new common_1.MedusaError(common_1.MedusaError.Types.INVALID_ARGUMENT, "No database clientUrl provided. Please provide the clientUrl through the [MODULE]_DATABASE_URL, MEDUSA_DATABASE_URL or DATABASE_URL environment variable or the options object in the initialize function.");
|
|
77
|
+
}
|
|
78
|
+
return database;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=load-module-database-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-module-database-config.js","sourceRoot":"","sources":["../../src/modules-sdk/load-module-database-config.ts"],"names":[],"mappings":";;AA+DA,gDA6CC;AA3GD,sCAAuC;AAEvC,SAAS,MAAM,CAAC,GAAW,EAAE,UAAkB;IAC7C,MAAM,KAAK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CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAA;QAC1D,QAAQ,CAAC,UAAU,GAAG,OAAO,CAAC,QAAS,CAAC,UAAU,CAAA;IACpD,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,SAAS,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QAC3D,MAAM,IAAI,oBAAW,CACnB,oBAAW,CAAC,KAAK,CAAC,gBAAgB,EAClC,4MAA4M,CAC7M,CAAA;IACH,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { LoaderOptions, MedusaContainer } from "@8medusa/types";
|
|
2
|
+
type RepositoryLoaderOptions = {
|
|
3
|
+
moduleModels: Record<string, any>;
|
|
4
|
+
moduleRepositories?: Record<string, any>;
|
|
5
|
+
customRepositories: Record<string, any>;
|
|
6
|
+
container: MedusaContainer;
|
|
7
|
+
};
|
|
8
|
+
type ServiceLoaderOptions = {
|
|
9
|
+
moduleModels: Record<string, any>;
|
|
10
|
+
moduleServices: Record<string, any>;
|
|
11
|
+
container: MedusaContainer;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Factory for creating a container loader for a module.
|
|
15
|
+
*
|
|
16
|
+
* @param moduleModels
|
|
17
|
+
* @param moduleServices
|
|
18
|
+
* @param moduleRepositories
|
|
19
|
+
* @param customRepositoryLoader The default repository loader is based on mikro orm. If you want to use a custom repository loader, you can pass it here.
|
|
20
|
+
*/
|
|
21
|
+
export declare function moduleContainerLoaderFactory({ moduleModels, moduleServices, moduleRepositories, customRepositoryLoader, }: {
|
|
22
|
+
moduleModels: Record<string, any>;
|
|
23
|
+
moduleServices: Record<string, any>;
|
|
24
|
+
moduleRepositories?: Record<string, any>;
|
|
25
|
+
customRepositoryLoader?: (options: RepositoryLoaderOptions) => void;
|
|
26
|
+
}): ({ container, options }: LoaderOptions) => Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Load the services from the module services object. If a service is not
|
|
29
|
+
* present a default service will be created for the model.
|
|
30
|
+
*
|
|
31
|
+
* @param moduleModels
|
|
32
|
+
* @param moduleServices
|
|
33
|
+
* @param container
|
|
34
|
+
*/
|
|
35
|
+
export declare function loadModuleServices({ moduleModels, moduleServices, container, }: ServiceLoaderOptions): void;
|
|
36
|
+
/**
|
|
37
|
+
* Load the repositories from the custom repositories object. If a repository is not
|
|
38
|
+
* present in the custom repositories object, the default repository will be used from the module repository.
|
|
39
|
+
* If none are present, a default repository will be created for the model.
|
|
40
|
+
*
|
|
41
|
+
* @param moduleModels
|
|
42
|
+
* @param moduleRepositories
|
|
43
|
+
* @param customRepositories
|
|
44
|
+
* @param container
|
|
45
|
+
*/
|
|
46
|
+
export declare function loadModuleRepositories({ moduleModels, moduleRepositories, customRepositories, container, }: RepositoryLoaderOptions): void;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=container-loader-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-loader-factory.d.ts","sourceRoot":"","sources":["../../../src/modules-sdk/loaders/container-loader-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,eAAe,EAIhB,MAAM,gBAAgB,CAAA;AAUvB,KAAK,uBAAuB,GAAG;IAC7B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvC,SAAS,EAAE,eAAe,CAAA;CAC3B,CAAA;AAED,KAAK,oBAAoB,GAAG;IAC1B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACnC,SAAS,EAAE,eAAe,CAA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