@budibase/backend-core 2.9.39-alpha.8 → 2.9.39
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/jest.config.js +25 -0
- package/dist/jest.config.js.map +1 -0
- package/dist/package.json +5 -5
- package/dist/src/accounts/accounts.js +75 -92
- package/dist/src/accounts/accounts.js.map +1 -7
- package/dist/src/accounts/api.js +85 -71
- package/dist/src/accounts/api.js.map +1 -7
- package/dist/src/accounts/index.js +16 -21
- package/dist/src/accounts/index.js.map +1 -7
- package/dist/src/auth/auth.js +178 -197
- package/dist/src/auth/auth.js.map +1 -7
- package/dist/src/auth/index.js +16 -21
- package/dist/src/auth/index.js.map +1 -7
- package/dist/src/blacklist/blacklist.js +69 -81
- package/dist/src/blacklist/blacklist.js.map +1 -7
- package/dist/src/blacklist/index.js +16 -21
- package/dist/src/blacklist/index.js.map +1 -7
- package/dist/src/cache/appMetadata.js +88 -78
- package/dist/src/cache/appMetadata.js.map +1 -7
- package/dist/src/cache/base/index.js +110 -92
- package/dist/src/cache/base/index.js.map +1 -7
- package/dist/src/cache/generic.js +26 -64
- package/dist/src/cache/generic.js.map +1 -7
- package/dist/src/cache/index.js +32 -48
- package/dist/src/cache/index.js.map +1 -7
- package/dist/src/cache/user.js +115 -91
- package/dist/src/cache/user.js.map +1 -7
- package/dist/src/cache/writethrough.js +144 -129
- package/dist/src/cache/writethrough.js.map +1 -7
- package/dist/src/configs/configs.js +265 -215
- package/dist/src/configs/configs.js.map +1 -7
- package/dist/src/configs/index.js +16 -21
- package/dist/src/configs/index.js.map +1 -7
- package/dist/src/constants/db.js +64 -104
- package/dist/src/constants/db.js.map +1 -7
- package/dist/src/constants/index.js +17 -23
- package/dist/src/constants/index.js.map +1 -7
- package/dist/src/constants/misc.js +53 -91
- package/dist/src/constants/misc.js.map +1 -7
- package/dist/src/context/Context.js +11 -33
- package/dist/src/context/Context.js.map +1 -7
- package/dist/src/context/identity.js +60 -75
- package/dist/src/context/identity.js.map +1 -7
- package/dist/src/context/index.js +31 -42
- package/dist/src/context/index.js.map +1 -7
- package/dist/src/context/mainContext.js +275 -264
- package/dist/src/context/mainContext.js.map +1 -7
- package/dist/src/context/types.js +2 -16
- package/dist/src/context/types.js.map +1 -7
- package/dist/src/db/Replication.js +81 -85
- package/dist/src/db/Replication.js.map +1 -7
- package/dist/src/db/constants.js +11 -37
- package/dist/src/db/constants.js.map +1 -7
- package/dist/src/db/couch/DatabaseImpl.js +236 -212
- package/dist/src/db/couch/DatabaseImpl.js.map +1 -7
- package/dist/src/db/couch/connections.js +81 -96
- package/dist/src/db/couch/connections.js.map +1 -7
- package/dist/src/db/couch/index.js +25 -42
- package/dist/src/db/couch/index.js.map +1 -7
- package/dist/src/db/couch/pouchDB.js +93 -103
- package/dist/src/db/couch/pouchDB.js.map +1 -7
- package/dist/src/db/couch/pouchDump.js +1 -1
- package/dist/src/db/couch/pouchDump.js.map +1 -7
- package/dist/src/db/couch/utils.js +49 -70
- package/dist/src/db/couch/utils.js.map +1 -7
- package/dist/src/db/db.js +49 -63
- package/dist/src/db/db.js.map +1 -7
- package/dist/src/db/errors.js +17 -38
- package/dist/src/db/errors.js.map +1 -7
- package/dist/src/db/index.js +45 -61
- package/dist/src/db/index.js.map +1 -7
- package/dist/src/db/lucene.js +655 -582
- package/dist/src/db/lucene.js.map +1 -7
- package/dist/src/db/searchIndexes/index.js +16 -21
- package/dist/src/db/searchIndexes/index.js.map +1 -7
- package/dist/src/db/searchIndexes/searchIndexes.js +72 -77
- package/dist/src/db/searchIndexes/searchIndexes.js.map +1 -7
- package/dist/src/db/utils.js +199 -184
- package/dist/src/db/utils.js.map +1 -7
- package/dist/src/db/views.js +187 -191
- package/dist/src/db/views.js.map +1 -7
- package/dist/src/docIds/conversions.js +48 -69
- package/dist/src/docIds/conversions.js.map +1 -7
- package/dist/src/docIds/ids.js +87 -76
- package/dist/src/docIds/ids.js.map +1 -7
- package/dist/src/docIds/index.js +17 -23
- package/dist/src/docIds/index.js.map +1 -7
- package/dist/src/docIds/newid.js +6 -29
- package/dist/src/docIds/newid.js.map +1 -7
- package/dist/src/docIds/params.js +111 -109
- package/dist/src/docIds/params.js.map +1 -7
- package/dist/src/docUpdates/index.js +29 -54
- package/dist/src/docUpdates/index.js.map +1 -7
- package/dist/src/environment.js +81 -152
- package/dist/src/environment.js.map +1 -7
- package/dist/src/errors/errors.js +77 -106
- package/dist/src/errors/errors.js.map +1 -7
- package/dist/src/errors/index.js +16 -21
- package/dist/src/errors/index.js.map +1 -7
- package/dist/src/events/analytics.js +38 -38
- package/dist/src/events/analytics.js.map +1 -7
- package/dist/src/events/asyncEvents/index.js +17 -23
- package/dist/src/events/asyncEvents/index.js.map +1 -7
- package/dist/src/events/asyncEvents/publisher.js +24 -36
- package/dist/src/events/asyncEvents/publisher.js.map +1 -7
- package/dist/src/events/asyncEvents/queue.js +21 -37
- package/dist/src/events/asyncEvents/queue.js.map +1 -7
- package/dist/src/events/backfill.js +170 -163
- package/dist/src/events/backfill.js.map +1 -7
- package/dist/src/events/documentId.js +23 -46
- package/dist/src/events/documentId.js.map +1 -7
- package/dist/src/events/events.js +68 -58
- package/dist/src/events/events.js.map +1 -7
- package/dist/src/events/identification.js +279 -254
- package/dist/src/events/identification.js.map +1 -7
- package/dist/src/events/index.js +42 -57
- package/dist/src/events/index.js.map +1 -7
- package/dist/src/events/processors/AnalyticsProcessor.js +81 -64
- package/dist/src/events/processors/AnalyticsProcessor.js.map +1 -7
- package/dist/src/events/processors/AuditLogsProcessor.js +79 -90
- package/dist/src/events/processors/AuditLogsProcessor.js.map +1 -7
- package/dist/src/events/processors/LoggingProcessor.js +39 -50
- package/dist/src/events/processors/LoggingProcessor.js.map +1 -7
- package/dist/src/events/processors/Processors.js +44 -49
- package/dist/src/events/processors/Processors.js.map +1 -7
- package/dist/src/events/processors/async/DocumentUpdateProcessor.js +37 -46
- package/dist/src/events/processors/async/DocumentUpdateProcessor.js.map +1 -7
- package/dist/src/events/processors/index.js +18 -52
- package/dist/src/events/processors/index.js.map +1 -7
- package/dist/src/events/processors/posthog/PosthogProcessor.js +126 -113
- package/dist/src/events/processors/posthog/PosthogProcessor.js.map +1 -7
- package/dist/src/events/processors/posthog/index.js +6 -34
- package/dist/src/events/processors/posthog/index.js.map +1 -7
- package/dist/src/events/processors/posthog/rateLimiting.js +104 -90
- package/dist/src/events/processors/posthog/rateLimiting.js.map +1 -7
- package/dist/src/events/processors/types.js +2 -28
- package/dist/src/events/processors/types.js.map +1 -7
- package/dist/src/events/publishers/account.js +37 -43
- package/dist/src/events/publishers/account.js.map +1 -7
- package/dist/src/events/publishers/app.js +139 -131
- package/dist/src/events/publishers/app.js.map +1 -7
- package/dist/src/events/publishers/auditLog.js +29 -37
- package/dist/src/events/publishers/auditLog.js.map +1 -7
- package/dist/src/events/publishers/auth.js +71 -71
- package/dist/src/events/publishers/auth.js.map +1 -7
- package/dist/src/events/publishers/automation.js +108 -102
- package/dist/src/events/publishers/automation.js.map +1 -7
- package/dist/src/events/publishers/backfill.js +75 -82
- package/dist/src/events/publishers/backfill.js.map +1 -7
- package/dist/src/events/publishers/backup.js +36 -44
- package/dist/src/events/publishers/backup.js.map +1 -7
- package/dist/src/events/publishers/datasource.js +46 -51
- package/dist/src/events/publishers/datasource.js.map +1 -7
- package/dist/src/events/publishers/email.js +25 -33
- package/dist/src/events/publishers/email.js.map +1 -7
- package/dist/src/events/publishers/environmentVariable.js +38 -47
- package/dist/src/events/publishers/environmentVariable.js.map +1 -7
- package/dist/src/events/publishers/group.js +97 -95
- package/dist/src/events/publishers/group.js.map +1 -7
- package/dist/src/events/publishers/index.js +53 -106
- package/dist/src/events/publishers/index.js.map +1 -7
- package/dist/src/events/publishers/installation.js +45 -49
- package/dist/src/events/publishers/installation.js.map +1 -7
- package/dist/src/events/publishers/layout.js +29 -37
- package/dist/src/events/publishers/layout.js.map +1 -7
- package/dist/src/events/publishers/license.js +67 -68
- package/dist/src/events/publishers/license.js.map +1 -7
- package/dist/src/events/publishers/org.js +44 -45
- package/dist/src/events/publishers/org.js.map +1 -7
- package/dist/src/events/publishers/plugin.js +49 -55
- package/dist/src/events/publishers/plugin.js.map +1 -7
- package/dist/src/events/publishers/query.js +70 -81
- package/dist/src/events/publishers/query.js.map +1 -7
- package/dist/src/events/publishers/role.js +61 -63
- package/dist/src/events/publishers/role.js.map +1 -7
- package/dist/src/events/publishers/rows.js +28 -39
- package/dist/src/events/publishers/rows.js.map +1 -7
- package/dist/src/events/publishers/screen.js +41 -47
- package/dist/src/events/publishers/screen.js.map +1 -7
- package/dist/src/events/publishers/serve.js +41 -47
- package/dist/src/events/publishers/serve.js.map +1 -7
- package/dist/src/events/publishers/table.js +69 -71
- package/dist/src/events/publishers/table.js.map +1 -7
- package/dist/src/events/publishers/user.js +184 -173
- package/dist/src/events/publishers/user.js.map +1 -7
- package/dist/src/events/publishers/view.js +98 -89
- package/dist/src/events/publishers/view.js.map +1 -7
- package/dist/src/features/index.js +88 -93
- package/dist/src/features/index.js.map +1 -7
- package/dist/src/features/installation.js +16 -38
- package/dist/src/features/installation.js.map +1 -7
- package/dist/src/helpers.js +11 -28
- package/dist/src/helpers.js.map +1 -7
- package/dist/src/index.js +77 -148
- package/dist/src/index.js.map +1 -7
- package/dist/src/installation.js +127 -128
- package/dist/src/installation.js.map +1 -7
- package/dist/src/logging/alerts.js +14 -39
- package/dist/src/logging/alerts.js.map +1 -7
- package/dist/src/logging/correlation/correlation.js +11 -35
- package/dist/src/logging/correlation/correlation.js.map +1 -7
- package/dist/src/logging/correlation/index.js +16 -21
- package/dist/src/logging/correlation/index.js.map +1 -7
- package/dist/src/logging/correlation/middleware.js +13 -33
- package/dist/src/logging/correlation/middleware.js.map +1 -7
- package/dist/src/logging/index.js +32 -45
- package/dist/src/logging/index.js.map +1 -7
- package/dist/src/logging/pino/logger.js +206 -185
- package/dist/src/logging/pino/logger.js.map +1 -7
- package/dist/src/logging/pino/middleware.js +38 -68
- package/dist/src/logging/pino/middleware.js.map +1 -7
- package/dist/src/logging/system.js +86 -95
- package/dist/src/logging/system.js.map +1 -7
- package/dist/src/middleware/adminOnly.js +16 -28
- package/dist/src/middleware/adminOnly.js.map +1 -7
- package/dist/src/middleware/auditLog.js +13 -24
- package/dist/src/middleware/auditLog.js.map +1 -7
- package/dist/src/middleware/authenticated.js +191 -165
- package/dist/src/middleware/authenticated.js.map +1 -7
- package/dist/src/middleware/builderOnly.js +29 -44
- package/dist/src/middleware/builderOnly.js.map +1 -7
- package/dist/src/middleware/builderOrAdmin.js +29 -44
- package/dist/src/middleware/builderOrAdmin.js.map +1 -7
- package/dist/src/middleware/csrf.js +75 -54
- package/dist/src/middleware/csrf.js.map +1 -7
- package/dist/src/middleware/errorHandling.js +60 -58
- package/dist/src/middleware/errorHandling.js.map +1 -7
- package/dist/src/middleware/index.js +61 -91
- package/dist/src/middleware/index.js.map +1 -7
- package/dist/src/middleware/internalApi.js +27 -36
- package/dist/src/middleware/internalApi.js.map +1 -7
- package/dist/src/middleware/joi-validator.js +39 -65
- package/dist/src/middleware/joi-validator.js.map +1 -7
- package/dist/src/middleware/matchers.js +36 -55
- package/dist/src/middleware/matchers.js.map +1 -7
- package/dist/src/middleware/passport/datasource/google.js +88 -96
- package/dist/src/middleware/passport/datasource/google.js.map +1 -7
- package/dist/src/middleware/passport/local.js +74 -66
- package/dist/src/middleware/passport/local.js.map +1 -7
- package/dist/src/middleware/passport/sso/google.js +81 -84
- package/dist/src/middleware/passport/sso/google.js.map +1 -7
- package/dist/src/middleware/passport/sso/oidc.js +140 -124
- package/dist/src/middleware/passport/sso/oidc.js.map +1 -7
- package/dist/src/middleware/passport/sso/sso.js +157 -141
- package/dist/src/middleware/passport/sso/sso.js.map +1 -7
- package/dist/src/middleware/passport/utils.js +60 -56
- package/dist/src/middleware/passport/utils.js.map +1 -7
- package/dist/src/middleware/querystringToBody.js +26 -42
- package/dist/src/middleware/querystringToBody.js.map +1 -7
- package/dist/src/middleware/tenancy.js +33 -42
- package/dist/src/middleware/tenancy.js.map +1 -7
- package/dist/src/migrations/definitions.js +37 -61
- package/dist/src/migrations/definitions.js.map +1 -7
- package/dist/src/migrations/index.js +17 -23
- package/dist/src/migrations/index.js.map +1 -7
- package/dist/src/migrations/migrations.js +182 -162
- package/dist/src/migrations/migrations.js.map +1 -7
- package/dist/src/objectStore/buckets/app.js +65 -57
- package/dist/src/objectStore/buckets/app.js.map +1 -7
- package/dist/src/objectStore/buckets/global.js +50 -55
- package/dist/src/objectStore/buckets/global.js.map +1 -7
- package/dist/src/objectStore/buckets/index.js +18 -25
- package/dist/src/objectStore/buckets/index.js.map +1 -7
- package/dist/src/objectStore/buckets/plugins.js +76 -82
- package/dist/src/objectStore/buckets/plugins.js.map +1 -7
- package/dist/src/objectStore/cloudfront.js +27 -61
- package/dist/src/objectStore/cloudfront.js.map +1 -7
- package/dist/src/objectStore/index.js +18 -25
- package/dist/src/objectStore/index.js.map +1 -7
- package/dist/src/objectStore/objectStore.js +351 -341
- package/dist/src/objectStore/objectStore.js.map +1 -7
- package/dist/src/objectStore/utils.js +26 -52
- package/dist/src/objectStore/utils.js.map +1 -7
- package/dist/src/platform/index.js +30 -42
- package/dist/src/platform/index.js.map +1 -7
- package/dist/src/platform/platformDb.js +7 -30
- package/dist/src/platform/platformDb.js.map +1 -7
- package/dist/src/platform/tenants.js +126 -110
- package/dist/src/platform/tenants.js.map +1 -7
- package/dist/src/platform/users.js +84 -92
- package/dist/src/platform/users.js.map +1 -7
- package/dist/src/plugin/index.js +16 -21
- package/dist/src/plugin/index.js.map +1 -7
- package/dist/src/plugin/utils.js +129 -137
- package/dist/src/plugin/utils.js.map +1 -7
- package/dist/src/queue/constants.js +10 -34
- package/dist/src/queue/constants.js.map +1 -7
- package/dist/src/queue/inMemoryQueue.js +137 -131
- package/dist/src/queue/inMemoryQueue.js.map +1 -7
- package/dist/src/queue/index.js +17 -23
- package/dist/src/queue/index.js.map +1 -7
- package/dist/src/queue/listeners.js +170 -161
- package/dist/src/queue/listeners.js.map +1 -7
- package/dist/src/queue/queue.js +83 -76
- package/dist/src/queue/queue.js.map +1 -7
- package/dist/src/redis/index.js +34 -45
- package/dist/src/redis/index.js.map +1 -7
- package/dist/src/redis/init.js +125 -115
- package/dist/src/redis/init.js.map +1 -7
- package/dist/src/redis/redis.js +302 -244
- package/dist/src/redis/redis.js.map +1 -7
- package/dist/src/redis/redlockImpl.js +152 -135
- package/dist/src/redis/redlockImpl.js.map +1 -7
- package/dist/src/redis/utils.js +115 -128
- package/dist/src/redis/utils.js.map +1 -7
- package/dist/src/security/encryption.js +141 -162
- package/dist/src/security/encryption.js.map +1 -7
- package/dist/src/security/permissions.js +132 -170
- package/dist/src/security/permissions.js.map +1 -7
- package/dist/src/security/roles.js +319 -298
- package/dist/src/security/roles.js.map +1 -7
- package/dist/src/security/sessions.js +106 -120
- package/dist/src/security/sessions.js.map +1 -7
- package/dist/src/tenancy/db.js +7 -30
- package/dist/src/tenancy/db.js.map +1 -7
- package/dist/src/tenancy/index.js +17 -23
- package/dist/src/tenancy/index.js.map +1 -7
- package/dist/src/tenancy/tenancy.js +101 -114
- package/dist/src/tenancy/tenancy.js.map +1 -7
- package/dist/src/timers/index.js +16 -21
- package/dist/src/timers/index.js.map +1 -7
- package/dist/src/timers/timers.js +18 -43
- package/dist/src/timers/timers.js.map +1 -7
- package/dist/src/users/db.js +403 -357
- package/dist/src/users/db.js.map +1 -7
- package/dist/src/users/events.js +150 -133
- package/dist/src/users/events.js.map +1 -7
- package/dist/src/users/index.js +21 -34
- package/dist/src/users/index.js.map +1 -7
- package/dist/src/users/lookup.js +104 -102
- package/dist/src/users/lookup.js.map +1 -7
- package/dist/src/users/users.js +244 -240
- package/dist/src/users/users.js.map +1 -7
- package/dist/src/users/utils.js +87 -90
- package/dist/src/users/utils.js.map +1 -7
- package/dist/src/utils/hashing.js +42 -48
- package/dist/src/utils/hashing.js.map +1 -7
- package/dist/src/utils/index.js +18 -25
- package/dist/src/utils/index.js.map +1 -7
- package/dist/src/utils/stringUtils.js +6 -30
- package/dist/src/utils/stringUtils.js.map +1 -7
- package/dist/src/utils/utils.js +212 -172
- package/dist/src/utils/utils.js.map +1 -7
- package/dist/tests/core/logging.js +21 -45
- package/dist/tests/core/logging.js.map +1 -7
- package/dist/tests/core/utilities/index.js +34 -51
- package/dist/tests/core/utilities/index.js.map +1 -7
- package/dist/tests/core/utilities/jestUtils.js +16 -45
- package/dist/tests/core/utilities/jestUtils.js.map +1 -7
- package/dist/tests/core/utilities/mocks/alerts.js +27 -38
- package/dist/tests/core/utilities/mocks/alerts.js.map +1 -7
- package/dist/tests/core/utilities/mocks/date.js +5 -31
- package/dist/tests/core/utilities/mocks/date.js.map +1 -7
- package/dist/tests/core/utilities/mocks/events.js +141 -131
- package/dist/tests/core/utilities/mocks/events.js.map +1 -7
- package/dist/tests/core/utilities/mocks/fetch.js +10 -34
- package/dist/tests/core/utilities/mocks/fetch.js.map +1 -7
- package/dist/tests/core/utilities/mocks/index.js +39 -51
- package/dist/tests/core/utilities/mocks/index.js.map +1 -7
- package/dist/tests/core/utilities/mocks/licenses.js +67 -107
- package/dist/tests/core/utilities/mocks/licenses.js.map +1 -7
- package/dist/tests/core/utilities/mocks/posthog.js +6 -6
- package/dist/tests/core/utilities/mocks/posthog.js.map +1 -7
- package/dist/tests/core/utilities/structures/Chance.js +17 -44
- package/dist/tests/core/utilities/structures/Chance.js.map +1 -7
- package/dist/tests/core/utilities/structures/accounts.js +61 -131
- package/dist/tests/core/utilities/structures/accounts.js.map +1 -7
- package/dist/tests/core/utilities/structures/apps.js +21 -44
- package/dist/tests/core/utilities/structures/apps.js.map +1 -7
- package/dist/tests/core/utilities/structures/common.js +8 -32
- package/dist/tests/core/utilities/structures/common.js.map +1 -7
- package/dist/tests/core/utilities/structures/db.js +11 -35
- package/dist/tests/core/utilities/structures/db.js.map +1 -7
- package/dist/tests/core/utilities/structures/documents/index.js +16 -21
- package/dist/tests/core/utilities/structures/documents/index.js.map +1 -7
- package/dist/tests/core/utilities/structures/documents/platform/index.js +26 -37
- package/dist/tests/core/utilities/structures/documents/platform/index.js.map +1 -7
- package/dist/tests/core/utilities/structures/documents/platform/installation.js +34 -44
- package/dist/tests/core/utilities/structures/documents/platform/installation.js.map +1 -7
- package/dist/tests/core/utilities/structures/generator.js +7 -38
- package/dist/tests/core/utilities/structures/generator.js.map +1 -7
- package/dist/tests/core/utilities/structures/index.js +43 -78
- package/dist/tests/core/utilities/structures/index.js.map +1 -7
- package/dist/tests/core/utilities/structures/koa.js +7 -39
- package/dist/tests/core/utilities/structures/koa.js.map +1 -7
- package/dist/tests/core/utilities/structures/licenses.js +121 -156
- package/dist/tests/core/utilities/structures/licenses.js.map +1 -7
- package/dist/tests/core/utilities/structures/plugins.js +20 -43
- package/dist/tests/core/utilities/structures/plugins.js.map +1 -7
- package/dist/tests/core/utilities/structures/quotas.js +67 -90
- package/dist/tests/core/utilities/structures/quotas.js.map +1 -7
- package/dist/tests/core/utilities/structures/scim.js +57 -84
- package/dist/tests/core/utilities/structures/scim.js.map +1 -7
- package/dist/tests/core/utilities/structures/shared.js +9 -41
- package/dist/tests/core/utilities/structures/shared.js.map +1 -7
- package/dist/tests/core/utilities/structures/sso.js +112 -124
- package/dist/tests/core/utilities/structures/sso.js.map +1 -7
- package/dist/tests/core/utilities/structures/tenants.js +6 -29
- package/dist/tests/core/utilities/structures/tenants.js.map +1 -7
- package/dist/tests/core/utilities/structures/userGroups.js +10 -33
- package/dist/tests/core/utilities/structures/userGroups.js.map +1 -7
- package/dist/tests/core/utilities/structures/users.js +36 -84
- package/dist/tests/core/utilities/structures/users.js.map +1 -7
- package/dist/tests/core/utilities/testContainerUtils.js +59 -84
- package/dist/tests/core/utilities/testContainerUtils.js.map +1 -7
- package/dist/tests/core/utilities/utils/index.js +26 -37
- package/dist/tests/core/utilities/utils/index.js.map +1 -7
- package/dist/tests/core/utilities/utils/time.js +5 -28
- package/dist/tests/core/utilities/utils/time.js.map +1 -7
- package/dist/tests/extra/DBTestConfiguration.js +50 -56
- package/dist/tests/extra/DBTestConfiguration.js.map +1 -7
- package/dist/tests/extra/index.js +30 -39
- package/dist/tests/extra/index.js.map +1 -7
- package/dist/tests/extra/testEnv.js +105 -84
- package/dist/tests/extra/testEnv.js.map +1 -7
- package/dist/tests/index.js +16 -21
- package/dist/tests/index.js.map +1 -7
- package/dist/tests/jestEnv.js +1 -1
- package/dist/tests/jestEnv.js.map +1 -7
- package/dist/tests/jestSetup.js +20 -33
- package/dist/tests/jestSetup.js.map +1 -7
- package/package.json +5 -5
- package/dist/plugins.js +0 -290
- package/dist/plugins.js.map +0 -7
- package/dist/plugins.js.meta.json +0 -1
- package/dist/src/auth/tests/auth.spec.js +0 -37
- package/dist/src/auth/tests/auth.spec.js.map +0 -7
- package/dist/src/blacklist/tests/blacklist.spec.js +0 -61
- package/dist/src/blacklist/tests/blacklist.spec.js.map +0 -7
- package/dist/src/cache/tests/writethrough.spec.js +0 -132
- package/dist/src/cache/tests/writethrough.spec.js.map +0 -7
- package/dist/src/configs/tests/configs.spec.js +0 -182
- package/dist/src/configs/tests/configs.spec.js.map +0 -7
- package/dist/src/context/tests/index.spec.js +0 -147
- package/dist/src/context/tests/index.spec.js.map +0 -7
- package/dist/src/db/tests/index.spec.js +0 -24
- package/dist/src/db/tests/index.spec.js.map +0 -7
- package/dist/src/db/tests/lucene.spec.js +0 -312
- package/dist/src/db/tests/lucene.spec.js.map +0 -7
- package/dist/src/db/tests/pouch.spec.js +0 -63
- package/dist/src/db/tests/pouch.spec.js.map +0 -7
- package/dist/src/db/tests/utils.spec.js +0 -50
- package/dist/src/db/tests/utils.spec.js.map +0 -7
- package/dist/src/events/processors/posthog/tests/PosthogProcessor.spec.js +0 -154
- package/dist/src/events/processors/posthog/tests/PosthogProcessor.spec.js.map +0 -7
- package/dist/src/features/tests/featureFlags.spec.js +0 -86
- package/dist/src/features/tests/featureFlags.spec.js.map +0 -7
- package/dist/src/logging/tests/system.spec.js +0 -59
- package/dist/src/logging/tests/system.spec.js.map +0 -7
- package/dist/src/middleware/passport/sso/tests/google.spec.js +0 -77
- package/dist/src/middleware/passport/sso/tests/google.spec.js.map +0 -7
- package/dist/src/middleware/passport/sso/tests/oidc.spec.js +0 -143
- package/dist/src/middleware/passport/sso/tests/oidc.spec.js.map +0 -7
- package/dist/src/middleware/passport/sso/tests/sso.spec.js +0 -167
- package/dist/src/middleware/passport/sso/tests/sso.spec.js.map +0 -7
- package/dist/src/middleware/tests/builder.spec.js +0 -169
- package/dist/src/middleware/tests/builder.spec.js.map +0 -7
- package/dist/src/middleware/tests/matchers.spec.js +0 -120
- package/dist/src/middleware/tests/matchers.spec.js.map +0 -7
- package/dist/src/migrations/tests/migrations.spec.js +0 -78
- package/dist/src/migrations/tests/migrations.spec.js.map +0 -7
- package/dist/src/objectStore/buckets/tests/app.spec.js +0 -171
- package/dist/src/objectStore/buckets/tests/app.spec.js.map +0 -7
- package/dist/src/objectStore/buckets/tests/global.spec.js +0 -87
- package/dist/src/objectStore/buckets/tests/global.spec.js.map +0 -7
- package/dist/src/objectStore/buckets/tests/plugins.spec.js +0 -123
- package/dist/src/objectStore/buckets/tests/plugins.spec.js.map +0 -7
- package/dist/src/platform/tests/tenants.spec.js +0 -46
- package/dist/src/platform/tests/tenants.spec.js.map +0 -7
- package/dist/src/plugin/tests/validation.spec.js +0 -97
- package/dist/src/plugin/tests/validation.spec.js.map +0 -7
- package/dist/src/security/tests/encryption.spec.js +0 -51
- package/dist/src/security/tests/encryption.spec.js.map +0 -7
- package/dist/src/security/tests/permissions.spec.js +0 -154
- package/dist/src/security/tests/permissions.spec.js.map +0 -7
- package/dist/src/security/tests/sessions.spec.js +0 -33
- package/dist/src/security/tests/sessions.spec.js.map +0 -7
- package/dist/src/tenancy/tests/tenancy.spec.js +0 -154
- package/dist/src/tenancy/tests/tenancy.spec.js.map +0 -7
- package/dist/src/utils/tests/utils.spec.js +0 -165
- package/dist/src/utils/tests/utils.spec.js.map +0 -7
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const baseConfig = {
|
|
4
|
+
preset: "@trendyol/jest-testcontainers",
|
|
5
|
+
setupFiles: ["./tests/jestEnv.ts"],
|
|
6
|
+
setupFilesAfterEnv: ["./tests/jestSetup.ts"],
|
|
7
|
+
transform: {
|
|
8
|
+
"^.+\\.ts?$": "@swc/jest",
|
|
9
|
+
},
|
|
10
|
+
moduleNameMapper: {
|
|
11
|
+
"@budibase/types": "<rootDir>/../types/src",
|
|
12
|
+
"@budibase/shared-core": ["<rootDir>/../shared-core/src"],
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
const config = {
|
|
16
|
+
projects: [
|
|
17
|
+
Object.assign(Object.assign({}, baseConfig), { displayName: "sequential test", testMatch: ["<rootDir>/**/*.seq.spec.[jt]s"], runner: "jest-serial-runner" }),
|
|
18
|
+
Object.assign(Object.assign({}, baseConfig), { testMatch: ["<rootDir>/**/!(*.seq).spec.[jt]s"] }),
|
|
19
|
+
],
|
|
20
|
+
collectCoverageFrom: ["src/**/*.{js,ts}"],
|
|
21
|
+
coverageReporters: ["lcov", "json", "clover"],
|
|
22
|
+
};
|
|
23
|
+
process.env.DISABLE_PINO_LOGGER = "1";
|
|
24
|
+
exports.default = config;
|
|
25
|
+
//# sourceMappingURL=jest.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":";;AAEA,MAAM,UAAU,GAAiC;IAC/C,MAAM,EAAE,+BAA+B;IACvC,UAAU,EAAE,CAAC,oBAAoB,CAAC;IAClC,kBAAkB,EAAE,CAAC,sBAAsB,CAAC;IAC5C,SAAS,EAAE;QACT,YAAY,EAAE,WAAW;KAC1B;IACD,gBAAgB,EAAE;QAChB,iBAAiB,EAAE,wBAAwB;QAC3C,uBAAuB,EAAE,CAAC,8BAA8B,CAAC;KAC1D;CACF,CAAA;AAED,MAAM,MAAM,GAA0B;IACpC,QAAQ,EAAE;wCAEH,UAAU,KACb,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAE,CAAC,+BAA+B,CAAC,EAC5C,MAAM,EAAE,oBAAoB;wCAGzB,UAAU,KACb,SAAS,EAAE,CAAC,kCAAkC,CAAC;KAElD;IACD,mBAAmB,EAAE,CAAC,kBAAkB,CAAC;IACzC,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;CAC9C,CAAA;AAED,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,GAAG,CAAA;AAErC,kBAAe,MAAM,CAAA"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/backend-core",
|
|
3
|
-
"version": "2.9.39
|
|
3
|
+
"version": "2.9.39",
|
|
4
4
|
"description": "Budibase backend core libraries used in server and worker",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"prebuild": "rimraf dist/",
|
|
16
16
|
"prepack": "cp package.json dist",
|
|
17
|
-
"build": "
|
|
17
|
+
"build": "tsc -p tsconfig.build.json --paths null && node ./scripts/build.js",
|
|
18
18
|
"build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput",
|
|
19
19
|
"check:types": "tsc -p tsconfig.json --noEmit --paths null",
|
|
20
20
|
"test": "bash scripts/test.sh",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@budibase/nano": "10.1.2",
|
|
25
25
|
"@budibase/pouchdb-replication-stream": "1.2.10",
|
|
26
|
-
"@budibase/shared-core": "2.9.39
|
|
27
|
-
"@budibase/types": "2.9.39
|
|
26
|
+
"@budibase/shared-core": "2.9.39",
|
|
27
|
+
"@budibase/types": "2.9.39",
|
|
28
28
|
"@techpass/passport-openidconnect": "0.3.2",
|
|
29
29
|
"aws-cloudfront-sign": "2.2.0",
|
|
30
30
|
"aws-sdk": "2.1030.0",
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "6d9f12b6e3f1760167a83e5c20babc0a45ec34db"
|
|
108
108
|
}
|
|
@@ -1,100 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
13
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getStatus = exports.getAccountByTenantId = exports.getAccount = void 0;
|
|
16
|
+
const api_1 = __importDefault(require("./api"));
|
|
17
|
+
const environment_1 = __importDefault(require("../environment"));
|
|
18
|
+
const constants_1 = require("../constants");
|
|
19
|
+
const api = new api_1.default(environment_1.default.ACCOUNT_PORTAL_URL);
|
|
20
|
+
/**
|
|
21
|
+
* This client is intended to be used in a cloud hosted deploy only.
|
|
22
|
+
* Rather than relying on each consumer to perform the necessary environmental checks
|
|
23
|
+
* we use the following check to exit early with a undefined response which should be
|
|
24
|
+
* handled by the caller.
|
|
25
|
+
*/
|
|
26
|
+
const EXIT_EARLY = environment_1.default.SELF_HOSTED || environment_1.default.DISABLE_ACCOUNT_PORTAL;
|
|
27
|
+
const getAccount = (email) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
if (EXIT_EARLY) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const payload = {
|
|
32
|
+
email,
|
|
33
|
+
};
|
|
34
|
+
const response = yield api.post(`/api/accounts/search`, {
|
|
35
|
+
body: payload,
|
|
36
|
+
headers: {
|
|
37
|
+
[constants_1.Header.API_KEY]: environment_1.default.ACCOUNT_PORTAL_API_KEY,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
if (response.status !== 200) {
|
|
41
|
+
throw new Error(`Error getting account by email ${email}`);
|
|
42
|
+
}
|
|
43
|
+
const json = yield response.json();
|
|
44
|
+
return json[0];
|
|
34
45
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const api = new import_api.default(import_environment.default.ACCOUNT_PORTAL_URL);
|
|
40
|
-
const EXIT_EARLY = import_environment.default.SELF_HOSTED || import_environment.default.DISABLE_ACCOUNT_PORTAL;
|
|
41
|
-
const getAccount = async (email) => {
|
|
42
|
-
if (EXIT_EARLY) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const payload = {
|
|
46
|
-
email
|
|
47
|
-
};
|
|
48
|
-
const response = await api.post(`/api/accounts/search`, {
|
|
49
|
-
body: payload,
|
|
50
|
-
headers: {
|
|
51
|
-
[import_constants.Header.API_KEY]: import_environment.default.ACCOUNT_PORTAL_API_KEY
|
|
46
|
+
exports.getAccount = getAccount;
|
|
47
|
+
const getAccountByTenantId = (tenantId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
+
if (EXIT_EARLY) {
|
|
49
|
+
return;
|
|
52
50
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const payload = {
|
|
65
|
-
tenantId
|
|
66
|
-
};
|
|
67
|
-
const response = await api.post(`/api/accounts/search`, {
|
|
68
|
-
body: payload,
|
|
69
|
-
headers: {
|
|
70
|
-
[import_constants.Header.API_KEY]: import_environment.default.ACCOUNT_PORTAL_API_KEY
|
|
51
|
+
const payload = {
|
|
52
|
+
tenantId,
|
|
53
|
+
};
|
|
54
|
+
const response = yield api.post(`/api/accounts/search`, {
|
|
55
|
+
body: payload,
|
|
56
|
+
headers: {
|
|
57
|
+
[constants_1.Header.API_KEY]: environment_1.default.ACCOUNT_PORTAL_API_KEY,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
if (response.status !== 200) {
|
|
61
|
+
throw new Error(`Error getting account by tenantId ${tenantId}`);
|
|
71
62
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const getStatus = async () => {
|
|
80
|
-
if (EXIT_EARLY) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const response = await api.get(`/api/status`, {
|
|
84
|
-
headers: {
|
|
85
|
-
[import_constants.Header.API_KEY]: import_environment.default.ACCOUNT_PORTAL_API_KEY
|
|
63
|
+
const json = yield response.json();
|
|
64
|
+
return json[0];
|
|
65
|
+
});
|
|
66
|
+
exports.getAccountByTenantId = getAccountByTenantId;
|
|
67
|
+
const getStatus = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
|
+
if (EXIT_EARLY) {
|
|
69
|
+
return;
|
|
86
70
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
getAccountByTenantId,
|
|
98
|
-
getStatus
|
|
71
|
+
const response = yield api.get(`/api/status`, {
|
|
72
|
+
headers: {
|
|
73
|
+
[constants_1.Header.API_KEY]: environment_1.default.ACCOUNT_PORTAL_API_KEY,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
const json = yield response.json();
|
|
77
|
+
if (response.status !== 200) {
|
|
78
|
+
throw new Error(`Error getting status`);
|
|
79
|
+
}
|
|
80
|
+
return json;
|
|
99
81
|
});
|
|
100
|
-
|
|
82
|
+
exports.getStatus = getStatus;
|
|
83
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/accounts/accounts.ts"],
|
|
4
|
-
"sourcesContent": ["import API from \"./api\"\nimport env from \"../environment\"\nimport { Header } from \"../constants\"\nimport { CloudAccount, HealthStatusResponse } from \"@budibase/types\"\n\nconst api = new API(env.ACCOUNT_PORTAL_URL)\n\n/**\n * This client is intended to be used in a cloud hosted deploy only.\n * Rather than relying on each consumer to perform the necessary environmental checks\n * we use the following check to exit early with a undefined response which should be\n * handled by the caller.\n */\nconst EXIT_EARLY = env.SELF_HOSTED || env.DISABLE_ACCOUNT_PORTAL\n\nexport const getAccount = async (\n email: string\n): Promise<CloudAccount | undefined> => {\n if (EXIT_EARLY) {\n return\n }\n const payload = {\n email,\n }\n const response = await api.post(`/api/accounts/search`, {\n body: payload,\n headers: {\n [Header.API_KEY]: env.ACCOUNT_PORTAL_API_KEY,\n },\n })\n\n if (response.status !== 200) {\n throw new Error(`Error getting account by email ${email}`)\n }\n\n const json: CloudAccount[] = await response.json()\n return json[0]\n}\n\nexport const getAccountByTenantId = async (\n tenantId: string\n): Promise<CloudAccount | undefined> => {\n if (EXIT_EARLY) {\n return\n }\n const payload = {\n tenantId,\n }\n const response = await api.post(`/api/accounts/search`, {\n body: payload,\n headers: {\n [Header.API_KEY]: env.ACCOUNT_PORTAL_API_KEY,\n },\n })\n\n if (response.status !== 200) {\n throw new Error(`Error getting account by tenantId ${tenantId}`)\n }\n\n const json: CloudAccount[] = await response.json()\n return json[0]\n}\n\nexport const getStatus = async (): Promise<\n HealthStatusResponse | undefined\n> => {\n if (EXIT_EARLY) {\n return\n }\n const response = await api.get(`/api/status`, {\n headers: {\n [Header.API_KEY]: env.ACCOUNT_PORTAL_API_KEY,\n },\n })\n const json = await response.json()\n\n if (response.status !== 200) {\n throw new Error(`Error getting status`)\n }\n\n return json\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAgB;AAChB,yBAAgB;AAChB,uBAAuB;AAGvB,MAAM,MAAM,IAAI,WAAAA,QAAI,mBAAAC,QAAI,kBAAkB;AAQ1C,MAAM,aAAa,mBAAAA,QAAI,eAAe,mBAAAA,QAAI;AAEnC,MAAM,aAAa,OACxB,UACsC;AACtC,MAAI,YAAY;AACd;AAAA,EACF;AACA,QAAM,UAAU;AAAA,IACd;AAAA,EACF;AACA,QAAM,WAAW,MAAM,IAAI,KAAK,wBAAwB;AAAA,IACtD,MAAM;AAAA,IACN,SAAS;AAAA,MACP,CAAC,wBAAO,OAAO,GAAG,mBAAAA,QAAI;AAAA,IACxB;AAAA,EACF,CAAC;AAED,MAAI,SAAS,WAAW,KAAK;AAC3B,UAAM,IAAI,MAAM,kCAAkC,KAAK,EAAE;AAAA,EAC3D;AAEA,QAAM,OAAuB,MAAM,SAAS,KAAK;AACjD,SAAO,KAAK,CAAC;AACf;AAEO,MAAM,uBAAuB,OAClC,aACsC;AACtC,MAAI,YAAY;AACd;AAAA,EACF;AACA,QAAM,UAAU;AAAA,IACd;AAAA,EACF;AACA,QAAM,WAAW,MAAM,IAAI,KAAK,wBAAwB;AAAA,IACtD,MAAM;AAAA,IACN,SAAS;AAAA,MACP,CAAC,wBAAO,OAAO,GAAG,mBAAAA,QAAI;AAAA,IACxB;AAAA,EACF,CAAC;AAED,MAAI,SAAS,WAAW,KAAK;AAC3B,UAAM,IAAI,MAAM,qCAAqC,QAAQ,EAAE;AAAA,EACjE;AAEA,QAAM,OAAuB,MAAM,SAAS,KAAK;AACjD,SAAO,KAAK,CAAC;AACf;AAEO,MAAM,YAAY,YAEpB;AACH,MAAI,YAAY;AACd;AAAA,EACF;AACA,QAAM,WAAW,MAAM,IAAI,IAAI,eAAe;AAAA,IAC5C,SAAS;AAAA,MACP,CAAC,wBAAO,OAAO,GAAG,mBAAAA,QAAI;AAAA,IACxB;AAAA,EACF,CAAC;AACD,QAAM,OAAO,MAAM,SAAS,KAAK;AAEjC,MAAI,SAAS,WAAW,KAAK;AAC3B,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,SAAO;AACT;",
|
|
6
|
-
"names": ["API", "env"]
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../src/accounts/accounts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAuB;AACvB,iEAAgC;AAChC,4CAAqC;AAGrC,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC,qBAAG,CAAC,kBAAkB,CAAC,CAAA;AAE3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AC,CAAC,CAAC,CAAA;AAChB,CAAC,CAAA,CAAA;AAtBY,QAAA,oBAAoB,wBAsBhC;AAEM,MAAM,SAAS,GAAG,GAEvB,EAAE;IACF,IAAI,UAAU,EAAE;QACd,OAAM;KACP;IACD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,aAAa,EAAE;QAC5C,OAAO,EAAE;YACP,CAAC,kBAAM,CAAC,OAAO,CAAC,EAAE,qBAAG,CAAC,sBAAsB;SAC7C;KACF,CAAC,CAAA;IACF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;IAElC,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;QAC3B,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAA;KACxC;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAA,CAAA;AAlBY,QAAA,SAAS,aAkBrB"}
|
package/dist/src/accounts/api.js
CHANGED
|
@@ -1,78 +1,92 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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;
|
|
11
24
|
};
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
19
33
|
};
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var api_exports = {};
|
|
30
|
-
__export(api_exports, {
|
|
31
|
-
default: () => API
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(api_exports);
|
|
34
|
-
var import_node_fetch = __toESM(require("node-fetch"));
|
|
35
|
-
var logging = __toESM(require("../logging"));
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
39
|
+
const logging = __importStar(require("../logging"));
|
|
36
40
|
class API {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
constructor(host) {
|
|
42
|
+
this.host = host;
|
|
43
|
+
}
|
|
44
|
+
apiCall(method, url, options) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
if (!options.headers) {
|
|
47
|
+
options.headers = {};
|
|
48
|
+
}
|
|
49
|
+
if (!options.headers["Content-Type"]) {
|
|
50
|
+
options.headers = Object.assign({ "Content-Type": "application/json", Accept: "application/json" }, options.headers);
|
|
51
|
+
}
|
|
52
|
+
let json = options.headers["Content-Type"] === "application/json";
|
|
53
|
+
// add x-budibase-correlation-id header
|
|
54
|
+
logging.correlation.setHeader(options.headers);
|
|
55
|
+
const requestOptions = {
|
|
56
|
+
method: method,
|
|
57
|
+
body: json ? JSON.stringify(options.body) : options.body,
|
|
58
|
+
headers: options.headers,
|
|
59
|
+
// TODO: See if this is necessary
|
|
60
|
+
credentials: "include",
|
|
61
|
+
};
|
|
62
|
+
return yield (0, node_fetch_1.default)(`${this.host}${url}`, requestOptions);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
post(url, options) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
return this.apiCall("POST", url, options);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
get(url, options) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
return this.apiCall("GET", url, options);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
patch(url, options) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
return this.apiCall("PATCH", url, options);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
del(url, options) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
return this.apiCall("DELETE", url, options);
|
|
83
|
+
});
|
|
43
84
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
...options.headers
|
|
49
|
-
};
|
|
85
|
+
put(url, options) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
return this.apiCall("PUT", url, options);
|
|
88
|
+
});
|
|
50
89
|
}
|
|
51
|
-
let json = options.headers["Content-Type"] === "application/json";
|
|
52
|
-
logging.correlation.setHeader(options.headers);
|
|
53
|
-
const requestOptions = {
|
|
54
|
-
method,
|
|
55
|
-
body: json ? JSON.stringify(options.body) : options.body,
|
|
56
|
-
headers: options.headers,
|
|
57
|
-
// TODO: See if this is necessary
|
|
58
|
-
credentials: "include"
|
|
59
|
-
};
|
|
60
|
-
return await (0, import_node_fetch.default)(`${this.host}${url}`, requestOptions);
|
|
61
|
-
}
|
|
62
|
-
async post(url, options) {
|
|
63
|
-
return this.apiCall("POST", url, options);
|
|
64
|
-
}
|
|
65
|
-
async get(url, options) {
|
|
66
|
-
return this.apiCall("GET", url, options);
|
|
67
|
-
}
|
|
68
|
-
async patch(url, options) {
|
|
69
|
-
return this.apiCall("PATCH", url, options);
|
|
70
|
-
}
|
|
71
|
-
async del(url, options) {
|
|
72
|
-
return this.apiCall("DELETE", url, options);
|
|
73
|
-
}
|
|
74
|
-
async put(url, options) {
|
|
75
|
-
return this.apiCall("PUT", url, options);
|
|
76
|
-
}
|
|
77
90
|
}
|
|
78
|
-
|
|
91
|
+
exports.default = API;
|
|
92
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/accounts/api.ts"],
|
|
4
|
-
"sourcesContent": ["import fetch from \"node-fetch\"\nimport * as logging from \"../logging\"\n\nexport default class API {\n host: string\n\n constructor(host: string) {\n this.host = host\n }\n\n async apiCall(method: string, url: string, options?: any) {\n if (!options.headers) {\n options.headers = {}\n }\n\n if (!options.headers[\"Content-Type\"]) {\n options.headers = {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n ...options.headers,\n }\n }\n\n let json = options.headers[\"Content-Type\"] === \"application/json\"\n\n // add x-budibase-correlation-id header\n logging.correlation.setHeader(options.headers)\n\n const requestOptions = {\n method: method,\n body: json ? JSON.stringify(options.body) : options.body,\n headers: options.headers,\n // TODO: See if this is necessary\n credentials: \"include\",\n }\n\n return await fetch(`${this.host}${url}`, requestOptions)\n }\n\n async post(url: string, options?: any) {\n return this.apiCall(\"POST\", url, options)\n }\n\n async get(url: string, options?: any) {\n return this.apiCall(\"GET\", url, options)\n }\n\n async patch(url: string, options?: any) {\n return this.apiCall(\"PATCH\", url, options)\n }\n\n async del(url: string, options?: any) {\n return this.apiCall(\"DELETE\", url, options)\n }\n\n async put(url: string, options?: any) {\n return this.apiCall(\"PUT\", url, options)\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAkB;AAClB,cAAyB;AAEzB,MAAO,IAAkB;AAAA,EAGvB,YAAY,MAAc;AACxB,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,MAAM,QAAQ,QAAgB,KAAa,SAAe;AACxD,QAAI,CAAC,QAAQ,SAAS;AACpB,cAAQ,UAAU,CAAC;AAAA,IACrB;AAEA,QAAI,CAAC,QAAQ,QAAQ,cAAc,GAAG;AACpC,cAAQ,UAAU;AAAA,QAChB,gBAAgB;AAAA,QAChB,QAAQ;AAAA,QACR,GAAG,QAAQ;AAAA,MACb;AAAA,IACF;AAEA,QAAI,OAAO,QAAQ,QAAQ,cAAc,MAAM;AAG/C,YAAQ,YAAY,UAAU,QAAQ,OAAO;AAE7C,UAAM,iBAAiB;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K,EAAE,GAAG,EAAE,OAAO,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AAvDD,sBAuDC"}
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
13
15
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
module.exports = __toCommonJS(accounts_exports);
|
|
18
|
-
__reExport(accounts_exports, require("./accounts"), module.exports);
|
|
19
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
-
0 && (module.exports = {
|
|
21
|
-
...require("./accounts")
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./accounts"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/accounts/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from \"./accounts\"\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,uBAAd;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/accounts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B"}
|