project-cpu-mcp 0.10.0 → 0.12.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 +111 -35
- package/dist/api/authentication-required.error.d.ts +6 -0
- package/dist/api/authentication-required.error.d.ts.map +1 -0
- package/dist/api/authentication-required.error.js +9 -0
- package/dist/api/authentication-required.error.js.map +1 -0
- package/dist/api/client.d.ts +7 -5
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +29 -14
- package/dist/api/client.js.map +1 -1
- package/dist/api/constants.d.ts +2 -0
- package/dist/api/constants.d.ts.map +1 -1
- package/dist/api/constants.js +6 -0
- package/dist/api/constants.js.map +1 -1
- package/dist/api/types.d.ts +189 -220
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js +43 -29
- package/dist/api/types.js.map +1 -1
- package/dist/config/constants.d.ts +6 -2
- package/dist/config/constants.d.ts.map +1 -1
- package/dist/config/constants.js +6 -2
- package/dist/config/constants.js.map +1 -1
- package/dist/config/types.js +2 -2
- package/dist/config/types.js.map +1 -1
- package/dist/contracts/cell.abi.d.ts +26 -2
- package/dist/contracts/cell.abi.d.ts.map +1 -1
- package/dist/contracts/cell.abi.js +21 -2
- package/dist/contracts/cell.abi.js.map +1 -1
- package/dist/contracts/erc20.abi.d.ts.map +1 -1
- package/dist/contracts/erc20.abi.js +1 -2
- package/dist/contracts/erc20.abi.js.map +1 -1
- package/dist/contracts/trade.abi.d.ts +341 -0
- package/dist/contracts/trade.abi.d.ts.map +1 -1
- package/dist/contracts/trade.abi.js +163 -0
- package/dist/contracts/trade.abi.js.map +1 -1
- package/dist/contracts/trade.types.d.ts +14 -0
- package/dist/contracts/trade.types.d.ts.map +1 -0
- package/dist/contracts/trade.types.js +15 -0
- package/dist/contracts/trade.types.js.map +1 -0
- package/dist/contracts/transport.abi.d.ts +4 -0
- package/dist/contracts/transport.abi.d.ts.map +1 -1
- package/dist/contracts/transport.abi.js +1 -0
- package/dist/contracts/transport.abi.js.map +1 -1
- package/dist/index.js +40 -3
- package/dist/index.js.map +1 -1
- package/dist/logger/constants.d.ts +7 -0
- package/dist/logger/constants.d.ts.map +1 -1
- package/dist/logger/constants.js +11 -0
- package/dist/logger/constants.js.map +1 -1
- package/dist/logger/file-log.utils.d.ts +4 -0
- package/dist/logger/file-log.utils.d.ts.map +1 -0
- package/dist/logger/file-log.utils.js +23 -0
- package/dist/logger/file-log.utils.js.map +1 -0
- package/dist/logger/index.d.ts +1 -1
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +5 -3
- package/dist/logger/index.js.map +1 -1
- package/dist/logger/logger.d.ts +4 -0
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.js +48 -3
- package/dist/logger/logger.js.map +1 -1
- package/dist/logger/redact.utils.d.ts.map +1 -1
- package/dist/logger/redact.utils.js +7 -2
- package/dist/logger/redact.utils.js.map +1 -1
- package/dist/logger/types.d.ts +8 -0
- package/dist/logger/types.d.ts.map +1 -1
- package/dist/map/attention.utils.d.ts.map +1 -1
- package/dist/map/attention.utils.js +1 -0
- package/dist/map/attention.utils.js.map +1 -1
- package/dist/map/cell-view.utils.d.ts.map +1 -1
- package/dist/map/cell-view.utils.js +5 -3
- package/dist/map/cell-view.utils.js.map +1 -1
- package/dist/map/process-projection.utils.js +2 -2
- package/dist/map/process-projection.utils.js.map +1 -1
- package/dist/map/reader.utils.d.ts.map +1 -1
- package/dist/map/reader.utils.js +3 -2
- package/dist/map/reader.utils.js.map +1 -1
- package/dist/map/storage.utils.d.ts.map +1 -1
- package/dist/map/storage.utils.js +5 -1
- package/dist/map/storage.utils.js.map +1 -1
- package/dist/map/types.d.ts +21 -0
- package/dist/map/types.d.ts.map +1 -1
- package/dist/map/types.js +6 -0
- package/dist/map/types.js.map +1 -1
- package/dist/paybox/auth/authority.d.ts +46 -0
- package/dist/paybox/auth/authority.d.ts.map +1 -0
- package/dist/paybox/auth/authority.js +410 -0
- package/dist/paybox/auth/authority.js.map +1 -0
- package/dist/paybox/auth/browser-opener.d.ts +8 -0
- package/dist/paybox/auth/browser-opener.d.ts.map +1 -0
- package/dist/paybox/auth/browser-opener.js +22 -0
- package/dist/paybox/auth/browser-opener.js.map +1 -0
- package/dist/paybox/auth/browser-opener.utils.d.ts +2 -0
- package/dist/paybox/auth/browser-opener.utils.d.ts.map +1 -0
- package/dist/paybox/auth/browser-opener.utils.js +10 -0
- package/dist/paybox/auth/browser-opener.utils.js.map +1 -0
- package/dist/paybox/auth/constants.d.ts +16 -0
- package/dist/paybox/auth/constants.d.ts.map +1 -0
- package/dist/paybox/auth/constants.js +16 -0
- package/dist/paybox/auth/constants.js.map +1 -0
- package/dist/paybox/auth/coordinator.d.ts +21 -0
- package/dist/paybox/auth/coordinator.d.ts.map +1 -0
- package/dist/paybox/auth/coordinator.factory.d.ts +5 -0
- package/dist/paybox/auth/coordinator.factory.d.ts.map +1 -0
- package/dist/paybox/auth/coordinator.factory.js +5 -0
- package/dist/paybox/auth/coordinator.factory.js.map +1 -0
- package/dist/paybox/auth/coordinator.js +87 -0
- package/dist/paybox/auth/coordinator.js.map +1 -0
- package/dist/paybox/auth/coordinator.utils.d.ts +4 -0
- package/dist/paybox/auth/coordinator.utils.d.ts.map +1 -0
- package/dist/paybox/auth/coordinator.utils.js +8 -0
- package/dist/paybox/auth/coordinator.utils.js.map +1 -0
- package/dist/paybox/auth/flow-session.d.ts +24 -0
- package/dist/paybox/auth/flow-session.d.ts.map +1 -0
- package/dist/paybox/auth/flow-session.js +155 -0
- package/dist/paybox/auth/flow-session.js.map +1 -0
- package/dist/paybox/auth/loopback-flow.d.ts +49 -0
- package/dist/paybox/auth/loopback-flow.d.ts.map +1 -0
- package/dist/paybox/auth/loopback-flow.js +381 -0
- package/dist/paybox/auth/loopback-flow.js.map +1 -0
- package/dist/paybox/auth/loopback-flow.utils.d.ts +7 -0
- package/dist/paybox/auth/loopback-flow.utils.d.ts.map +1 -0
- package/dist/paybox/auth/loopback-flow.utils.js +47 -0
- package/dist/paybox/auth/loopback-flow.utils.js.map +1 -0
- package/dist/paybox/auth/loopback-page-fonts.constants.d.ts +3 -0
- package/dist/paybox/auth/loopback-page-fonts.constants.d.ts.map +1 -0
- package/dist/paybox/auth/loopback-page-fonts.constants.js +228 -0
- package/dist/paybox/auth/loopback-page-fonts.constants.js.map +1 -0
- package/dist/paybox/auth/loopback-page.utils.d.ts +4 -0
- package/dist/paybox/auth/loopback-page.utils.d.ts.map +1 -0
- package/dist/paybox/auth/loopback-page.utils.js +261 -0
- package/dist/paybox/auth/loopback-page.utils.js.map +1 -0
- package/dist/paybox/auth/provisioning.utils.d.ts +3 -0
- package/dist/paybox/auth/provisioning.utils.d.ts.map +1 -0
- package/dist/paybox/auth/provisioning.utils.js +27 -0
- package/dist/paybox/auth/provisioning.utils.js.map +1 -0
- package/dist/paybox/auth/signing-key.utils.d.ts +2 -0
- package/dist/paybox/auth/signing-key.utils.d.ts.map +1 -0
- package/dist/paybox/auth/signing-key.utils.js +14 -0
- package/dist/paybox/auth/signing-key.utils.js.map +1 -0
- package/dist/paybox/auth/types.d.ts +18 -0
- package/dist/paybox/auth/types.d.ts.map +1 -0
- package/dist/paybox/auth/types.js +6 -0
- package/dist/paybox/auth/types.js.map +1 -0
- package/dist/paybox/auth/utils.d.ts +5 -0
- package/dist/paybox/auth/utils.d.ts.map +1 -0
- package/dist/paybox/auth/utils.js +17 -0
- package/dist/paybox/auth/utils.js.map +1 -0
- package/dist/paybox/constants.d.ts +11 -0
- package/dist/paybox/constants.d.ts.map +1 -0
- package/dist/paybox/constants.js +11 -0
- package/dist/paybox/constants.js.map +1 -0
- package/dist/paybox/errors.d.ts +43 -0
- package/dist/paybox/errors.d.ts.map +1 -0
- package/dist/paybox/errors.js +141 -0
- package/dist/paybox/errors.js.map +1 -0
- package/dist/paybox/sdk/adapter.d.ts +16 -0
- package/dist/paybox/sdk/adapter.d.ts.map +1 -0
- package/dist/paybox/sdk/adapter.js +127 -0
- package/dist/paybox/sdk/adapter.js.map +1 -0
- package/dist/paybox/sdk/constants.d.ts +14 -0
- package/dist/paybox/sdk/constants.d.ts.map +1 -0
- package/dist/paybox/sdk/constants.js +23 -0
- package/dist/paybox/sdk/constants.js.map +1 -0
- package/dist/paybox/sdk/factory.d.ts +4 -0
- package/dist/paybox/sdk/factory.d.ts.map +1 -0
- package/dist/paybox/sdk/factory.js +24 -0
- package/dist/paybox/sdk/factory.js.map +1 -0
- package/dist/paybox/sdk/logging.utils.d.ts +4 -0
- package/dist/paybox/sdk/logging.utils.d.ts.map +1 -0
- package/dist/paybox/sdk/logging.utils.js +19 -0
- package/dist/paybox/sdk/logging.utils.js.map +1 -0
- package/dist/paybox/sdk/utils.d.ts +7 -0
- package/dist/paybox/sdk/utils.d.ts.map +1 -0
- package/dist/paybox/sdk/utils.js +182 -0
- package/dist/paybox/sdk/utils.js.map +1 -0
- package/dist/paybox/storage.d.ts +17 -0
- package/dist/paybox/storage.d.ts.map +1 -0
- package/dist/paybox/storage.js +87 -0
- package/dist/paybox/storage.js.map +1 -0
- package/dist/paybox/types.d.ts +481 -0
- package/dist/paybox/types.d.ts.map +1 -0
- package/dist/paybox/types.js +144 -0
- package/dist/paybox/types.js.map +1 -0
- package/dist/paybox/wallet/manager.d.ts +22 -0
- package/dist/paybox/wallet/manager.d.ts.map +1 -0
- package/dist/paybox/wallet/manager.js +111 -0
- package/dist/paybox/wallet/manager.js.map +1 -0
- package/dist/paybox/wallet/rpc.client.d.ts +16 -0
- package/dist/paybox/wallet/rpc.client.d.ts.map +1 -0
- package/dist/paybox/wallet/rpc.client.js +53 -0
- package/dist/paybox/wallet/rpc.client.js.map +1 -0
- package/dist/paybox/wallet/utils.d.ts +5 -0
- package/dist/paybox/wallet/utils.d.ts.map +1 -0
- package/dist/paybox/wallet/utils.js +82 -0
- package/dist/paybox/wallet/utils.js.map +1 -0
- package/dist/server.constants.d.ts.map +1 -1
- package/dist/server.constants.js +5 -2
- package/dist/server.constants.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -2
- package/dist/server.js.map +1 -1
- package/dist/services/app-config.utils.d.ts.map +1 -1
- package/dist/services/app-config.utils.js +22 -11
- package/dist/services/app-config.utils.js.map +1 -1
- package/dist/services/auth.service.d.ts +3 -5
- package/dist/services/auth.service.d.ts.map +1 -1
- package/dist/services/auth.service.js +20 -77
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/cell.client.d.ts.map +1 -1
- package/dist/services/cell.client.js +22 -9
- package/dist/services/cell.client.js.map +1 -1
- package/dist/services/lot-return.constants.d.ts +3 -0
- package/dist/services/lot-return.constants.d.ts.map +1 -0
- package/dist/services/lot-return.constants.js +35 -0
- package/dist/services/lot-return.constants.js.map +1 -0
- package/dist/services/lot-return.service.d.ts +25 -0
- package/dist/services/lot-return.service.d.ts.map +1 -0
- package/dist/services/lot-return.service.js +151 -0
- package/dist/services/lot-return.service.js.map +1 -0
- package/dist/services/lot-return.types.d.ts +19 -0
- package/dist/services/lot-return.types.d.ts.map +1 -0
- package/dist/services/lot-return.types.js +2 -0
- package/dist/services/lot-return.types.js.map +1 -0
- package/dist/services/lot-return.utils.d.ts +33 -0
- package/dist/services/lot-return.utils.d.ts.map +1 -0
- package/dist/services/lot-return.utils.js +128 -0
- package/dist/services/lot-return.utils.js.map +1 -0
- package/dist/services/lot-terms.constants.d.ts +4 -0
- package/dist/services/lot-terms.constants.d.ts.map +1 -0
- package/dist/services/lot-terms.constants.js +5 -0
- package/dist/services/lot-terms.constants.js.map +1 -0
- package/dist/services/lot-terms.helpers.d.ts +11 -0
- package/dist/services/lot-terms.helpers.d.ts.map +1 -0
- package/dist/services/lot-terms.helpers.js +45 -0
- package/dist/services/lot-terms.helpers.js.map +1 -0
- package/dist/services/lot-terms.service.d.ts +20 -0
- package/dist/services/lot-terms.service.d.ts.map +1 -0
- package/dist/services/lot-terms.service.js +119 -0
- package/dist/services/lot-terms.service.js.map +1 -0
- package/dist/services/lot-terms.types.d.ts +25 -0
- package/dist/services/lot-terms.types.d.ts.map +1 -0
- package/dist/services/lot-terms.types.js +2 -0
- package/dist/services/lot-terms.types.js.map +1 -0
- package/dist/services/reveal-revert.utils.d.ts +1 -0
- package/dist/services/reveal-revert.utils.d.ts.map +1 -1
- package/dist/services/reveal-revert.utils.js +20 -0
- package/dist/services/reveal-revert.utils.js.map +1 -1
- package/dist/services/reveal.constants.d.ts +1 -1
- package/dist/services/reveal.constants.d.ts.map +1 -1
- package/dist/services/reveal.constants.js +1 -1
- package/dist/services/reveal.constants.js.map +1 -1
- package/dist/services/reveal.service.d.ts +4 -3
- package/dist/services/reveal.service.d.ts.map +1 -1
- package/dist/services/reveal.service.js +35 -10
- package/dist/services/reveal.service.js.map +1 -1
- package/dist/services/reveal.utils.d.ts +7 -8
- package/dist/services/reveal.utils.d.ts.map +1 -1
- package/dist/services/reveal.utils.js +15 -8
- package/dist/services/reveal.utils.js.map +1 -1
- package/dist/services/route.constants.d.ts +12 -1
- package/dist/services/route.constants.d.ts.map +1 -1
- package/dist/services/route.constants.js +66 -15
- package/dist/services/route.constants.js.map +1 -1
- package/dist/services/route.lots.d.ts +18 -0
- package/dist/services/route.lots.d.ts.map +1 -0
- package/dist/services/route.lots.js +33 -0
- package/dist/services/route.lots.js.map +1 -0
- package/dist/services/route.service.d.ts +13 -4
- package/dist/services/route.service.d.ts.map +1 -1
- package/dist/services/route.service.js +95 -13
- package/dist/services/route.service.js.map +1 -1
- package/dist/services/route.types.d.ts +76 -0
- package/dist/services/route.types.d.ts.map +1 -0
- package/dist/services/route.types.js +8 -0
- package/dist/services/route.types.js.map +1 -0
- package/dist/services/route.utils.d.ts +19 -0
- package/dist/services/route.utils.d.ts.map +1 -1
- package/dist/services/route.utils.js +35 -0
- package/dist/services/route.utils.js.map +1 -1
- package/dist/services/trade-eviction.constants.d.ts +12 -0
- package/dist/services/trade-eviction.constants.d.ts.map +1 -0
- package/dist/services/trade-eviction.constants.js +25 -0
- package/dist/services/trade-eviction.constants.js.map +1 -0
- package/dist/services/trade-eviction.service.d.ts +22 -0
- package/dist/services/trade-eviction.service.d.ts.map +1 -0
- package/dist/services/trade-eviction.service.js +101 -0
- package/dist/services/trade-eviction.service.js.map +1 -0
- package/dist/services/trade-eviction.types.d.ts +30 -0
- package/dist/services/trade-eviction.types.d.ts.map +1 -0
- package/dist/services/trade-eviction.types.js +2 -0
- package/dist/services/trade-eviction.types.js.map +1 -0
- package/dist/services/trade-eviction.utils.d.ts +9 -0
- package/dist/services/trade-eviction.utils.d.ts.map +1 -0
- package/dist/services/trade-eviction.utils.js +38 -0
- package/dist/services/trade-eviction.utils.js.map +1 -0
- package/dist/services/trade-rules.service.d.ts +15 -0
- package/dist/services/trade-rules.service.d.ts.map +1 -0
- package/dist/services/trade-rules.service.js +45 -0
- package/dist/services/trade-rules.service.js.map +1 -0
- package/dist/services/trade.client.d.ts +11 -1
- package/dist/services/trade.client.d.ts.map +1 -1
- package/dist/services/trade.client.js +87 -0
- package/dist/services/trade.client.js.map +1 -1
- package/dist/services/trade.constants.d.ts +9 -0
- package/dist/services/trade.constants.d.ts.map +1 -0
- package/dist/services/trade.constants.js +28 -0
- package/dist/services/trade.constants.js.map +1 -0
- package/dist/services/trade.helpers.d.ts +9 -1
- package/dist/services/trade.helpers.d.ts.map +1 -1
- package/dist/services/trade.helpers.js +40 -27
- package/dist/services/trade.helpers.js.map +1 -1
- package/dist/services/transport-revert.utils.d.ts +3 -0
- package/dist/services/transport-revert.utils.d.ts.map +1 -0
- package/dist/services/transport-revert.utils.js +15 -0
- package/dist/services/transport-revert.utils.js.map +1 -0
- package/dist/services/transport.client.d.ts.map +1 -1
- package/dist/services/transport.client.js +14 -6
- package/dist/services/transport.client.js.map +1 -1
- package/dist/services/types.d.ts +249 -21
- package/dist/services/types.d.ts.map +1 -1
- package/dist/services/types.js +25 -0
- package/dist/services/types.js.map +1 -1
- package/dist/services/warehouse.utils.d.ts +8 -0
- package/dist/services/warehouse.utils.d.ts.map +1 -1
- package/dist/services/warehouse.utils.js +25 -0
- package/dist/services/warehouse.utils.js.map +1 -1
- package/dist/session/manager.d.ts +1 -0
- package/dist/session/manager.d.ts.map +1 -1
- package/dist/session/manager.js +13 -0
- package/dist/session/manager.js.map +1 -1
- package/dist/session/storage.d.ts +0 -3
- package/dist/session/storage.d.ts.map +1 -1
- package/dist/session/storage.js +6 -43
- package/dist/session/storage.js.map +1 -1
- package/dist/session/types.d.ts +4 -98
- package/dist/session/types.d.ts.map +1 -1
- package/dist/session/types.js +0 -15
- package/dist/session/types.js.map +1 -1
- package/dist/tools/authenticate.d.ts +1 -1
- package/dist/tools/authenticate.d.ts.map +1 -1
- package/dist/tools/authenticate.js +19 -45
- package/dist/tools/authenticate.js.map +1 -1
- package/dist/tools/config/get-game-config/constants.d.ts +3 -0
- package/dist/tools/config/get-game-config/constants.d.ts.map +1 -1
- package/dist/tools/config/get-game-config/constants.js +13 -2
- package/dist/tools/config/get-game-config/constants.js.map +1 -1
- package/dist/tools/config/get-game-config/get-game-config.d.ts.map +1 -1
- package/dist/tools/config/get-game-config/get-game-config.js +6 -3
- package/dist/tools/config/get-game-config/get-game-config.js.map +1 -1
- package/dist/tools/config/get-game-config/get-game-config.utils.d.ts +4 -4
- package/dist/tools/config/get-game-config/get-game-config.utils.d.ts.map +1 -1
- package/dist/tools/config/get-game-config/get-game-config.utils.js +26 -9
- package/dist/tools/config/get-game-config/get-game-config.utils.js.map +1 -1
- package/dist/tools/config/get-game-config/types.d.ts +6 -2
- package/dist/tools/config/get-game-config/types.d.ts.map +1 -1
- package/dist/tools/config/resource-lens/resource-lens.utils.d.ts.map +1 -1
- package/dist/tools/config/resource-lens/resource-lens.utils.js +5 -4
- package/dist/tools/config/resource-lens/resource-lens.utils.js.map +1 -1
- package/dist/tools/map/attention/attention.d.ts.map +1 -1
- package/dist/tools/map/attention/attention.js +16 -5
- package/dist/tools/map/attention/attention.js.map +1 -1
- package/dist/tools/map/attention/constants.d.ts +6 -0
- package/dist/tools/map/attention/constants.d.ts.map +1 -1
- package/dist/tools/map/attention/constants.js +16 -2
- package/dist/tools/map/attention/constants.js.map +1 -1
- package/dist/tools/map/attention/evicted.service.d.ts +19 -0
- package/dist/tools/map/attention/evicted.service.d.ts.map +1 -0
- package/dist/tools/map/attention/evicted.service.js +73 -0
- package/dist/tools/map/attention/evicted.service.js.map +1 -0
- package/dist/tools/map/attention/evicted.utils.d.ts +16 -0
- package/dist/tools/map/attention/evicted.utils.d.ts.map +1 -0
- package/dist/tools/map/attention/evicted.utils.js +72 -0
- package/dist/tools/map/attention/evicted.utils.js.map +1 -0
- package/dist/tools/map/attention/panel.utils.d.ts.map +1 -1
- package/dist/tools/map/attention/panel.utils.js +1 -0
- package/dist/tools/map/attention/panel.utils.js.map +1 -1
- package/dist/tools/map/attention/types.d.ts +17 -0
- package/dist/tools/map/attention/types.d.ts.map +1 -1
- package/dist/tools/map/attention/types.js.map +1 -1
- package/dist/tools/map/get-map/constants.d.ts.map +1 -1
- package/dist/tools/map/get-map/constants.js +4 -2
- package/dist/tools/map/get-map/constants.js.map +1 -1
- package/dist/tools/reveal/constants.d.ts.map +1 -1
- package/dist/tools/reveal/constants.js +3 -1
- package/dist/tools/reveal/constants.js.map +1 -1
- package/dist/tools/trade/buy-lot/buy-lot.d.ts.map +1 -1
- package/dist/tools/trade/buy-lot/buy-lot.js +2 -0
- package/dist/tools/trade/buy-lot/buy-lot.js.map +1 -1
- package/dist/tools/trade/buy-lot/constants.d.ts.map +1 -1
- package/dist/tools/trade/buy-lot/constants.js +2 -0
- package/dist/tools/trade/buy-lot/constants.js.map +1 -1
- package/dist/tools/trade/buyer-guard/constants.d.ts +4 -0
- package/dist/tools/trade/buyer-guard/constants.d.ts.map +1 -0
- package/dist/tools/trade/buyer-guard/constants.js +11 -0
- package/dist/tools/trade/buyer-guard/constants.js.map +1 -0
- package/dist/tools/trade/buyer-guard/lot-open.guard.d.ts +9 -0
- package/dist/tools/trade/buyer-guard/lot-open.guard.d.ts.map +1 -0
- package/dist/tools/trade/buyer-guard/lot-open.guard.js +15 -0
- package/dist/tools/trade/buyer-guard/lot-open.guard.js.map +1 -0
- package/dist/tools/trade/buyer-guard/types.d.ts +6 -0
- package/dist/tools/trade/buyer-guard/types.d.ts.map +1 -0
- package/dist/tools/trade/buyer-guard/types.js +2 -0
- package/dist/tools/trade/buyer-guard/types.js.map +1 -0
- package/dist/tools/trade/constants.d.ts +5 -0
- package/dist/tools/trade/constants.d.ts.map +1 -0
- package/dist/tools/trade/constants.js +14 -0
- package/dist/tools/trade/constants.js.map +1 -0
- package/dist/tools/trade/create-lot/constants.d.ts.map +1 -1
- package/dist/tools/trade/create-lot/constants.js +4 -1
- package/dist/tools/trade/create-lot/constants.js.map +1 -1
- package/dist/tools/trade/create-lot/create-lot.d.ts +2 -1
- package/dist/tools/trade/create-lot/create-lot.d.ts.map +1 -1
- package/dist/tools/trade/create-lot/create-lot.js +15 -1
- package/dist/tools/trade/create-lot/create-lot.js.map +1 -1
- package/dist/tools/trade/evict-lot/constants.d.ts +4 -0
- package/dist/tools/trade/evict-lot/constants.d.ts.map +1 -0
- package/dist/tools/trade/evict-lot/constants.js +13 -0
- package/dist/tools/trade/evict-lot/constants.js.map +1 -0
- package/dist/tools/trade/evict-lot/evict-lot.d.ts +6 -0
- package/dist/tools/trade/evict-lot/evict-lot.d.ts.map +1 -0
- package/dist/tools/trade/evict-lot/evict-lot.js +35 -0
- package/dist/tools/trade/evict-lot/evict-lot.js.map +1 -0
- package/dist/tools/trade/evict-lot/format.utils.d.ts +5 -0
- package/dist/tools/trade/evict-lot/format.utils.d.ts.map +1 -0
- package/dist/tools/trade/evict-lot/format.utils.js +10 -0
- package/dist/tools/trade/evict-lot/format.utils.js.map +1 -0
- package/dist/tools/trade/evict-lot/types.d.ts +5 -0
- package/dist/tools/trade/evict-lot/types.d.ts.map +1 -0
- package/dist/tools/trade/evict-lot/types.js +8 -0
- package/dist/tools/trade/evict-lot/types.js.map +1 -0
- package/dist/tools/trade/format.utils.d.ts +2 -4
- package/dist/tools/trade/format.utils.d.ts.map +1 -1
- package/dist/tools/trade/format.utils.js +11 -13
- package/dist/tools/trade/format.utils.js.map +1 -1
- package/dist/tools/trade/get-lot/constants.d.ts.map +1 -1
- package/dist/tools/trade/get-lot/constants.js +2 -1
- package/dist/tools/trade/get-lot/constants.js.map +1 -1
- package/dist/tools/trade/list-lots/constants.d.ts +2 -0
- package/dist/tools/trade/list-lots/constants.d.ts.map +1 -1
- package/dist/tools/trade/list-lots/constants.js +5 -1
- package/dist/tools/trade/list-lots/constants.js.map +1 -1
- package/dist/tools/trade/list-lots/list-lots.d.ts.map +1 -1
- package/dist/tools/trade/list-lots/list-lots.js +2 -1
- package/dist/tools/trade/list-lots/list-lots.js.map +1 -1
- package/dist/tools/trade/list-lots/list-lots.utils.d.ts +8 -0
- package/dist/tools/trade/list-lots/list-lots.utils.d.ts.map +1 -0
- package/dist/tools/trade/list-lots/list-lots.utils.js +10 -0
- package/dist/tools/trade/list-lots/list-lots.utils.js.map +1 -0
- package/dist/tools/trade/list-mine/constants.d.ts.map +1 -1
- package/dist/tools/trade/list-mine/constants.js +3 -1
- package/dist/tools/trade/list-mine/constants.js.map +1 -1
- package/dist/tools/trade/lot-terms/constants.d.ts +5 -0
- package/dist/tools/trade/lot-terms/constants.d.ts.map +1 -0
- package/dist/tools/trade/lot-terms/constants.js +13 -0
- package/dist/tools/trade/lot-terms/constants.js.map +1 -0
- package/dist/tools/trade/lot-terms/factory.d.ts +4 -0
- package/dist/tools/trade/lot-terms/factory.d.ts.map +1 -0
- package/dist/tools/trade/lot-terms/factory.js +14 -0
- package/dist/tools/trade/lot-terms/factory.js.map +1 -0
- package/dist/tools/trade/lot-terms/format.utils.d.ts +4 -0
- package/dist/tools/trade/lot-terms/format.utils.d.ts.map +1 -0
- package/dist/tools/trade/lot-terms/format.utils.js +30 -0
- package/dist/tools/trade/lot-terms/format.utils.js.map +1 -0
- package/dist/tools/trade/lot-terms/lot-terms.d.ts +5 -0
- package/dist/tools/trade/lot-terms/lot-terms.d.ts.map +1 -0
- package/dist/tools/trade/lot-terms/lot-terms.js +23 -0
- package/dist/tools/trade/lot-terms/lot-terms.js.map +1 -0
- package/dist/tools/trade/lot-terms/types.d.ts +6 -0
- package/dist/tools/trade/lot-terms/types.d.ts.map +1 -0
- package/dist/tools/trade/lot-terms/types.js +7 -0
- package/dist/tools/trade/lot-terms/types.js.map +1 -0
- package/dist/tools/trade/market-index/constants.d.ts.map +1 -1
- package/dist/tools/trade/market-index/constants.js +2 -0
- package/dist/tools/trade/market-index/constants.js.map +1 -1
- package/dist/tools/trade/markets/constants.d.ts.map +1 -1
- package/dist/tools/trade/markets/constants.js +2 -1
- package/dist/tools/trade/markets/constants.js.map +1 -1
- package/dist/tools/trade/quote-buy/constants.d.ts.map +1 -1
- package/dist/tools/trade/quote-buy/constants.js +4 -2
- package/dist/tools/trade/quote-buy/constants.js.map +1 -1
- package/dist/tools/trade/quote-buy/quote-buy.d.ts.map +1 -1
- package/dist/tools/trade/quote-buy/quote-buy.js +2 -0
- package/dist/tools/trade/quote-buy/quote-buy.js.map +1 -1
- package/dist/tools/trade/quote-lot-return/constants.d.ts +2 -0
- package/dist/tools/trade/quote-lot-return/constants.d.ts.map +1 -0
- package/dist/tools/trade/quote-lot-return/constants.js +11 -0
- package/dist/tools/trade/quote-lot-return/constants.js.map +1 -0
- package/dist/tools/trade/quote-lot-return/quote-lot-return.d.ts +5 -0
- package/dist/tools/trade/quote-lot-return/quote-lot-return.d.ts.map +1 -0
- package/dist/tools/trade/quote-lot-return/quote-lot-return.js +20 -0
- package/dist/tools/trade/quote-lot-return/quote-lot-return.js.map +1 -0
- package/dist/tools/trade/return-lot/constants.d.ts +5 -0
- package/dist/tools/trade/return-lot/constants.d.ts.map +1 -0
- package/dist/tools/trade/return-lot/constants.js +26 -0
- package/dist/tools/trade/return-lot/constants.js.map +1 -0
- package/dist/tools/trade/return-lot/factory.d.ts +4 -0
- package/dist/tools/trade/return-lot/factory.d.ts.map +1 -0
- package/dist/tools/trade/return-lot/factory.js +18 -0
- package/dist/tools/trade/return-lot/factory.js.map +1 -0
- package/dist/tools/trade/return-lot/format.utils.d.ts +5 -0
- package/dist/tools/trade/return-lot/format.utils.d.ts.map +1 -0
- package/dist/tools/trade/return-lot/format.utils.js +39 -0
- package/dist/tools/trade/return-lot/format.utils.js.map +1 -0
- package/dist/tools/trade/return-lot/return-lot.d.ts +5 -0
- package/dist/tools/trade/return-lot/return-lot.d.ts.map +1 -0
- package/dist/tools/trade/return-lot/return-lot.js +25 -0
- package/dist/tools/trade/return-lot/return-lot.js.map +1 -0
- package/dist/tools/trade/return-lot/types.d.ts +11 -0
- package/dist/tools/trade/return-lot/types.d.ts.map +1 -0
- package/dist/tools/trade/return-lot/types.js +21 -0
- package/dist/tools/trade/return-lot/types.js.map +1 -0
- package/dist/tools/trade/types.d.ts +0 -4
- package/dist/tools/trade/types.d.ts.map +1 -1
- package/dist/tools/trade/types.js +4 -12
- package/dist/tools/trade/types.js.map +1 -1
- package/dist/tools/transport/constants.d.ts.map +1 -1
- package/dist/tools/transport/constants.js +9 -0
- package/dist/tools/transport/constants.js.map +1 -1
- package/dist/tools/transport/network/constants.d.ts +2 -0
- package/dist/tools/transport/network/constants.d.ts.map +1 -1
- package/dist/tools/transport/network/constants.js +2 -0
- package/dist/tools/transport/network/constants.js.map +1 -1
- package/dist/tools/transport/network/panel.utils.d.ts +2 -2
- package/dist/tools/transport/network/panel.utils.d.ts.map +1 -1
- package/dist/tools/transport/network/panel.utils.js +20 -0
- package/dist/tools/transport/network/panel.utils.js.map +1 -1
- package/dist/tools/transport/network/route-network.d.ts.map +1 -1
- package/dist/tools/transport/network/route-network.js +1 -1
- package/dist/tools/transport/network/route-network.js.map +1 -1
- package/dist/tools/transport/next-hops/next-hops.d.ts.map +1 -1
- package/dist/tools/transport/next-hops/next-hops.js +13 -3
- package/dist/tools/transport/next-hops/next-hops.js.map +1 -1
- package/dist/tools/transport/quote/constants.d.ts.map +1 -1
- package/dist/tools/transport/quote/constants.js +5 -3
- package/dist/tools/transport/quote/constants.js.map +1 -1
- package/dist/tools/transport/types.d.ts +2 -0
- package/dist/tools/transport/types.d.ts.map +1 -1
- package/dist/tools/transport/types.js +16 -0
- package/dist/tools/transport/types.js.map +1 -1
- package/dist/tools/types.d.ts +7 -1
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +16 -1
- package/dist/tools/types.js.map +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/wei.constants.d.ts +6 -0
- package/dist/utils/wei.constants.d.ts.map +1 -0
- package/dist/utils/wei.constants.js +6 -0
- package/dist/utils/wei.constants.js.map +1 -0
- package/dist/wallet/index.d.ts.map +1 -1
- package/dist/wallet/index.js +2 -3
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/types.d.ts +0 -9
- package/dist/wallet/types.d.ts.map +1 -1
- package/dist/wallet/types.js.map +1 -1
- package/package.json +2 -2
- package/dist/tools/trade/cancel-lot/cancel-lot.d.ts +0 -4
- package/dist/tools/trade/cancel-lot/cancel-lot.d.ts.map +0 -1
- package/dist/tools/trade/cancel-lot/cancel-lot.js +0 -20
- package/dist/tools/trade/cancel-lot/cancel-lot.js.map +0 -1
- package/dist/tools/trade/cancel-lot/constants.d.ts +0 -2
- package/dist/tools/trade/cancel-lot/constants.d.ts.map +0 -1
- package/dist/tools/trade/cancel-lot/constants.js +0 -8
- package/dist/tools/trade/cancel-lot/constants.js.map +0 -1
- package/dist/wallet/agw.manager.d.ts +0 -20
- package/dist/wallet/agw.manager.d.ts.map +0 -1
- package/dist/wallet/agw.manager.js +0 -90
- package/dist/wallet/agw.manager.js.map +0 -1
- package/dist/wallet/agw.provider.d.ts +0 -14
- package/dist/wallet/agw.provider.d.ts.map +0 -1
- package/dist/wallet/agw.provider.js +0 -48
- package/dist/wallet/agw.provider.js.map +0 -1
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import { createServer } from 'node:http';
|
|
2
|
+
import { DEFAULT_LOOPBACK_TIMEOUT_MS, HTML_HEADERS, KEY_BODY_LIMIT_BYTES, LOOPBACK_CALLBACK_PREFIX, LOOPBACK_HOST, LOOPBACK_KEY_PREFIX, OAUTH_DISCOVERY_PATH, OAUTH_SCOPE, PAYBOX_OAUTH_CLIENT_NAME, } from './constants.js';
|
|
3
|
+
import { oauthError, oauthTokenError, pkceChallenge, randomUrlPart } from './utils.js';
|
|
4
|
+
import { PayboxAuthFlowError, PayboxAuthInvalidError, PayboxLoopbackUnavailableError, PayboxTemporarilyUnavailableError, } from '../errors.js';
|
|
5
|
+
import { SystemBrowserOpener } from './browser-opener.js';
|
|
6
|
+
import { formKey, isObject, nonEmptyString, tokenResponse, urlField } from './loopback-flow.utils.js';
|
|
7
|
+
import { connectionCompletePage, connectionFailedPage, signingKeyPage } from './loopback-page.utils.js';
|
|
8
|
+
import { agentKeyProvisioningUrl } from './provisioning.utils.js';
|
|
9
|
+
import { isPbxk1 } from './signing-key.utils.js';
|
|
10
|
+
import { classifiedPayboxError, classifiedPayboxHttpStatus } from '../sdk/utils.js';
|
|
11
|
+
import { PayboxRequestContext, } from '../types.js';
|
|
12
|
+
export class LoopbackAuthFlow {
|
|
13
|
+
options;
|
|
14
|
+
browserOpener;
|
|
15
|
+
server = null;
|
|
16
|
+
completion = null;
|
|
17
|
+
rejectCompletion = null;
|
|
18
|
+
callbackPath = null;
|
|
19
|
+
keyPath = null;
|
|
20
|
+
state = null;
|
|
21
|
+
verifier = null;
|
|
22
|
+
metadata = null;
|
|
23
|
+
clientId = null;
|
|
24
|
+
code = null;
|
|
25
|
+
key = null;
|
|
26
|
+
callbackResponse = null;
|
|
27
|
+
provisioningUrl = null;
|
|
28
|
+
started = false;
|
|
29
|
+
operation = null;
|
|
30
|
+
signal = null;
|
|
31
|
+
abortListener = null;
|
|
32
|
+
waiters = new Set();
|
|
33
|
+
waiterRejectors = new Set();
|
|
34
|
+
constructor(options, browserOpener = new SystemBrowserOpener()) {
|
|
35
|
+
this.options = options;
|
|
36
|
+
this.browserOpener = browserOpener;
|
|
37
|
+
}
|
|
38
|
+
async start(parentSignal) {
|
|
39
|
+
if (this.started) {
|
|
40
|
+
throw oauthError('flow already started');
|
|
41
|
+
}
|
|
42
|
+
this.started = true;
|
|
43
|
+
const operation = new AbortController();
|
|
44
|
+
const timeout = AbortSignal.timeout(this.options.timeoutMs ?? DEFAULT_LOOPBACK_TIMEOUT_MS);
|
|
45
|
+
const signal = AbortSignal.any([parentSignal, operation.signal, timeout]);
|
|
46
|
+
this.operation = operation;
|
|
47
|
+
this.signal = signal;
|
|
48
|
+
this.abortListener = () => this.abort(signal.reason);
|
|
49
|
+
signal.addEventListener('abort', this.abortListener, { once: true });
|
|
50
|
+
try {
|
|
51
|
+
signal.throwIfAborted();
|
|
52
|
+
const metadata = await this.discover(signal);
|
|
53
|
+
signal.throwIfAborted();
|
|
54
|
+
this.metadata = metadata;
|
|
55
|
+
this.state = randomUrlPart();
|
|
56
|
+
this.verifier = randomUrlPart();
|
|
57
|
+
this.callbackPath = `${LOOPBACK_CALLBACK_PREFIX}${randomUrlPart()}`;
|
|
58
|
+
this.keyPath = `${LOOPBACK_KEY_PREFIX}${randomUrlPart()}`;
|
|
59
|
+
await this.listen(signal);
|
|
60
|
+
signal.throwIfAborted();
|
|
61
|
+
const redirectUri = this.redirectUri();
|
|
62
|
+
const clientId = await this.register(redirectUri, signal);
|
|
63
|
+
signal.throwIfAborted();
|
|
64
|
+
this.clientId = clientId;
|
|
65
|
+
const completion = new Promise((resolve, reject) => {
|
|
66
|
+
this.rejectCompletion = reject;
|
|
67
|
+
void this.waitForResult(resolve);
|
|
68
|
+
});
|
|
69
|
+
void completion.catch(() => undefined);
|
|
70
|
+
this.completion = completion;
|
|
71
|
+
const authorizationUrl = new URL(this.metadata.authorizationEndpoint);
|
|
72
|
+
authorizationUrl.searchParams.set('response_type', 'code');
|
|
73
|
+
authorizationUrl.searchParams.set('client_id', this.clientId);
|
|
74
|
+
authorizationUrl.searchParams.set('redirect_uri', redirectUri);
|
|
75
|
+
authorizationUrl.searchParams.set('scope', OAUTH_SCOPE);
|
|
76
|
+
authorizationUrl.searchParams.set('state', this.state);
|
|
77
|
+
authorizationUrl.searchParams.set('code_challenge', pkceChallenge(this.verifier));
|
|
78
|
+
authorizationUrl.searchParams.set('code_challenge_method', 'S256');
|
|
79
|
+
const serializedAuthorizationUrl = authorizationUrl.toString();
|
|
80
|
+
try {
|
|
81
|
+
this.browserOpener.open(serializedAuthorizationUrl);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Returning the URL keeps authentication usable when GUI launch is unavailable.
|
|
85
|
+
}
|
|
86
|
+
return { authorizationUrl: serializedAuthorizationUrl };
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (signal.aborted)
|
|
90
|
+
throw this.abortError(signal.reason);
|
|
91
|
+
if (this.signal === signal)
|
|
92
|
+
this.reset();
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async finish() {
|
|
97
|
+
if (this.completion === null) {
|
|
98
|
+
throw oauthError('flow not started');
|
|
99
|
+
}
|
|
100
|
+
return this.completion.finally(() => this.close());
|
|
101
|
+
}
|
|
102
|
+
async discover(signal) {
|
|
103
|
+
const issuer = new URL(this.options.issuerUrl);
|
|
104
|
+
const response = await this.payboxRequest(new URL(OAUTH_DISCOVERY_PATH, issuer).toString(), { method: 'GET' }, signal);
|
|
105
|
+
if (!response.ok) {
|
|
106
|
+
throw classifiedPayboxHttpStatus(response.status, PayboxRequestContext.Unauthenticated);
|
|
107
|
+
}
|
|
108
|
+
const value = await this.responseJson(response);
|
|
109
|
+
if (!isObject(value))
|
|
110
|
+
throw oauthError('malformed discovery response');
|
|
111
|
+
const authorizationEndpoint = urlField(value, 'authorization_endpoint');
|
|
112
|
+
const registrationEndpoint = urlField(value, 'registration_endpoint');
|
|
113
|
+
const tokenEndpoint = urlField(value, 'token_endpoint');
|
|
114
|
+
return { authorizationEndpoint, registrationEndpoint, tokenEndpoint };
|
|
115
|
+
}
|
|
116
|
+
async register(redirectUri, signal) {
|
|
117
|
+
const metadata = this.required(this.metadata, 'metadata');
|
|
118
|
+
const response = await this.payboxRequest(metadata.registrationEndpoint, {
|
|
119
|
+
method: 'POST',
|
|
120
|
+
headers: { 'content-type': 'application/json' },
|
|
121
|
+
body: JSON.stringify({
|
|
122
|
+
client_name: PAYBOX_OAUTH_CLIENT_NAME,
|
|
123
|
+
redirect_uris: [redirectUri],
|
|
124
|
+
token_endpoint_auth_method: 'none',
|
|
125
|
+
}),
|
|
126
|
+
}, signal);
|
|
127
|
+
if (!response.ok) {
|
|
128
|
+
throw classifiedPayboxHttpStatus(response.status, PayboxRequestContext.Unauthenticated);
|
|
129
|
+
}
|
|
130
|
+
const value = await this.responseJson(response);
|
|
131
|
+
if (!isObject(value))
|
|
132
|
+
throw oauthError('malformed registration response');
|
|
133
|
+
return nonEmptyString(value, 'client_id');
|
|
134
|
+
}
|
|
135
|
+
async listen(signal) {
|
|
136
|
+
this.server = createServer((request, response) => this.handle(request, response));
|
|
137
|
+
await new Promise((resolve, reject) => {
|
|
138
|
+
const server = this.required(this.server, 'server');
|
|
139
|
+
const onAbort = () => {
|
|
140
|
+
cleanup();
|
|
141
|
+
reject(this.abortError(signal.reason));
|
|
142
|
+
};
|
|
143
|
+
const onError = (error) => {
|
|
144
|
+
cleanup();
|
|
145
|
+
reject(new PayboxLoopbackUnavailableError('loopback unavailable', { cause: error }));
|
|
146
|
+
};
|
|
147
|
+
const cleanup = () => {
|
|
148
|
+
signal.removeEventListener('abort', onAbort);
|
|
149
|
+
server.off('error', onError);
|
|
150
|
+
};
|
|
151
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
152
|
+
server.once('error', onError);
|
|
153
|
+
server.listen(0, LOOPBACK_HOST, () => {
|
|
154
|
+
cleanup();
|
|
155
|
+
resolve();
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
redirectUri() {
|
|
160
|
+
const address = this.required(this.server, 'server').address();
|
|
161
|
+
if (address === null || typeof address === 'string')
|
|
162
|
+
throw oauthError('loopback address unavailable');
|
|
163
|
+
return `http://${LOOPBACK_HOST}:${address.port}${this.required(this.callbackPath, 'callback path')}`;
|
|
164
|
+
}
|
|
165
|
+
handle(request, response) {
|
|
166
|
+
const url = new URL(request.url ?? '/', `http://${LOOPBACK_HOST}`);
|
|
167
|
+
if (url.pathname === this.callbackPath) {
|
|
168
|
+
this.handleCallback(request, response, url);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (url.pathname === this.keyPath) {
|
|
172
|
+
this.handleKey(request, response);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
this.respond(response, 404, 'Not found');
|
|
176
|
+
}
|
|
177
|
+
handleCallback(request, response, url) {
|
|
178
|
+
if (request.method !== 'GET')
|
|
179
|
+
return this.respond(response, 405, 'Method not allowed');
|
|
180
|
+
if (url.searchParams.get('state') !== this.state || url.searchParams.get('code') === null) {
|
|
181
|
+
return this.respond(response, 400, 'Invalid callback');
|
|
182
|
+
}
|
|
183
|
+
if (this.code !== null)
|
|
184
|
+
return this.respond(response, 409, 'Already used');
|
|
185
|
+
this.callbackResponse = response;
|
|
186
|
+
this.code = url.searchParams.get('code');
|
|
187
|
+
this.notifyWaiters();
|
|
188
|
+
}
|
|
189
|
+
handleKey(request, response) {
|
|
190
|
+
if (request.method === 'GET') {
|
|
191
|
+
this.respond(response, 405, 'Method not allowed');
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (request.method !== 'POST')
|
|
195
|
+
return this.respond(response, 405, 'Method not allowed');
|
|
196
|
+
if (!String(request.headers['content-type'] ?? '').startsWith('application/x-www-form-urlencoded')) {
|
|
197
|
+
return this.respond(response, 415, 'Unsupported media type');
|
|
198
|
+
}
|
|
199
|
+
if (this.provisioningUrl === null) {
|
|
200
|
+
return this.respond(response, 409, connectionFailedPage());
|
|
201
|
+
}
|
|
202
|
+
let body = '';
|
|
203
|
+
let size = 0;
|
|
204
|
+
request.on('data', (chunk) => {
|
|
205
|
+
size += chunk.length;
|
|
206
|
+
if (size <= KEY_BODY_LIMIT_BYTES)
|
|
207
|
+
body += chunk.toString('utf8');
|
|
208
|
+
});
|
|
209
|
+
request.on('end', () => {
|
|
210
|
+
if (size > KEY_BODY_LIMIT_BYTES)
|
|
211
|
+
return this.respond(response, 413, 'Request too large');
|
|
212
|
+
if (this.key !== null)
|
|
213
|
+
return this.respond(response, 409, 'Already used');
|
|
214
|
+
try {
|
|
215
|
+
const key = formKey(body);
|
|
216
|
+
if (typeof key !== 'string' || !isPbxk1(key)) {
|
|
217
|
+
return this.respond(response, 400, signingKeyPage(this.required(this.keyPath, 'key path'), this.required(this.provisioningUrl, 'provisioning URL'), 'That is not a valid pbxk1 signing key. Copy the complete value from Paybox and try again.'));
|
|
218
|
+
}
|
|
219
|
+
this.key = key;
|
|
220
|
+
this.notifyWaiters();
|
|
221
|
+
this.respond(response, 200, connectionCompletePage());
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
this.respond(response, 400, 'Invalid request');
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
async waitForResult(resolve) {
|
|
229
|
+
try {
|
|
230
|
+
const code = await this.waitFor(() => this.code);
|
|
231
|
+
const token = await this.exchange(code, this.required(this.signal, 'signal'));
|
|
232
|
+
const provisioningUrl = agentKeyProvisioningUrl(this.options.issuerUrl, token.accessToken);
|
|
233
|
+
if (provisioningUrl === null)
|
|
234
|
+
throw oauthError('signing key provisioning unavailable');
|
|
235
|
+
this.provisioningUrl = provisioningUrl;
|
|
236
|
+
try {
|
|
237
|
+
this.browserOpener.open(provisioningUrl);
|
|
238
|
+
}
|
|
239
|
+
catch {
|
|
240
|
+
// The local callback page keeps the provisioning URL available as a visible fallback.
|
|
241
|
+
}
|
|
242
|
+
this.respondCallback(200, signingKeyPage(this.required(this.keyPath, 'key path'), provisioningUrl, null));
|
|
243
|
+
const signingKey = await this.waitFor(() => this.key);
|
|
244
|
+
resolve({
|
|
245
|
+
tokens: {
|
|
246
|
+
clientId: this.required(this.clientId, 'client id'),
|
|
247
|
+
baseUrl: this.options.issuerUrl,
|
|
248
|
+
...token,
|
|
249
|
+
},
|
|
250
|
+
signingKey,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
catch (error) {
|
|
254
|
+
this.respondCallback(502, connectionFailedPage());
|
|
255
|
+
if (this.started) {
|
|
256
|
+
this.fail(error instanceof Error ? error : oauthError('authentication failed'));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
async waitFor(read) {
|
|
261
|
+
const value = read();
|
|
262
|
+
if (value !== null)
|
|
263
|
+
return value;
|
|
264
|
+
return new Promise((resolve, reject) => {
|
|
265
|
+
const check = () => {
|
|
266
|
+
const next = read();
|
|
267
|
+
if (next === null)
|
|
268
|
+
return;
|
|
269
|
+
this.waiters.delete(check);
|
|
270
|
+
this.waiterRejectors.delete(reject);
|
|
271
|
+
resolve(next);
|
|
272
|
+
};
|
|
273
|
+
this.waiters.add(check);
|
|
274
|
+
this.waiterRejectors.add(reject);
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
async exchange(code, signal) {
|
|
278
|
+
const response = await this.payboxRequest(this.required(this.metadata, 'metadata').tokenEndpoint, {
|
|
279
|
+
method: 'POST',
|
|
280
|
+
headers: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
281
|
+
body: new URLSearchParams({
|
|
282
|
+
grant_type: 'authorization_code',
|
|
283
|
+
code,
|
|
284
|
+
redirect_uri: this.redirectUri(),
|
|
285
|
+
client_id: this.required(this.clientId, 'client id'),
|
|
286
|
+
code_verifier: this.required(this.verifier, 'verifier'),
|
|
287
|
+
}).toString(),
|
|
288
|
+
}, signal);
|
|
289
|
+
if (!response.ok)
|
|
290
|
+
throw oauthTokenError(response.status);
|
|
291
|
+
return tokenResponse(await this.responseJson(response));
|
|
292
|
+
}
|
|
293
|
+
async payboxRequest(url, init, signal) {
|
|
294
|
+
try {
|
|
295
|
+
return await this.options.httpClient.fetch(url, { ...init, signal });
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
if (signal.aborted)
|
|
299
|
+
throw this.abortError(signal.reason);
|
|
300
|
+
throw classifiedPayboxError(error, PayboxRequestContext.Unauthenticated);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
async responseJson(response) {
|
|
304
|
+
try {
|
|
305
|
+
return await response.json();
|
|
306
|
+
}
|
|
307
|
+
catch {
|
|
308
|
+
throw oauthError('malformed response');
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
close() {
|
|
312
|
+
this.server?.close();
|
|
313
|
+
this.server?.closeAllConnections();
|
|
314
|
+
this.server = null;
|
|
315
|
+
}
|
|
316
|
+
fail(error) {
|
|
317
|
+
const operation = this.operation;
|
|
318
|
+
this.abort(error);
|
|
319
|
+
operation?.abort(error);
|
|
320
|
+
}
|
|
321
|
+
abort(reason) {
|
|
322
|
+
const error = this.abortError(reason);
|
|
323
|
+
void this.completion?.catch(() => undefined);
|
|
324
|
+
this.rejectCompletion?.(error);
|
|
325
|
+
for (const reject of this.waiterRejectors)
|
|
326
|
+
reject(error);
|
|
327
|
+
this.waiters.clear();
|
|
328
|
+
this.waiterRejectors.clear();
|
|
329
|
+
this.reset();
|
|
330
|
+
this.rejectCompletion = null;
|
|
331
|
+
}
|
|
332
|
+
abortError(reason) {
|
|
333
|
+
if (reason instanceof PayboxAuthFlowError ||
|
|
334
|
+
reason instanceof PayboxAuthInvalidError ||
|
|
335
|
+
reason instanceof PayboxTemporarilyUnavailableError) {
|
|
336
|
+
return reason;
|
|
337
|
+
}
|
|
338
|
+
return oauthError('cancelled');
|
|
339
|
+
}
|
|
340
|
+
reset() {
|
|
341
|
+
if (this.signal !== null && this.abortListener !== null) {
|
|
342
|
+
this.signal.removeEventListener('abort', this.abortListener);
|
|
343
|
+
}
|
|
344
|
+
this.close();
|
|
345
|
+
this.started = false;
|
|
346
|
+
this.operation = null;
|
|
347
|
+
this.signal = null;
|
|
348
|
+
this.abortListener = null;
|
|
349
|
+
this.callbackPath = null;
|
|
350
|
+
this.keyPath = null;
|
|
351
|
+
this.state = null;
|
|
352
|
+
this.verifier = null;
|
|
353
|
+
this.metadata = null;
|
|
354
|
+
this.clientId = null;
|
|
355
|
+
this.code = null;
|
|
356
|
+
this.key = null;
|
|
357
|
+
this.callbackResponse = null;
|
|
358
|
+
this.provisioningUrl = null;
|
|
359
|
+
}
|
|
360
|
+
notifyWaiters() {
|
|
361
|
+
for (const waiter of this.waiters)
|
|
362
|
+
waiter();
|
|
363
|
+
}
|
|
364
|
+
respond(response, status, body) {
|
|
365
|
+
response.writeHead(status, HTML_HEADERS);
|
|
366
|
+
response.end(body);
|
|
367
|
+
}
|
|
368
|
+
respondCallback(status, body) {
|
|
369
|
+
const response = this.callbackResponse;
|
|
370
|
+
if (response === null)
|
|
371
|
+
return;
|
|
372
|
+
this.callbackResponse = null;
|
|
373
|
+
this.respond(response, status, body);
|
|
374
|
+
}
|
|
375
|
+
required(value, name) {
|
|
376
|
+
if (value === null)
|
|
377
|
+
throw oauthError(`${name} unavailable`);
|
|
378
|
+
return value;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
//# sourceMappingURL=loopback-flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loopback-flow.js","sourceRoot":"","sources":["../../../src/paybox/auth/loopback-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAC;AAEjG,OAAO,EACH,2BAA2B,EAC3B,YAAY,EACZ,oBAAoB,EACpB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACX,wBAAwB,GAC3B,MA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AI,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IAEO,QAAQ,CAAI,KAAe,EAAE,IAAY;QAC7C,IAAI,KAAK,KAAK,IAAI;YAAE,MAAM,UAAU,CAAC,GAAG,IAAI,cAAc,CAAC,CAAC;QAC5D,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OAuthTokenResponse } from '../types.js';
|
|
2
|
+
export declare function isObject(value: unknown): value is Record<string, unknown>;
|
|
3
|
+
export declare function urlField(value: Record<string, unknown>, name: string): string;
|
|
4
|
+
export declare function nonEmptyString(value: Record<string, unknown>, name: string): string;
|
|
5
|
+
export declare function tokenResponse(value: unknown): OAuthTokenResponse;
|
|
6
|
+
export declare function formKey(body: string): string | null;
|
|
7
|
+
//# sourceMappingURL=loopback-flow.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loopback-flow.utils.d.ts","sourceRoot":"","sources":["../../../src/paybox/auth/loopback-flow.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQ7E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAInF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAyBhE;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGnD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { oauthError } from './utils.js';
|
|
2
|
+
export function isObject(value) {
|
|
3
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
4
|
+
}
|
|
5
|
+
export function urlField(value, name) {
|
|
6
|
+
const field = nonEmptyString(value, name);
|
|
7
|
+
try {
|
|
8
|
+
new URL(field);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
throw oauthError(`invalid ${name}`);
|
|
12
|
+
}
|
|
13
|
+
return field;
|
|
14
|
+
}
|
|
15
|
+
export function nonEmptyString(value, name) {
|
|
16
|
+
const field = value[name];
|
|
17
|
+
if (typeof field !== 'string' || field.length === 0)
|
|
18
|
+
throw oauthError(`response missing ${name}`);
|
|
19
|
+
return field;
|
|
20
|
+
}
|
|
21
|
+
export function tokenResponse(value) {
|
|
22
|
+
if (!isObject(value) || typeof value.access_token !== 'string' || value.access_token.length === 0) {
|
|
23
|
+
throw oauthError('malformed token response');
|
|
24
|
+
}
|
|
25
|
+
if (value.refresh_token !== undefined &&
|
|
26
|
+
(typeof value.refresh_token !== 'string' || value.refresh_token.length === 0)) {
|
|
27
|
+
throw oauthError('malformed token response');
|
|
28
|
+
}
|
|
29
|
+
if (value.resource !== undefined && (typeof value.resource !== 'string' || value.resource.length === 0)) {
|
|
30
|
+
throw oauthError('malformed token response');
|
|
31
|
+
}
|
|
32
|
+
if (value.expires_in !== undefined &&
|
|
33
|
+
(typeof value.expires_in !== 'number' || !Number.isFinite(value.expires_in) || value.expires_in < 0)) {
|
|
34
|
+
throw oauthError('malformed token response');
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
accessToken: value.access_token,
|
|
38
|
+
refreshToken: value.refresh_token ?? null,
|
|
39
|
+
resource: value.resource ?? null,
|
|
40
|
+
expiresAt: value.expires_in === undefined ? null : Date.now() + value.expires_in * 1000,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function formKey(body) {
|
|
44
|
+
const value = new URLSearchParams(body).get('key');
|
|
45
|
+
return value === null ? null : value;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=loopback-flow.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loopback-flow.utils.js","sourceRoot":"","sources":["../../../src/paybox/auth/loopback-flow.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,MAAM,UAAU,QAAQ,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAA8B,EAAE,IAAY;IACjE,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC;QACD,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAAC,MAAM,CAAC;QACL,MAAM,UAAU,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAA8B,EAAE,IAAY;IACvE,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,UAAU,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;IAClG,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAc;IACxC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ,IAAI,KAAK,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChG,MAAM,UAAU,CAAC,0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