@todoist/ui-extensions-server 0.0.1 → 4.0.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 +2 -44
- package/dist/analytics/events.d.ts +8 -0
- package/dist/analytics/events.js +15 -0
- package/dist/analytics/events.js.map +1 -0
- package/dist/buffer/cloneBuffer.d.ts +1 -0
- package/dist/buffer/cloneBuffer.js +12 -0
- package/dist/buffer/cloneBuffer.js.map +1 -0
- package/dist/buffer/incomingMessageWithRawBody.d.ts +4 -0
- package/dist/buffer/incomingMessageWithRawBody.js +8 -0
- package/dist/buffer/incomingMessageWithRawBody.js.map +1 -0
- package/dist/buffer/index.d.ts +2 -0
- package/dist/buffer/index.js +19 -0
- package/dist/buffer/index.js.map +1 -0
- package/dist/config/configurationBase.d.ts +29 -0
- package/dist/config/configurationBase.js +58 -0
- package/dist/config/configurationBase.js.map +1 -0
- package/dist/constants/card-actions.d.ts +12 -0
- package/dist/constants/card-actions.js +17 -0
- package/dist/constants/card-actions.js.map +1 -0
- package/dist/constants/core-strings.d.ts +61 -0
- package/dist/constants/core-strings.js +66 -0
- package/dist/constants/core-strings.js.map +1 -0
- package/dist/constants/images.d.ts +25 -0
- package/dist/constants/images.js +29 -0
- package/dist/constants/images.js.map +1 -0
- package/dist/constants/index.d.ts +4 -0
- package/dist/constants/index.js +21 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/ui-constants.d.ts +1 -0
- package/dist/constants/ui-constants.js +5 -0
- package/dist/constants/ui-constants.js.map +1 -0
- package/dist/controllers/app.controller.d.ts +15 -0
- package/dist/controllers/app.controller.js +76 -0
- package/dist/controllers/app.controller.js.map +1 -0
- package/dist/controllers/auth.controller.d.ts +47 -0
- package/dist/controllers/auth.controller.js +348 -0
- package/dist/controllers/auth.controller.js.map +1 -0
- package/dist/controllers/index.d.ts +3 -0
- package/dist/controllers/index.js +20 -0
- package/dist/controllers/index.js.map +1 -0
- package/dist/controllers/ping.controller.d.ts +3 -0
- package/dist/controllers/ping.controller.js +30 -0
- package/dist/controllers/ping.controller.js.map +1 -0
- package/dist/decorators/action-decorators.d.ts +12 -0
- package/dist/decorators/action-decorators.js +12 -0
- package/dist/decorators/action-decorators.js.map +1 -0
- package/dist/decorators/app-token.decorator.d.ts +1 -0
- package/dist/decorators/app-token.decorator.js +12 -0
- package/dist/decorators/app-token.decorator.js.map +1 -0
- package/dist/decorators/index.d.ts +2 -0
- package/dist/decorators/index.js +19 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/typed-method-decorator.d.ts +1 -0
- package/dist/decorators/typed-method-decorator.js +3 -0
- package/dist/decorators/typed-method-decorator.js.map +1 -0
- package/dist/entities/User.d.ts +24 -0
- package/dist/entities/User.js +89 -0
- package/dist/entities/User.js.map +1 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.js +18 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/exceptions/index.d.ts +1 -0
- package/dist/exceptions/index.js +18 -0
- package/dist/exceptions/index.js.map +1 -0
- package/dist/exceptions/integration.exception.d.ts +32 -0
- package/dist/exceptions/integration.exception.js +17 -0
- package/dist/exceptions/integration.exception.js.map +1 -0
- package/dist/filters/index.d.ts +1 -0
- package/dist/filters/index.js +18 -0
- package/dist/filters/index.js.map +1 -0
- package/dist/filters/integration-exception.filter.d.ts +10 -0
- package/dist/filters/integration-exception.filter.js +83 -0
- package/dist/filters/integration-exception.filter.js.map +1 -0
- package/dist/guards/extensionVerification.guard.d.ts +6 -0
- package/dist/guards/extensionVerification.guard.js +55 -0
- package/dist/guards/extensionVerification.guard.js.map +1 -0
- package/dist/guards/index.d.ts +1 -0
- package/dist/guards/index.js +18 -0
- package/dist/guards/index.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/interceptors/sentry.interceptor.d.ts +5 -0
- package/dist/interceptors/sentry.interceptor.js +30 -0
- package/dist/interceptors/sentry.interceptor.js.map +1 -0
- package/dist/logging/index.d.ts +1 -0
- package/dist/logging/index.js +18 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/json.logger.d.ts +7 -0
- package/dist/logging/json.logger.js +23 -0
- package/dist/logging/json.logger.js.map +1 -0
- package/dist/middleware/index.d.ts +1 -0
- package/dist/middleware/index.js +18 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/middleware/request-header.middleware.d.ts +8 -0
- package/dist/middleware/request-header.middleware.js +29 -0
- package/dist/middleware/request-header.middleware.js.map +1 -0
- package/dist/middleware/workflow-initial-action.middleware.d.ts +13 -0
- package/dist/middleware/workflow-initial-action.middleware.js +23 -0
- package/dist/middleware/workflow-initial-action.middleware.js.map +1 -0
- package/dist/modules/analytics.module.d.ts +5 -0
- package/dist/modules/analytics.module.js +37 -0
- package/dist/modules/analytics.module.js.map +1 -0
- package/dist/modules/app-token.module.d.ts +2 -0
- package/dist/modules/app-token.module.js +22 -0
- package/dist/modules/app-token.module.js.map +1 -0
- package/dist/modules/auth.module.d.ts +17 -0
- package/dist/modules/auth.module.js +44 -0
- package/dist/modules/auth.module.js.map +1 -0
- package/dist/modules/core.module.d.ts +4 -0
- package/dist/modules/core.module.js +38 -0
- package/dist/modules/core.module.js.map +1 -0
- package/dist/modules/error.module.d.ts +7 -0
- package/dist/modules/error.module.js +39 -0
- package/dist/modules/error.module.js.map +1 -0
- package/dist/modules/index.d.ts +3 -0
- package/dist/modules/index.js +20 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/request-headers.module.d.ts +2 -0
- package/dist/modules/request-headers.module.js +22 -0
- package/dist/modules/request-headers.module.js.map +1 -0
- package/dist/server.d.ts +11 -0
- package/dist/server.js +52 -0
- package/dist/server.js.map +1 -0
- package/dist/services/actions.service.d.ts +19 -0
- package/dist/services/actions.service.js +126 -0
- package/dist/services/actions.service.js.map +1 -0
- package/dist/services/adaptive-card.service.d.ts +57 -0
- package/dist/services/adaptive-card.service.js +284 -0
- package/dist/services/adaptive-card.service.js.map +1 -0
- package/dist/services/analytics.service.d.ts +7 -0
- package/dist/services/analytics.service.js +20 -0
- package/dist/services/analytics.service.js.map +1 -0
- package/dist/services/app-token.service.d.ts +6 -0
- package/dist/services/app-token.service.js +47 -0
- package/dist/services/app-token.service.js.map +1 -0
- package/dist/services/authentication-client.d.ts +42 -0
- package/dist/services/authentication-client.js +95 -0
- package/dist/services/authentication-client.js.map +1 -0
- package/dist/services/composer-append-formatting.service.d.ts +9 -0
- package/dist/services/composer-append-formatting.service.js +37 -0
- package/dist/services/composer-append-formatting.service.js.map +1 -0
- package/dist/services/composer-append-settings.service.d.ts +7 -0
- package/dist/services/composer-append-settings.service.js +39 -0
- package/dist/services/composer-append-settings.service.js.map +1 -0
- package/dist/services/errorCard.service.d.ts +14 -0
- package/dist/services/errorCard.service.js +129 -0
- package/dist/services/errorCard.service.js.map +1 -0
- package/dist/services/google-analytics.service.d.ts +10 -0
- package/dist/services/google-analytics.service.js +56 -0
- package/dist/services/google-analytics.service.js.map +1 -0
- package/dist/services/index.d.ts +15 -0
- package/dist/services/index.js +32 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/legacy-google-analytics.service.d.ts +10 -0
- package/dist/services/legacy-google-analytics.service.js +56 -0
- package/dist/services/legacy-google-analytics.service.js.map +1 -0
- package/dist/services/login.service.d.ts +31 -0
- package/dist/services/login.service.js +165 -0
- package/dist/services/login.service.js.map +1 -0
- package/dist/services/request-headers.service.d.ts +9 -0
- package/dist/services/request-headers.service.js +53 -0
- package/dist/services/request-headers.service.js.map +1 -0
- package/dist/services/state.service.d.ts +18 -0
- package/dist/services/state.service.js +96 -0
- package/dist/services/state.service.js.map +1 -0
- package/dist/services/theme.service.d.ts +5 -0
- package/dist/services/theme.service.js +28 -0
- package/dist/services/theme.service.js.map +1 -0
- package/dist/services/translation.service.d.ts +3 -0
- package/dist/services/translation.service.js +20 -0
- package/dist/services/translation.service.js.map +1 -0
- package/dist/services/user-database.service.d.ts +18 -0
- package/dist/services/user-database.service.js +87 -0
- package/dist/services/user-database.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/types/auth.d.ts +8 -0
- package/dist/types/auth.js +3 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/data.d.ts +12 -0
- package/dist/types/data.js +10 -0
- package/dist/types/data.js.map +1 -0
- package/dist/types/endpoints.d.ts +1 -0
- package/dist/types/endpoints.js +3 -0
- package/dist/types/endpoints.js.map +1 -0
- package/dist/types/error-card-options.d.ts +11 -0
- package/dist/types/error-card-options.js +3 -0
- package/dist/types/error-card-options.js.map +1 -0
- package/dist/types/error.d.ts +2 -0
- package/dist/types/error.js +12 -0
- package/dist/types/error.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +24 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/logging.d.ts +1 -0
- package/dist/types/logging.js +3 -0
- package/dist/types/logging.js.map +1 -0
- package/dist/types/product.d.ts +1 -0
- package/dist/types/product.js +3 -0
- package/dist/types/product.js.map +1 -0
- package/dist/types/retry.d.ts +11 -0
- package/dist/types/retry.js +12 -0
- package/dist/types/retry.js.map +1 -0
- package/dist/ui/back-button.d.ts +7 -0
- package/dist/ui/back-button.js +33 -0
- package/dist/ui/back-button.js.map +1 -0
- package/dist/ui/button.d.ts +15 -0
- package/dist/ui/button.js +27 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/column.d.ts +4 -0
- package/dist/ui/column.js +23 -0
- package/dist/ui/column.js.map +1 -0
- package/dist/ui/container.d.ts +11 -0
- package/dist/ui/container.js +31 -0
- package/dist/ui/container.js.map +1 -0
- package/dist/ui/date-time-input.d.ts +17 -0
- package/dist/ui/date-time-input.js +59 -0
- package/dist/ui/date-time-input.js.map +1 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.js +26 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/profile-details.d.ts +3 -0
- package/dist/ui/profile-details.js +16 -0
- package/dist/ui/profile-details.js.map +1 -0
- package/dist/ui/stock-button.d.ts +20 -0
- package/dist/ui/stock-button.js +131 -0
- package/dist/ui/stock-button.js.map +1 -0
- package/dist/ui/text-block.d.ts +9 -0
- package/dist/ui/text-block.js +24 -0
- package/dist/ui/text-block.js.map +1 -0
- package/dist/ui/ui-builder-context.d.ts +7 -0
- package/dist/ui/ui-builder-context.js +3 -0
- package/dist/ui/ui-builder-context.js.map +1 -0
- package/dist/utils/action-utils.d.ts +5 -0
- package/dist/utils/action-utils.js +29 -0
- package/dist/utils/action-utils.js.map +1 -0
- package/dist/utils/card-bridge.d.ts +7 -0
- package/dist/utils/card-bridge.js +30 -0
- package/dist/utils/card-bridge.js.map +1 -0
- package/dist/utils/context-utils.d.ts +3 -0
- package/dist/utils/context-utils.js +21 -0
- package/dist/utils/context-utils.js.map +1 -0
- package/dist/utils/dateUtils.d.ts +10 -0
- package/dist/utils/dateUtils.js +88 -0
- package/dist/utils/dateUtils.js.map +1 -0
- package/dist/utils/encryption.d.ts +10 -0
- package/dist/utils/encryption.js +70 -0
- package/dist/utils/encryption.js.map +1 -0
- package/dist/utils/endpointUtils.d.ts +2 -0
- package/dist/utils/endpointUtils.js +7 -0
- package/dist/utils/endpointUtils.js.map +1 -0
- package/dist/utils/envUtils.d.ts +1 -0
- package/dist/utils/envUtils.js +7 -0
- package/dist/utils/envUtils.js.map +1 -0
- package/dist/utils/errorUtils.d.ts +6 -0
- package/dist/utils/errorUtils.js +51 -0
- package/dist/utils/errorUtils.js.map +1 -0
- package/dist/utils/header-utils.d.ts +9 -0
- package/dist/utils/header-utils.js +24 -0
- package/dist/utils/header-utils.js.map +1 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.js +30 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +10 -0
- package/dist/utils/logger.js +50 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/paginationDataUtils.d.ts +6 -0
- package/dist/utils/paginationDataUtils.js +52 -0
- package/dist/utils/paginationDataUtils.js.map +1 -0
- package/dist/utils/urlUtils.d.ts +2 -0
- package/dist/utils/urlUtils.js +20 -0
- package/dist/utils/urlUtils.js.map +1 -0
- package/dist/utils/validationUtils.d.ts +3 -0
- package/dist/utils/validationUtils.js +22 -0
- package/dist/utils/validationUtils.js.map +1 -0
- package/package.json +62 -8
- package/views/authDetails.hbs +97 -0
- package/views/partials/errorBody.hbs +7 -0
- package/views/partials/errorTitle.hbs +1 -0
- package/views/partials/successBody.hbs +2 -0
- package/views/partials/successTitle.hbs +1 -0
|
@@ -0,0 +1,89 @@
|
|
|
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.User = void 0;
|
|
13
|
+
exports.getEncryptionTransformer = getEncryptionTransformer;
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const typeorm_encrypted_1 = require("typeorm-encrypted");
|
|
16
|
+
const configurationBase_1 = require("../config/configurationBase");
|
|
17
|
+
function getEncryptionTransformer() {
|
|
18
|
+
var _a;
|
|
19
|
+
if (process.env.DB_HOST === undefined) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
const encryptionOptions = (_a = (0, configurationBase_1.getBaseConfigurationWithDatabase)().database) === null || _a === void 0 ? void 0 : _a.encryption;
|
|
23
|
+
return encryptionOptions ? new typeorm_encrypted_1.EncryptionTransformer(encryptionOptions) : undefined;
|
|
24
|
+
}
|
|
25
|
+
let User = class User {
|
|
26
|
+
set(data) {
|
|
27
|
+
const { authToken, emailAddress, externalUserId, name, refreshToken, tokenExpiresAt, twistId, } = data;
|
|
28
|
+
this.twistId = twistId;
|
|
29
|
+
this.authToken = authToken;
|
|
30
|
+
this.emailAddress = emailAddress;
|
|
31
|
+
this.refreshToken = refreshToken;
|
|
32
|
+
this.externalUserId = externalUserId;
|
|
33
|
+
this.name = name;
|
|
34
|
+
this.tokenExpiresAt = tokenExpiresAt;
|
|
35
|
+
}
|
|
36
|
+
update(_data) {
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.User = User;
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], User.prototype, "id", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)(),
|
|
46
|
+
(0, typeorm_1.Index)(),
|
|
47
|
+
__metadata("design:type", Number)
|
|
48
|
+
], User.prototype, "twistId", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({
|
|
51
|
+
type: 'longtext',
|
|
52
|
+
transformer: getEncryptionTransformer(),
|
|
53
|
+
}),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], User.prototype, "authToken", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({
|
|
58
|
+
type: 'longtext',
|
|
59
|
+
transformer: getEncryptionTransformer(),
|
|
60
|
+
nullable: true,
|
|
61
|
+
}),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], User.prototype, "refreshToken", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
66
|
+
__metadata("design:type", Date)
|
|
67
|
+
], User.prototype, "tokenExpiresAt", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)(),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], User.prototype, "externalUserId", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, typeorm_1.Column)({
|
|
74
|
+
transformer: getEncryptionTransformer(),
|
|
75
|
+
nullable: true,
|
|
76
|
+
}),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], User.prototype, "emailAddress", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.Column)({
|
|
81
|
+
transformer: getEncryptionTransformer(),
|
|
82
|
+
nullable: true,
|
|
83
|
+
}),
|
|
84
|
+
__metadata("design:type", String)
|
|
85
|
+
], User.prototype, "name", void 0);
|
|
86
|
+
exports.User = User = __decorate([
|
|
87
|
+
(0, typeorm_1.Entity)()
|
|
88
|
+
], User);
|
|
89
|
+
//# sourceMappingURL=User.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../src/entities/User.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,4DAYC;AAjBD,qCAAuE;AACvE,yDAAyD;AAEzD,mEAA8E;AAE9E,SAAgB,wBAAwB;;IACpC,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAKpC,OAAO,SAAS,CAAA;IACpB,CAAC;IAED,MAAM,iBAAiB,GAAG,MAAA,IAAA,oDAAgC,GAAE,CAAC,QAAQ,0CAAE,UAAU,CAAA;IAEjF,OAAO,iBAAiB,CAAC,CAAC,CAAC,IAAI,yCAAqB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AACvF,CAAC;AAGM,IAAM,IAAI,GAAV,MAAM,IAAI;IAuCb,GAAG,CAAC,IAQH;QACG,MAAM,EACF,SAAS,EACT,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,cAAc,EACd,OAAO,GACV,GAAG,IAAI,CAAA;QAER,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;IACxC,CAAC;IAED,MAAM,CAAC,KAAiC;IAGxC,CAAC;CACJ,CAAA;AAvEY,oBAAI;AAEb;IADC,IAAA,gCAAsB,GAAE;;gCACd;AAIX;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,GAAE;;qCACQ;AAMhB;IAJC,IAAA,gBAAM,EAAC;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,wBAAwB,EAAE;KAC1C,CAAC;;uCACgB;AAOlB;IALC,IAAA,gBAAM,EAAC;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,wBAAwB,EAAE;QACvC,QAAQ,EAAE,IAAI;KACjB,CAAC;;0CACmB;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACV,IAAI;4CAAA;AAGrB;IADC,IAAA,gBAAM,GAAE;;4CACc;AAMvB;IAJC,IAAA,gBAAM,EAAC;QACJ,WAAW,EAAE,wBAAwB,EAAE;QACvC,QAAQ,EAAE,IAAI;KACjB,CAAC;;0CACmB;AAMrB;IAJC,IAAA,gBAAM,EAAC;QACJ,WAAW,EAAE,wBAAwB,EAAE;QACvC,QAAQ,EAAE,IAAI;KACjB,CAAC;;kCACW;eArCJ,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CAuEhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './User';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./User"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './integration.exception';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./integration.exception"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exceptions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HttpException } from '@nestjs/common';
|
|
2
|
+
import type { TodoistCardAction } from '@todoist/ui-extensions-core';
|
|
3
|
+
type IntegrationExceptionProps = {
|
|
4
|
+
error: unknown;
|
|
5
|
+
overrides?: ErrorHandlerOverrides;
|
|
6
|
+
};
|
|
7
|
+
type ErrorHandlerOverrides = RetryOptions & ErrorMessageOptions & {
|
|
8
|
+
logException?: boolean;
|
|
9
|
+
userId?: string;
|
|
10
|
+
};
|
|
11
|
+
type RetryOptions = {
|
|
12
|
+
showSignout?: boolean;
|
|
13
|
+
} & ({
|
|
14
|
+
showRetry?: boolean;
|
|
15
|
+
retryAction?: never;
|
|
16
|
+
} | {
|
|
17
|
+
showRetry?: never;
|
|
18
|
+
retryAction?: TodoistCardAction;
|
|
19
|
+
});
|
|
20
|
+
type ErrorMessageOptions = {
|
|
21
|
+
showErrorMessageToUser?: true;
|
|
22
|
+
errorMessage?: never;
|
|
23
|
+
} | {
|
|
24
|
+
showErrorMessageToUser?: never;
|
|
25
|
+
errorMessage?: string;
|
|
26
|
+
};
|
|
27
|
+
export declare class IntegrationException extends HttpException {
|
|
28
|
+
readonly error: unknown;
|
|
29
|
+
readonly overrides: ErrorHandlerOverrides;
|
|
30
|
+
constructor({ error, overrides }: IntegrationExceptionProps);
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegrationException = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
class IntegrationException extends common_1.HttpException {
|
|
7
|
+
constructor({ error, overrides = {} }) {
|
|
8
|
+
var _a;
|
|
9
|
+
super((0, utils_1.getErrorMessage)(error), (_a = (0, utils_1.getErrorCode)(error)) !== null && _a !== void 0 ? _a : 500, {
|
|
10
|
+
cause: error instanceof Error ? error : undefined,
|
|
11
|
+
});
|
|
12
|
+
this.error = error;
|
|
13
|
+
this.overrides = overrides;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.IntegrationException = IntegrationException;
|
|
17
|
+
//# sourceMappingURL=integration.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.exception.js","sourceRoot":"","sources":["../../src/exceptions/integration.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAE9C,oCAAwD;AAsBxD,MAAa,oBAAqB,SAAQ,sBAAa;IAInD,YAAY,EAAE,KAAK,EAAE,SAAS,GAAG,EAAE,EAA6B;;QAC5D,KAAK,CAAC,IAAA,uBAAe,EAAC,KAAK,CAAC,EAAE,MAAA,IAAA,oBAAY,EAAC,KAAK,CAAC,mCAAI,GAAG,EAAE;YACtD,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;SACpD,CAAC,CAAA;QACF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC9B,CAAC;CACJ;AAXD,oDAWC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './integration-exception.filter';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./integration-exception.filter"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/filters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iEAA8C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ArgumentsHost, ExceptionFilter } from '@nestjs/common';
|
|
2
|
+
import { IntegrationException } from '../exceptions';
|
|
3
|
+
import { ErrorCardService } from '../services/errorCard.service';
|
|
4
|
+
export declare class IntegrationExceptionFilter implements ExceptionFilter {
|
|
5
|
+
private readonly errorCardService;
|
|
6
|
+
constructor(errorCardService: ErrorCardService);
|
|
7
|
+
catch(exception: IntegrationException, host: ArgumentsHost): void;
|
|
8
|
+
private static shouldLogException;
|
|
9
|
+
private static shouldShowRetryAction;
|
|
10
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
var IntegrationExceptionFilter_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.IntegrationExceptionFilter = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const node_1 = require("@sentry/node");
|
|
16
|
+
const uuid_1 = require("uuid");
|
|
17
|
+
const exceptions_1 = require("../exceptions");
|
|
18
|
+
const errorCard_service_1 = require("../services/errorCard.service");
|
|
19
|
+
const utils_1 = require("../utils");
|
|
20
|
+
let IntegrationExceptionFilter = IntegrationExceptionFilter_1 = class IntegrationExceptionFilter {
|
|
21
|
+
constructor(errorCardService) {
|
|
22
|
+
this.errorCardService = errorCardService;
|
|
23
|
+
}
|
|
24
|
+
catch(exception, host) {
|
|
25
|
+
var _a;
|
|
26
|
+
const ctx = host.switchToHttp();
|
|
27
|
+
const response = ctx.getResponse();
|
|
28
|
+
const request = ctx.getRequest().body;
|
|
29
|
+
const errorCardOptions = {
|
|
30
|
+
exceptionMessage: exception.message,
|
|
31
|
+
};
|
|
32
|
+
const errorId = (0, uuid_1.v4)();
|
|
33
|
+
new utils_1.Logger(IntegrationExceptionFilter_1.name, 'REQUEST_DEBUG').log({
|
|
34
|
+
exception,
|
|
35
|
+
errorId,
|
|
36
|
+
...(exception.overrides.userId ? { userId: exception.overrides.userId } : {}),
|
|
37
|
+
});
|
|
38
|
+
if (IntegrationExceptionFilter_1.shouldLogException(exception)) {
|
|
39
|
+
const captureContext = {
|
|
40
|
+
tags: {
|
|
41
|
+
errorId: errorId,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
if (exception.error && typeof exception.error === 'object') {
|
|
45
|
+
captureContext.contexts = {
|
|
46
|
+
error: exception.error,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
(0, node_1.captureException)(exception.error, captureContext);
|
|
50
|
+
errorCardOptions.errorId = errorId;
|
|
51
|
+
}
|
|
52
|
+
if (IntegrationExceptionFilter_1.shouldShowRetryAction(exception)) {
|
|
53
|
+
errorCardOptions.retryRequest = {
|
|
54
|
+
retryAction: (_a = exception.overrides.retryAction) !== null && _a !== void 0 ? _a : request.action,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (exception.overrides.showErrorMessageToUser) {
|
|
58
|
+
errorCardOptions.errorMessage = exception.message;
|
|
59
|
+
}
|
|
60
|
+
if (exception.overrides.errorMessage) {
|
|
61
|
+
errorCardOptions.errorMessage = exception.overrides.errorMessage;
|
|
62
|
+
}
|
|
63
|
+
const errorCard = this.errorCardService.errorCard(request, errorCardOptions);
|
|
64
|
+
response.status(exception.getStatus()).json({ card: errorCard });
|
|
65
|
+
}
|
|
66
|
+
static shouldLogException(exception) {
|
|
67
|
+
var _a;
|
|
68
|
+
return (_a = exception.overrides.logException) !== null && _a !== void 0 ? _a : exception.getStatus() >= 500;
|
|
69
|
+
}
|
|
70
|
+
static shouldShowRetryAction(exception) {
|
|
71
|
+
if (exception.overrides.retryAction != null)
|
|
72
|
+
return true;
|
|
73
|
+
if (exception.overrides.showRetry != null)
|
|
74
|
+
return exception.overrides.showRetry;
|
|
75
|
+
return exception.getStatus() < 400 || exception.getStatus() >= 500;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
exports.IntegrationExceptionFilter = IntegrationExceptionFilter;
|
|
79
|
+
exports.IntegrationExceptionFilter = IntegrationExceptionFilter = IntegrationExceptionFilter_1 = __decorate([
|
|
80
|
+
(0, common_1.Catch)(exceptions_1.IntegrationException),
|
|
81
|
+
__metadata("design:paramtypes", [errorCard_service_1.ErrorCardService])
|
|
82
|
+
], IntegrationExceptionFilter);
|
|
83
|
+
//# sourceMappingURL=integration-exception.filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-exception.filter.js","sourceRoot":"","sources":["../../src/filters/integration-exception.filter.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import type { Observable } from 'rxjs';
|
|
3
|
+
export declare class ExtensionVerificationGuard implements CanActivate {
|
|
4
|
+
private readonly logger;
|
|
5
|
+
canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
var ExtensionVerificationGuard_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ExtensionVerificationGuard = void 0;
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const crypto_js_1 = __importDefault(require("crypto-js"));
|
|
16
|
+
const configurationBase_1 = require("../config/configurationBase");
|
|
17
|
+
const utils_1 = require("../utils");
|
|
18
|
+
const header_utils_1 = require("../utils/header-utils");
|
|
19
|
+
let ExtensionVerificationGuard = ExtensionVerificationGuard_1 = class ExtensionVerificationGuard {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.logger = new utils_1.Logger(ExtensionVerificationGuard_1.name, 'REQUEST_DEBUG');
|
|
22
|
+
}
|
|
23
|
+
canActivate(context) {
|
|
24
|
+
const request = context.switchToHttp().getRequest();
|
|
25
|
+
const headers = request.headers;
|
|
26
|
+
const buffer = request.rawBody;
|
|
27
|
+
if (!buffer) {
|
|
28
|
+
this.logger.log('!buffer -> ExtensionVerificationGuard returns false');
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
this.logger.log({ headers, buffer: buffer.toString('utf-8') });
|
|
32
|
+
const hashedHeader = (0, header_utils_1.getHashedHeader)(headers);
|
|
33
|
+
if (!hashedHeader) {
|
|
34
|
+
this.logger.log('!hashedHeader -> ExtensionVerificationGuard returns false');
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
const { extensionVerificationTokens } = (0, configurationBase_1.getBaseConfiguration)();
|
|
38
|
+
this.logger.log('Tokens from config:', extensionVerificationTokens);
|
|
39
|
+
const success = extensionVerificationTokens.some((token) => {
|
|
40
|
+
const hashedRequest = crypto_js_1.default.HmacSHA256(buffer.toString('utf-8'), token.trim()).toString(crypto_js_1.default.enc.Base64);
|
|
41
|
+
this.logger.log({
|
|
42
|
+
hashedHeader,
|
|
43
|
+
hashedRequest,
|
|
44
|
+
'ExtensionVerificationGuard result:': hashedHeader === hashedRequest,
|
|
45
|
+
});
|
|
46
|
+
return hashedHeader === hashedRequest;
|
|
47
|
+
});
|
|
48
|
+
return success;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.ExtensionVerificationGuard = ExtensionVerificationGuard;
|
|
52
|
+
exports.ExtensionVerificationGuard = ExtensionVerificationGuard = ExtensionVerificationGuard_1 = __decorate([
|
|
53
|
+
(0, common_1.Injectable)()
|
|
54
|
+
], ExtensionVerificationGuard);
|
|
55
|
+
//# sourceMappingURL=extensionVerification.guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensionVerification.guard.js","sourceRoot":"","sources":["../../src/guards/extensionVerification.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA0E;AAC1E,0DAAgC;AAGhC,mEAAkE;AAClE,oCAAiC;AACjC,wDAAuD;AAGhD,IAAM,0BAA0B,kCAAhC,MAAM,0BAA0B;IAAhC;QACc,WAAM,GAAG,IAAI,cAAM,CAAC,4BAA0B,CAAC,IAAI,EAAE,eAAe,CAAC,CAAA;IAyC1F,CAAC;IAvCG,WAAW,CAAC,OAAyB;QACjC,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAA8B,CAAA;QAC/E,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;QAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAA;QAE9B,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAA;YACtE,OAAO,KAAK,CAAA;QAChB,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAC9D,MAAM,YAAY,GAAG,IAAA,8BAAe,EAAC,OAAO,CAAC,CAAA;QAC7C,IAAI,CAAC,YAAY,EAAE,CAAC;YAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAA;YAC5E,OAAO,KAAK,CAAA;QAChB,CAAC;QAED,MAAM,EAAE,2BAA2B,EAAE,GAAG,IAAA,wCAAoB,GAAE,CAAA;QAC9D,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE,2BAA2B,CAAC,CAAA;QAEnE,MAAM,OAAO,GAAG,2BAA2B,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;YACvD,MAAM,aAAa,GAAG,mBAAQ,CAAC,UAAU,CACrC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAGxB,KAAK,CAAC,IAAI,EAAE,CACf,CAAC,QAAQ,CAAC,mBAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;YAE/B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;gBACZ,YAAY;gBACZ,aAAa;gBACb,oCAAoC,EAAE,YAAY,KAAK,aAAa;aACvE,CAAC,CAAA;YAEF,OAAO,YAAY,KAAK,aAAa,CAAA;QACzC,CAAC,CAAC,CAAA;QAEF,OAAO,OAAO,CAAA;IAClB,CAAC;CACJ,CAAA;AA1CY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;GACA,0BAA0B,CA0CtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './extensionVerification.guard';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./extensionVerification.guard"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/guards/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA6C"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './analytics/events';
|
|
2
|
+
export * from './buffer';
|
|
3
|
+
export * from './config/configurationBase';
|
|
4
|
+
export * from './constants';
|
|
5
|
+
export * from './controllers';
|
|
6
|
+
export * from './decorators';
|
|
7
|
+
export * from './entities';
|
|
8
|
+
export * from './exceptions';
|
|
9
|
+
export * from './guards';
|
|
10
|
+
export * from './logging';
|
|
11
|
+
export * from './middleware';
|
|
12
|
+
export * from './modules';
|
|
13
|
+
export * from './server';
|
|
14
|
+
export * from './services';
|
|
15
|
+
export * from './types';
|
|
16
|
+
export * from './ui';
|
|
17
|
+
export * from './utils';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./analytics/events"), exports);
|
|
18
|
+
__exportStar(require("./buffer"), exports);
|
|
19
|
+
__exportStar(require("./config/configurationBase"), exports);
|
|
20
|
+
__exportStar(require("./constants"), exports);
|
|
21
|
+
__exportStar(require("./controllers"), exports);
|
|
22
|
+
__exportStar(require("./decorators"), exports);
|
|
23
|
+
__exportStar(require("./entities"), exports);
|
|
24
|
+
__exportStar(require("./exceptions"), exports);
|
|
25
|
+
__exportStar(require("./guards"), exports);
|
|
26
|
+
__exportStar(require("./logging"), exports);
|
|
27
|
+
__exportStar(require("./middleware"), exports);
|
|
28
|
+
__exportStar(require("./modules"), exports);
|
|
29
|
+
__exportStar(require("./server"), exports);
|
|
30
|
+
__exportStar(require("./services"), exports);
|
|
31
|
+
__exportStar(require("./types"), exports);
|
|
32
|
+
__exportStar(require("./ui"), exports);
|
|
33
|
+
__exportStar(require("./utils"), exports);
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,2CAAwB;AACxB,6DAA0C;AAC1C,8CAA2B;AAC3B,gDAA6B;AAC7B,+CAA4B;AAC5B,6CAA0B;AAC1B,+CAA4B;AAC5B,2CAAwB;AACxB,4CAAyB;AACzB,+CAA4B;AAC5B,4CAAyB;AACzB,2CAAwB;AACxB,6CAA0B;AAC1B,0CAAuB;AACvB,uCAAoB;AACpB,0CAAuB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
|
|
2
|
+
import type { Observable } from 'rxjs';
|
|
3
|
+
export declare class SentryInterceptor implements NestInterceptor {
|
|
4
|
+
intercept(_context: ExecutionContext, next: CallHandler): Observable<unknown>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 SentryInterceptor_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.SentryInterceptor = void 0;
|
|
11
|
+
const common_1 = require("@nestjs/common");
|
|
12
|
+
const node_1 = require("@sentry/node");
|
|
13
|
+
const operators_1 = require("rxjs/operators");
|
|
14
|
+
const exceptions_1 = require("../exceptions");
|
|
15
|
+
const utils_1 = require("../utils");
|
|
16
|
+
let SentryInterceptor = SentryInterceptor_1 = class SentryInterceptor {
|
|
17
|
+
intercept(_context, next) {
|
|
18
|
+
return next.handle().pipe((0, operators_1.tap)(null, (exception) => {
|
|
19
|
+
new utils_1.Logger(SentryInterceptor_1.name, 'REQUEST_DEBUG').log({ exception });
|
|
20
|
+
if (!(exception instanceof exceptions_1.IntegrationException)) {
|
|
21
|
+
(0, node_1.captureException)(exception);
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.SentryInterceptor = SentryInterceptor;
|
|
27
|
+
exports.SentryInterceptor = SentryInterceptor = SentryInterceptor_1 = __decorate([
|
|
28
|
+
(0, common_1.Injectable)()
|
|
29
|
+
], SentryInterceptor);
|
|
30
|
+
//# sourceMappingURL=sentry.interceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry.interceptor.js","sourceRoot":"","sources":["../../src/interceptors/sentry.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA2F;AAC3F,uCAA+C;AAE/C,8CAAoC;AACpC,8CAAoD;AACpD,oCAAiC;AAG1B,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAC1B,SAAS,CAAC,QAA0B,EAAE,IAAiB;QACnD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CACrB,IAAA,eAAG,EAAC,IAAI,EAAE,CAAC,SAAS,EAAE,EAAE;YAEpB,IAAI,cAAM,CAAC,mBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,CAAA;YAGtE,IAAI,CAAC,CAAC,SAAS,YAAY,iCAAoB,CAAC,EAAE,CAAC;gBAC/C,IAAA,uBAAgB,EAAC,SAAS,CAAC,CAAA;YAC/B,CAAC;QACL,CAAC,CAAC,CACL,CAAA;IACL,CAAC;CACJ,CAAA;AAdY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAc7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './json.logger';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./json.logger"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/logging/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LoggerService } from '@nestjs/common';
|
|
2
|
+
export declare class JsonLogger implements LoggerService {
|
|
3
|
+
log(message: unknown, ...optionalParams: unknown[]): void;
|
|
4
|
+
error(message: unknown, ...optionalParams: unknown[]): void;
|
|
5
|
+
warn(message: unknown, ...optionalParams: unknown[]): void;
|
|
6
|
+
private internalLog;
|
|
7
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JsonLogger = void 0;
|
|
4
|
+
class JsonLogger {
|
|
5
|
+
log(message, ...optionalParams) {
|
|
6
|
+
this.internalLog('log', message, optionalParams);
|
|
7
|
+
}
|
|
8
|
+
error(message, ...optionalParams) {
|
|
9
|
+
this.internalLog('error', message, optionalParams);
|
|
10
|
+
}
|
|
11
|
+
warn(message, ...optionalParams) {
|
|
12
|
+
this.internalLog('warn', message, optionalParams);
|
|
13
|
+
}
|
|
14
|
+
internalLog(logLevel, message, ...optionalParams) {
|
|
15
|
+
console.log(JSON.stringify({
|
|
16
|
+
logLevel,
|
|
17
|
+
message,
|
|
18
|
+
optionalParams,
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.JsonLogger = JsonLogger;
|
|
23
|
+
//# sourceMappingURL=json.logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.logger.js","sourceRoot":"","sources":["../../src/logging/json.logger.ts"],"names":[],"mappings":";;;AAIA,MAAa,UAAU;IACnB,GAAG,CAAC,OAAgB,EAAE,GAAG,cAAyB;QAC9C,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;IACpD,CAAC;IAED,KAAK,CAAC,OAAgB,EAAE,GAAG,cAAyB;QAChD,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;IACtD,CAAC;IAED,IAAI,CAAC,OAAgB,EAAE,GAAG,cAAyB;QAC/C,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAA;IACrD,CAAC;IAEO,WAAW,CAAC,QAAkB,EAAE,OAAgB,EAAE,GAAG,cAAyB;QAElF,OAAO,CAAC,GAAG,CACP,IAAI,CAAC,SAAS,CAAC;YACX,QAAQ;YACR,OAAO;YACP,cAAc;SACjB,CAAC,CACL,CAAA;IACL,CAAC;CACJ;AAvBD,gCAuBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './workflow-initial-action.middleware';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./workflow-initial-action.middleware"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uEAAoD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { NestMiddleware } from '@nestjs/common';
|
|
2
|
+
import type { Request, Response } from 'express';
|
|
3
|
+
import { RequestHeadersService } from '../services';
|
|
4
|
+
export declare class RequestHeaderMiddleware implements NestMiddleware {
|
|
5
|
+
private readonly requestHeaderService;
|
|
6
|
+
constructor(requestHeaderService: RequestHeadersService);
|
|
7
|
+
use(req: Request, _res: Response, next: () => void): void;
|
|
8
|
+
}
|