@miguelmorales13/nestkit 0.26.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/dist/alerts/alert-on-failure.decorator.d.ts +5 -0
- package/dist/alerts/alert-sinks.d.ts +29 -0
- package/dist/alerts/alerts.module.d.ts +19 -0
- package/dist/alerts/alerts.options.d.ts +1 -0
- package/dist/alerts/alerts.service.d.ts +28 -0
- package/dist/alerts/alerts.types.d.ts +66 -0
- package/dist/alerts/index.cjs +276 -0
- package/dist/alerts/index.d.ts +10 -0
- package/dist/alerts/index.js +276 -0
- package/dist/alerts/logger-with-alerts.d.ts +18 -0
- package/dist/alerts/process-guards.d.ts +21 -0
- package/dist/alerts/runtime.d.ts +4 -0
- package/dist/audit/index.cjs +13 -13
- package/dist/audit/index.js +2 -2
- package/dist/auth/index.cjs +21 -21
- package/dist/auth/index.js +3 -3
- package/dist/auth/oauth/index.cjs +101 -101
- package/dist/auth/oauth/index.js +3 -3
- package/dist/bootstrap/apply-defaults.d.ts +9 -0
- package/dist/bootstrap/index.cjs +7 -6
- package/dist/bootstrap/index.js +6 -5
- package/dist/chunk-33KFVAUZ.cjs +151 -0
- package/dist/chunk-3TUMVLPJ.js +14 -0
- package/dist/{chunk-PA24P76K.js → chunk-45SW7FBE.js} +1 -1
- package/dist/{chunk-RF75KC63.cjs → chunk-47IYXZHW.cjs} +2 -2
- package/dist/{chunk-TUNDBBQF.js → chunk-4WWOKZIO.js} +4 -4
- package/dist/{chunk-2DUEQKOI.js → chunk-5LVGCTJ3.js} +4 -4
- package/dist/chunk-A6YGIZCQ.cjs +14 -0
- package/dist/chunk-A7FI6HXV.js +40 -0
- package/dist/chunk-CU4FUIVJ.cjs +8 -0
- package/dist/{chunk-FH5UNWWW.cjs → chunk-D35TBVRO.cjs} +4 -4
- package/dist/{chunk-4MGIQFAJ.js → chunk-D3DDJWUD.js} +5 -0
- package/dist/chunk-DVGPEBUL.js +8 -0
- package/dist/{chunk-VKOPDDCC.js → chunk-ENZ7LQRE.js} +1 -1
- package/dist/{chunk-3AUOOEQO.cjs → chunk-F77X4QUN.cjs} +2 -2
- package/dist/chunk-FBNV5X6C.js +61 -0
- package/dist/{chunk-APUFKA4K.cjs → chunk-FDZQCLLK.cjs} +6 -6
- package/dist/{chunk-DYHSOULW.js → chunk-IGSNB5BX.js} +1 -1
- package/dist/chunk-IVWPA6QH.cjs +90 -0
- package/dist/{chunk-LSDY6ETG.cjs → chunk-JJKGQNGD.cjs} +5 -5
- package/dist/{chunk-ALIKVFOV.cjs → chunk-JRFE7NSO.cjs} +12 -4
- package/dist/{chunk-HVHYZXBB.cjs → chunk-KNU5RN3O.cjs} +3 -3
- package/dist/{chunk-52IOOHNX.cjs → chunk-KQPJCVN3.cjs} +26 -26
- package/dist/chunk-LGFHLAY3.cjs +61 -0
- package/dist/{chunk-2REOCMUD.cjs → chunk-LRX7AMSS.cjs} +6 -1
- package/dist/chunk-LU3HO7B3.js +151 -0
- package/dist/{chunk-4PFAKLT3.js → chunk-MUWHGBIB.js} +1 -1
- package/dist/{chunk-ZJMLEP5H.js → chunk-NJYLQDB3.js} +1 -1
- package/dist/{chunk-IFNYRZP2.js → chunk-OSRH6KYZ.js} +4 -4
- package/dist/{chunk-6RAPVLJM.js → chunk-OTE77ONL.js} +1 -1
- package/dist/chunk-UDACUMLO.cjs +40 -0
- package/dist/{chunk-PFHHLB7B.js → chunk-UGAAJRPO.js} +10 -2
- package/dist/{chunk-SPTDXUED.cjs → chunk-URLDTS2Q.cjs} +2 -2
- package/dist/{chunk-W2T2VFLC.cjs → chunk-VALDHJOO.cjs} +5 -5
- package/dist/chunk-WFCQDOSN.js +90 -0
- package/dist/consent/consent.interceptor.d.ts +20 -0
- package/dist/consent/consent.module.d.ts +25 -0
- package/dist/consent/consent.options.d.ts +30 -0
- package/dist/consent/consent.port.d.ts +17 -0
- package/dist/consent/consent.service.d.ts +44 -0
- package/dist/consent/guard/index.cjs +13 -0
- package/dist/consent/guard/index.d.ts +31 -0
- package/dist/consent/guard/index.js +13 -0
- package/dist/consent/index.cjs +271 -0
- package/dist/consent/index.d.ts +13 -0
- package/dist/consent/index.js +271 -0
- package/dist/consent/memory.store.d.ts +7 -0
- package/dist/consent/shared/index.cjs +11 -0
- package/dist/consent/shared/index.d.ts +19 -0
- package/dist/consent/shared/index.js +11 -0
- package/dist/consent/typeorm.store.d.ts +22 -0
- package/dist/crud/index.cjs +4 -4
- package/dist/crud/index.js +3 -3
- package/dist/database/postgres/index.cjs +3 -3
- package/dist/database/postgres/index.js +2 -2
- package/dist/database/supabase/index.cjs +3 -3
- package/dist/database/supabase/index.js +2 -2
- package/dist/database/typeorm/index.cjs +2 -2
- package/dist/database/typeorm/index.js +1 -1
- package/dist/devices/device-check.interceptor.d.ts +20 -0
- package/dist/devices/devices.module.d.ts +28 -0
- package/dist/devices/devices.options.d.ts +53 -0
- package/dist/devices/devices.port.d.ts +62 -0
- package/dist/devices/devices.service.d.ts +58 -0
- package/dist/devices/index.cjs +327 -0
- package/dist/devices/index.d.ts +8 -0
- package/dist/devices/index.js +327 -0
- package/dist/devices/memory.store.d.ts +12 -0
- package/dist/email/index.cjs +2 -2
- package/dist/email/index.js +1 -1
- package/dist/email/nodemailer/index.cjs +2 -2
- package/dist/email/nodemailer/index.js +1 -1
- package/dist/email/resend/index.cjs +2 -2
- package/dist/email/resend/index.js +1 -1
- package/dist/entities/index.cjs +1 -1
- package/dist/entities/index.js +1 -1
- package/dist/errors/index.cjs +7 -7
- package/dist/errors/index.js +7 -7
- package/dist/events/buses.d.ts +27 -0
- package/dist/events/events.controller.d.ts +15 -0
- package/dist/events/events.module.d.ts +29 -0
- package/dist/events/events.options.d.ts +50 -0
- package/dist/events/events.service.d.ts +49 -0
- package/dist/events/events.types.d.ts +77 -0
- package/dist/events/index.cjs +557 -0
- package/dist/events/index.d.ts +10 -0
- package/dist/events/index.js +557 -0
- package/dist/events/memory-ticket.store.d.ts +9 -0
- package/dist/google-business/google-business-http.d.ts +41 -0
- package/dist/google-business/google-business.errors.d.ts +75 -0
- package/dist/google-business/google-business.mappers.d.ts +52 -0
- package/dist/google-business/google-business.module.d.ts +26 -0
- package/dist/google-business/google-business.options.d.ts +40 -0
- package/dist/google-business/google-business.ports.d.ts +18 -0
- package/dist/google-business/google-business.service.d.ts +120 -0
- package/dist/google-business/google-business.types.d.ts +155 -0
- package/dist/google-business/index.cjs +1025 -0
- package/dist/google-business/index.d.ts +15 -0
- package/dist/google-business/index.js +1025 -0
- package/dist/google-business/testing/google-simulator.d.ts +61 -0
- package/dist/hardening/body-limits.d.ts +24 -0
- package/dist/hardening/http.types.d.ts +26 -0
- package/dist/hardening/index.cjs +179 -0
- package/dist/hardening/index.d.ts +19 -0
- package/dist/hardening/index.js +179 -0
- package/dist/hardening/memory-rate-limit.store.d.ts +10 -0
- package/dist/hardening/origin-secret.d.ts +29 -0
- package/dist/hardening/rate-limit.decorator.d.ts +8 -0
- package/dist/hardening/rate-limit.guard.d.ts +18 -0
- package/dist/hardening/rate-limit.module.d.ts +23 -0
- package/dist/hardening/rate-limit.options.d.ts +35 -0
- package/dist/hardening/rate-limit.port.d.ts +11 -0
- package/dist/hardening/redis-rate-limit.store.d.ts +23 -0
- package/dist/hardening/trust-proxy.d.ts +22 -0
- package/dist/health/health.controller.d.ts +32 -0
- package/dist/health/health.module.d.ts +15 -0
- package/dist/health/health.options.d.ts +24 -0
- package/dist/health/index.cjs +103 -0
- package/dist/health/index.d.ts +5 -0
- package/dist/health/index.js +103 -0
- package/dist/i18n/index.cjs +3 -3
- package/dist/i18n/index.js +2 -2
- package/dist/idempotency/idempotency.interceptor.d.ts +1 -0
- package/dist/idempotency/idempotency.options.d.ts +15 -0
- package/dist/idempotency/index.cjs +214 -7
- package/dist/idempotency/index.d.ts +5 -0
- package/dist/idempotency/index.js +210 -3
- package/dist/idempotency/no-idempotency.decorator.d.ts +8 -0
- package/dist/idempotency/postgres.store.d.ts +49 -0
- package/dist/idempotency/redis.store.d.ts +59 -0
- package/dist/index.cjs +21 -20
- package/dist/index.js +33 -32
- package/dist/invoicing/index.cjs +2 -2
- package/dist/invoicing/index.js +1 -1
- package/dist/jobs/defer-job.d.ts +10 -0
- package/dist/jobs/index.cjs +318 -0
- package/dist/jobs/index.d.ts +8 -0
- package/dist/jobs/index.js +318 -0
- package/dist/jobs/jobs-admin.controller.d.ts +18 -0
- package/dist/jobs/jobs.module.d.ts +33 -0
- package/dist/jobs/jobs.options.d.ts +62 -0
- package/dist/jobs/jobs.service.d.ts +53 -0
- package/dist/jobs/jobs.sql.d.ts +11 -0
- package/dist/media/index.cjs +14 -14
- package/dist/media/index.js +1 -1
- package/dist/meta/index.cjs +3 -3
- package/dist/meta/index.js +1 -1
- package/dist/notifications/index.cjs +375 -0
- package/dist/notifications/index.d.ts +8 -0
- package/dist/notifications/index.js +375 -0
- package/dist/notifications/memory.stores.d.ts +23 -0
- package/dist/notifications/notifications.controller.d.ts +11 -0
- package/dist/notifications/notifications.module.d.ts +31 -0
- package/dist/notifications/notifications.options.d.ts +33 -0
- package/dist/notifications/notifications.port.d.ts +97 -0
- package/dist/notifications/notifier.service.d.ts +31 -0
- package/dist/payments/connect/credentials-cipher.d.ts +14 -0
- package/dist/payments/connect/mercadopago-refund.d.ts +118 -0
- package/dist/payments/connect/mercadopago-signature.d.ts +6 -0
- package/dist/payments/connect/online-checkout.d.ts +69 -0
- package/dist/payments/connect/rejection.d.ts +7 -0
- package/dist/payments/connect/status.d.ts +20 -0
- package/dist/payments/connect/terminal-connections.d.ts +291 -0
- package/dist/payments/index.cjs +908 -10
- package/dist/payments/index.d.ts +10 -0
- package/dist/payments/index.js +900 -2
- package/dist/pinterest/index.cjs +3 -3
- package/dist/pinterest/index.js +1 -1
- package/dist/privacy/anonymizer.d.ts +14 -0
- package/dist/privacy/index.cjs +768 -0
- package/dist/privacy/index.d.ts +13 -0
- package/dist/privacy/index.js +768 -0
- package/dist/privacy/memory.store.d.ts +15 -0
- package/dist/privacy/privacy.module.d.ts +30 -0
- package/dist/privacy/privacy.options.d.ts +43 -0
- package/dist/privacy/privacy.port.d.ts +25 -0
- package/dist/privacy/privacy.service.d.ts +69 -0
- package/dist/privacy/privacy.types.d.ts +125 -0
- package/dist/privacy/sql.d.ts +7 -0
- package/dist/privacy/sql.store.d.ts +21 -0
- package/dist/privacy/zip.d.ts +23 -0
- package/dist/push/index.cjs +13 -13
- package/dist/push/index.js +5 -5
- package/dist/resilience/alert-channels.d.ts +39 -0
- package/dist/resilience/alert-errors.interceptor.d.ts +10 -0
- package/dist/resilience/alert-on-failure.decorator.d.ts +10 -0
- package/dist/resilience/alert.service.d.ts +77 -0
- package/dist/resilience/index.cjs +863 -0
- package/dist/resilience/index.d.ts +18 -0
- package/dist/resilience/index.js +863 -0
- package/dist/resilience/memory-alert-store.d.ts +26 -0
- package/dist/resilience/provider-health.controller.d.ts +14 -0
- package/dist/resilience/provider-unavailable.exception.d.ts +11 -0
- package/dist/resilience/resilience.module.d.ts +34 -0
- package/dist/resilience/resilience.options.d.ts +28 -0
- package/dist/resilience/resilience.types.d.ts +167 -0
- package/dist/resilience/resilient-fetch.d.ts +38 -0
- package/dist/resilience/runtime.d.ts +24 -0
- package/dist/resilience/typeorm/alert.entity.d.ts +21 -0
- package/dist/resilience/typeorm/index.cjs +102 -0
- package/dist/resilience/typeorm/index.d.ts +3 -0
- package/dist/resilience/typeorm/index.js +102 -0
- package/dist/resilience/typeorm/typeorm-alert-store.d.ts +39 -0
- package/dist/resilience/validate-destination.d.ts +63 -0
- package/dist/response/index.cjs +3 -3
- package/dist/response/index.js +2 -2
- package/dist/scheduling/cron-lock.service.d.ts +36 -0
- package/dist/scheduling/cron-unico.decorator.d.ts +27 -0
- package/dist/scheduling/fallback.store.d.ts +34 -0
- package/dist/scheduling/index.cjs +392 -0
- package/dist/scheduling/index.d.ts +18 -0
- package/dist/scheduling/index.js +392 -0
- package/dist/scheduling/lock-store.port.d.ts +19 -0
- package/dist/scheduling/memory.store.d.ts +15 -0
- package/dist/scheduling/redis.module.d.ts +31 -0
- package/dist/scheduling/redis.store.d.ts +24 -0
- package/dist/scheduling/scheduling.module.d.ts +24 -0
- package/dist/scheduling/scheduling.options.d.ts +27 -0
- package/dist/scheduling/sql.store.d.ts +26 -0
- package/dist/secrets/index.cjs +274 -0
- package/dist/secrets/index.d.ts +8 -0
- package/dist/secrets/index.js +274 -0
- package/dist/secrets/secrets.errors.d.ts +6 -0
- package/dist/secrets/secrets.module.d.ts +21 -0
- package/dist/secrets/secrets.options.d.ts +32 -0
- package/dist/secrets/secrets.service.d.ts +54 -0
- package/dist/secrets/secrets.transformer.d.ts +33 -0
- package/dist/security/hash.d.ts +8 -0
- package/dist/security/index.cjs +27 -35
- package/dist/security/index.d.ts +5 -0
- package/dist/security/index.js +24 -32
- package/dist/security/mask.d.ts +22 -0
- package/dist/security/signed-grant.d.ts +30 -0
- package/dist/storage/index.cjs +2 -2
- package/dist/storage/index.js +1 -1
- package/dist/stripe/index.cjs +7 -7
- package/dist/stripe/index.js +1 -1
- package/dist/telegram/index.cjs +2 -2
- package/dist/telegram/index.js +1 -1
- package/dist/tenancy/app-role.d.ts +24 -0
- package/dist/tenancy/db-helpers.d.ts +12 -0
- package/dist/tenancy/index.cjs +205 -0
- package/dist/tenancy/index.d.ts +14 -0
- package/dist/tenancy/index.js +205 -0
- package/dist/tenancy/pg/index.cjs +34 -0
- package/dist/tenancy/pg/index.d.ts +2 -0
- package/dist/tenancy/pg/index.js +34 -0
- package/dist/tenancy/pg/with-tenant.d.ts +23 -0
- package/dist/tenancy/request-context.d.ts +18 -0
- package/dist/tenancy/rls-guardrail.d.ts +38 -0
- package/dist/tenancy/scope.d.ts +5 -0
- package/dist/tenancy/tenancy.errors.d.ts +5 -0
- package/dist/tenancy/tenancy.middleware.d.ts +8 -0
- package/dist/tenancy/tenancy.module.d.ts +37 -0
- package/dist/tenancy/tenancy.options.d.ts +34 -0
- package/dist/tenancy/typeorm/index.cjs +41 -0
- package/dist/tenancy/typeorm/index.d.ts +2 -0
- package/dist/tenancy/typeorm/index.js +41 -0
- package/dist/tenancy/typeorm/with-tenant.d.ts +23 -0
- package/dist/tiktok/index.cjs +3 -3
- package/dist/tiktok/index.js +1 -1
- package/dist/tracking/index.cjs +3 -3
- package/dist/tracking/index.js +2 -2
- package/dist/umami/index.cjs +4 -4
- package/dist/umami/index.js +1 -1
- package/dist/whatsapp/index.cjs +2 -2
- package/dist/whatsapp/index.js +1 -1
- package/package.json +108 -3
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkD35TBVROcjs = require('../../chunk-D35TBVRO.cjs');
|
|
5
|
+
require('../../chunk-SDWHKPXI.cjs');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
var _chunkHDFPSA2Vcjs = require('../../chunk-HDFPSA2V.cjs');
|
|
10
11
|
require('../../chunk-Q5Y33L7B.cjs');
|
|
11
|
-
require('../../chunk-SDWHKPXI.cjs');
|
|
12
12
|
require('../../chunk-PNK5WMPP.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkLRX7AMSScjs = require('../../chunk-LRX7AMSS.cjs');
|
|
17
17
|
|
|
18
18
|
// src/auth/oauth/oauth-provider.ts
|
|
19
19
|
async function readJson(response, what) {
|
|
@@ -1223,21 +1223,21 @@ var OAuthAuthService = class {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
}
|
|
1225
1225
|
};
|
|
1226
|
-
OAuthAuthService = exports.OAuthAuthService =
|
|
1226
|
+
OAuthAuthService = exports.OAuthAuthService = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1227
1227
|
_common.Injectable.call(void 0, ),
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1228
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Inject.call(void 0, OAUTH_AUTH_OPTIONS)),
|
|
1229
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Inject.call(void 0, OAUTH_STORE)),
|
|
1230
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 2, _common.Inject.call(void 0, REFRESH_TOKEN_STORE)),
|
|
1231
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 3, _common.Optional.call(void 0, )),
|
|
1232
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 3, _common.Inject.call(void 0, MAGIC_LINK_STORE)),
|
|
1233
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 4, _common.Optional.call(void 0, )),
|
|
1234
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 4, _common.Inject.call(void 0, MAGIC_LINK_SENDER)),
|
|
1235
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 5, _common.Optional.call(void 0, )),
|
|
1236
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 5, _common.Inject.call(void 0, TWO_FACTOR_STORE)),
|
|
1237
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 6, _common.Optional.call(void 0, )),
|
|
1238
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 6, _common.Inject.call(void 0, PASSKEY_STORE)),
|
|
1239
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 7, _common.Optional.call(void 0, )),
|
|
1240
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 7, _common.Inject.call(void 0, WEBAUTHN))
|
|
1241
1241
|
], OAuthAuthService);
|
|
1242
1242
|
function normaliseEmail(email) {
|
|
1243
1243
|
return email.trim().toLowerCase();
|
|
@@ -1340,57 +1340,57 @@ var MemoryPasskeyStore = class {
|
|
|
1340
1340
|
var _classvalidator = require('class-validator');
|
|
1341
1341
|
var MagicLinkRequestDto = class {
|
|
1342
1342
|
};
|
|
1343
|
-
|
|
1343
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1344
1344
|
_classvalidator.IsEmail.call(void 0, )
|
|
1345
1345
|
], MagicLinkRequestDto.prototype, "email", 2);
|
|
1346
1346
|
var MagicLinkVerifyDto = class {
|
|
1347
1347
|
};
|
|
1348
|
-
|
|
1348
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1349
1349
|
_classvalidator.IsString.call(void 0, ),
|
|
1350
1350
|
_classvalidator.MinLength.call(void 0, 16)
|
|
1351
1351
|
], MagicLinkVerifyDto.prototype, "token", 2);
|
|
1352
1352
|
var TwoFactorCodeDto = class {
|
|
1353
1353
|
};
|
|
1354
|
-
|
|
1354
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1355
1355
|
_classvalidator.IsString.call(void 0, ),
|
|
1356
1356
|
_classvalidator.MinLength.call(void 0, 6)
|
|
1357
1357
|
], TwoFactorCodeDto.prototype, "code", 2);
|
|
1358
1358
|
var MfaVerifyDto = class {
|
|
1359
1359
|
};
|
|
1360
|
-
|
|
1360
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1361
1361
|
_classvalidator.IsString.call(void 0, ),
|
|
1362
1362
|
_classvalidator.MinLength.call(void 0, 16)
|
|
1363
1363
|
], MfaVerifyDto.prototype, "challenge", 2);
|
|
1364
|
-
|
|
1364
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1365
1365
|
_classvalidator.IsString.call(void 0, ),
|
|
1366
1366
|
_classvalidator.MinLength.call(void 0, 6)
|
|
1367
1367
|
], MfaVerifyDto.prototype, "code", 2);
|
|
1368
1368
|
var PasskeyRegisterDto = class {
|
|
1369
1369
|
};
|
|
1370
|
-
|
|
1370
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1371
1371
|
_classvalidator.IsString.call(void 0, ),
|
|
1372
1372
|
_classvalidator.MinLength.call(void 0, 16)
|
|
1373
1373
|
], PasskeyRegisterDto.prototype, "token", 2);
|
|
1374
|
-
|
|
1374
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1375
1375
|
_classvalidator.IsObject.call(void 0, )
|
|
1376
1376
|
], PasskeyRegisterDto.prototype, "response", 2);
|
|
1377
|
-
|
|
1377
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1378
1378
|
_classvalidator.IsOptional.call(void 0, ),
|
|
1379
1379
|
_classvalidator.IsString.call(void 0, )
|
|
1380
1380
|
], PasskeyRegisterDto.prototype, "name", 2);
|
|
1381
1381
|
var PasskeyLoginOptionsDto = class {
|
|
1382
1382
|
};
|
|
1383
|
-
|
|
1383
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1384
1384
|
_classvalidator.IsOptional.call(void 0, ),
|
|
1385
1385
|
_classvalidator.IsEmail.call(void 0, )
|
|
1386
1386
|
], PasskeyLoginOptionsDto.prototype, "email", 2);
|
|
1387
1387
|
var PasskeyLoginDto = class {
|
|
1388
1388
|
};
|
|
1389
|
-
|
|
1389
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1390
1390
|
_classvalidator.IsString.call(void 0, ),
|
|
1391
1391
|
_classvalidator.MinLength.call(void 0, 16)
|
|
1392
1392
|
], PasskeyLoginDto.prototype, "token", 2);
|
|
1393
|
-
|
|
1393
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1394
1394
|
_classvalidator.IsObject.call(void 0, )
|
|
1395
1395
|
], PasskeyLoginDto.prototype, "response", 2);
|
|
1396
1396
|
|
|
@@ -1432,9 +1432,9 @@ var OAuthCallbackFilter = class {
|
|
|
1432
1432
|
redirect(reply, this.options.onErrorRedirect(message));
|
|
1433
1433
|
}
|
|
1434
1434
|
};
|
|
1435
|
-
OAuthCallbackFilter = exports.OAuthCallbackFilter =
|
|
1435
|
+
OAuthCallbackFilter = exports.OAuthCallbackFilter = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1436
1436
|
_common.Catch.call(void 0, ),
|
|
1437
|
-
|
|
1437
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Inject.call(void 0, OAUTH_AUTH_OPTIONS))
|
|
1438
1438
|
], OAuthCallbackFilter);
|
|
1439
1439
|
|
|
1440
1440
|
// src/auth/oauth/oauth.controller.ts
|
|
@@ -1453,7 +1453,7 @@ OAuthCallbackFilter = exports.OAuthCallbackFilter = _chunk2REOCMUDcjs.__decorate
|
|
|
1453
1453
|
|
|
1454
1454
|
|
|
1455
1455
|
function createOAuthController(options = {}) {
|
|
1456
|
-
const Guard = _nullishCoalesce(options.guard, () => (
|
|
1456
|
+
const Guard = _nullishCoalesce(options.guard, () => ( _chunkD35TBVROcjs.JwtAuthGuard));
|
|
1457
1457
|
const userId = _nullishCoalesce(options.userId, () => ( ((user) => user.sub)));
|
|
1458
1458
|
let OAuthControllerHost = class {
|
|
1459
1459
|
// Explicit token: the build emits no `design:paramtypes`, so a subclass
|
|
@@ -1626,140 +1626,140 @@ function createOAuthController(options = {}) {
|
|
|
1626
1626
|
});
|
|
1627
1627
|
}
|
|
1628
1628
|
};
|
|
1629
|
-
|
|
1629
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1630
1630
|
_common.Post.call(void 0, "refresh"),
|
|
1631
|
-
|
|
1632
|
-
|
|
1631
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Req.call(void 0, )),
|
|
1632
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Res.call(void 0, { passthrough: true }))
|
|
1633
1633
|
], OAuthControllerHost.prototype, "refresh", 1);
|
|
1634
|
-
|
|
1634
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1635
1635
|
_common.Post.call(void 0, "logout"),
|
|
1636
|
-
|
|
1637
|
-
|
|
1636
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Req.call(void 0, )),
|
|
1637
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Res.call(void 0, { passthrough: true }))
|
|
1638
1638
|
], OAuthControllerHost.prototype, "logout", 1);
|
|
1639
|
-
|
|
1639
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1640
1640
|
_common.UseGuards.call(void 0, Guard),
|
|
1641
1641
|
_common.Get.call(void 0, "me"),
|
|
1642
|
-
|
|
1642
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, ))
|
|
1643
1643
|
], OAuthControllerHost.prototype, "me", 1);
|
|
1644
|
-
|
|
1644
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1645
1645
|
_common.UseGuards.call(void 0, Guard),
|
|
1646
1646
|
_common.Get.call(void 0, "linked-accounts"),
|
|
1647
|
-
|
|
1647
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, ))
|
|
1648
1648
|
], OAuthControllerHost.prototype, "linkedAccounts", 1);
|
|
1649
|
-
|
|
1649
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1650
1650
|
_common.UseGuards.call(void 0, Guard),
|
|
1651
1651
|
_common.Post.call(void 0, "link-intent"),
|
|
1652
|
-
|
|
1653
|
-
|
|
1652
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, )),
|
|
1653
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Res.call(void 0, { passthrough: true }))
|
|
1654
1654
|
], OAuthControllerHost.prototype, "linkIntent", 1);
|
|
1655
|
-
|
|
1655
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1656
1656
|
_common.Post.call(void 0, "magic-link"),
|
|
1657
|
-
|
|
1657
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Body.call(void 0, ))
|
|
1658
1658
|
], OAuthControllerHost.prototype, "requestMagicLink", 1);
|
|
1659
|
-
|
|
1659
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1660
1660
|
_common.Post.call(void 0, "magic-link/verify"),
|
|
1661
|
-
|
|
1662
|
-
|
|
1661
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Body.call(void 0, )),
|
|
1662
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Res.call(void 0, { passthrough: true }))
|
|
1663
1663
|
], OAuthControllerHost.prototype, "verifyMagicLink", 1);
|
|
1664
|
-
|
|
1664
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1665
1665
|
_common.Post.call(void 0, "2fa/verify"),
|
|
1666
|
-
|
|
1667
|
-
|
|
1666
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Body.call(void 0, )),
|
|
1667
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Res.call(void 0, { passthrough: true }))
|
|
1668
1668
|
], OAuthControllerHost.prototype, "verifyMfa", 1);
|
|
1669
|
-
|
|
1669
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1670
1670
|
_common.UseGuards.call(void 0, Guard),
|
|
1671
1671
|
_common.Get.call(void 0, "2fa"),
|
|
1672
|
-
|
|
1672
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, ))
|
|
1673
1673
|
], OAuthControllerHost.prototype, "twoFactorStatus", 1);
|
|
1674
|
-
|
|
1674
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1675
1675
|
_common.UseGuards.call(void 0, Guard),
|
|
1676
1676
|
_common.Post.call(void 0, "2fa/setup"),
|
|
1677
|
-
|
|
1677
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, ))
|
|
1678
1678
|
], OAuthControllerHost.prototype, "twoFactorSetup", 1);
|
|
1679
|
-
|
|
1679
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1680
1680
|
_common.UseGuards.call(void 0, Guard),
|
|
1681
1681
|
_common.Post.call(void 0, "2fa/confirm"),
|
|
1682
|
-
|
|
1683
|
-
|
|
1682
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, )),
|
|
1683
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Body.call(void 0, ))
|
|
1684
1684
|
], OAuthControllerHost.prototype, "twoFactorConfirm", 1);
|
|
1685
|
-
|
|
1685
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1686
1686
|
_common.UseGuards.call(void 0, Guard),
|
|
1687
1687
|
_common.Post.call(void 0, "2fa/disable"),
|
|
1688
|
-
|
|
1689
|
-
|
|
1688
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, )),
|
|
1689
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Body.call(void 0, ))
|
|
1690
1690
|
], OAuthControllerHost.prototype, "twoFactorDisable", 1);
|
|
1691
|
-
|
|
1691
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1692
1692
|
_common.UseGuards.call(void 0, Guard),
|
|
1693
1693
|
_common.Post.call(void 0, "passkeys/register/options"),
|
|
1694
|
-
|
|
1694
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, ))
|
|
1695
1695
|
], OAuthControllerHost.prototype, "passkeyRegistrationOptions", 1);
|
|
1696
|
-
|
|
1696
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1697
1697
|
_common.UseGuards.call(void 0, Guard),
|
|
1698
1698
|
_common.Post.call(void 0, "passkeys/register"),
|
|
1699
|
-
|
|
1700
|
-
|
|
1699
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, )),
|
|
1700
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Body.call(void 0, ))
|
|
1701
1701
|
], OAuthControllerHost.prototype, "passkeyRegister", 1);
|
|
1702
|
-
|
|
1702
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1703
1703
|
_common.UseGuards.call(void 0, Guard),
|
|
1704
1704
|
_common.Post.call(void 0, "passkeys/unlock/options"),
|
|
1705
|
-
|
|
1705
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, ))
|
|
1706
1706
|
], OAuthControllerHost.prototype, "passkeyUnlockOptions", 1);
|
|
1707
|
-
|
|
1707
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1708
1708
|
_common.UseGuards.call(void 0, Guard),
|
|
1709
1709
|
_common.Post.call(void 0, "passkeys/unlock"),
|
|
1710
|
-
|
|
1711
|
-
|
|
1710
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, )),
|
|
1711
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Body.call(void 0, ))
|
|
1712
1712
|
], OAuthControllerHost.prototype, "passkeyUnlock", 1);
|
|
1713
|
-
|
|
1713
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1714
1714
|
_common.UseGuards.call(void 0, Guard),
|
|
1715
1715
|
_common.Get.call(void 0, "passkeys"),
|
|
1716
|
-
|
|
1716
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, ))
|
|
1717
1717
|
], OAuthControllerHost.prototype, "listPasskeys", 1);
|
|
1718
|
-
|
|
1718
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1719
1719
|
_common.UseGuards.call(void 0, Guard),
|
|
1720
1720
|
_common.Delete.call(void 0, "passkeys/:id"),
|
|
1721
|
-
|
|
1722
|
-
|
|
1721
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _chunkD35TBVROcjs.CurrentUser.call(void 0, )),
|
|
1722
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Param.call(void 0, "id"))
|
|
1723
1723
|
], OAuthControllerHost.prototype, "deletePasskey", 1);
|
|
1724
|
-
|
|
1724
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1725
1725
|
_common.Post.call(void 0, "passkeys/login/options"),
|
|
1726
|
-
|
|
1726
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Body.call(void 0, ))
|
|
1727
1727
|
], OAuthControllerHost.prototype, "passkeyLoginOptions", 1);
|
|
1728
|
-
|
|
1728
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1729
1729
|
_common.Post.call(void 0, "passkeys/login"),
|
|
1730
|
-
|
|
1731
|
-
|
|
1730
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Body.call(void 0, )),
|
|
1731
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Res.call(void 0, { passthrough: true }))
|
|
1732
1732
|
], OAuthControllerHost.prototype, "passkeyLogin", 1);
|
|
1733
|
-
|
|
1733
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1734
1734
|
_common.Get.call(void 0, "magic-link/callback"),
|
|
1735
1735
|
_common.UseFilters.call(void 0, OAuthCallbackFilter),
|
|
1736
|
-
|
|
1737
|
-
|
|
1736
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Query.call(void 0, "token")),
|
|
1737
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Res.call(void 0, ))
|
|
1738
1738
|
], OAuthControllerHost.prototype, "magicLinkCallback", 1);
|
|
1739
|
-
|
|
1739
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1740
1740
|
_common.Get.call(void 0, ":provider"),
|
|
1741
|
-
|
|
1742
|
-
|
|
1741
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "provider")),
|
|
1742
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Res.call(void 0, ))
|
|
1743
1743
|
], OAuthControllerHost.prototype, "start", 1);
|
|
1744
|
-
|
|
1744
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1745
1745
|
_common.Get.call(void 0, ":provider/callback"),
|
|
1746
1746
|
_common.UseFilters.call(void 0, OAuthCallbackFilter),
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1747
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "provider")),
|
|
1748
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Query.call(void 0, )),
|
|
1749
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 2, _common.Req.call(void 0, )),
|
|
1750
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 3, _common.Res.call(void 0, ))
|
|
1751
1751
|
], OAuthControllerHost.prototype, "callback", 1);
|
|
1752
|
-
|
|
1752
|
+
_chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1753
1753
|
_common.Post.call(void 0, ":provider/callback"),
|
|
1754
1754
|
_common.UseFilters.call(void 0, OAuthCallbackFilter),
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1755
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "provider")),
|
|
1756
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Body.call(void 0, )),
|
|
1757
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 2, _common.Req.call(void 0, )),
|
|
1758
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 3, _common.Res.call(void 0, ))
|
|
1759
1759
|
], OAuthControllerHost.prototype, "callbackByPost", 1);
|
|
1760
|
-
OAuthControllerHost =
|
|
1760
|
+
OAuthControllerHost = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1761
1761
|
_common.Controller.call(void 0, _nullishCoalesce(options.path, () => ( "auth"))),
|
|
1762
|
-
|
|
1762
|
+
_chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Inject.call(void 0, OAuthAuthService))
|
|
1763
1763
|
], OAuthControllerHost);
|
|
1764
1764
|
return OAuthControllerHost;
|
|
1765
1765
|
}
|
|
@@ -1784,7 +1784,7 @@ var OAuthAuthModule = class {
|
|
|
1784
1784
|
};
|
|
1785
1785
|
}
|
|
1786
1786
|
};
|
|
1787
|
-
OAuthAuthModule = exports.OAuthAuthModule =
|
|
1787
|
+
OAuthAuthModule = exports.OAuthAuthModule = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
|
|
1788
1788
|
_common.Module.call(void 0, {})
|
|
1789
1789
|
], OAuthAuthModule);
|
|
1790
1790
|
|
package/dist/auth/oauth/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CurrentUser,
|
|
3
3
|
JwtAuthGuard
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-4WWOKZIO.js";
|
|
5
|
+
import "../../chunk-ETRUVZTJ.js";
|
|
5
6
|
import {
|
|
6
7
|
NotFoundAppException,
|
|
7
8
|
UnauthorizedAppException,
|
|
8
9
|
ValidationAppException
|
|
9
10
|
} from "../../chunk-ZFIDAX7K.js";
|
|
10
11
|
import "../../chunk-M3GQDRWR.js";
|
|
11
|
-
import "../../chunk-ETRUVZTJ.js";
|
|
12
12
|
import "../../chunk-VVMRZEIW.js";
|
|
13
13
|
import {
|
|
14
14
|
__decorateClass,
|
|
15
15
|
__decorateParam
|
|
16
|
-
} from "../../chunk-
|
|
16
|
+
} from "../../chunk-D3DDJWUD.js";
|
|
17
17
|
|
|
18
18
|
// src/auth/oauth/oauth-provider.ts
|
|
19
19
|
async function readJson(response, what) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type INestApplication, type ValidationPipeOptions } from '@nestjs/common';
|
|
2
2
|
import type { CorsOptions } from '@nestjs/common/interfaces/external/cors-options.interface';
|
|
3
|
+
import { type BodyLimitsOptions } from '../hardening/body-limits.js';
|
|
4
|
+
import { type OriginSecretOptions } from '../hardening/origin-secret.js';
|
|
5
|
+
import { type TrustProxyValue } from '../hardening/trust-proxy.js';
|
|
3
6
|
export interface SwaggerBootstrapOptions {
|
|
4
7
|
title: string;
|
|
5
8
|
path?: string;
|
|
@@ -9,6 +12,12 @@ export interface ApplyNestKitDefaultsOptions {
|
|
|
9
12
|
/** Pass `false` to skip mounting Swagger entirely. */
|
|
10
13
|
swagger?: SwaggerBootstrapOptions | false;
|
|
11
14
|
validation?: ValidationPipeOptions;
|
|
15
|
+
/** Express `trust proxy` (e.g. `1` behind one proxy). Omitted: untouched. */
|
|
16
|
+
trustProxy?: TrustProxyValue;
|
|
17
|
+
/** Rejects with 403 whatever does not carry the CDN's shared secret header. Omitted: off. */
|
|
18
|
+
originSecret?: OriginSecretOptions;
|
|
19
|
+
/** JSON body limit (default and per route). Omitted: Nest/Express defaults. */
|
|
20
|
+
bodyLimits?: BodyLimitsOptions;
|
|
12
21
|
}
|
|
13
22
|
/**
|
|
14
23
|
* Applies nestkit's opinionated defaults to a Nest application, in order:
|
package/dist/bootstrap/index.cjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
3
|
+
var _chunkJRFE7NSOcjs = require('../chunk-JRFE7NSO.cjs');
|
|
4
|
+
require('../chunk-F77X4QUN.cjs');
|
|
5
|
+
require('../chunk-JJKGQNGD.cjs');
|
|
6
|
+
require('../chunk-IVWPA6QH.cjs');
|
|
7
7
|
require('../chunk-AXMW5JF7.cjs');
|
|
8
8
|
require('../chunk-Y72D5L6I.cjs');
|
|
9
9
|
require('../chunk-SDWHKPXI.cjs');
|
|
10
|
+
require('../chunk-Q5Y33L7B.cjs');
|
|
10
11
|
require('../chunk-PNK5WMPP.cjs');
|
|
11
|
-
require('../chunk-
|
|
12
|
+
require('../chunk-LRX7AMSS.cjs');
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
exports.applyNestKitDefaults =
|
|
15
|
+
exports.applyNestKitDefaults = _chunkJRFE7NSOcjs.applyNestKitDefaults;
|
package/dist/bootstrap/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyNestKitDefaults
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-UGAAJRPO.js";
|
|
4
|
+
import "../chunk-IGSNB5BX.js";
|
|
5
|
+
import "../chunk-5LVGCTJ3.js";
|
|
6
|
+
import "../chunk-WFCQDOSN.js";
|
|
7
7
|
import "../chunk-X4PQJZ4G.js";
|
|
8
8
|
import "../chunk-TCAMLNUZ.js";
|
|
9
9
|
import "../chunk-ETRUVZTJ.js";
|
|
10
|
+
import "../chunk-M3GQDRWR.js";
|
|
10
11
|
import "../chunk-VVMRZEIW.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-D3DDJWUD.js";
|
|
12
13
|
export {
|
|
13
14
|
applyNestKitDefaults
|
|
14
15
|
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/security/signed-state.ts
|
|
2
|
+
var _crypto = require('crypto');
|
|
3
|
+
function signState(payload, options) {
|
|
4
|
+
const body = JSON.stringify({ ts: Date.now(), nonce: _crypto.randomBytes.call(void 0, 8).toString("hex"), ...payload });
|
|
5
|
+
const b64 = Buffer.from(body).toString("base64url");
|
|
6
|
+
const sig = _crypto.createHmac.call(void 0, "sha256", options.secret).update(b64).digest("base64url");
|
|
7
|
+
return `${b64}.${sig}`;
|
|
8
|
+
}
|
|
9
|
+
function readState(state, options) {
|
|
10
|
+
if (!state) return null;
|
|
11
|
+
const parts = state.split(".");
|
|
12
|
+
if (parts.length !== 2) return null;
|
|
13
|
+
const [b64, sig] = parts;
|
|
14
|
+
const expected = _crypto.createHmac.call(void 0, "sha256", options.secret).update(b64).digest("base64url");
|
|
15
|
+
const provided = Buffer.from(sig);
|
|
16
|
+
const wanted = Buffer.from(expected);
|
|
17
|
+
if (provided.length !== wanted.length || !_crypto.timingSafeEqual.call(void 0, provided, wanted)) return null;
|
|
18
|
+
let parsed;
|
|
19
|
+
try {
|
|
20
|
+
parsed = JSON.parse(Buffer.from(b64, "base64url").toString());
|
|
21
|
+
} catch (e) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const ts = parsed.ts;
|
|
25
|
+
const ttl = _nullishCoalesce(options.ttlMs, () => ( 10 * 6e4));
|
|
26
|
+
if (typeof ts !== "number" || !Number.isFinite(ts) || Date.now() - ts >= ttl) return null;
|
|
27
|
+
const { ts: _ts, nonce: _nonce, ...rest } = parsed;
|
|
28
|
+
return rest;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/security/mask.ts
|
|
32
|
+
function maskEmail(email) {
|
|
33
|
+
const clean = email.trim();
|
|
34
|
+
const at = clean.lastIndexOf("@");
|
|
35
|
+
if (at < 1) return "***";
|
|
36
|
+
return `${clean[0]}***${clean.slice(at)}`;
|
|
37
|
+
}
|
|
38
|
+
function maskPhone(phone, visible = 4) {
|
|
39
|
+
const digits = phone.replace(/\D/g, "");
|
|
40
|
+
if (digits.length <= visible) return "***";
|
|
41
|
+
return `***${digits.slice(-visible)}`;
|
|
42
|
+
}
|
|
43
|
+
function maskToken(token, keep = 2) {
|
|
44
|
+
if (token.length <= keep * 2) return "***";
|
|
45
|
+
return `${token.slice(0, keep)}***${token.slice(-keep)}`;
|
|
46
|
+
}
|
|
47
|
+
function shapeOf(value, depth = 4) {
|
|
48
|
+
if (value === null) return "null";
|
|
49
|
+
if (Array.isArray(value)) return depth <= 0 ? "array" : value.slice(0, 3).map((v) => shapeOf(v, depth - 1));
|
|
50
|
+
if (typeof value === "object") {
|
|
51
|
+
if (depth <= 0) return "object";
|
|
52
|
+
return Object.fromEntries(
|
|
53
|
+
Object.entries(value).map(([k, v]) => [k, shapeOf(v, depth - 1)])
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return typeof value;
|
|
57
|
+
}
|
|
58
|
+
var apply = (rule, value) => {
|
|
59
|
+
if (typeof rule === "function") return rule(value);
|
|
60
|
+
if (rule === "drop") return void 0;
|
|
61
|
+
if (rule === "redact" || typeof value !== "string") return "***";
|
|
62
|
+
if (rule === "email") return maskEmail(value);
|
|
63
|
+
if (rule === "phone") return maskPhone(value);
|
|
64
|
+
return maskToken(value);
|
|
65
|
+
};
|
|
66
|
+
function maskFields(value, rules, maxDepth = 8) {
|
|
67
|
+
const byKey = new Map(Object.entries(rules).map(([k, r]) => [k.toLowerCase(), r]));
|
|
68
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
69
|
+
const walk = (v, depth) => {
|
|
70
|
+
if (v === null || typeof v !== "object") return v;
|
|
71
|
+
if (depth > maxDepth || seen.has(v)) return "[\u2026]";
|
|
72
|
+
seen.add(v);
|
|
73
|
+
if (Array.isArray(v)) return v.map((x) => walk(x, depth + 1));
|
|
74
|
+
const out = {};
|
|
75
|
+
for (const [k, x] of Object.entries(v)) {
|
|
76
|
+
const rule = byKey.get(k.toLowerCase());
|
|
77
|
+
if (rule === void 0) out[k] = walk(x, depth + 1);
|
|
78
|
+
else {
|
|
79
|
+
try {
|
|
80
|
+
const masked = apply(rule, x);
|
|
81
|
+
if (masked !== void 0) out[k] = masked;
|
|
82
|
+
} catch (e2) {
|
|
83
|
+
out[k] = "***";
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
};
|
|
89
|
+
return walk(value, 0);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// src/security/hash.ts
|
|
93
|
+
|
|
94
|
+
var hashSha256 = (value) => _crypto.createHash.call(void 0, "sha256").update(value).digest("hex");
|
|
95
|
+
function constantTimeEqual(a, b) {
|
|
96
|
+
const ba = Buffer.from(a);
|
|
97
|
+
const bb = Buffer.from(b);
|
|
98
|
+
if (ba.length !== bb.length) {
|
|
99
|
+
_crypto.timingSafeEqual.call(void 0, ba, ba);
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
return _crypto.timingSafeEqual.call(void 0, ba, bb);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// src/security/signed-grant.ts
|
|
106
|
+
|
|
107
|
+
var sign = (b64, secret) => _crypto.createHmac.call(void 0, "sha256", secret).update(b64).digest("base64url");
|
|
108
|
+
function signGrant(claims, secret, ttlMs = 6e4) {
|
|
109
|
+
const body = JSON.stringify({
|
|
110
|
+
a: claims.actor,
|
|
111
|
+
p: claims.permission,
|
|
112
|
+
r: claims.resource,
|
|
113
|
+
t: claims.tenant,
|
|
114
|
+
exp: Date.now() + ttlMs,
|
|
115
|
+
n: _crypto.randomBytes.call(void 0, 8).toString("hex")
|
|
116
|
+
});
|
|
117
|
+
const b64 = Buffer.from(body).toString("base64url");
|
|
118
|
+
return `${b64}.${sign(b64, secret)}`;
|
|
119
|
+
}
|
|
120
|
+
function verifyGrant(token, secret, expected) {
|
|
121
|
+
if (!token) return null;
|
|
122
|
+
const parts = token.split(".");
|
|
123
|
+
if (parts.length !== 2) return null;
|
|
124
|
+
const [b64, sig] = parts;
|
|
125
|
+
if (!constantTimeEqual(sig, sign(b64, secret))) return null;
|
|
126
|
+
let p;
|
|
127
|
+
try {
|
|
128
|
+
p = JSON.parse(Buffer.from(b64, "base64url").toString());
|
|
129
|
+
} catch (e3) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
if (typeof p.exp !== "number" || !Number.isFinite(p.exp) || Date.now() >= p.exp) return null;
|
|
133
|
+
if (typeof p.a !== "string" || typeof p.p !== "string" || typeof p.r !== "string" || typeof p.t !== "string") return null;
|
|
134
|
+
if (p.p !== expected.permission || p.r !== expected.resource || p.t !== expected.tenant) return null;
|
|
135
|
+
if (expected.actor !== void 0 && p.a !== expected.actor) return null;
|
|
136
|
+
return { actor: p.a, permission: p.p, resource: p.r, tenant: p.t };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
exports.signState = signState; exports.readState = readState; exports.maskEmail = maskEmail; exports.maskPhone = maskPhone; exports.maskToken = maskToken; exports.shapeOf = shapeOf; exports.maskFields = maskFields; exports.hashSha256 = hashSha256; exports.constantTimeEqual = constantTimeEqual; exports.signGrant = signGrant; exports.verifyGrant = verifyGrant;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/consent/shared/index.ts
|
|
2
|
+
function compareVersions(a, b) {
|
|
3
|
+
return a === b ? 0 : a < b ? -1 : 1;
|
|
4
|
+
}
|
|
5
|
+
function versionAceptadaVigente(version, minima) {
|
|
6
|
+
return !!version && version >= minima;
|
|
7
|
+
}
|
|
8
|
+
var isAcceptedVersionValid = versionAceptadaVigente;
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
compareVersions,
|
|
12
|
+
versionAceptadaVigente,
|
|
13
|
+
isAcceptedVersionValid
|
|
14
|
+
};
|