@servicelabsco/nestjs-utility-services 3.0.19 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +275 -1
- package/README.md +3 -1
- package/dist/app.module.js +10 -43
- package/dist/app.module.js.map +1 -1
- package/dist/auth/auth.module.js +1 -4
- package/dist/auth/auth.module.js.map +1 -1
- package/dist/auth/middlewares/internal.middleware.js +4 -36
- package/dist/auth/middlewares/internal.middleware.js.map +1 -1
- package/dist/auth/services/auth.service.js.map +1 -1
- package/dist/auth/services/device.token.service.js +4 -3
- package/dist/auth/services/device.token.service.js.map +1 -1
- package/dist/auth/services/refresh.token.service.js +1 -34
- package/dist/auth/services/refresh.token.service.js.map +1 -1
- package/dist/common/adapters/redis.io.adapter.d.ts +1 -3
- package/dist/common/adapters/redis.io.adapter.js +3 -7
- package/dist/common/adapters/redis.io.adapter.js.map +1 -1
- package/dist/common/libraries/auth.js +1 -34
- package/dist/common/libraries/auth.js.map +1 -1
- package/dist/common/libraries/common.subscriber.js +15 -15
- package/dist/common/libraries/common.subscriber.js.map +1 -1
- package/dist/common/libraries/custom.crypt.js +13 -46
- package/dist/common/libraries/custom.crypt.js.map +1 -1
- package/dist/common/libraries/custom.logger.js +1 -1
- package/dist/common/libraries/custom.logger.js.map +1 -1
- package/dist/common/libraries/date.util.js +3 -3
- package/dist/common/libraries/date.util.js.map +1 -1
- package/dist/common/libraries/hash.js +3 -36
- package/dist/common/libraries/hash.js.map +1 -1
- package/dist/common/libraries/json.evaluator.js +26 -26
- package/dist/common/libraries/json.evaluator.js.map +1 -1
- package/dist/common/libraries/log.redactor.js +14 -14
- package/dist/common/libraries/log.redactor.js.map +1 -1
- package/dist/common/libraries/money.js +4 -4
- package/dist/common/libraries/money.js.map +1 -1
- package/dist/common/libraries/platform.utility.js +1 -4
- package/dist/common/libraries/platform.utility.js.map +1 -1
- package/dist/common/libraries/record.manager.js.map +1 -1
- package/dist/common/libraries/sentry.sdk.d.ts +1 -1
- package/dist/common/libraries/sentry.sdk.js +1 -1
- package/dist/common/libraries/sentry.sdk.js.map +1 -1
- package/dist/config/jwt.config.js.map +1 -1
- package/dist/config/orm.config.js +0 -3
- package/dist/config/orm.config.js.map +1 -1
- package/dist/config/read.typeorm.config.js +6 -35
- package/dist/config/read.typeorm.config.js.map +1 -1
- package/dist/config/sentry.options.js +14 -1
- package/dist/config/sentry.options.js.map +1 -1
- package/dist/config/typeorm.config.js +6 -37
- package/dist/config/typeorm.config.js.map +1 -1
- package/dist/health.check.controller.js +18 -0
- package/dist/health.check.controller.js.map +1 -1
- package/dist/main.d.ts +0 -1
- package/dist/main.js +6 -45
- package/dist/main.js.map +1 -1
- package/dist/migrations/1619296224563-AddMasterSeedersDataSeederTable.js +2 -35
- package/dist/migrations/1619296224563-AddMasterSeedersDataSeederTable.js.map +1 -1
- package/dist/migrations/1779607111923-AddUniqueIndexSysPropertiesName.js +2 -2
- package/dist/migrations/1779607111923-AddUniqueIndexSysPropertiesName.js.map +1 -1
- package/dist/migrations/1779607111924-AddUniqueIndexSysDocumentsFileHash.js +2 -2
- package/dist/migrations/1779607111924-AddUniqueIndexSysDocumentsFileHash.js.map +1 -1
- package/dist/migrations/1779690975270-AddUniqueIndexSysSessionIdentifiers.js +1 -1
- package/dist/migrations/1779690975270-AddUniqueIndexSysSessionIdentifiers.js.map +1 -1
- package/dist/migrations/1779773659655-AddIdempotencyIndexesForJobs.js +3 -3
- package/dist/migrations/1779773659655-AddIdempotencyIndexesForJobs.js.map +1 -1
- package/dist/migrations/1780002352495-MigrateJsonColumnsToJsonb.js +20 -20
- package/dist/migrations/1780002352495-MigrateJsonColumnsToJsonb.js.map +1 -1
- package/dist/migrations/1788287350858-ReplaceUniqueIndexesWithSoftDeleteAware.js +4 -4
- package/dist/migrations/1788287350858-ReplaceUniqueIndexesWithSoftDeleteAware.js.map +1 -1
- package/dist/migrations/1788287350859-NormalizeSocialIdentitiesUuidDefault.js +1 -1
- package/dist/migrations/1788287350859-NormalizeSocialIdentitiesUuidDefault.js.map +1 -1
- package/dist/migrations/1793302598724-CreateUploadSessionTable.d.ts +5 -0
- package/dist/migrations/1793302598724-CreateUploadSessionTable.js +33 -0
- package/dist/migrations/1793302598724-CreateUploadSessionTable.js.map +1 -0
- package/dist/migrations/1793726866264-CreateSourceVersionTable.d.ts +5 -0
- package/dist/migrations/1793726866264-CreateSourceVersionTable.js +22 -0
- package/dist/migrations/1793726866264-CreateSourceVersionTable.js.map +1 -0
- package/dist/migrations/1793732831136-AddLastViewedAtSysMaterialViewsTable.d.ts +5 -0
- package/dist/migrations/1793732831136-AddLastViewedAtSysMaterialViewsTable.js +15 -0
- package/dist/migrations/1793732831136-AddLastViewedAtSysMaterialViewsTable.js.map +1 -0
- package/dist/platformUtility/constants/index.d.ts +1 -0
- package/dist/platformUtility/constants/index.js +1 -0
- package/dist/platformUtility/constants/index.js.map +1 -1
- package/dist/platformUtility/constants/servicelabs.constants.d.ts +30 -0
- package/dist/platformUtility/constants/servicelabs.constants.js +34 -0
- package/dist/platformUtility/constants/servicelabs.constants.js.map +1 -0
- package/dist/platformUtility/consumers/job.consumer.d.ts +2 -1
- package/dist/platformUtility/consumers/job.consumer.js +8 -8
- package/dist/platformUtility/consumers/job.consumer.js.map +1 -1
- package/dist/platformUtility/es6.classes.d.ts +36 -4
- package/dist/platformUtility/es6.classes.js +8 -1
- package/dist/platformUtility/es6.classes.js.map +1 -1
- package/dist/platformUtility/filters/sentry.reporting.filter.js +2 -1
- package/dist/platformUtility/filters/sentry.reporting.filter.js.map +1 -1
- package/dist/platformUtility/interfaces/index.d.ts +19 -0
- package/dist/platformUtility/interfaces/index.js +19 -0
- package/dist/platformUtility/interfaces/index.js.map +1 -1
- package/dist/platformUtility/interfaces/servicelabs.call.options.interface.d.ts +8 -0
- package/dist/platformUtility/interfaces/servicelabs.call.options.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.call.options.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.callback.event.interface.d.ts +6 -0
- package/dist/platformUtility/interfaces/servicelabs.callback.event.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.callback.event.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.error.interface.d.ts +10 -0
- package/dist/platformUtility/interfaces/servicelabs.error.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.error.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.html.pdf.input.interface.d.ts +5 -0
- package/dist/platformUtility/interfaces/servicelabs.html.pdf.input.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.html.pdf.input.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.job.file.interface.d.ts +10 -0
- package/dist/platformUtility/interfaces/servicelabs.job.file.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.job.file.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.job.interface.d.ts +31 -0
- package/dist/platformUtility/interfaces/servicelabs.job.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.job.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.job.list.interface.d.ts +5 -0
- package/dist/platformUtility/interfaces/servicelabs.job.list.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.job.list.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.job.list.options.interface.d.ts +6 -0
- package/dist/platformUtility/interfaces/servicelabs.job.list.options.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.job.list.options.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.job.summary.interface.d.ts +15 -0
- package/dist/platformUtility/interfaces/servicelabs.job.summary.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.job.summary.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.request.interface.d.ts +5 -0
- package/dist/platformUtility/interfaces/servicelabs.request.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.request.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.response.interface.d.ts +6 -0
- package/dist/platformUtility/interfaces/servicelabs.response.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.response.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.run.options.interface.d.ts +8 -0
- package/dist/platformUtility/interfaces/servicelabs.run.options.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.run.options.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.store.options.interface.d.ts +5 -0
- package/dist/platformUtility/interfaces/servicelabs.store.options.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.store.options.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.stored.file.interface.d.ts +6 -0
- package/dist/platformUtility/interfaces/servicelabs.stored.file.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.stored.file.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.url.input.interface.d.ts +3 -0
- package/dist/platformUtility/interfaces/servicelabs.url.input.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.url.input.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.utility.interface.d.ts +12 -0
- package/dist/platformUtility/interfaces/servicelabs.utility.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.utility.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.zip.entry.interface.d.ts +4 -0
- package/dist/platformUtility/interfaces/servicelabs.zip.entry.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.zip.entry.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/servicelabs.zip.files.input.interface.d.ts +4 -0
- package/dist/platformUtility/interfaces/servicelabs.zip.files.input.interface.js +3 -0
- package/dist/platformUtility/interfaces/servicelabs.zip.files.input.interface.js.map +1 -0
- package/dist/platformUtility/interfaces/unzip.file.interface.d.ts +6 -0
- package/dist/platformUtility/interfaces/unzip.file.interface.js +3 -0
- package/dist/platformUtility/interfaces/unzip.file.interface.js.map +1 -0
- package/dist/platformUtility/libraries/common.servicelabs.callback.controller.d.ts +11 -0
- package/dist/platformUtility/libraries/common.servicelabs.callback.controller.js +43 -0
- package/dist/platformUtility/libraries/common.servicelabs.callback.controller.js.map +1 -0
- package/dist/platformUtility/libraries/create.entity.constants.file.js +1 -34
- package/dist/platformUtility/libraries/create.entity.constants.file.js.map +1 -1
- package/dist/platformUtility/libraries/create.es6.classes.file.js +1 -34
- package/dist/platformUtility/libraries/create.es6.classes.file.js.map +1 -1
- package/dist/platformUtility/libraries/create.es6.jobs.file.js +1 -34
- package/dist/platformUtility/libraries/create.es6.jobs.file.js.map +1 -1
- package/dist/platformUtility/libraries/create.es6.service.file.js +1 -34
- package/dist/platformUtility/libraries/create.es6.service.file.js.map +1 -1
- package/dist/platformUtility/libraries/create.index.file.js +1 -34
- package/dist/platformUtility/libraries/create.index.file.js.map +1 -1
- package/dist/platformUtility/libraries/file.system.utility.js +1 -34
- package/dist/platformUtility/libraries/file.system.utility.js.map +1 -1
- package/dist/platformUtility/libraries/index.d.ts +1 -0
- package/dist/platformUtility/libraries/index.js +1 -0
- package/dist/platformUtility/libraries/index.js.map +1 -1
- package/dist/platformUtility/libraries/process.common.mail.js +4 -7
- package/dist/platformUtility/libraries/process.common.mail.js.map +1 -1
- package/dist/platformUtility/libraries/process.kaleyra.sms.d.ts +1 -0
- package/dist/platformUtility/libraries/process.kaleyra.sms.js +11 -37
- package/dist/platformUtility/libraries/process.kaleyra.sms.js.map +1 -1
- package/dist/platformUtility/libraries/process.smtp.mail.js +1 -34
- package/dist/platformUtility/libraries/process.smtp.mail.js.map +1 -1
- package/dist/platformUtility/libraries/sentry.bootstrap.js +5 -5
- package/dist/platformUtility/libraries/sentry.bootstrap.js.map +1 -1
- package/dist/platformUtility/libraries/sentry.context.d.ts +1 -1
- package/dist/platformUtility/libraries/sentry.context.js +1 -2
- package/dist/platformUtility/libraries/sentry.context.js.map +1 -1
- package/dist/platformUtility/middlewares/trim.pipe.js +13 -12
- package/dist/platformUtility/middlewares/trim.pipe.js.map +1 -1
- package/dist/platformUtility/platform.utility.module.js +9 -5
- package/dist/platformUtility/platform.utility.module.js.map +1 -1
- package/dist/platformUtility/services/aws.client.factory.js +3 -2
- package/dist/platformUtility/services/aws.client.factory.js.map +1 -1
- package/dist/platformUtility/services/aws.config.service.js +3 -2
- package/dist/platformUtility/services/aws.config.service.js.map +1 -1
- package/dist/platformUtility/services/cache.service.js +4 -2
- package/dist/platformUtility/services/cache.service.js.map +1 -1
- package/dist/platformUtility/services/dynamo.service.js +4 -3
- package/dist/platformUtility/services/dynamo.service.js.map +1 -1
- package/dist/platformUtility/services/index.d.ts +2 -0
- package/dist/platformUtility/services/index.js +2 -0
- package/dist/platformUtility/services/index.js.map +1 -1
- package/dist/platformUtility/services/local.property.service.js +1 -4
- package/dist/platformUtility/services/local.property.service.js.map +1 -1
- package/dist/platformUtility/services/maintenance.service.js +2 -35
- package/dist/platformUtility/services/maintenance.service.js.map +1 -1
- package/dist/platformUtility/services/pdf.service.d.ts +4 -1
- package/dist/platformUtility/services/pdf.service.js +16 -2
- package/dist/platformUtility/services/pdf.service.js.map +1 -1
- package/dist/platformUtility/services/queue.service.d.ts +5 -3
- package/dist/platformUtility/services/queue.service.js +14 -3
- package/dist/platformUtility/services/queue.service.js.map +1 -1
- package/dist/platformUtility/services/redis.service.d.ts +1 -0
- package/dist/platformUtility/services/redis.service.js +10 -8
- package/dist/platformUtility/services/redis.service.js.map +1 -1
- package/dist/platformUtility/services/remote.request.service.js +1 -4
- package/dist/platformUtility/services/remote.request.service.js.map +1 -1
- package/dist/platformUtility/services/s3.service.js +1 -34
- package/dist/platformUtility/services/s3.service.js.map +1 -1
- package/dist/platformUtility/services/servicelabs.dev.service.d.ts +49 -0
- package/dist/platformUtility/services/servicelabs.dev.service.js +181 -0
- package/dist/platformUtility/services/servicelabs.dev.service.js.map +1 -0
- package/dist/platformUtility/services/servicelabs.utility.service.d.ts +51 -0
- package/dist/platformUtility/services/servicelabs.utility.service.js +193 -0
- package/dist/platformUtility/services/servicelabs.utility.service.js.map +1 -0
- package/dist/platformUtility/services/shutdown.service.js.map +1 -1
- package/dist/platformUtility/services/split.pdf.service.d.ts +3 -1
- package/dist/platformUtility/services/split.pdf.service.js +9 -2
- package/dist/platformUtility/services/split.pdf.service.js.map +1 -1
- package/dist/platformUtility/services/sql.service.d.ts +13 -0
- package/dist/platformUtility/services/sql.service.js +51 -0
- package/dist/platformUtility/services/sql.service.js.map +1 -1
- package/dist/platformUtility/services/zip.service.d.ts +7 -2
- package/dist/platformUtility/services/zip.service.js +41 -5
- package/dist/platformUtility/services/zip.service.js.map +1 -1
- package/dist/security/security.module.js +1 -4
- package/dist/security/security.module.js.map +1 -1
- package/dist/system/constants/index.d.ts +1 -0
- package/dist/system/constants/index.js +1 -0
- package/dist/system/constants/index.js.map +1 -1
- package/dist/system/constants/upload.session.constants.d.ts +21 -0
- package/dist/system/constants/upload.session.constants.js +25 -0
- package/dist/system/constants/upload.session.constants.js.map +1 -0
- package/dist/system/controllers/upload.controller.js +2 -2
- package/dist/system/controllers/upload.controller.js.map +1 -1
- package/dist/system/dtos/direct.upload.file.dto.d.ts +5 -0
- package/dist/system/dtos/direct.upload.file.dto.js +37 -0
- package/dist/system/dtos/direct.upload.file.dto.js.map +1 -0
- package/dist/system/dtos/direct.upload.initiate.dto.d.ts +4 -0
- package/dist/system/dtos/direct.upload.initiate.dto.js +27 -0
- package/dist/system/dtos/direct.upload.initiate.dto.js.map +1 -0
- package/dist/system/dtos/direct.upload.options.dto.d.ts +8 -0
- package/dist/system/dtos/direct.upload.options.dto.js +54 -0
- package/dist/system/dtos/direct.upload.options.dto.js.map +1 -0
- package/dist/system/dtos/direct.upload.parts.dto.d.ts +3 -0
- package/dist/system/dtos/direct.upload.parts.dto.js +26 -0
- package/dist/system/dtos/direct.upload.parts.dto.js.map +1 -0
- package/dist/system/dtos/index.d.ts +5 -0
- package/dist/system/dtos/index.js +5 -0
- package/dist/system/dtos/index.js.map +1 -1
- package/dist/system/dtos/local.file.s3.upload.dto.d.ts +1 -0
- package/dist/system/dtos/local.file.s3.upload.dto.js +4 -0
- package/dist/system/dtos/local.file.s3.upload.dto.js.map +1 -1
- package/dist/system/dtos/material.view.attributes.dto.d.ts +4 -0
- package/dist/system/dtos/material.view.attributes.dto.js.map +1 -1
- package/dist/system/dtos/upload.session.attributes.dto.d.ts +5 -0
- package/dist/system/dtos/upload.session.attributes.dto.js +7 -0
- package/dist/system/dtos/upload.session.attributes.dto.js.map +1 -0
- package/dist/system/entities/index.d.ts +2 -0
- package/dist/system/entities/index.js +2 -0
- package/dist/system/entities/index.js.map +1 -1
- package/dist/system/entities/material.view.entity.d.ts +1 -0
- package/dist/system/entities/material.view.entity.js +4 -0
- package/dist/system/entities/material.view.entity.js.map +1 -1
- package/dist/system/entities/source.version.entity.d.ts +9 -0
- package/dist/system/entities/source.version.entity.js +45 -0
- package/dist/system/entities/source.version.entity.js.map +1 -0
- package/dist/system/entities/upload.session.entity.d.ts +20 -0
- package/dist/system/entities/upload.session.entity.js +86 -0
- package/dist/system/entities/upload.session.entity.js.map +1 -0
- package/dist/system/es6.classes.d.ts +38 -6
- package/dist/system/es6.classes.js +26 -1
- package/dist/system/es6.classes.js.map +1 -1
- package/dist/system/interfaces/direct.upload.part.url.interface.d.ts +6 -0
- package/dist/system/interfaces/direct.upload.part.url.interface.js +3 -0
- package/dist/system/interfaces/direct.upload.part.url.interface.js.map +1 -0
- package/dist/system/interfaces/direct.upload.result.interface.d.ts +10 -0
- package/dist/system/interfaces/direct.upload.result.interface.js +3 -0
- package/dist/system/interfaces/direct.upload.result.interface.js.map +1 -0
- package/dist/system/interfaces/direct.upload.session.interface.d.ts +16 -0
- package/dist/system/interfaces/direct.upload.session.interface.js +3 -0
- package/dist/system/interfaces/direct.upload.session.interface.js.map +1 -0
- package/dist/system/interfaces/direct.upload.status.interface.d.ts +12 -0
- package/dist/system/interfaces/direct.upload.status.interface.js +3 -0
- package/dist/system/interfaces/direct.upload.status.interface.js.map +1 -0
- package/dist/system/interfaces/index.d.ts +6 -0
- package/dist/system/interfaces/index.js +6 -0
- package/dist/system/interfaces/index.js.map +1 -1
- package/dist/system/interfaces/source.version.options.interface.d.ts +7 -0
- package/dist/system/interfaces/source.version.options.interface.js +3 -0
- package/dist/system/interfaces/source.version.options.interface.js.map +1 -0
- package/dist/system/interfaces/uploaded.part.interface.d.ts +5 -0
- package/dist/system/interfaces/uploaded.part.interface.js +3 -0
- package/dist/system/interfaces/uploaded.part.interface.js.map +1 -0
- package/dist/system/jobs/execute.material.view.job.js +2 -0
- package/dist/system/jobs/execute.material.view.job.js.map +1 -1
- package/dist/system/jobs/expire.upload.session.job.d.ts +13 -0
- package/dist/system/jobs/expire.upload.session.job.js +38 -0
- package/dist/system/jobs/expire.upload.session.job.js.map +1 -0
- package/dist/system/jobs/index.d.ts +1 -0
- package/dist/system/jobs/index.js +1 -0
- package/dist/system/jobs/index.js.map +1 -1
- package/dist/system/jobs/orphan.sweeper.job.js +3 -2
- package/dist/system/jobs/orphan.sweeper.job.js.map +1 -1
- package/dist/system/jobs/set.event.queue.job.js +3 -2
- package/dist/system/jobs/set.event.queue.job.js.map +1 -1
- package/dist/system/jobs/sqs.polling.job.js.map +1 -1
- package/dist/system/jobs/sync.all.code.job.d.ts +9 -0
- package/dist/system/jobs/sync.all.code.job.js +106 -28
- package/dist/system/jobs/sync.all.code.job.js.map +1 -1
- package/dist/system/libraries/code.evaluator.d.ts +13 -0
- package/dist/system/libraries/code.evaluator.js +41 -1
- package/dist/system/libraries/code.evaluator.js.map +1 -1
- package/dist/system/libraries/common.direct.upload.controller.d.ts +19 -0
- package/dist/system/libraries/common.direct.upload.controller.js +84 -0
- package/dist/system/libraries/common.direct.upload.controller.js.map +1 -0
- package/dist/system/libraries/common.storage.service.d.ts +13 -0
- package/dist/system/libraries/common.storage.service.js +78 -1
- package/dist/system/libraries/common.storage.service.js.map +1 -1
- package/dist/system/libraries/crypt.re.encrypt.processor.js +2 -2
- package/dist/system/libraries/crypt.re.encrypt.processor.js.map +1 -1
- package/dist/system/libraries/file.type.detector.d.ts +2 -0
- package/dist/system/libraries/file.type.detector.js +88 -75
- package/dist/system/libraries/file.type.detector.js.map +1 -1
- package/dist/system/libraries/generate.downloadable.report.file.d.ts +1 -0
- package/dist/system/libraries/generate.downloadable.report.file.js +14 -36
- package/dist/system/libraries/generate.downloadable.report.file.js.map +1 -1
- package/dist/system/libraries/index.d.ts +1 -0
- package/dist/system/libraries/index.js +1 -0
- package/dist/system/libraries/index.js.map +1 -1
- package/dist/system/libraries/model.sync.js +2 -2
- package/dist/system/libraries/model.sync.js.map +1 -1
- package/dist/system/libraries/sandboxed.script.executor.js +17 -17
- package/dist/system/libraries/sandboxed.script.executor.js.map +1 -1
- package/dist/system/services/aws.s3.service.js +6 -5
- package/dist/system/services/aws.s3.service.js.map +1 -1
- package/dist/system/services/base.service.js.map +1 -1
- package/dist/system/services/direct.upload.service.d.ts +41 -0
- package/dist/system/services/direct.upload.service.js +385 -0
- package/dist/system/services/direct.upload.service.js.map +1 -0
- package/dist/system/services/document.service.js +2 -38
- package/dist/system/services/document.service.js.map +1 -1
- package/dist/system/services/event.detail.service.js.map +1 -1
- package/dist/system/services/event.queue.service.js +3 -2
- package/dist/system/services/event.queue.service.js.map +1 -1
- package/dist/system/services/index.d.ts +2 -0
- package/dist/system/services/index.js +2 -0
- package/dist/system/services/index.js.map +1 -1
- package/dist/system/services/source.version.service.d.ts +17 -0
- package/dist/system/services/source.version.service.js +86 -0
- package/dist/system/services/source.version.service.js.map +1 -0
- package/dist/system/services/storage.service.d.ts +20 -0
- package/dist/system/services/storage.service.js +62 -7
- package/dist/system/services/storage.service.js.map +1 -1
- package/dist/system/services/upload.service.d.ts +4 -1
- package/dist/system/services/upload.service.js +18 -6
- package/dist/system/services/upload.service.js.map +1 -1
- package/dist/system/subscribers/index.d.ts +1 -0
- package/dist/system/subscribers/index.js +1 -0
- package/dist/system/subscribers/index.js.map +1 -1
- package/dist/system/subscribers/system.script.subscriber.d.ts +13 -0
- package/dist/system/subscribers/system.script.subscriber.js +61 -0
- package/dist/system/subscribers/system.script.subscriber.js.map +1 -0
- package/dist/system/system.module.js +1 -4
- package/dist/system/system.module.js.map +1 -1
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +2 -1
- package/dist/worker.js.map +1 -1
- package/docs/sentry-reporting.md +26 -20
- package/docs/servicelabs-utilities.md +174 -0
- package/docs/upgrade-4.0.md +215 -0
- package/package.json +70 -74
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.service.js","sourceRoot":"","sources":["../../../src/system/services/upload.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"upload.service.js","sourceRoot":"","sources":["../../../src/system/services/upload.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2CAA4C;AAC5C,iCAA0B;AAC1B,2BAA4C;AAC5C,0EAAsE;AACtE,+FAAiF;AAGjF,qFAAiF;AAIjF,wEAAmE;AAEnE,uDAAmD;AA8B5C,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,8BAAa;IAK5C,YAA6B,cAA8B;QACvD,KAAK,EAAE,CAAC;QADiB,mBAAc,GAAd,cAAc,CAAgB;IAE3D,CAAC;IAYD,KAAK,CAAC,MAAM,CAAC,IAAuB,EAAE,UAA8B,EAAE;QAIlE,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,SAAS,IAAI,qCAAgB,CAAC,iBAAiB,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;QAElI,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CACxC;YACI,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,YAAY,EAAE,IAAI,CAAC,YAAY;SAClC,EACD,EAAE,GAAG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subscriber"), exports);
|
|
21
21
|
__exportStar(require("./recurring.query.subscriber"), exports);
|
|
22
22
|
__exportStar(require("./scheduled.event.subscriber"), exports);
|
|
23
|
+
__exportStar(require("./system.script.subscriber"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/system/subscribers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAAA,+DAA6C;AAAA,6DAA2C;AAAA,wDAAsC;AAAA,+DAA6C;AAAA,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/system/subscribers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA+C;AAAA,+DAA6C;AAAA,6DAA2C;AAAA,wDAAsC;AAAA,+DAA6C;AAAA,+DAA6C;AAAA,6DAA0C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DataSource, InsertEvent, UpdateEvent } from 'typeorm';
|
|
2
|
+
import { CommonSubscriber } from '../../common/libraries/common.subscriber';
|
|
3
|
+
import { SystemScriptEntity } from '../entities/system.script.entity';
|
|
4
|
+
import { SourceVersionService } from '../services/source.version.service';
|
|
5
|
+
export declare class SystemScriptSubscriber extends CommonSubscriber<SystemScriptEntity> {
|
|
6
|
+
private readonly dataSource;
|
|
7
|
+
private readonly sourceVersionService;
|
|
8
|
+
constructor(dataSource: DataSource, sourceVersionService: SourceVersionService);
|
|
9
|
+
listenTo(): typeof SystemScriptEntity;
|
|
10
|
+
afterInsert(event: InsertEvent<SystemScriptEntity>): Promise<import("..").SourceVersionEntity>;
|
|
11
|
+
afterUpdate(event: UpdateEvent<SystemScriptEntity>): Promise<import("..").SourceVersionEntity>;
|
|
12
|
+
private createVersion;
|
|
13
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SystemScriptSubscriber = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const common_subscriber_1 = require("../../common/libraries/common.subscriber");
|
|
15
|
+
const system_script_entity_1 = require("../entities/system.script.entity");
|
|
16
|
+
const source_version_service_1 = require("../services/source.version.service");
|
|
17
|
+
const SourceHash = require("../../config/source.hash");
|
|
18
|
+
let SystemScriptSubscriber = class SystemScriptSubscriber extends common_subscriber_1.CommonSubscriber {
|
|
19
|
+
constructor(dataSource, sourceVersionService) {
|
|
20
|
+
super();
|
|
21
|
+
this.dataSource = dataSource;
|
|
22
|
+
this.sourceVersionService = sourceVersionService;
|
|
23
|
+
dataSource.subscribers.push(this);
|
|
24
|
+
}
|
|
25
|
+
listenTo() {
|
|
26
|
+
return system_script_entity_1.SystemScriptEntity;
|
|
27
|
+
}
|
|
28
|
+
async afterInsert(event) {
|
|
29
|
+
await super.afterInsert(event);
|
|
30
|
+
return this.createVersion(event.manager, event.entity?.id);
|
|
31
|
+
}
|
|
32
|
+
async afterUpdate(event) {
|
|
33
|
+
await super.afterUpdate(event);
|
|
34
|
+
if (event.entity?.deleted_at)
|
|
35
|
+
return;
|
|
36
|
+
return this.createVersion(event.manager, event.entity?.id ?? event.databaseEntity?.id);
|
|
37
|
+
}
|
|
38
|
+
async createVersion(manager, id) {
|
|
39
|
+
if (!id)
|
|
40
|
+
return;
|
|
41
|
+
const script = await manager.findOne(system_script_entity_1.SystemScriptEntity, { where: { id } });
|
|
42
|
+
if (!script)
|
|
43
|
+
return;
|
|
44
|
+
const value = {
|
|
45
|
+
name: script.name,
|
|
46
|
+
type_id: script.type_id,
|
|
47
|
+
source_type: script.source_type,
|
|
48
|
+
source_id: script.source_id,
|
|
49
|
+
script: script.script,
|
|
50
|
+
attributes: script.attributes,
|
|
51
|
+
};
|
|
52
|
+
return this.sourceVersionService.createVersion({ source_type: SourceHash.script, source_id: script.id }, value, { manager });
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
exports.SystemScriptSubscriber = SystemScriptSubscriber;
|
|
56
|
+
exports.SystemScriptSubscriber = SystemScriptSubscriber = __decorate([
|
|
57
|
+
(0, typeorm_1.EventSubscriber)(),
|
|
58
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource,
|
|
59
|
+
source_version_service_1.SourceVersionService])
|
|
60
|
+
], SystemScriptSubscriber);
|
|
61
|
+
//# sourceMappingURL=system.script.subscriber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.script.subscriber.js","sourceRoot":"","sources":["../../../src/system/subscribers/system.script.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+F;AAC/F,gFAA4E;AAC5E,2EAAsE;AACtE,+EAA0E;AAC1E,uDAAwD;AAQjD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,oCAAoC;IAC5E,YACqB,UAAsB,EACtB,oBAA0C;QAE3D,KAAK,EAAE,CAAC;QAHS,eAAU,GAAV,UAAU,CAAY;QACtB,yBAAoB,GAApB,oBAAoB,CAAsB;QAG3D,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;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AC;IACjI,CAAC;CACJ,CAAA;AAjDY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,yBAAe,GAAE;qCAGmB,oBAAU;QACA,6CAAoB;GAHtD,sBAAsB,CAiDlC"}
|
|
@@ -5,15 +5,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
9
|
exports.SystemModule = void 0;
|
|
13
10
|
const common_1 = require("@nestjs/common");
|
|
14
11
|
const auth_module_1 = require("../auth/auth.module");
|
|
15
12
|
const platform_utility_module_1 = require("../platformUtility/platform.utility.module");
|
|
16
|
-
const es6_classes_1 =
|
|
13
|
+
const es6_classes_1 = require("./es6.classes");
|
|
17
14
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
15
|
let SystemModule = class SystemModule {
|
|
19
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.module.js","sourceRoot":"","sources":["../../src/system/system.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"system.module.js","sourceRoot":"","sources":["../../src/system/system.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,qDAAiD;AACjD,wFAAmF;AACnF,+CAAuC;AACvC,6CAAgD;AAQzC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAAG,CAAA;AAAf,oCAAY;uBAAZ,YAAY;IANxB,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,qBAAU,CAAC,QAAQ,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,+CAAqB,CAAC,CAAC;QAC/H,WAAW,EAAE,qBAAU,CAAC,WAAW;QACnC,SAAS,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,WAAW,EAAE,GAAG,qBAAU,CAAC,IAAI,CAAC;QAClF,OAAO,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,IAAI,CAAC;KACxD,CAAC;GACW,YAAY,CAAG"}
|
package/dist/worker.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import './instrument';
|
package/dist/worker.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("./instrument");
|
|
3
4
|
const core_1 = require("@nestjs/core");
|
|
4
5
|
const app_module_1 = require("./app.module");
|
|
5
6
|
const queue_service_1 = require("./platformUtility/services/queue.service");
|
|
@@ -16,7 +17,7 @@ async function bootstrap() {
|
|
|
16
17
|
async function assertRedisReachable(queueService) {
|
|
17
18
|
try {
|
|
18
19
|
const queue = queueService.getQueueInstance();
|
|
19
|
-
const client = await queue.client;
|
|
20
|
+
const client = await queue.getBackend().client;
|
|
20
21
|
const info = await Promise.race([
|
|
21
22
|
client.info(),
|
|
22
23
|
new Promise((_, reject) => setTimeout(() => reject(new Error(`timed out after ${REDIS_PING_TIMEOUT_MS}ms`)), REDIS_PING_TIMEOUT_MS)),
|
package/dist/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":";;AAEA,w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MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,yCAAyC,OAAO,EAAE,CAAC,CAAC;QACzE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC;AAED,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACxB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
package/docs/sentry-reporting.md
CHANGED
|
@@ -5,16 +5,18 @@
|
|
|
5
5
|
package's security defaults:
|
|
6
6
|
|
|
7
7
|
- `LogRedactor` on every outbound event (`beforeSend`)
|
|
8
|
-
- `includeLocalVariables: false`, `
|
|
9
|
-
|
|
8
|
+
- `includeLocalVariables: false`, and an explicit restrictive `dataCollection` (Sentry v11 replaced
|
|
9
|
+
`sendDefaultPii`; its default now collects cookies, bodies, DB query data and queue payloads — the
|
|
10
|
+
package pins the old `sendDefaultPii: false` baseline instead)
|
|
11
|
+
- Auth user (`id` + `email` only) on the request scope
|
|
10
12
|
- HTTP **5xx** reporting (4xx `HttpException` values stay out of Sentry)
|
|
11
13
|
- **No reporting from queue worker processes** (`worker.ts` entrypoint) unless opted in
|
|
12
14
|
with `SENTRY_ENABLE_WORKER=true` (see §5)
|
|
13
15
|
- Quiet one-line **ERROR** logs in local/dev (full stacks still go to Sentry)
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
`@sentry/nestjs` (v11) is a dependency of this package and pins its own `@sentry/node` /
|
|
18
|
+
`@sentry/core` — do not add separately-ranged `@sentry/*` packages to your app, or a second
|
|
19
|
+
SDK copy can end up with its own (uninitialised) client.
|
|
18
20
|
|
|
19
21
|
## 1. Environment variables
|
|
20
22
|
|
|
@@ -33,19 +35,14 @@ via `worker.ts` / `dist/worker.js` unless that process also has `SENTRY_ENABLE_W
|
|
|
33
35
|
|
|
34
36
|
## 2. Early init (`instrument.ts`)
|
|
35
37
|
|
|
36
|
-
Sentry must initialize **before**
|
|
37
|
-
|
|
38
|
+
Sentry must initialize **before** `@nestjs/*`, `express`, `pg`, `ioredis` and `bullmq` are
|
|
39
|
+
loaded — its instrumentation only applies to modules loaded after `init()`, and v11 no
|
|
40
|
+
longer warns when that order is wrong.
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
import { initSentry } from '@servicelabsco/nestjs-utility-services';
|
|
41
|
-
|
|
42
|
-
initSentry();
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Import it as the **first line** of `main.ts`:
|
|
42
|
+
Import the package's side-effect-only instrument file as the **first line** of `main.ts`:
|
|
46
43
|
|
|
47
44
|
```typescript
|
|
48
|
-
import '
|
|
45
|
+
import '@servicelabsco/nestjs-utility-services/dist/instrument';
|
|
49
46
|
|
|
50
47
|
import { NestFactory } from '@nestjs/core';
|
|
51
48
|
import { AppModule } from './app.module';
|
|
@@ -57,7 +54,15 @@ async function bootstrap() {
|
|
|
57
54
|
bootstrap();
|
|
58
55
|
```
|
|
59
56
|
|
|
60
|
-
|
|
57
|
+
Do **not** use `import { initSentry } from '@servicelabsco/nestjs-utility-services'` for
|
|
58
|
+
this: the package barrel loads every module (and with them Nest, TypeORM/pg, ioredis,
|
|
59
|
+
BullMQ) *before* `initSentry()` runs, so none of those get instrumented. `dist/instrument`
|
|
60
|
+
loads only `dotenv` and the Sentry SDK.
|
|
61
|
+
|
|
62
|
+
Alternatively preload it: `node --import @servicelabsco/nestjs-utility-services/dist/instrument.js dist/main.js`.
|
|
63
|
+
Never use `--require` — Sentry v11 does not support it.
|
|
64
|
+
|
|
65
|
+
Add the same import as the first line of `worker.ts` too. `initSentry()` is a
|
|
61
66
|
no-op on the worker entrypoint unless `SENTRY_ENABLE_WORKER=true`, so importing it
|
|
62
67
|
is safe either way and lets each deployment decide through env alone.
|
|
63
68
|
|
|
@@ -94,7 +99,7 @@ runs without Sentry.
|
|
|
94
99
|
|
|
95
100
|
1. `SentryModule.forRoot()` — official Nest SDK integration + HTTP transaction naming
|
|
96
101
|
2. `SentryReportingFilter` — global exception filter (must stay ahead of custom filters)
|
|
97
|
-
3. `SentryUserScopeInterceptor` — per-request user
|
|
102
|
+
3. `SentryUserScopeInterceptor` — per-request auth user on the Sentry scope
|
|
98
103
|
|
|
99
104
|
If you define your own global `APP_FILTER`, register `SentryReportingModule` **before**
|
|
100
105
|
any custom exception filters, or compose filters explicitly so Sentry still runs first.
|
|
@@ -102,7 +107,7 @@ any custom exception filters, or compose filters explicitly so Sentry still runs
|
|
|
102
107
|
## 4. Manual `captureException`
|
|
103
108
|
|
|
104
109
|
Prefer the package's lazy `SentrySdk` over importing `@sentry/*` directly. A top-level
|
|
105
|
-
`import * as Sentry from '@sentry/
|
|
110
|
+
`import * as Sentry from '@sentry/nestjs'` loads the SDK (~14 MB heap, ~1,300 modules) into every
|
|
106
111
|
process, including those where Sentry is off; `SentrySdk` only loads it when Sentry is enabled
|
|
107
112
|
for the process and is a no-op otherwise. Events pass through the same `beforeSend` redaction
|
|
108
113
|
configured in `initSentry()`.
|
|
@@ -114,7 +119,8 @@ SentrySdk.captureException(error, { tags: { service: 'MyService' } });
|
|
|
114
119
|
```
|
|
115
120
|
|
|
116
121
|
On HTTP requests, `SentryUserScopeInterceptor` already attaches the authenticated user
|
|
117
|
-
(from `Auth.user()`)
|
|
122
|
+
(from `Auth.user()`) to the isolation scope; request data comes from the SDK itself,
|
|
123
|
+
filtered by `dataCollection` and then `beforeSend` redaction.
|
|
118
124
|
|
|
119
125
|
## 5. Workers
|
|
120
126
|
|
|
@@ -152,5 +158,5 @@ for your CI/CD pipeline.
|
|
|
152
158
|
The standalone dev app in this repository follows the same pattern:
|
|
153
159
|
|
|
154
160
|
- `src/instrument.ts` → `initSentry()`
|
|
155
|
-
- `src/main.ts` → `import './instrument'` first
|
|
161
|
+
- `src/main.ts` and `src/worker.ts` → `import './instrument'` first
|
|
156
162
|
- `src/app.module.ts` → `SentryReportingModule.forRoot()`
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# ServiceLabs utilities
|
|
2
|
+
|
|
3
|
+
`ServicelabsUtilityService` calls the [ServiceLabs utilities API](https://servicelabs.dev/docs/):
|
|
4
|
+
HTML → PDF, split PDF, zip, unzip and XLS → XLSX behind one API key. Every utility can run **sync**
|
|
5
|
+
(wait for the result) or **async** (get a job id back, then a signed callback or a poll).
|
|
6
|
+
|
|
7
|
+
ServiceLabs keeps its output files for 30 days only, so nu copies them into the app's default
|
|
8
|
+
storage engine (`STORAGE_ENGINE`: S3 or R2) and hands back links to that copy.
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
| Property | Value |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| `servicelabs.api.key` | The service's API key (`du_live_…`), from the ServiceLabs console. One key per service. |
|
|
15
|
+
| `servicelabs.webhook.secret` | The key's callback signing secret (`whsec_…`). Needed only for async callbacks. |
|
|
16
|
+
| `servicelabs.api.url` | Optional. Defaults to `https://api.servicelabs.dev`. |
|
|
17
|
+
|
|
18
|
+
`PdfService.convert`, `SplitPdfService.split` and `ZipService.zip` / `unzip` switch to ServiceLabs as
|
|
19
|
+
soon as `servicelabs.api.key` is set. Their return shapes do not change; without the key they keep
|
|
20
|
+
calling the Lambda URLs. Set the key in one environment, check the output, then move the next one.
|
|
21
|
+
|
|
22
|
+
## Sync
|
|
23
|
+
|
|
24
|
+
The helpers run the utility, wait for it, copy the output into storage and return the stored files.
|
|
25
|
+
Use them where the caller can wait: a typical PDF takes a few seconds, but the call can take minutes
|
|
26
|
+
on a large input (nu long-polls past ServiceLabs' 90 s sync budget).
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
constructor(private readonly servicelabs: ServicelabsUtilityService) {}
|
|
30
|
+
|
|
31
|
+
const pdf = await this.servicelabs.htmlToPdf('https://…/invoice.html', { format: 'A4' });
|
|
32
|
+
// pdf: { url, bucket, key, size, contentType, name } — key: servicelabs/html-pdf/<date>/<job id>/<file>
|
|
33
|
+
|
|
34
|
+
const pages = await this.servicelabs.splitPdf('s3://finnoto-data/uploads/statement.pdf'); // [{ …, pageNumber }]
|
|
35
|
+
const zip = await this.servicelabs.zipFiles([{ url: 'https://…/a.pdf', fileName: 'invoices/a.pdf' }]);
|
|
36
|
+
const files = await this.servicelabs.unzipFiles('https://…/bundle.zip'); // [{ …, path }]
|
|
37
|
+
const xlsx = await this.servicelabs.xlsToXlsx('https://…/report.xls');
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Every helper takes run options (`metadata`, `idempotencyKey`, `waitTimeoutMs`, `source` for a
|
|
41
|
+
`RemoteRequestLogEntity` row) and store options (`folder`, default `servicelabs`; `visibility`, default
|
|
42
|
+
`public`; `engine`). A utility that fails throws `OperationException` with ServiceLabs' error code and
|
|
43
|
+
message, e.g. `upstream_rejected: Password-protected PDFs are not supported`.
|
|
44
|
+
|
|
45
|
+
## Async
|
|
46
|
+
|
|
47
|
+
For batches, large inputs and anything a user is not waiting on. `create…Job` answers at once with the
|
|
48
|
+
queued job:
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
const job = await this.servicelabs.createSplitPdfJob(url, {
|
|
52
|
+
callbackUrl: 'https://api.example.com/webhooks/servicelabs',
|
|
53
|
+
metadata: { statementId: statement.id },
|
|
54
|
+
idempotencyKey: `statement-${statement.id}`,
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`createHtmlPdfJob`, `createSplitPdfJob`, `createZipFilesJob`, `createUnzipFilesJob`,
|
|
59
|
+
`createXlsToXlsxJob`, or `createJob(slug, input, options)` for any utility.
|
|
60
|
+
|
|
61
|
+
### Receiving the callback
|
|
62
|
+
|
|
63
|
+
Mount `CommonServicelabsCallbackController` on your own route. It verifies the Standard Webhooks
|
|
64
|
+
signature, answers `204` and calls `onJobFinished`:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
@Controller('webhooks/servicelabs')
|
|
68
|
+
export class ServicelabsCallbackController extends CommonServicelabsCallbackController {
|
|
69
|
+
constructor(
|
|
70
|
+
servicelabsUtilityService: ServicelabsUtilityService,
|
|
71
|
+
private readonly statementSplitJob: StatementSplitJob
|
|
72
|
+
) {
|
|
73
|
+
super(servicelabsUtilityService);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
protected async onJobFinished(event: ServicelabsCallbackEventInterface): Promise<void> {
|
|
77
|
+
await this.statementSplitJob.dispatch(event.data);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
// in the job: copy the output, then use event.data.metadata to find your record
|
|
84
|
+
const pages = await this.servicelabsUtilityService.storeFiles(job);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
- **Raw body.** The signature covers the exact bytes received. Create the app with
|
|
88
|
+
`NestFactory.create(AppModule, { rawBody: true })`, or every callback is refused.
|
|
89
|
+
- **Route.** The signature is the authentication. Mount the controller outside `api/…`, where
|
|
90
|
+
`RestrictedMiddleware` would demand a logged-in user. `callbackUrl` must be public `https://`.
|
|
91
|
+
- **Answer fast.** ServiceLabs waits 10 s for a 2xx and retries anything else (8 attempts over about
|
|
92
|
+
21 minutes). Copying files can take longer, so dispatch a job from `onJobFinished`.
|
|
93
|
+
- **Duplicates.** The same callback can arrive twice. De-duplicate on `event.data.id`.
|
|
94
|
+
- **Several API keys.** Override `signingSecret()` to choose the secret per request.
|
|
95
|
+
|
|
96
|
+
Apps with their own webhook route can call `servicelabsUtilityService.verifyCallback(rawBody, headers)`
|
|
97
|
+
directly.
|
|
98
|
+
|
|
99
|
+
### Polling instead
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
const finished = await this.servicelabs.waitForJob(job.id); // long-polls ?wait=60 until final
|
|
103
|
+
const files = await this.servicelabs.storeFiles(finished); // throws unless it succeeded
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`getJob(id, waitSeconds)`, `listJobs({ utility, status, limit, cursor })` and `cancelJob(id)` (queued
|
|
107
|
+
jobs only) cover the rest. Callbacks are a notification, not the source of truth: a periodic
|
|
108
|
+
`listJobs({ status: 'succeeded' })` reconcile catches anything missed while the receiver was down.
|
|
109
|
+
|
|
110
|
+
## The bare API: `ServicelabsDevService`
|
|
111
|
+
|
|
112
|
+
`ServicelabsUtilityService` is built on `ServicelabsDevService`, which apps can inject directly to
|
|
113
|
+
use the API as it is: one method per [operation](https://servicelabs.dev/docs/reference/operations/),
|
|
114
|
+
the API's own request body, and its raw answer.
|
|
115
|
+
|
|
116
|
+
| Method | Operation |
|
|
117
|
+
| --- | --- |
|
|
118
|
+
| `runHtmlPdf`, `runSplitPdf`, `runZipFiles`, `runUnzipFiles`, `runXlsToXlsx`, `runUtility(slug, …)` | `POST /v1/utilities/{slug}` (sync) |
|
|
119
|
+
| `createHtmlPdfJob`, `createSplitPdfJob`, `createZipFilesJob`, `createUnzipFilesJob`, `createXlsToXlsxJob`, `createUtilityJob(slug, …)` | `POST /v1/utilities/{slug}/jobs` (async) |
|
|
120
|
+
| `getJob(id, { wait })`, `listJobs(query)`, `cancelJob(id)` | `GET /v1/jobs/{id}`, `GET /v1/jobs`, `POST /v1/jobs/{id}/cancel` |
|
|
121
|
+
| `listUtilities()`, `getUtility(slug)`, `getOpenApi()` | catalog and `GET /v1/openapi.json` |
|
|
122
|
+
| `verifyCallback(rawBody, headers, secret?)` | Standard Webhooks signature check |
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
const response = await this.servicelabsDevService.runSplitPdf(
|
|
126
|
+
{ input: { url }, metadata: { statementId: 7 } },
|
|
127
|
+
{ idempotencyKey: 'statement-7', requestId: 'req-123' }
|
|
128
|
+
);
|
|
129
|
+
// response: { success, status, data, headers }
|
|
130
|
+
if (response.status === 202) {
|
|
131
|
+
// still running after 90 s: poll response.data.id (response.headers.location)
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Every call returns `{ success, status, data, headers }` and does not throw for API answers. A refused
|
|
136
|
+
request comes back with its `{ error: { code, message, details } }` body and status (`429` with
|
|
137
|
+
`retry-after` in `headers`), a failed sync run with the failed job, and a run past 90 s as `202`.
|
|
138
|
+
Results stay on ServiceLabs' storage (30 days); copy them with `ServicelabsUtilityService.storeFiles`
|
|
139
|
+
if you need them longer. Call options: `idempotencyKey`, `respondAsync` (`Prefer: respond-async`),
|
|
140
|
+
`requestId` (`X-Request-Id`), `timeout`, and `source` for a `RemoteRequestLogEntity` row. The only
|
|
141
|
+
throws are a missing API key and an empty id or slug.
|
|
142
|
+
|
|
143
|
+
## From stored scripts and code evaluation
|
|
144
|
+
|
|
145
|
+
Both services are exposed to the script runtime under their registry hashes
|
|
146
|
+
(`md5('platformUtility:<ClassName>')`), so eval and code-eval scripts reach them with `fn.getService`:
|
|
147
|
+
|
|
148
|
+
| Service | Hash |
|
|
149
|
+
| --- | --- |
|
|
150
|
+
| `ServicelabsUtilityService` | `f7943f26e51e694f1338906b2770bd45` |
|
|
151
|
+
| `ServicelabsDevService` | `f04986ac567c8b0c4c5f8af2161be73d` |
|
|
152
|
+
|
|
153
|
+
```js
|
|
154
|
+
const servicelabs = fn.getService('f7943f26e51e694f1338906b2770bd45');
|
|
155
|
+
const pdf = await servicelabs.htmlToPdf(htmlUrl, { format: 'A4' });
|
|
156
|
+
|
|
157
|
+
const dev = fn.getService('f04986ac567c8b0c4c5f8af2161be73d');
|
|
158
|
+
const response = await dev.getJob(jobId, { wait: 30 });
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
To look a service up by a readable identifier instead (`getServiceInstance('servicelabs')`), add a
|
|
162
|
+
`sys_service_details` row mapping that identifier to the hash, as for any other service.
|
|
163
|
+
|
|
164
|
+
## Limits
|
|
165
|
+
|
|
166
|
+
| | |
|
|
167
|
+
| --- | --- |
|
|
168
|
+
| Sync budget | 90 s, then the job keeps running and nu long-polls it |
|
|
169
|
+
| Utility time limit | 900 s (300 s for XLS → XLSX) |
|
|
170
|
+
| Inputs | `http(s)://` everywhere; `s3://` (the `finnoto-data` bucket) for html-pdf, split-pdf, unzip-files |
|
|
171
|
+
| Split PDF | ≤ 150 MB, ≤ 500 pages, no password-protected files |
|
|
172
|
+
| Zip | 1–500 files, unique relative `fileName`s |
|
|
173
|
+
| Rate limit | 600 requests / minute / key by default; polling counts |
|
|
174
|
+
| ServiceLabs retention | Output files 30 days, job records 90 days |
|