@bondsports/types 2.4.84-a-3 → 2.4.84-a-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/terminal/dto/terminal-actions.dto.d.ts +2 -2
- package/dist/types/terminal/dto/terminal-readers.dto.d.ts +1 -1
- package/dist/types/terminal/types/classes/terminal-reader.classes.d.ts +1 -1
- package/dist/types/terminal/types/consts/index.d.ts +4 -0
- package/dist/types/terminal/types/consts/index.js +21 -0
- package/dist/types/terminal/types/consts/index.js.map +1 -0
- package/dist/types/terminal/types/consts/terminal-action.consts.d.ts +7 -0
- package/dist/types/terminal/types/consts/terminal-action.consts.js +11 -0
- package/dist/types/terminal/types/consts/terminal-action.consts.js.map +1 -0
- package/dist/types/terminal/types/consts/terminal-events.consts.js.map +1 -0
- package/dist/types/terminal/types/consts/terminal-readers.consts.d.ts +1 -0
- package/dist/types/terminal/types/consts/terminal-readers.consts.js +6 -0
- package/dist/types/terminal/types/consts/terminal-readers.consts.js.map +1 -0
- package/dist/types/terminal/types/{terminal-webhook.consts.js → consts/terminal-webhook.consts.js} +1 -1
- package/dist/types/terminal/types/consts/terminal-webhook.consts.js.map +1 -0
- package/dist/types/terminal/types/enums/index.d.ts +3 -0
- package/dist/types/terminal/types/enums/index.js +20 -0
- package/dist/types/terminal/types/enums/index.js.map +1 -0
- package/dist/types/terminal/types/enums/terminal-action.enums.d.ts +24 -0
- package/dist/types/terminal/types/enums/terminal-action.enums.js +33 -0
- package/dist/types/terminal/types/enums/terminal-action.enums.js.map +1 -0
- package/dist/types/terminal/types/{terminal-readers.enums.d.ts → enums/terminal-readers.enums.d.ts} +0 -1
- package/dist/types/terminal/types/{terminal-readers.enums.js → enums/terminal-readers.enums.js} +1 -2
- package/dist/types/terminal/types/enums/terminal-readers.enums.js.map +1 -0
- package/dist/types/terminal/types/enums/terminal-webhook.enums.js.map +1 -0
- package/dist/types/terminal/types/index.d.ts +3 -8
- package/dist/types/terminal/types/index.js +3 -8
- package/dist/types/terminal/types/index.js.map +1 -1
- package/dist/types/terminal/types/interfaces/index.d.ts +3 -0
- package/dist/types/terminal/types/interfaces/index.js +20 -0
- package/dist/types/terminal/types/interfaces/index.js.map +1 -0
- package/dist/types/terminal/types/{terminal-action-service.types.d.ts → interfaces/terminal-action-service.interfaces.d.ts} +28 -4
- package/dist/types/terminal/types/interfaces/terminal-action-service.interfaces.js +3 -0
- package/dist/types/terminal/types/interfaces/terminal-action-service.interfaces.js.map +1 -0
- package/dist/types/terminal/types/interfaces/terminal-action.interfaces.d.ts +65 -0
- package/dist/types/terminal/types/{terminal-webhook.types.js → interfaces/terminal-action.interfaces.js} +1 -1
- package/dist/types/terminal/types/interfaces/terminal-action.interfaces.js.map +1 -0
- package/dist/types/terminal/types/{terminal-webhook.types.d.ts → interfaces/terminal-webhook.interfaces.d.ts} +3 -3
- package/dist/types/terminal/types/{terminal-action-service.types.js → interfaces/terminal-webhook.interfaces.js} +1 -1
- package/dist/types/terminal/types/interfaces/terminal-webhook.interfaces.js.map +1 -0
- package/package.json +1 -1
- package/dist/types/terminal/types/terminal-action-service.types.js.map +0 -1
- package/dist/types/terminal/types/terminal-action.enums.d.ts +0 -9
- package/dist/types/terminal/types/terminal-action.enums.js +0 -15
- package/dist/types/terminal/types/terminal-action.enums.js.map +0 -1
- package/dist/types/terminal/types/terminal-action.types.d.ts +0 -73
- package/dist/types/terminal/types/terminal-action.types.js +0 -55
- package/dist/types/terminal/types/terminal-action.types.js.map +0 -1
- package/dist/types/terminal/types/terminal-events.consts.js.map +0 -1
- package/dist/types/terminal/types/terminal-readers.enums.js.map +0 -1
- package/dist/types/terminal/types/terminal-webhook.consts.js.map +0 -1
- package/dist/types/terminal/types/terminal-webhook.enums.js.map +0 -1
- package/dist/types/terminal/types/terminal-webhook.types.js.map +0 -1
- /package/dist/types/terminal/types/{terminal-events.consts.d.ts → consts/terminal-events.consts.d.ts} +0 -0
- /package/dist/types/terminal/types/{terminal-events.consts.js → consts/terminal-events.consts.js} +0 -0
- /package/dist/types/terminal/types/{terminal-webhook.consts.d.ts → consts/terminal-webhook.consts.d.ts} +0 -0
- /package/dist/types/terminal/types/{terminal-webhook.enums.d.ts → enums/terminal-webhook.enums.d.ts} +0 -0
- /package/dist/types/terminal/types/{terminal-webhook.enums.js → enums/terminal-webhook.enums.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SaveCardTerminalInputDto } from '../../dto/userPaymentMethod.dto';
|
|
2
2
|
import { SetupIntentDto } from '../../payment/dto/payment.dto';
|
|
3
3
|
import { PlatformsEnum } from '../../services/enums.service';
|
|
4
|
-
import { TerminalActionCancelRequestReasonEnum } from '../types/terminal-action.enums';
|
|
5
|
-
import { TerminalReaderActionStatusEnum, TerminalReaderActionTypeEnum } from '../types/terminal-readers.enums';
|
|
4
|
+
import { TerminalActionCancelRequestReasonEnum } from '../types/enums/terminal-action.enums';
|
|
5
|
+
import { TerminalReaderActionStatusEnum, TerminalReaderActionTypeEnum } from '../types/enums/terminal-readers.enums';
|
|
6
6
|
import { TerminalPresentPaymentMethodTypeEnum } from './terminal-actions.enums';
|
|
7
7
|
export declare class TerminalPaymentIntentDto {
|
|
8
8
|
amount: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ByOrganizationIdDto } from '../../organization/dto/organization.dto';
|
|
2
|
-
import { TerminalReaderActionStatusEnum, TerminalReaderActionTypeEnum, TerminalReaderDeviceTypeEnum, TerminalReaderStatusEnum } from '../types/terminal-readers.enums';
|
|
2
|
+
import { TerminalReaderActionStatusEnum, TerminalReaderActionTypeEnum, TerminalReaderDeviceTypeEnum, TerminalReaderStatusEnum } from '../types/enums/terminal-readers.enums';
|
|
3
3
|
export declare class GetTerminalReadersQueryDto {
|
|
4
4
|
locationId: string;
|
|
5
5
|
status?: TerminalReaderStatusEnum;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TerminalReaderActionStatusEnum, TerminalReaderActionTypeEnum, TerminalReaderStatusEnum } from '../terminal-readers.enums';
|
|
1
|
+
import { TerminalReaderActionStatusEnum, TerminalReaderActionTypeEnum, TerminalReaderStatusEnum } from '../enums/terminal-readers.enums';
|
|
2
2
|
export declare class StripeTerminalReaderActionModel {
|
|
3
3
|
id?: string;
|
|
4
4
|
type?: TerminalReaderActionTypeEnum;
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./terminal-action.consts"), exports);
|
|
18
|
+
__exportStar(require("./terminal-events.consts"), exports);
|
|
19
|
+
__exportStar(require("./terminal-readers.consts"), exports);
|
|
20
|
+
__exportStar(require("./terminal-webhook.consts"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/consts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,2DAAyC;AACzC,4DAA0C;AAC1C,4DAA0C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const ACTIVE_ACTION_TTL_SECONDS = 300;
|
|
2
|
+
export declare const GHOST_CANCEL_TTL_SECONDS = 300;
|
|
3
|
+
export declare const GHOST_CANCEL_RETRY_COOLDOWN_MS = 30000;
|
|
4
|
+
export declare const LOCK_TTL_MS = 30000;
|
|
5
|
+
export declare const STRIPE_TERMINAL_READER_BUSY_CODE = "terminal_reader_busy";
|
|
6
|
+
export declare const STRIPE_TERMINAL_READER_OFFLINE_CODE = "terminal_reader_offline";
|
|
7
|
+
export declare const STRIPE_TERMINAL_READER_TIMEOUT_CODE = "terminal_reader_timeout";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STRIPE_TERMINAL_READER_TIMEOUT_CODE = exports.STRIPE_TERMINAL_READER_OFFLINE_CODE = exports.STRIPE_TERMINAL_READER_BUSY_CODE = exports.LOCK_TTL_MS = exports.GHOST_CANCEL_RETRY_COOLDOWN_MS = exports.GHOST_CANCEL_TTL_SECONDS = exports.ACTIVE_ACTION_TTL_SECONDS = void 0;
|
|
4
|
+
exports.ACTIVE_ACTION_TTL_SECONDS = 300;
|
|
5
|
+
exports.GHOST_CANCEL_TTL_SECONDS = 300;
|
|
6
|
+
exports.GHOST_CANCEL_RETRY_COOLDOWN_MS = 30000;
|
|
7
|
+
exports.LOCK_TTL_MS = 30000;
|
|
8
|
+
exports.STRIPE_TERMINAL_READER_BUSY_CODE = 'terminal_reader_busy';
|
|
9
|
+
exports.STRIPE_TERMINAL_READER_OFFLINE_CODE = 'terminal_reader_offline';
|
|
10
|
+
exports.STRIPE_TERMINAL_READER_TIMEOUT_CODE = 'terminal_reader_timeout';
|
|
11
|
+
//# sourceMappingURL=terminal-action.consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-action.consts.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/consts/terminal-action.consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,yBAAyB,GAAG,GAAG,CAAC;AAEhC,QAAA,wBAAwB,GAAG,GAAG,CAAC;AAE/B,QAAA,8BAA8B,GAAG,KAAM,CAAC;AAExC,QAAA,WAAW,GAAG,KAAM,CAAC;AAErB,QAAA,gCAAgC,GAAG,sBAAsB,CAAC;AAE1D,QAAA,mCAAmC,GAAG,yBAAyB,CAAC;AAEhE,QAAA,mCAAmC,GAAG,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-events.consts.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/consts/terminal-events.consts.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,IAAI,CAAC;AAEpB,QAAA,0BAA0B,GAAG,KAAK,CAAC;AAEnC,QAAA,+BAA+B,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SIMULATED_TERMINAL_READER_DEVICE_TYPES_SET: Set<string>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SIMULATED_TERMINAL_READER_DEVICE_TYPES_SET = void 0;
|
|
4
|
+
const terminal_readers_enums_1 = require("../enums/terminal-readers.enums");
|
|
5
|
+
exports.SIMULATED_TERMINAL_READER_DEVICE_TYPES_SET = new Set(Object.values(terminal_readers_enums_1.SimulatedTerminalReaderDeviceTypeEnum));
|
|
6
|
+
//# sourceMappingURL=terminal-readers.consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-readers.consts.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/consts/terminal-readers.consts.ts"],"names":[],"mappings":";;;AAAA,4EAAwF;AAE3E,QAAA,0CAA0C,GAAG,IAAI,GAAG,CAChE,MAAM,CAAC,MAAM,CAAC,8DAAqC,CAAC,CACpD,CAAC"}
|
package/dist/types/terminal/types/{terminal-webhook.consts.js → consts/terminal-webhook.consts.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TERMINAL_WEBHOOK_ACTION_TYPES = exports.TERMINAL_WEBHOOK_IDEMPOTENCY_NAMESPACE = exports.CUSTOMER_CANCELED_FAILURE_CODE = exports.WEBHOOK_IDEMPOTENCY_TTL_SECONDS = void 0;
|
|
4
|
-
const terminal_webhook_enums_1 = require("
|
|
4
|
+
const terminal_webhook_enums_1 = require("../enums/terminal-webhook.enums");
|
|
5
5
|
const WEBHOOK_IDEMPOTENCY_TTL_HOURS = 24;
|
|
6
6
|
const SECONDS_PER_MINUTE = 60;
|
|
7
7
|
const MINUTES_PER_HOUR = 60;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-webhook.consts.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/consts/terminal-webhook.consts.ts"],"names":[],"mappings":";;;AAAA,4EAAgF;AAEhF,MAAM,6BAA6B,GAAG,EAAE,CAAC;AACzC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAElD,QAAA,+BAA+B,GAAG,6BAA6B,GAAG,gBAAgB,CAAC;AAEnF,QAAA,8BAA8B,GAAG,mBAAmB,CAAC;AAErD,QAAA,sCAAsC,GAAG,kBAAkB,CAAC;AAE5D,QAAA,6BAA6B,GAAwB,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,sDAA6B,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./terminal-action.enums"), exports);
|
|
18
|
+
__exportStar(require("./terminal-readers.enums"), exports);
|
|
19
|
+
__exportStar(require("./terminal-webhook.enums"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,2DAAyC;AACzC,2DAAyC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare enum TerminalActionCancelReasonEnum {
|
|
2
|
+
USER_CANCEL = "user_cancel",
|
|
3
|
+
TIMEOUT = "timeout",
|
|
4
|
+
OVERRIDE = "override"
|
|
5
|
+
}
|
|
6
|
+
export declare enum TerminalActionCancelRequestReasonEnum {
|
|
7
|
+
USER_CANCEL = "user_cancel",
|
|
8
|
+
TIMEOUT = "timeout"
|
|
9
|
+
}
|
|
10
|
+
export declare enum TerminalActionErrorCodeEnum {
|
|
11
|
+
TERMINAL_READER_BUSY = "TERMINAL_READER_BUSY",
|
|
12
|
+
TERMINAL_READER_OFFLINE = "TERMINAL_READER_OFFLINE",
|
|
13
|
+
TERMINAL_READER_TIMEOUT = "TERMINAL_READER_TIMEOUT",
|
|
14
|
+
TERMINAL_OVERRIDE_IN_PROGRESS = "TERMINAL_OVERRIDE_IN_PROGRESS",
|
|
15
|
+
TERMINAL_OVERRIDE_FAILED = "TERMINAL_OVERRIDE_FAILED"
|
|
16
|
+
}
|
|
17
|
+
export declare enum TerminalOverrideFailureReasonEnum {
|
|
18
|
+
AUTHORIZATION_IN_PROGRESS = "authorization_in_progress",
|
|
19
|
+
CANCEL_FAILED = "cancel_failed",
|
|
20
|
+
DISPATCH_FAILED = "dispatch_failed"
|
|
21
|
+
}
|
|
22
|
+
export declare enum TerminalReaderEventTypeEnum {
|
|
23
|
+
ACTION_CANCELED = "action_canceled"
|
|
24
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalReaderEventTypeEnum = exports.TerminalOverrideFailureReasonEnum = exports.TerminalActionErrorCodeEnum = exports.TerminalActionCancelRequestReasonEnum = exports.TerminalActionCancelReasonEnum = void 0;
|
|
4
|
+
var TerminalActionCancelReasonEnum;
|
|
5
|
+
(function (TerminalActionCancelReasonEnum) {
|
|
6
|
+
TerminalActionCancelReasonEnum["USER_CANCEL"] = "user_cancel";
|
|
7
|
+
TerminalActionCancelReasonEnum["TIMEOUT"] = "timeout";
|
|
8
|
+
TerminalActionCancelReasonEnum["OVERRIDE"] = "override";
|
|
9
|
+
})(TerminalActionCancelReasonEnum = exports.TerminalActionCancelReasonEnum || (exports.TerminalActionCancelReasonEnum = {}));
|
|
10
|
+
var TerminalActionCancelRequestReasonEnum;
|
|
11
|
+
(function (TerminalActionCancelRequestReasonEnum) {
|
|
12
|
+
TerminalActionCancelRequestReasonEnum["USER_CANCEL"] = "user_cancel";
|
|
13
|
+
TerminalActionCancelRequestReasonEnum["TIMEOUT"] = "timeout";
|
|
14
|
+
})(TerminalActionCancelRequestReasonEnum = exports.TerminalActionCancelRequestReasonEnum || (exports.TerminalActionCancelRequestReasonEnum = {}));
|
|
15
|
+
var TerminalActionErrorCodeEnum;
|
|
16
|
+
(function (TerminalActionErrorCodeEnum) {
|
|
17
|
+
TerminalActionErrorCodeEnum["TERMINAL_READER_BUSY"] = "TERMINAL_READER_BUSY";
|
|
18
|
+
TerminalActionErrorCodeEnum["TERMINAL_READER_OFFLINE"] = "TERMINAL_READER_OFFLINE";
|
|
19
|
+
TerminalActionErrorCodeEnum["TERMINAL_READER_TIMEOUT"] = "TERMINAL_READER_TIMEOUT";
|
|
20
|
+
TerminalActionErrorCodeEnum["TERMINAL_OVERRIDE_IN_PROGRESS"] = "TERMINAL_OVERRIDE_IN_PROGRESS";
|
|
21
|
+
TerminalActionErrorCodeEnum["TERMINAL_OVERRIDE_FAILED"] = "TERMINAL_OVERRIDE_FAILED";
|
|
22
|
+
})(TerminalActionErrorCodeEnum = exports.TerminalActionErrorCodeEnum || (exports.TerminalActionErrorCodeEnum = {}));
|
|
23
|
+
var TerminalOverrideFailureReasonEnum;
|
|
24
|
+
(function (TerminalOverrideFailureReasonEnum) {
|
|
25
|
+
TerminalOverrideFailureReasonEnum["AUTHORIZATION_IN_PROGRESS"] = "authorization_in_progress";
|
|
26
|
+
TerminalOverrideFailureReasonEnum["CANCEL_FAILED"] = "cancel_failed";
|
|
27
|
+
TerminalOverrideFailureReasonEnum["DISPATCH_FAILED"] = "dispatch_failed";
|
|
28
|
+
})(TerminalOverrideFailureReasonEnum = exports.TerminalOverrideFailureReasonEnum || (exports.TerminalOverrideFailureReasonEnum = {}));
|
|
29
|
+
var TerminalReaderEventTypeEnum;
|
|
30
|
+
(function (TerminalReaderEventTypeEnum) {
|
|
31
|
+
TerminalReaderEventTypeEnum["ACTION_CANCELED"] = "action_canceled";
|
|
32
|
+
})(TerminalReaderEventTypeEnum = exports.TerminalReaderEventTypeEnum || (exports.TerminalReaderEventTypeEnum = {}));
|
|
33
|
+
//# sourceMappingURL=terminal-action.enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-action.enums.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/enums/terminal-action.enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,8BAIX;AAJD,WAAY,8BAA8B;IACzC,6DAA2B,CAAA;IAC3B,qDAAmB,CAAA;IACnB,uDAAqB,CAAA;AACtB,CAAC,EAJW,8BAA8B,GAA9B,sCAA8B,KAA9B,sCAA8B,QAIzC;AAED,IAAY,qCAGX;AAHD,WAAY,qCAAqC;IAChD,oEAA2B,CAAA;IAC3B,4DAAmB,CAAA;AACpB,CAAC,EAHW,qCAAqC,GAArC,6CAAqC,KAArC,6CAAqC,QAGhD;AAED,IAAY,2BAMX;AAND,WAAY,2BAA2B;IACtC,4EAA6C,CAAA;IAC7C,kFAAmD,CAAA;IACnD,kFAAmD,CAAA;IACnD,8FAA+D,CAAA;IAC/D,oFAAqD,CAAA;AACtD,CAAC,EANW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAMtC;AAED,IAAY,iCAIX;AAJD,WAAY,iCAAiC;IAC5C,4FAAuD,CAAA;IACvD,oEAA+B,CAAA;IAC/B,wEAAmC,CAAA;AACpC,CAAC,EAJW,iCAAiC,GAAjC,yCAAiC,KAAjC,yCAAiC,QAI5C;AAED,IAAY,2BAEX;AAFD,WAAY,2BAA2B;IACtC,kEAAmC,CAAA;AACpC,CAAC,EAFW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAEtC"}
|
package/dist/types/terminal/types/{terminal-readers.enums.js → enums/terminal-readers.enums.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TerminalReaderActionTypeEnum = exports.TerminalReaderActionStatusEnum = exports.TerminalReaderStatusEnum = exports.SimulatedTerminalReaderDeviceTypeEnum = exports.TerminalReaderDeviceTypeEnum = void 0;
|
|
4
4
|
var TerminalReaderDeviceTypeEnum;
|
|
5
5
|
(function (TerminalReaderDeviceTypeEnum) {
|
|
6
6
|
TerminalReaderDeviceTypeEnum["BBPOS_WISEPAD3"] = "bbpos_wisepad3";
|
|
@@ -53,5 +53,4 @@ var TerminalReaderActionTypeEnum;
|
|
|
53
53
|
TerminalReaderActionTypeEnum["REFUND_PAYMENT"] = "refund_payment";
|
|
54
54
|
TerminalReaderActionTypeEnum["SET_READER_DISPLAY"] = "set_reader_display";
|
|
55
55
|
})(TerminalReaderActionTypeEnum = exports.TerminalReaderActionTypeEnum || (exports.TerminalReaderActionTypeEnum = {}));
|
|
56
|
-
exports.SIMULATED_TERMINAL_READER_DEVICE_TYPES_SET = new Set(Object.values(SimulatedTerminalReaderDeviceTypeEnum));
|
|
57
56
|
//# sourceMappingURL=terminal-readers.enums.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-readers.enums.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/enums/terminal-readers.enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,4BAoBX;AApBD,WAAY,4BAA4B;IACvC,iEAAiC,CAAA;IACjC,uDAAuB,CAAA;IACvB,2DAA2B,CAAA;IAC3B,mEAAmC,CAAA;IACnC,mEAAmC,CAAA;IACnC,+DAA+B,CAAA;IAC/B,2EAA2C,CAAA;IAC3C,+EAA+C,CAAA;IAC/C,2EAA2C,CAAA;IAC3C,2DAA2B,CAAA;IAC3B,iEAAiC,CAAA;IACjC,iEAAiC,CAAA;IACjC,+DAA+B,CAAA;IAC/B,+DAA+B,CAAA;IAC/B,+EAA+C,CAAA;IAC/C,qFAAqD,CAAA;IACrD,qFAAqD,CAAA;IACrD,mFAAmD,CAAA;IACnD,mFAAmD,CAAA;AACpD,CAAC,EApBW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAoBvC;AAED,IAAY,qCAQX;AARD,WAAY,qCAAqC;IAChD,oFAA2C,CAAA;IAC3C,wFAA+C,CAAA;IAC/C,wFAA+C,CAAA;IAC/C,8FAAqD,CAAA;IACrD,8FAAqD,CAAA;IACrD,4FAAmD,CAAA;IACnD,4FAAmD,CAAA;AACpD,CAAC,EARW,qCAAqC,GAArC,6CAAqC,KAArC,6CAAqC,QAQhD;AAED,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IACnC,+CAAmB,CAAA;IACnB,6CAAiB,CAAA;AAClB,CAAC,EAHW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAGnC;AAED,IAAY,8BAIX;AAJD,WAAY,8BAA8B;IACzC,mDAAiB,CAAA;IACjB,6DAA2B,CAAA;IAC3B,yDAAuB,CAAA;AACxB,CAAC,EAJW,8BAA8B,GAA9B,sCAA8B,KAA9B,sCAA8B,QAIzC;AAED,IAAY,4BAOX;AAPD,WAAY,4BAA4B;IACvC,iEAAiC,CAAA;IACjC,iFAAiD,CAAA;IACjD,6EAA6C,CAAA;IAC7C,iFAAiD,CAAA;IACjD,iEAAiC,CAAA;IACjC,yEAAyC,CAAA;AAC1C,CAAC,EAPW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAOvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-webhook.enums.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/enums/terminal-webhook.enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,4BAIX;AAJD,WAAY,4BAA4B;IACvC,qEAAqC,CAAA;IACrC,+DAA+B,CAAA;IAC/B,iEAAiC,CAAA;AAClC,CAAC,EAJW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAIvC;AAED,IAAY,6BAMX;AAND,WAAY,6BAA6B;IACxC,kFAAiD,CAAA;IACjD,8EAA6C,CAAA;IAC7C,kEAAiC,CAAA;IACjC,kEAAiC,CAAA;IACjC,0EAAyC,CAAA;AAC1C,CAAC,EANW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAMxC;AAED,IAAY,8BAEX;AAFD,WAAY,8BAA8B;IACzC,+DAA6B,CAAA;AAC9B,CAAC,EAFW,8BAA8B,GAA9B,sCAA8B,KAA9B,sCAA8B,QAEzC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
export * from './classes';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './terminal-events.consts';
|
|
6
|
-
export * from './terminal-readers.enums';
|
|
7
|
-
export * from './terminal-webhook.consts';
|
|
8
|
-
export * from './terminal-webhook.enums';
|
|
9
|
-
export * from './terminal-webhook.types';
|
|
2
|
+
export * from './consts';
|
|
3
|
+
export * from './enums';
|
|
4
|
+
export * from './interfaces';
|
|
@@ -15,12 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./classes"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./
|
|
21
|
-
__exportStar(require("./terminal-events.consts"), exports);
|
|
22
|
-
__exportStar(require("./terminal-readers.enums"), exports);
|
|
23
|
-
__exportStar(require("./terminal-webhook.consts"), exports);
|
|
24
|
-
__exportStar(require("./terminal-webhook.enums"), exports);
|
|
25
|
-
__exportStar(require("./terminal-webhook.types"), exports);
|
|
18
|
+
__exportStar(require("./consts"), exports);
|
|
19
|
+
__exportStar(require("./enums"), exports);
|
|
20
|
+
__exportStar(require("./interfaces"), exports);
|
|
26
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/terminal/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/terminal/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,+CAA6B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./terminal-action-service.interfaces"), exports);
|
|
18
|
+
__exportStar(require("./terminal-action.interfaces"), exports);
|
|
19
|
+
__exportStar(require("./terminal-webhook.interfaces"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uEAAqD;AACrD,+DAA6C;AAC7C,gEAA8C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Stripe from 'stripe';
|
|
2
|
-
import { TerminalActionResponseDto } from '
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { TerminalActionResponseDto } from '../../dto/terminal-actions.dto';
|
|
3
|
+
import { TerminalReaderActionTypeEnum, TerminalReaderStatusEnum } from '../enums/terminal-readers.enums';
|
|
4
|
+
import { ITerminalActionInitiatedBy, ITerminalActiveAction, ITerminalGhostCancel } from './terminal-action.interfaces';
|
|
5
5
|
export type StripeReaderAction = (Stripe.Terminal.Reader.Action & {
|
|
6
6
|
id?: string;
|
|
7
7
|
}) | null;
|
|
@@ -12,8 +12,11 @@ export interface IBusyState {
|
|
|
12
12
|
type: TerminalReaderActionTypeEnum | null;
|
|
13
13
|
}
|
|
14
14
|
export interface IBusyStateSnapshot {
|
|
15
|
+
liveActionTargetId: string | null;
|
|
15
16
|
busyState: IBusyState;
|
|
17
|
+
ghostCancel: ITerminalGhostCancel | null;
|
|
16
18
|
previous: ITerminalActiveAction | null;
|
|
19
|
+
readerStatus: TerminalReaderStatusEnum | null;
|
|
17
20
|
}
|
|
18
21
|
export interface ITriggerDecisionDispatch {
|
|
19
22
|
actionDispatchedLogMeta: {
|
|
@@ -25,19 +28,40 @@ export interface ITriggerDecisionDispatch {
|
|
|
25
28
|
export interface ITriggerDecisionRejectBusy {
|
|
26
29
|
busyState: IBusyState;
|
|
27
30
|
kind: 'reject_busy';
|
|
31
|
+
staleGhostCancelMarker: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface ITriggerDecisionRejectOffline {
|
|
34
|
+
kind: 'reject_offline';
|
|
28
35
|
}
|
|
29
36
|
export interface ITriggerDecisionForceOverride {
|
|
30
37
|
forceParams: IForceActionTriggerParams;
|
|
31
38
|
kind: 'force_override';
|
|
32
39
|
}
|
|
33
|
-
export
|
|
40
|
+
export interface ITriggerDecisionReclaimGhostAction {
|
|
41
|
+
forceParams: IForceActionTriggerParams;
|
|
42
|
+
kind: 'reclaim_ghost_action';
|
|
43
|
+
}
|
|
44
|
+
export type TTriggerDecision = ITriggerDecisionDispatch | ITriggerDecisionRejectBusy | ITriggerDecisionRejectOffline | ITriggerDecisionForceOverride | ITriggerDecisionReclaimGhostAction;
|
|
45
|
+
export interface IActionRejectionLogMeta {
|
|
46
|
+
organizationId: number;
|
|
47
|
+
readerId: string;
|
|
48
|
+
actionType: TerminalReaderActionTypeEnum;
|
|
49
|
+
ghostCancelAgeMs: number | null;
|
|
50
|
+
ghostCancelStripeCode: string | null;
|
|
51
|
+
hasGhostCancelMarker: boolean;
|
|
52
|
+
hasRegistryEntry: boolean;
|
|
53
|
+
latencyMs: number;
|
|
54
|
+
readerStatus: TerminalReaderStatusEnum | null;
|
|
55
|
+
}
|
|
34
56
|
export interface IActionLogTemplates {
|
|
35
57
|
actionDispatched: string;
|
|
36
58
|
dispatchContention: string;
|
|
37
59
|
dispatchFollowupFailed: string;
|
|
38
60
|
forceOverrideInFlightAction: string;
|
|
61
|
+
ghostActionReclaimed: string;
|
|
39
62
|
overrideContention: string;
|
|
40
63
|
readerBusyRejected: string;
|
|
64
|
+
readerOfflineRejected: string;
|
|
41
65
|
}
|
|
42
66
|
export interface IExecuteActionTriggerParams {
|
|
43
67
|
organizationId: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-action-service.interfaces.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/interfaces/terminal-action-service.interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { TerminalActionCancelReasonEnum, TerminalReaderEventTypeEnum } from '../enums/terminal-action.enums';
|
|
2
|
+
import { TerminalReaderActionTypeEnum } from '../enums/terminal-readers.enums';
|
|
3
|
+
/**
|
|
4
|
+
* Entry stored in the Redis action registry (`terminal:reader:<id>:active`) when an
|
|
5
|
+
* action is successfully dispatched. Cleared by the webhook handler on
|
|
6
|
+
* `action_succeeded` / `action_failed`, and by this service on synthetic `action_canceled`.
|
|
7
|
+
*/
|
|
8
|
+
export interface ITerminalActiveAction {
|
|
9
|
+
organizationId: number;
|
|
10
|
+
actionId: string | null;
|
|
11
|
+
userId: number | null;
|
|
12
|
+
displayName: string | null;
|
|
13
|
+
startedAt: number;
|
|
14
|
+
type: TerminalReaderActionTypeEnum;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Identity of a reader action whose cancel Stripe did not confirm, leaving it a ghost.
|
|
18
|
+
* Stripe's `Terminal.Reader.Action` has no id, so the action is keyed by the object it targets.
|
|
19
|
+
*/
|
|
20
|
+
export interface ITerminalPendingCancel {
|
|
21
|
+
bondActionId: string | null;
|
|
22
|
+
targetId: string;
|
|
23
|
+
actionType: TerminalReaderActionTypeEnum | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Short-lived Redis marker recording that a cancel or dispatch failed and may have left a ghost
|
|
27
|
+
* action running on the reader. Written whenever Stripe returns `terminal_reader_offline` /
|
|
28
|
+
* `terminal_reader_timeout`, and refreshed with whatever code a failed ghost-reclaim cancel returned.
|
|
29
|
+
*
|
|
30
|
+
* `stripeCode` therefore says why the cancel failed, not that the reader is unreachable: only the
|
|
31
|
+
* offline and timeout codes prove that, which is why the offline reclassification is gated on
|
|
32
|
+
* `isReaderUnreachableStripeCode` rather than on the marker's mere presence.
|
|
33
|
+
*
|
|
34
|
+
* The TTL only has to outlive Stripe's heartbeat lag: once the heartbeat itself reports `offline`,
|
|
35
|
+
* `readerStatus` carries the reclassification and the marker is redundant. Every failed cancel
|
|
36
|
+
* refreshes it, so a reader that stays unreachable keeps a live marker.
|
|
37
|
+
*/
|
|
38
|
+
export interface ITerminalGhostCancel {
|
|
39
|
+
at: number;
|
|
40
|
+
lastCancelAttemptAt: number;
|
|
41
|
+
pendingCancel: ITerminalPendingCancel | null;
|
|
42
|
+
stripeCode: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Identity of the user who initiated the in-flight action, surfaced to the frontend so it can
|
|
46
|
+
* render the Take-over modal. Null when the originator is unknown (e.g. live Stripe-state fallback).
|
|
47
|
+
*/
|
|
48
|
+
export interface ITerminalActionInitiatedBy {
|
|
49
|
+
userId: number | null;
|
|
50
|
+
displayName: string | null;
|
|
51
|
+
startedAt: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Synthetic `action_canceled` message published to the reader's Redis channel after a programmatic
|
|
55
|
+
* cancel (override or explicit cancel-action), since Stripe fires no webhook for programmatic cancels.
|
|
56
|
+
*/
|
|
57
|
+
export interface ITerminalSyntheticCancelMessage {
|
|
58
|
+
actionId: string | null;
|
|
59
|
+
readerId: string;
|
|
60
|
+
at: number;
|
|
61
|
+
canceledBy: {
|
|
62
|
+
reason: TerminalActionCancelReasonEnum;
|
|
63
|
+
};
|
|
64
|
+
type: TerminalReaderEventTypeEnum.ACTION_CANCELED;
|
|
65
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-action.interfaces.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/interfaces/terminal-action.interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { TerminalReaderActionStatusEnum } from '../enums/terminal-readers.enums';
|
|
2
|
+
import { TerminalReaderSseEventTypeEnum, TerminalWebhookActionTypeEnum, TerminalWebhookEventTypeEnum } from '../enums/terminal-webhook.enums';
|
|
3
|
+
import { ITerminalSyntheticCancelMessage } from './terminal-action.interfaces';
|
|
4
4
|
export interface ITerminalWebhookFailure {
|
|
5
5
|
failureCode: string | null;
|
|
6
6
|
failureMessage: string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-webhook.interfaces.js","sourceRoot":"","sources":["../../../../../src/types/terminal/types/interfaces/terminal-webhook.interfaces.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-action-service.types.js","sourceRoot":"","sources":["../../../../src/types/terminal/types/terminal-action-service.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TerminalActionCancelRequestReasonEnum = exports.TerminalActionCancelReasonEnum = void 0;
|
|
4
|
-
var TerminalActionCancelReasonEnum;
|
|
5
|
-
(function (TerminalActionCancelReasonEnum) {
|
|
6
|
-
TerminalActionCancelReasonEnum["USER_CANCEL"] = "user_cancel";
|
|
7
|
-
TerminalActionCancelReasonEnum["TIMEOUT"] = "timeout";
|
|
8
|
-
TerminalActionCancelReasonEnum["OVERRIDE"] = "override";
|
|
9
|
-
})(TerminalActionCancelReasonEnum = exports.TerminalActionCancelReasonEnum || (exports.TerminalActionCancelReasonEnum = {}));
|
|
10
|
-
var TerminalActionCancelRequestReasonEnum;
|
|
11
|
-
(function (TerminalActionCancelRequestReasonEnum) {
|
|
12
|
-
TerminalActionCancelRequestReasonEnum["USER_CANCEL"] = "user_cancel";
|
|
13
|
-
TerminalActionCancelRequestReasonEnum["TIMEOUT"] = "timeout";
|
|
14
|
-
})(TerminalActionCancelRequestReasonEnum = exports.TerminalActionCancelRequestReasonEnum || (exports.TerminalActionCancelRequestReasonEnum = {}));
|
|
15
|
-
//# sourceMappingURL=terminal-action.enums.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-action.enums.js","sourceRoot":"","sources":["../../../../src/types/terminal/types/terminal-action.enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,8BAIX;AAJD,WAAY,8BAA8B;IACzC,6DAA2B,CAAA;IAC3B,qDAAmB,CAAA;IACnB,uDAAqB,CAAA;AACtB,CAAC,EAJW,8BAA8B,GAA9B,sCAA8B,KAA9B,sCAA8B,QAIzC;AAED,IAAY,qCAGX;AAHD,WAAY,qCAAqC;IAChD,oEAA2B,CAAA;IAC3B,4DAAmB,CAAA;AACpB,CAAC,EAHW,qCAAqC,GAArC,6CAAqC,KAArC,6CAAqC,QAGhD"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { TerminalActionCancelReasonEnum } from './terminal-action.enums';
|
|
2
|
-
import { TerminalReaderActionTypeEnum } from './terminal-readers.enums';
|
|
3
|
-
export declare const ACTIVE_ACTION_TTL_SECONDS = 300;
|
|
4
|
-
export declare const LOCK_TTL_MS = 30000;
|
|
5
|
-
export declare enum TerminalActionErrorCodeEnum {
|
|
6
|
-
TERMINAL_READER_BUSY = "TERMINAL_READER_BUSY",
|
|
7
|
-
TERMINAL_READER_OFFLINE = "TERMINAL_READER_OFFLINE",
|
|
8
|
-
TERMINAL_READER_TIMEOUT = "TERMINAL_READER_TIMEOUT",
|
|
9
|
-
TERMINAL_OVERRIDE_IN_PROGRESS = "TERMINAL_OVERRIDE_IN_PROGRESS",
|
|
10
|
-
TERMINAL_OVERRIDE_FAILED = "TERMINAL_OVERRIDE_FAILED"
|
|
11
|
-
}
|
|
12
|
-
export declare const STRIPE_TERMINAL_READER_BUSY_CODE = "terminal_reader_busy";
|
|
13
|
-
export declare const STRIPE_TERMINAL_READER_OFFLINE_CODE = "terminal_reader_offline";
|
|
14
|
-
export declare const STRIPE_TERMINAL_READER_TIMEOUT_CODE = "terminal_reader_timeout";
|
|
15
|
-
export declare enum TerminalOverrideFailureReasonEnum {
|
|
16
|
-
AUTHORIZATION_IN_PROGRESS = "authorization_in_progress",
|
|
17
|
-
CANCEL_FAILED = "cancel_failed",
|
|
18
|
-
DISPATCH_FAILED = "dispatch_failed"
|
|
19
|
-
}
|
|
20
|
-
export declare enum TerminalReaderEventTypeEnum {
|
|
21
|
-
ACTION_CANCELED = "action_canceled"
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Entry stored in the Redis action registry (`terminal:reader:<id>:active`) when an
|
|
25
|
-
* action is successfully dispatched. Cleared by the webhook handler on
|
|
26
|
-
* `action_succeeded` / `action_failed`, and by this service on synthetic `action_canceled`.
|
|
27
|
-
*/
|
|
28
|
-
export interface ITerminalActiveAction {
|
|
29
|
-
organizationId: number;
|
|
30
|
-
actionId: string | null;
|
|
31
|
-
userId: number | null;
|
|
32
|
-
displayName: string | null;
|
|
33
|
-
startedAt: number;
|
|
34
|
-
type: TerminalReaderActionTypeEnum;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Identity of the user who initiated the in-flight action, surfaced to the frontend so it can
|
|
38
|
-
* render the Take-over modal. Null when the originator is unknown (e.g. live Stripe-state fallback).
|
|
39
|
-
*/
|
|
40
|
-
export interface ITerminalActionInitiatedBy {
|
|
41
|
-
userId: number | null;
|
|
42
|
-
displayName: string | null;
|
|
43
|
-
startedAt: number;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Synthetic `action_canceled` message published to the reader's Redis channel after a programmatic
|
|
47
|
-
* cancel (override or explicit cancel-action), since Stripe fires no webhook for programmatic cancels.
|
|
48
|
-
*/
|
|
49
|
-
export interface ITerminalSyntheticCancelMessage {
|
|
50
|
-
actionId: string | null;
|
|
51
|
-
readerId: string;
|
|
52
|
-
at: number;
|
|
53
|
-
canceledBy: {
|
|
54
|
-
reason: TerminalActionCancelReasonEnum;
|
|
55
|
-
};
|
|
56
|
-
type: TerminalReaderEventTypeEnum.ACTION_CANCELED;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Builds the Redis key holding the active-action registry entry for a reader.
|
|
60
|
-
*/
|
|
61
|
-
export declare function buildActiveActionKey(readerId: string): string;
|
|
62
|
-
/**
|
|
63
|
-
* Builds the Redis pub/sub channel name carrying reader action events for a reader.
|
|
64
|
-
*/
|
|
65
|
-
export declare function buildReaderEventsChannel(readerId: string): string;
|
|
66
|
-
/**
|
|
67
|
-
* Builds the DistributedMutex resource name guarding override (cancel-then-dispatch) for a reader.
|
|
68
|
-
*/
|
|
69
|
-
export declare function buildOverrideLockResource(readerId: string): string;
|
|
70
|
-
/**
|
|
71
|
-
* Builds the DistributedMutex resource name guarding dispatch for a reader.
|
|
72
|
-
*/
|
|
73
|
-
export declare function buildDispatchLockResource(readerId: string): string;
|