@de./sdk 1.0.4 → 2.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/dist/allend/Access.d.ts +39 -3
- package/dist/allend/Access.js +147 -114
- package/dist/allend/Access.js.map +1 -1
- package/dist/allend/Agent/consolidation.d.ts +16 -0
- package/dist/allend/Agent/consolidation.js +38 -0
- package/dist/allend/Agent/consolidation.js.map +1 -0
- package/dist/allend/Agent/delivery.d.ts +11 -0
- package/dist/allend/Agent/delivery.js +43 -0
- package/dist/allend/Agent/delivery.js.map +1 -0
- package/dist/allend/Agent/dispatch.d.ts +8 -0
- package/dist/allend/Agent/dispatch.js +24 -0
- package/dist/allend/Agent/dispatch.js.map +1 -0
- package/dist/allend/Agent/index.d.ts +49 -0
- package/dist/allend/Agent/index.js +74 -0
- package/dist/allend/Agent/index.js.map +1 -0
- package/dist/allend/Agent/navigation.d.ts +8 -0
- package/dist/allend/Agent/navigation.js +25 -0
- package/dist/allend/Agent/navigation.js.map +1 -0
- package/dist/allend/Agent/origin.d.ts +9 -0
- package/dist/allend/Agent/origin.js +31 -0
- package/dist/allend/Agent/origin.js.map +1 -0
- package/dist/allend/Agent/reallocation.d.ts +7 -0
- package/dist/allend/Agent/reallocation.js +17 -0
- package/dist/allend/Agent/reallocation.js.map +1 -0
- package/dist/allend/Agent/realtime.d.ts +36 -0
- package/dist/allend/Agent/realtime.js +111 -0
- package/dist/allend/Agent/realtime.js.map +1 -0
- package/dist/allend/Agent/rides.d.ts +12 -0
- package/dist/allend/Agent/rides.js +51 -0
- package/dist/allend/Agent/rides.js.map +1 -0
- package/dist/allend/Agent/shipping.d.ts +11 -0
- package/dist/allend/Agent/shipping.js +43 -0
- package/dist/allend/Agent/shipping.js.map +1 -0
- package/dist/allend/CSP/analytics.d.ts +12 -0
- package/dist/allend/CSP/analytics.js +51 -0
- package/dist/allend/CSP/analytics.js.map +1 -0
- package/dist/allend/CSP/index.d.ts +25 -0
- package/dist/allend/CSP/index.js +43 -0
- package/dist/allend/CSP/index.js.map +1 -0
- package/dist/allend/CSP/inventory.d.ts +16 -0
- package/dist/allend/CSP/inventory.js +78 -0
- package/dist/allend/CSP/inventory.js.map +1 -0
- package/dist/allend/CSP/orders.d.ts +19 -0
- package/dist/allend/CSP/orders.js +97 -0
- package/dist/allend/CSP/orders.js.map +1 -0
- package/dist/allend/CSP/webhooks.d.ts +13 -0
- package/dist/allend/CSP/webhooks.js +56 -0
- package/dist/allend/CSP/webhooks.js.map +1 -0
- package/dist/allend/Customer/index.d.ts +27 -0
- package/dist/allend/Customer/index.js +39 -0
- package/dist/allend/Customer/index.js.map +1 -0
- package/dist/allend/Customer/intents.d.ts +12 -0
- package/dist/allend/Customer/intents.js +55 -0
- package/dist/allend/Customer/intents.js.map +1 -0
- package/dist/allend/Customer/orders.d.ts +11 -0
- package/dist/allend/Customer/orders.js +43 -0
- package/dist/allend/Customer/orders.js.map +1 -0
- package/dist/allend/Customer/rides.d.ts +12 -0
- package/dist/allend/Customer/rides.js +50 -0
- package/dist/allend/Customer/rides.js.map +1 -0
- package/dist/allend/DEV/developers.d.ts +11 -0
- package/dist/allend/DEV/developers.js +35 -0
- package/dist/allend/DEV/developers.js.map +1 -0
- package/dist/allend/DEV/index.d.ts +19 -0
- package/dist/allend/DEV/index.js +37 -0
- package/dist/allend/DEV/index.js.map +1 -0
- package/dist/allend/IoTClient.js +29 -35
- package/dist/allend/IoTClient.js.map +1 -1
- package/dist/allend/IoTSP/backend.d.ts +29 -0
- package/dist/allend/IoTSP/backend.js +75 -0
- package/dist/allend/IoTSP/backend.js.map +1 -0
- package/dist/allend/IoTSP/devices.d.ts +14 -0
- package/dist/allend/IoTSP/devices.js +61 -0
- package/dist/allend/IoTSP/devices.js.map +1 -0
- package/dist/allend/IoTSP/index.d.ts +28 -0
- package/dist/allend/IoTSP/index.js +84 -0
- package/dist/allend/IoTSP/index.js.map +1 -0
- package/dist/allend/IoTSP/rules.d.ts +17 -0
- package/dist/allend/IoTSP/rules.js +81 -0
- package/dist/allend/IoTSP/rules.js.map +1 -0
- package/dist/allend/IoTSP/topics.d.ts +17 -0
- package/dist/allend/IoTSP/topics.js +81 -0
- package/dist/allend/IoTSP/topics.js.map +1 -0
- package/dist/allend/LSP/agents.d.ts +20 -0
- package/dist/allend/LSP/agents.js +89 -0
- package/dist/allend/LSP/agents.js.map +1 -0
- package/dist/allend/LSP/carriers.d.ts +54 -0
- package/dist/allend/LSP/carriers.js +315 -0
- package/dist/allend/LSP/carriers.js.map +1 -0
- package/dist/allend/LSP/coverage.d.ts +44 -0
- package/dist/allend/LSP/coverage.js +135 -0
- package/dist/allend/LSP/coverage.js.map +1 -0
- package/dist/allend/LSP/fleets.d.ts +66 -0
- package/dist/allend/LSP/fleets.js +381 -0
- package/dist/allend/LSP/fleets.js.map +1 -0
- package/dist/allend/LSP/hubs.d.ts +39 -0
- package/dist/allend/LSP/hubs.js +186 -0
- package/dist/allend/LSP/hubs.js.map +1 -0
- package/dist/allend/LSP/index.d.ts +37 -0
- package/dist/allend/LSP/index.js +55 -0
- package/dist/allend/LSP/index.js.map +1 -0
- package/dist/allend/LSP/inventory.d.ts +13 -0
- package/dist/allend/LSP/inventory.js +56 -0
- package/dist/allend/LSP/inventory.js.map +1 -0
- package/dist/allend/LSP/operations.d.ts +47 -0
- package/dist/allend/LSP/operations.js +156 -0
- package/dist/allend/LSP/operations.js.map +1 -0
- package/dist/allend/LSP/orders.d.ts +69 -0
- package/dist/allend/LSP/orders.js +303 -0
- package/dist/allend/LSP/orders.js.map +1 -0
- package/dist/allend/LSP/pods.d.ts +26 -0
- package/dist/allend/LSP/pods.js +137 -0
- package/dist/allend/LSP/pods.js.map +1 -0
- package/dist/allend/LSP/pricing.d.ts +35 -0
- package/dist/allend/LSP/pricing.js +151 -0
- package/dist/allend/LSP/pricing.js.map +1 -0
- package/dist/allend/LSP/psl.d.ts +15 -0
- package/dist/allend/LSP/psl.js +68 -0
- package/dist/allend/LSP/psl.js.map +1 -0
- package/dist/allend/LSP/warehouses.d.ts +23 -0
- package/dist/allend/LSP/warehouses.js +94 -0
- package/dist/allend/LSP/warehouses.js.map +1 -0
- package/dist/allend/MSI/Controls.d.ts +9 -5
- package/dist/allend/MSI/Controls.js +269 -297
- package/dist/allend/MSI/Controls.js.map +1 -1
- package/dist/allend/MSI/Handles.d.ts +5 -4
- package/dist/allend/MSI/Handles.js +136 -233
- package/dist/allend/MSI/Handles.js.map +1 -1
- package/dist/allend/MSI/Plugins.d.ts +2 -2
- package/dist/allend/MSI/Plugins.js +12 -15
- package/dist/allend/MSI/Plugins.js.map +1 -1
- package/dist/allend/MSI/index.d.ts +4 -3
- package/dist/allend/MSI/index.js +123 -87
- package/dist/allend/MSI/index.js.map +1 -1
- package/dist/allend/MSI/native.d.ts +32 -0
- package/dist/allend/MSI/native.js +246 -0
- package/dist/allend/MSI/native.js.map +1 -0
- package/dist/allend/MSI/token.d.ts +12 -0
- package/dist/allend/MSI/token.js +21 -0
- package/dist/allend/MSI/token.js.map +1 -0
- package/dist/allend/OTPAuth/index.d.ts +77 -0
- package/dist/allend/OTPAuth/index.js +69 -0
- package/dist/allend/OTPAuth/index.js.map +1 -0
- package/dist/allend/Pipelines/analytics.d.ts +8 -0
- package/dist/allend/Pipelines/analytics.js +24 -0
- package/dist/allend/Pipelines/analytics.js.map +1 -0
- package/dist/allend/Pipelines/escalations.d.ts +8 -0
- package/dist/allend/Pipelines/escalations.js +25 -0
- package/dist/allend/Pipelines/escalations.js.map +1 -0
- package/dist/allend/Pipelines/executions.d.ts +11 -0
- package/dist/allend/Pipelines/executions.js +44 -0
- package/dist/allend/Pipelines/executions.js.map +1 -0
- package/dist/allend/Pipelines/index.d.ts +42 -0
- package/dist/allend/Pipelines/index.js +88 -0
- package/dist/allend/Pipelines/index.js.map +1 -0
- package/dist/allend/Pipelines/interventions.d.ts +8 -0
- package/dist/allend/Pipelines/interventions.js +25 -0
- package/dist/allend/Pipelines/interventions.js.map +1 -0
- package/dist/allend/Pipelines/monitor.d.ts +9 -0
- package/dist/allend/Pipelines/monitor.js +30 -0
- package/dist/allend/Pipelines/monitor.js.map +1 -0
- package/dist/allend/Pipelines/queries.d.ts +8 -0
- package/dist/allend/Pipelines/queries.js +25 -0
- package/dist/allend/Pipelines/queries.js.map +1 -0
- package/dist/allend/Pipelines/templates.d.ts +11 -0
- package/dist/allend/Pipelines/templates.js +46 -0
- package/dist/allend/Pipelines/templates.js.map +1 -0
- package/dist/allend/Pipelines/utils.d.ts +0 -0
- package/dist/allend/Pipelines/utils.js +2 -0
- package/dist/allend/Pipelines/utils.js.map +1 -0
- package/dist/allend/Pipelines/webhooks.d.ts +9 -0
- package/dist/allend/Pipelines/webhooks.js +35 -0
- package/dist/allend/Pipelines/webhooks.js.map +1 -0
- package/dist/allend/Pipelines/workers.d.ts +11 -0
- package/dist/allend/Pipelines/workers.js +45 -0
- package/dist/allend/Pipelines/workers.js.map +1 -0
- package/dist/allend/Queries/capacity.d.ts +11 -0
- package/dist/allend/Queries/capacity.js +44 -0
- package/dist/allend/Queries/capacity.js.map +1 -0
- package/dist/allend/Queries/discovery.d.ts +11 -0
- package/dist/allend/Queries/discovery.js +45 -0
- package/dist/allend/Queries/discovery.js.map +1 -0
- package/dist/allend/Queries/index.d.ts +27 -0
- package/dist/allend/Queries/index.js +40 -0
- package/dist/allend/Queries/index.js.map +1 -0
- package/dist/allend/Queries/matching.d.ts +7 -0
- package/dist/allend/Queries/matching.js +18 -0
- package/dist/allend/Queries/matching.js.map +1 -0
- package/dist/allend/Queries/performance.d.ts +9 -0
- package/dist/allend/Queries/performance.js +31 -0
- package/dist/allend/Queries/performance.js.map +1 -0
- package/dist/allend/Queries/pricing.d.ts +11 -0
- package/dist/allend/Queries/pricing.js +43 -0
- package/dist/allend/Queries/pricing.js.map +1 -0
- package/dist/allend/{DClient/Event.d.ts → Realtime/index.d.ts} +2 -6
- package/dist/allend/Realtime/index.js +62 -0
- package/dist/allend/Realtime/index.js.map +1 -0
- package/dist/allend/Shared/account.d.ts +10 -0
- package/dist/allend/Shared/account.js +22 -0
- package/dist/allend/Shared/account.js.map +1 -0
- package/dist/allend/Shared/buckets.d.ts +21 -0
- package/dist/allend/Shared/buckets.js +95 -0
- package/dist/allend/Shared/buckets.js.map +1 -0
- package/dist/allend/Shared/context.d.ts +14 -0
- package/dist/allend/Shared/context.js +33 -0
- package/dist/allend/Shared/context.js.map +1 -0
- package/dist/allend/Shared/faqs.d.ts +20 -0
- package/dist/allend/Shared/faqs.js +87 -0
- package/dist/allend/Shared/faqs.js.map +1 -0
- package/dist/allend/Shared/invitation.d.ts +42 -0
- package/dist/allend/Shared/invitation.js +40 -0
- package/dist/allend/Shared/invitation.js.map +1 -0
- package/dist/allend/Shared/operators.d.ts +39 -0
- package/dist/allend/Shared/operators.js +37 -0
- package/dist/allend/Shared/operators.js.map +1 -0
- package/dist/allend/Shared/users.d.ts +11 -0
- package/dist/allend/Shared/users.js +29 -0
- package/dist/allend/Shared/users.js.map +1 -0
- package/dist/allend/Tracking/index.d.ts +17 -0
- package/dist/allend/Tracking/index.js +39 -0
- package/dist/allend/Tracking/index.js.map +1 -0
- package/dist/allend/Utilities/common.d.ts +12 -0
- package/dist/allend/Utilities/common.js +53 -0
- package/dist/allend/Utilities/common.js.map +1 -0
- package/dist/allend/Utilities/fares.d.ts +10 -0
- package/dist/allend/Utilities/fares.js +39 -0
- package/dist/allend/Utilities/fares.js.map +1 -0
- package/dist/allend/Utilities/index.d.ts +23 -0
- package/dist/allend/Utilities/index.js +36 -0
- package/dist/allend/Utilities/index.js.map +1 -0
- package/dist/allend/Utilities/nearby.d.ts +9 -0
- package/dist/allend/Utilities/nearby.js +32 -0
- package/dist/allend/Utilities/nearby.js.map +1 -0
- package/dist/allend/Workflows/Client.d.ts +17 -0
- package/dist/allend/Workflows/Client.js +50 -0
- package/dist/allend/Workflows/Client.js.map +1 -0
- package/dist/allend/Workflows/Delivery.d.ts +36 -0
- package/dist/allend/Workflows/Delivery.js +16 -0
- package/dist/allend/Workflows/Delivery.js.map +1 -0
- package/dist/allend/Workflows/index.d.ts +11 -0
- package/dist/allend/Workflows/index.js +25 -0
- package/dist/allend/Workflows/index.js.map +1 -0
- package/dist/allend/Workspace/index.d.ts +162 -0
- package/dist/allend/Workspace/index.js +220 -0
- package/dist/allend/Workspace/index.js.map +1 -0
- package/dist/allend/index.d.ts +8 -5
- package/dist/allend/index.js +15 -8
- package/dist/allend/index.js.map +1 -1
- package/dist/backend/Auth.d.ts +28 -4
- package/dist/backend/Auth.js +125 -245
- package/dist/backend/Auth.js.map +1 -1
- package/dist/baseUrl.d.ts +56 -0
- package/dist/baseUrl.js +72 -4
- package/dist/baseUrl.js.map +1 -1
- package/dist/core.d.ts +88 -0
- package/dist/core.js +121 -0
- package/dist/core.js.map +1 -0
- package/dist/error.d.ts +17 -0
- package/dist/error.js +26 -0
- package/dist/error.js.map +1 -0
- package/dist/index.d.ts +30 -12
- package/dist/index.js +38 -14
- package/dist/index.js.map +1 -1
- package/dist/react-native.d.ts +30 -0
- package/dist/react-native.js +55 -0
- package/dist/react-native.js.map +1 -0
- package/dist/types/access.d.ts +64 -7
- package/dist/types/auth.d.ts +17 -17
- package/dist/types/channel.d.ts +45 -0
- package/dist/types/index.d.ts +379 -237
- package/dist/utils/index.d.ts +25 -0
- package/dist/utils/index.js +11 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/stream.js +25 -26
- package/dist/utils/stream.js.map +1 -1
- package/package.json +38 -18
- package/src/allend/Access.ts +143 -13
- package/src/allend/Agent/consolidation.ts +43 -0
- package/src/allend/Agent/delivery.ts +51 -0
- package/src/allend/Agent/dispatch.ts +27 -0
- package/src/allend/Agent/index.ts +113 -0
- package/src/allend/Agent/navigation.ts +27 -0
- package/src/allend/Agent/origin.ts +36 -0
- package/src/allend/Agent/reallocation.ts +16 -0
- package/src/allend/Agent/realtime.ts +140 -0
- package/src/allend/Agent/rides.ts +61 -0
- package/src/allend/Agent/shipping.ts +51 -0
- package/src/allend/CSP/analytics.ts +61 -0
- package/src/allend/CSP/index.ts +57 -0
- package/src/allend/CSP/inventory.ts +96 -0
- package/src/allend/CSP/orders.ts +121 -0
- package/src/allend/CSP/webhooks.ts +68 -0
- package/src/allend/Customer/index.ts +56 -0
- package/src/allend/Customer/intents.ts +66 -0
- package/src/allend/Customer/orders.ts +51 -0
- package/src/allend/Customer/rides.ts +60 -0
- package/src/allend/DEV/developers.ts +42 -0
- package/src/allend/DEV/index.ts +48 -0
- package/src/allend/IoTSP/backend.ts +103 -0
- package/src/allend/IoTSP/devices.ts +74 -0
- package/src/allend/IoTSP/index.ts +69 -0
- package/src/allend/IoTSP/rules.ts +99 -0
- package/src/allend/IoTSP/topics.ts +99 -0
- package/src/allend/LSP/agents.ts +115 -0
- package/src/allend/LSP/carriers.ts +408 -0
- package/src/allend/LSP/coverage.ts +212 -0
- package/src/allend/LSP/fleets.ts +505 -0
- package/src/allend/LSP/hubs.ts +245 -0
- package/src/allend/LSP/index.ts +75 -0
- package/src/allend/LSP/inventory.ts +65 -0
- package/src/allend/LSP/operations.ts +202 -0
- package/src/allend/LSP/orders.ts +397 -0
- package/src/allend/LSP/pods.ts +176 -0
- package/src/allend/LSP/pricing.ts +192 -0
- package/src/allend/LSP/psl.ts +81 -0
- package/src/allend/LSP/warehouses.ts +118 -0
- package/src/allend/MSI/Controls.ts +109 -90
- package/src/allend/MSI/Handles.ts +24 -15
- package/src/allend/MSI/Plugins.ts +3 -3
- package/src/allend/MSI/index.ts +85 -16
- package/src/allend/MSI/native.tsx +314 -0
- package/src/allend/MSI/token.ts +20 -0
- package/src/allend/OTPAuth/index.ts +130 -0
- package/src/allend/Pipelines/analytics.ts +25 -0
- package/src/allend/Pipelines/escalations.ts +26 -0
- package/src/allend/Pipelines/executions.ts +51 -0
- package/src/allend/Pipelines/index.ts +125 -0
- package/src/allend/Pipelines/interventions.ts +27 -0
- package/src/allend/Pipelines/monitor.ts +33 -0
- package/src/allend/Pipelines/queries.ts +27 -0
- package/src/allend/Pipelines/templates.ts +51 -0
- package/src/allend/Pipelines/utils.ts +0 -0
- package/src/allend/Pipelines/webhooks.ts +36 -0
- package/src/allend/Pipelines/workers.ts +49 -0
- package/src/allend/Queries/capacity.ts +51 -0
- package/src/allend/Queries/discovery.ts +53 -0
- package/src/allend/Queries/index.ts +58 -0
- package/src/allend/Queries/matching.ts +16 -0
- package/src/allend/Queries/performance.ts +35 -0
- package/src/allend/Queries/pricing.ts +51 -0
- package/src/allend/{DClient/Event.ts → Realtime/index.ts} +23 -22
- package/src/allend/Shared/account.ts +24 -0
- package/src/allend/Shared/buckets.ts +117 -0
- package/src/allend/Shared/context.ts +36 -0
- package/src/allend/Shared/faqs.ts +106 -0
- package/src/allend/Shared/invitation.ts +77 -0
- package/src/allend/Shared/operators.ts +84 -0
- package/src/allend/Shared/users.ts +32 -0
- package/src/allend/Tracking/index.ts +48 -0
- package/src/allend/Utilities/common.ts +63 -0
- package/src/allend/Utilities/fares.ts +45 -0
- package/src/allend/Utilities/index.ts +52 -0
- package/src/allend/Utilities/nearby.ts +36 -0
- package/src/allend/{DClient → Workflows}/Client.ts +12 -22
- package/src/allend/Workflows/Delivery.ts +94 -0
- package/src/allend/Workflows/index.ts +31 -0
- package/src/allend/Workspace/index.ts +302 -0
- package/src/allend/index.ts +23 -10
- package/src/backend/Auth.ts +68 -35
- package/src/baseUrl.ts +81 -7
- package/src/core.ts +145 -0
- package/src/error.ts +27 -0
- package/src/index.ts +25 -17
- package/src/react-native.ts +43 -0
- package/src/types/access.d.ts +64 -7
- package/src/types/auth.d.ts +17 -17
- package/src/types/channel.d.ts +45 -0
- package/src/types/index.d.ts +379 -237
- package/src/utils/index.ts +33 -1
- package/dist/allend/DAuth/index.d.ts +0 -20
- package/dist/allend/DAuth/index.js +0 -92
- package/dist/allend/DAuth/index.js.map +0 -1
- package/dist/allend/DClient/Client.d.ts +0 -10
- package/dist/allend/DClient/Client.js +0 -144
- package/dist/allend/DClient/Client.js.map +0 -1
- package/dist/allend/DClient/Event.js +0 -100
- package/dist/allend/DClient/Event.js.map +0 -1
- package/dist/allend/DClient/Order.d.ts +0 -49
- package/dist/allend/DClient/Order.js +0 -601
- package/dist/allend/DClient/Order.js.map +0 -1
- package/dist/bundle.js +0 -1
- package/src/allend/DAuth/index.ts +0 -39
- package/src/allend/DClient/Order.ts +0 -452
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.plugin = plugin;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const react_native_1 = require("react-native");
|
|
10
|
+
const react_native_webview_1 = require("react-native-webview");
|
|
11
|
+
const webview_io_1 = __importDefault(require("webview.io"));
|
|
12
|
+
const Handles_1 = __importDefault(require("./Handles"));
|
|
13
|
+
const Controls_1 = __importDefault(require("./Controls"));
|
|
14
|
+
const Plugins_1 = __importDefault(require("./Plugins"));
|
|
15
|
+
const token_1 = __importDefault(require("./token"));
|
|
16
|
+
const REGISTERED_PLUGINS = {},
|
|
17
|
+
// Time allowed for the gateway to acknowledge `bind`
|
|
18
|
+
BIND_TIMEOUT = 10000,
|
|
19
|
+
/**
|
|
20
|
+
* Events the gateway is allowed to send us. Anything else is dropped by the
|
|
21
|
+
* transport before it reaches a listener.
|
|
22
|
+
*
|
|
23
|
+
* Kept identical to the web entry: the gateway speaks one protocol, and the
|
|
24
|
+
* two entries differ only in transport.
|
|
25
|
+
*/
|
|
26
|
+
ALLOWED_INCOMING_EVENTS = [
|
|
27
|
+
'error',
|
|
28
|
+
'ready',
|
|
29
|
+
'pick:location',
|
|
30
|
+
'current:location',
|
|
31
|
+
'current:location:error',
|
|
32
|
+
'live:location:start',
|
|
33
|
+
'live:location:update',
|
|
34
|
+
'live:location:end',
|
|
35
|
+
'route',
|
|
36
|
+
'navigation:direction'
|
|
37
|
+
];
|
|
38
|
+
/**
|
|
39
|
+
* Forward the WebView's console into the React Native log.
|
|
40
|
+
*
|
|
41
|
+
* Injected only in dev: in production it turns every gateway log into a bridge
|
|
42
|
+
* message, which is pure overhead on the very traffic the map depends on.
|
|
43
|
+
*/
|
|
44
|
+
function injectedConsole() {
|
|
45
|
+
return `
|
|
46
|
+
(function(){
|
|
47
|
+
var forward = function( level ){
|
|
48
|
+
var original = console[ level ]
|
|
49
|
+
console[ level ] = function(){
|
|
50
|
+
var args = Array.prototype.slice.call( arguments )
|
|
51
|
+
try {
|
|
52
|
+
window.ReactNativeWebView.postMessage( JSON.stringify({
|
|
53
|
+
type: '__console',
|
|
54
|
+
level: level,
|
|
55
|
+
message: args.map( String ).join(' ')
|
|
56
|
+
}) )
|
|
57
|
+
}
|
|
58
|
+
catch( error ){}
|
|
59
|
+
|
|
60
|
+
original.apply( console, args )
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
forward('log')
|
|
65
|
+
forward('warn')
|
|
66
|
+
forward('error')
|
|
67
|
+
})();
|
|
68
|
+
`;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Resolve the gateway host for the running platform.
|
|
72
|
+
*
|
|
73
|
+
* A native app cannot reach the developer's machine on `localhost`: the Android
|
|
74
|
+
* emulator maps the host to 10.0.2.2, and a physical device needs the LAN
|
|
75
|
+
* address, supplied as `devHostname`.
|
|
76
|
+
*/
|
|
77
|
+
function gatewayURL({ env, devHostname }) {
|
|
78
|
+
if (env !== 'dev')
|
|
79
|
+
return 'https://msi.dedot.io';
|
|
80
|
+
const host = devHostname
|
|
81
|
+
|| react_native_1.Platform.select({ android: '10.0.2.2', default: 'localhost' });
|
|
82
|
+
return `http://${host}:4800`;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* MSI gateway for React Native.
|
|
86
|
+
*
|
|
87
|
+
* Mirrors the web entry: same Controls/Handles/Plugins surface, same protocol,
|
|
88
|
+
* same event allowlist -- only the transport and the mounting differ.
|
|
89
|
+
*/
|
|
90
|
+
exports.default = (0, react_1.forwardRef)((props, ref) => {
|
|
91
|
+
const webViewRef = (0, react_1.useRef)(null), wioRef = (0, react_1.useRef)(null), apiRef = (0, react_1.useRef)(null), isInitializedRef = (0, react_1.useRef)(false), [isConnected, setIsConnected] = (0, react_1.useState)(false), [isReady, setIsReady] = (0, react_1.useState)(false), baseURL = gatewayURL(props),
|
|
92
|
+
/**
|
|
93
|
+
* Report an error once, in Error form, whatever shape the transport used.
|
|
94
|
+
*/
|
|
95
|
+
reportError = (0, react_1.useCallback)((error) => {
|
|
96
|
+
var _a;
|
|
97
|
+
const normalized = error instanceof Error
|
|
98
|
+
? error
|
|
99
|
+
: new Error(typeof error === 'string' ? error : (error === null || error === void 0 ? void 0 : error.error) || 'Unknown MSI error');
|
|
100
|
+
(_a = props.onError) === null || _a === void 0 ? void 0 : _a.call(props, normalized);
|
|
101
|
+
}, [props.onError]), initializeConnection = (0, react_1.useCallback)(() => {
|
|
102
|
+
if (!wioRef.current || !webViewRef.current)
|
|
103
|
+
return;
|
|
104
|
+
wioRef.current.initiate(webViewRef, baseURL);
|
|
105
|
+
}, [baseURL]);
|
|
106
|
+
// Expose the control surface to the host
|
|
107
|
+
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
108
|
+
get controls() { var _a; return (_a = apiRef.current) === null || _a === void 0 ? void 0 : _a.controls; },
|
|
109
|
+
get handles() { var _a; return (_a = apiRef.current) === null || _a === void 0 ? void 0 : _a.handles; },
|
|
110
|
+
get plugins() { var _a; return (_a = apiRef.current) === null || _a === void 0 ? void 0 : _a.plugins; },
|
|
111
|
+
isReady: () => isConnected && isReady,
|
|
112
|
+
retry: () => {
|
|
113
|
+
isInitializedRef.current = false;
|
|
114
|
+
initializeConnection();
|
|
115
|
+
}
|
|
116
|
+
}), [isConnected, isReady, initializeConnection]);
|
|
117
|
+
(0, react_1.useEffect)(() => {
|
|
118
|
+
const wio = wioRef.current = new webview_io_1.default({
|
|
119
|
+
type: 'WEBVIEW',
|
|
120
|
+
debug: props.env === 'dev',
|
|
121
|
+
allowedIncomingEvents: ALLOWED_INCOMING_EVENTS,
|
|
122
|
+
maxMessagesPerSecond: 100,
|
|
123
|
+
connectionTimeout: 15000,
|
|
124
|
+
connectionPingInterval: 2000,
|
|
125
|
+
maxConnectionAttempts: 5,
|
|
126
|
+
autoReconnect: true,
|
|
127
|
+
heartbeatInterval: 30000
|
|
128
|
+
});
|
|
129
|
+
wio
|
|
130
|
+
.on('connect', async () => {
|
|
131
|
+
try {
|
|
132
|
+
/**
|
|
133
|
+
* Resolve the token here rather than at mount, so a reconnect after a
|
|
134
|
+
* backgrounded app or a dropped bridge binds with a current token.
|
|
135
|
+
*/
|
|
136
|
+
const { getAccessToken, onReady, onError, onLoaded, style, ...config } = props;
|
|
137
|
+
await wio.emitAsync('bind', {
|
|
138
|
+
...config,
|
|
139
|
+
accessToken: (0, token_1.default)(props),
|
|
140
|
+
origin: 'react-native'
|
|
141
|
+
}, BIND_TIMEOUT);
|
|
142
|
+
setIsConnected(true);
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
reportError(error);
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
.on('ready', () => {
|
|
149
|
+
var _a;
|
|
150
|
+
setIsReady(true);
|
|
151
|
+
(_a = props.onReady) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
152
|
+
})
|
|
153
|
+
.on('disconnect', () => {
|
|
154
|
+
setIsConnected(false);
|
|
155
|
+
setIsReady(false);
|
|
156
|
+
})
|
|
157
|
+
.on('reconnecting', () => {
|
|
158
|
+
setIsConnected(false);
|
|
159
|
+
setIsReady(false);
|
|
160
|
+
})
|
|
161
|
+
.on('connect_timeout', ({ attempts }) => reportError(new Error(`Failed to connect after ${attempts} attempts`)))
|
|
162
|
+
.on('reconnection_failed', ({ attempts }) => reportError(new Error(`Reconnection failed after ${attempts} attempts`)))
|
|
163
|
+
.on('error', (error) => {
|
|
164
|
+
// Rate limiting is throttling, not a failure of the map
|
|
165
|
+
if ((error === null || error === void 0 ? void 0 : error.type) === 'RATE_LIMIT_EXCEEDED')
|
|
166
|
+
return;
|
|
167
|
+
reportError(error);
|
|
168
|
+
});
|
|
169
|
+
/**
|
|
170
|
+
* Pause gateway work while backgrounded, and re-establish the bridge on
|
|
171
|
+
* resume -- iOS in particular tears down the WebView's socket.
|
|
172
|
+
*/
|
|
173
|
+
const subscription = react_native_1.AppState.addEventListener('change', (state) => {
|
|
174
|
+
if (state === 'background') {
|
|
175
|
+
wio.emit('app:background');
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (state === 'active') {
|
|
179
|
+
wio.emit('app:foreground');
|
|
180
|
+
!wio.isConnected() && initializeConnection();
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return () => {
|
|
184
|
+
subscription.remove();
|
|
185
|
+
wio.disconnect();
|
|
186
|
+
apiRef.current = null;
|
|
187
|
+
isInitializedRef.current = false;
|
|
188
|
+
};
|
|
189
|
+
}, []);
|
|
190
|
+
// Build the control surface once the bridge is both connected and ready
|
|
191
|
+
(0, react_1.useEffect)(() => {
|
|
192
|
+
var _a;
|
|
193
|
+
if (isInitializedRef.current || !wioRef.current || !isConnected || !isReady)
|
|
194
|
+
return;
|
|
195
|
+
const chn = wioRef.current, controls = new Controls_1.default(chn, props), handles = new Handles_1.default(chn, controls, props), plugins = new Plugins_1.default(chn, handles, controls, props);
|
|
196
|
+
plugins.mount(REGISTERED_PLUGINS);
|
|
197
|
+
apiRef.current = { controls, handles, plugins };
|
|
198
|
+
isInitializedRef.current = true;
|
|
199
|
+
(_a = props.onLoaded) === null || _a === void 0 ? void 0 : _a.call(props, apiRef.current);
|
|
200
|
+
}, [isConnected, isReady]);
|
|
201
|
+
const onMessage = (event) => {
|
|
202
|
+
var _a;
|
|
203
|
+
// Console forwarding rides the same bridge; peel it off before WIO sees it
|
|
204
|
+
try {
|
|
205
|
+
const data = JSON.parse(event.nativeEvent.data);
|
|
206
|
+
if ((data === null || data === void 0 ? void 0 : data.type) === '__console') {
|
|
207
|
+
const message = `[MSI gateway] ${data.message}`;
|
|
208
|
+
switch (data.level) {
|
|
209
|
+
case 'error':
|
|
210
|
+
console.error(message);
|
|
211
|
+
break;
|
|
212
|
+
case 'warn':
|
|
213
|
+
console.warn(message);
|
|
214
|
+
break;
|
|
215
|
+
default: console.debug(message);
|
|
216
|
+
}
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
// Not console traffic -- fall through to the transport
|
|
222
|
+
}
|
|
223
|
+
(_a = wioRef.current) === null || _a === void 0 ? void 0 : _a.handleMessage(event);
|
|
224
|
+
};
|
|
225
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: [styles.container, props.style], children: (0, jsx_runtime_1.jsx)(react_native_webview_1.WebView, { ref: webViewRef, source: { uri: baseURL }, style: styles.webview, injectedJavaScript: `
|
|
226
|
+
${props.env === 'dev' ? injectedConsole() : ''}
|
|
227
|
+
${new webview_io_1.default({ type: 'WEBVIEW' }).getInjectedJavaScript()}
|
|
228
|
+
`, javaScriptEnabled: true, domStorageEnabled: true, geolocationEnabled: true, allowsInlineMediaPlayback: true, cacheEnabled: props.env !== 'dev', incognito: props.env === 'dev', androidLayerType: "hardware", allowsBackForwardNavigationGestures: false, bounces: false, scrollEnabled: false, originWhitelist: [baseURL], onMessage: onMessage, onLoadEnd: initializeConnection, onError: ({ nativeEvent }) => reportError(new Error((nativeEvent === null || nativeEvent === void 0 ? void 0 : nativeEvent.description) || 'WebView error')) }) }));
|
|
229
|
+
});
|
|
230
|
+
/**
|
|
231
|
+
* Register a plugin to be mounted on every MSI instance.
|
|
232
|
+
*/
|
|
233
|
+
function plugin(name, fn) {
|
|
234
|
+
REGISTERED_PLUGINS[name] = fn;
|
|
235
|
+
}
|
|
236
|
+
const styles = react_native_1.StyleSheet.create({
|
|
237
|
+
container: {
|
|
238
|
+
flex: 1,
|
|
239
|
+
backgroundColor: '#f0f0f0'
|
|
240
|
+
},
|
|
241
|
+
webview: {
|
|
242
|
+
flex: 1,
|
|
243
|
+
backgroundColor: 'transparent'
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
//# sourceMappingURL=native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/allend/MSI/native.tsx"],"names":[],"mappings":";;;;;AA4SA,wBAEC;;AA5SD,iCAAwG;AACxG,+CAAwF;AACxF,+DAA8C;AAC9C,4DAA4B;AAC5B,wDAA+B;AAC/B,0DAAiC;AACjC,wDAAgD;AAChD,oDAAwC;AAQxC,MACA,kBAAkB,GAAgC,EAAE;AAEpD,qDAAqD;AACrD,YAAY,GAAG,KAAK;AAEpB;;;;;;GAMG;AACH,uBAAuB,GAAG;IACxB,OAAO;IACP,OAAO;IACP,eAAe;IACf,kBAAkB;IAClB,wBAAwB;IACxB,qBAAqB;IACrB,sBAAsB;IACtB,mBAAmB;IACnB,OAAO;IACP,sBAAsB;CACvB,CAAA;AAED;;;;;GAKG;AACH,SAAS,eAAe;IACtB,OAAO;;;;;;;;;;;;;;;;;;;;;;;GAuBN,CAAA;AACH,CAAC;AAED;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,EAAE,GAAG,EAAE,WAAW,EAAc;IAClD,IAAI,GAAG,KAAK,KAAK;QAAG,OAAO,sBAAsB,CAAA;IAEjD,MAAM,IAAI,GAAG,WAAW;WACf,uBAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAA;IAEvE,OAAO,UAAU,IAAI,OAAO,CAAA;AAC9B,CAAC;AAcD;;;;;GAKG;AACH,kBAAe,IAAA,kBAAU,EAAoB,CAAE,KAA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B,QACjB,kBAAkB,QAClB,yBAAyB,QACzB,YAAY,EAAE,KAAK,CAAC,GAAG,KAAK,KAAK,EACjC,SAAS,EAAE,KAAK,CAAC,GAAG,KAAK,KAAK,EAC9B,gBAAgB,EAAC,UAAU,EAC3B,mCAAmC,EAAE,KAAK,EAC1C,OAAO,EAAE,KAAK,EACd,aAAa,EAAE,KAAK,EACpB,eAAe,EAAE,CAAE,OAAO,CAAE,EAC5B,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,oBAAoB,EAC/B,OAAO,EAAE,CAAE,EAAE,WAAW,EAAO,EAAG,EAAE,CAAC,WAAW,CAAE,IAAI,KAAK,CAAE,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,KAAI,eAAe,CAAC,CAAE,GAC3G,GACG,CACR,CAAA;AACH,CAAC,CAAE,CAAA;AAEH;;GAEG;AACH,SAAgB,MAAM,CAAK,IAAY,EAAE,EAAa;IACpD,kBAAkB,CAAE,IAAI,CAAE,GAAG,EAAE,CAAA;AACjC,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,SAAS;KAC3B;IACD,OAAO,EAAE;QACP,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,aAAa;KAC/B;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MapOptions } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the access token to bind the gateway with.
|
|
4
|
+
*
|
|
5
|
+
* `getAccessToken` wins when supplied, and is deliberately called at every bind
|
|
6
|
+
* rather than read once: a host that rotates tokens can hand back a fresh one
|
|
7
|
+
* on reconnect without the caller having to drive `controls.refreshToken()`.
|
|
8
|
+
*
|
|
9
|
+
* @param options - Map options carrying either form of the token
|
|
10
|
+
* @return - A non-empty access token
|
|
11
|
+
*/
|
|
12
|
+
export default function resolveAccessToken(options: MapOptions): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = resolveAccessToken;
|
|
4
|
+
/**
|
|
5
|
+
* Resolve the access token to bind the gateway with.
|
|
6
|
+
*
|
|
7
|
+
* `getAccessToken` wins when supplied, and is deliberately called at every bind
|
|
8
|
+
* rather than read once: a host that rotates tokens can hand back a fresh one
|
|
9
|
+
* on reconnect without the caller having to drive `controls.refreshToken()`.
|
|
10
|
+
*
|
|
11
|
+
* @param options - Map options carrying either form of the token
|
|
12
|
+
* @return - A non-empty access token
|
|
13
|
+
*/
|
|
14
|
+
function resolveAccessToken(options) {
|
|
15
|
+
var _a;
|
|
16
|
+
const token = ((_a = options.getAccessToken) === null || _a === void 0 ? void 0 : _a.call(options)) || options.accessToken;
|
|
17
|
+
if (!token)
|
|
18
|
+
throw new Error('Invalid Access Token');
|
|
19
|
+
return token;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/allend/MSI/token.ts"],"names":[],"mappings":";;AAYA,qCAOC;AAjBD;;;;;;;;;GASG;AACH,SAAwB,kBAAkB,CAAE,OAAmB;;IAC7D,MAAM,KAAK,GAAG,CAAA,MAAA,OAAO,CAAC,cAAc,uDAAI,KAAI,OAAO,CAAC,WAAW,CAAA;IAE/D,IAAI,CAAC,KAAK;QACR,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAA;IAEzC,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { AccessOptions, UserSession } from '../../types/access';
|
|
2
|
+
import AccessManager from '../Access';
|
|
3
|
+
import { type Res } from '../../utils';
|
|
4
|
+
export type SigninBody = {
|
|
5
|
+
phone: string;
|
|
6
|
+
/** Device fingerprint — an object or its JSON string. */
|
|
7
|
+
device: string | Record<string, any>;
|
|
8
|
+
/** ISO 3166-1 alpha-2. */
|
|
9
|
+
country?: string;
|
|
10
|
+
};
|
|
11
|
+
export type SigninResult = {
|
|
12
|
+
/** What the caller must do next — verification, or account creation first. */
|
|
13
|
+
next: string;
|
|
14
|
+
/**
|
|
15
|
+
* The OTP itself, returned only when de.auth runs with
|
|
16
|
+
* NODE_ENV=development. In every other environment the code arrives by SMS
|
|
17
|
+
* and this is absent, which is what makes unattended sign-in a dev-only
|
|
18
|
+
* capability rather than a hole.
|
|
19
|
+
*/
|
|
20
|
+
testVCode?: number;
|
|
21
|
+
};
|
|
22
|
+
export type CreateAccountBody = {
|
|
23
|
+
phone: string;
|
|
24
|
+
agreeTerms: boolean | string;
|
|
25
|
+
firstName?: string;
|
|
26
|
+
lastName?: string;
|
|
27
|
+
photo?: string;
|
|
28
|
+
type?: string;
|
|
29
|
+
country?: string;
|
|
30
|
+
newsletters?: boolean | string;
|
|
31
|
+
};
|
|
32
|
+
export type VerifyResult = {
|
|
33
|
+
ctoken?: string;
|
|
34
|
+
deviceId?: string;
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
};
|
|
37
|
+
export default class OTPAuth extends AccessManager {
|
|
38
|
+
constructor(access: AccessOptions);
|
|
39
|
+
/** Step 1 — sends the code. */
|
|
40
|
+
signin(body: SigninBody): Promise<Res<SigninResult>>;
|
|
41
|
+
/** Step 2 — exchanges the code for a session. */
|
|
42
|
+
verify(body: {
|
|
43
|
+
phone: string;
|
|
44
|
+
pvc: number;
|
|
45
|
+
new_phone?: string;
|
|
46
|
+
}): Promise<Res<VerifyResult>>;
|
|
47
|
+
/** Step 1a — for a phone de.auth has never seen. */
|
|
48
|
+
setAccount(body: CreateAccountBody): Promise<Res<{
|
|
49
|
+
next: string;
|
|
50
|
+
}>>;
|
|
51
|
+
resendSms(body: {
|
|
52
|
+
phone: string;
|
|
53
|
+
}): Promise<Res<void>>;
|
|
54
|
+
/** GET, with the scope in the querystring — not a POST. */
|
|
55
|
+
signout(querystring?: {
|
|
56
|
+
allDevices?: boolean | string;
|
|
57
|
+
}): Promise<Res<void>>;
|
|
58
|
+
/**
|
|
59
|
+
* Resolve the session to a user, and to a uid.
|
|
60
|
+
*
|
|
61
|
+
* `scope` is not optional in practice: without it de.auth falls back to the
|
|
62
|
+
* calling service's configured scope and then fails its own response
|
|
63
|
+
* validation. This is the same scope de.arch asks for.
|
|
64
|
+
*/
|
|
65
|
+
active(session: UserSession, scope?: string): Promise<Res<{
|
|
66
|
+
uid: string;
|
|
67
|
+
}>>;
|
|
68
|
+
retrieve(querystring?: {
|
|
69
|
+
type?: string;
|
|
70
|
+
}): Promise<Res<{
|
|
71
|
+
user: any;
|
|
72
|
+
}>>;
|
|
73
|
+
search(querystring: Record<string, any>): Promise<Res<any>>;
|
|
74
|
+
updateProfile(body: Record<string, any>): Promise<Res<any>>;
|
|
75
|
+
updateSettings(body: Record<string, any>): Promise<Res<any>>;
|
|
76
|
+
remove(body: Record<string, any>): Promise<Res<void>>;
|
|
77
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Access_1 = __importDefault(require("../Access"));
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
class OTPAuth extends Access_1.default {
|
|
9
|
+
constructor(access) {
|
|
10
|
+
super(access, 'ASI');
|
|
11
|
+
}
|
|
12
|
+
// ── Sign-in ───────────────────────────────────────────────────────────────
|
|
13
|
+
/** Step 1 — sends the code. */
|
|
14
|
+
async signin(body) {
|
|
15
|
+
if (!body.phone)
|
|
16
|
+
throw new Error('<phone> argument required');
|
|
17
|
+
return this.request({ url: '/signin', method: 'POST', body });
|
|
18
|
+
}
|
|
19
|
+
/** Step 2 — exchanges the code for a session. */
|
|
20
|
+
async verify(body) {
|
|
21
|
+
return this.request({ url: '/verification', method: 'POST', body });
|
|
22
|
+
}
|
|
23
|
+
/** Step 1a — for a phone de.auth has never seen. */
|
|
24
|
+
async setAccount(body) {
|
|
25
|
+
return this.request({ url: '/set-account', method: 'POST', body });
|
|
26
|
+
}
|
|
27
|
+
async resendSms(body) {
|
|
28
|
+
return this.request({ url: '/resend/sms', method: 'POST', body });
|
|
29
|
+
}
|
|
30
|
+
/** GET, with the scope in the querystring — not a POST. */
|
|
31
|
+
async signout(querystring) {
|
|
32
|
+
return this.request({ url: `/signout${(0, utils_1.qs)(querystring)}`, method: 'GET' });
|
|
33
|
+
}
|
|
34
|
+
// ── The signed-in person ──────────────────────────────────────────────────
|
|
35
|
+
/**
|
|
36
|
+
* Resolve the session to a user, and to a uid.
|
|
37
|
+
*
|
|
38
|
+
* `scope` is not optional in practice: without it de.auth falls back to the
|
|
39
|
+
* calling service's configured scope and then fails its own response
|
|
40
|
+
* validation. This is the same scope de.arch asks for.
|
|
41
|
+
*/
|
|
42
|
+
async active(session, scope = 'name:photo:email:phone:timezone') {
|
|
43
|
+
return this.request({
|
|
44
|
+
url: `/user/active${(0, utils_1.qs)({ scope })}`,
|
|
45
|
+
method: 'GET',
|
|
46
|
+
headers: {
|
|
47
|
+
'de-auth-token': session.token,
|
|
48
|
+
'de-auth-device': session.device
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async retrieve(querystring) {
|
|
53
|
+
return this.request({ url: `/user${(0, utils_1.qs)(querystring)}`, method: 'GET' });
|
|
54
|
+
}
|
|
55
|
+
async search(querystring) {
|
|
56
|
+
return this.request({ url: `/user/search${(0, utils_1.qs)(querystring)}`, method: 'GET' });
|
|
57
|
+
}
|
|
58
|
+
async updateProfile(body) {
|
|
59
|
+
return this.request({ url: '/user/profile', method: 'PATCH', body });
|
|
60
|
+
}
|
|
61
|
+
async updateSettings(body) {
|
|
62
|
+
return this.request({ url: '/user/settings', method: 'PATCH', body });
|
|
63
|
+
}
|
|
64
|
+
async remove(body) {
|
|
65
|
+
return this.request({ url: '/user', method: 'DELETE', body });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.default = OTPAuth;
|
|
69
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/allend/OTPAuth/index.ts"],"names":[],"mappings":";;;;;AACA,uDAAqC;AACrC,uCAA0C;AAuD1C,MAAqB,OAAQ,SAAQ,gBAAa;IACjD,YAAa,MAAqB;QACjC,KAAK,CAAE,MAAM,EAAE,KAAK,CAAE,CAAA;IACvB,CAAC;IAED,6EAA6E;IAE7E,+BAA+B;IAC/B,KAAK,CAAC,MAAM,CAAE,IAAgB;QAC7B,IAAI,CAAC,IAAI,CAAC,KAAK;YAAG,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;QAE9D,OAAO,IAAI,CAAC,OAAO,CAAoB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;IACjF,CAAC;IAED,iDAAiD;IACjD,KAAK,CAAC,MAAM,CAAE,IAAwD;QACrE,OAAO,IAAI,CAAC,OAAO,CAAoB,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;IACvF,CAAC;IAED,oDAAoD;IACpD,KAAK,CAAC,UAAU,CAAE,IAAuB;QACxC,OAAO,IAAI,CAAC,OAAO,CAAwB,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;IAC1F,CAAC;IAED,KAAK,CAAC,SAAS,CAAE,IAAuB;QACvC,OAAO,IAAI,CAAC,OAAO,CAAY,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA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,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;IAChF,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,IAAyB;QACtC,OAAO,IAAI,CAAC,OAAO,CAAY,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IACzE,CAAC;CACD;AAxED,0BAwEC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PipelineAnalyticsOverviewValidation, PipelineAnalyticsPipelineValidation } from '@de./types';
|
|
2
|
+
import { type Http } from '../../utils';
|
|
3
|
+
export declare class PipelinesAnalytics {
|
|
4
|
+
private http;
|
|
5
|
+
constructor(http: Http);
|
|
6
|
+
overview(querystring?: PipelineAnalyticsOverviewValidation['querystring']): Promise<PipelineAnalyticsOverviewValidation['response']>;
|
|
7
|
+
pipeline(pid: string, querystring?: PipelineAnalyticsPipelineValidation['querystring']): Promise<PipelineAnalyticsPipelineValidation['response']>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PipelinesAnalytics = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
// ─── Analytics ────────────────────────────────────────────────────────────────
|
|
6
|
+
class PipelinesAnalytics {
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
async overview(querystring) {
|
|
11
|
+
return await this.http.request({
|
|
12
|
+
url: `/pipelines/analytics/overview${(0, utils_1.qs)(querystring)}`,
|
|
13
|
+
method: 'GET'
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
async pipeline(pid, querystring) {
|
|
17
|
+
return await this.http.request({
|
|
18
|
+
url: `/pipelines/analytics/pipeline/${pid}${(0, utils_1.qs)(querystring)}`,
|
|
19
|
+
method: 'GET'
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.PipelinesAnalytics = PipelinesAnalytics;
|
|
24
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../../src/allend/Pipelines/analytics.ts"],"names":[],"mappings":";;;AAIA,uCAAgE;AAEhE,iFAAiF;AAEjF,MAAa,kBAAkB;IAC9B,YAAqB,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAEnC,KAAK,CAAC,QAAQ,CAAE,WAAgE;QAC/E,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAkD;YAC/E,GAAG,EAAE,gCAAgC,IAAA,UAAE,EAAE,WAAW,CAAE,EAAE;YACxD,MAAM,EAAE,KAAK;SACb,CAAC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,QAAQ,CAAE,GAAW,EAAE,WAAgE;QAC5F,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAkD;YAC/E,GAAG,EAAE,iCAAiC,GAAG,GAAG,IAAA,UAAE,EAAE,WAAW,CAAE,EAAE;YAC/D,MAAM,EAAE,KAAK;SACb,CAAC,CAAA;IACH,CAAC;CACD;AAhBD,gDAgBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PipelineEscalationListValidation, PipelineEscalationResolveValidation } from '@de./types';
|
|
2
|
+
import { type Http } from '../../utils';
|
|
3
|
+
export declare class PipelinesEscalations {
|
|
4
|
+
private http;
|
|
5
|
+
constructor(http: Http);
|
|
6
|
+
list(querystring?: PipelineEscalationListValidation['querystring']): Promise<PipelineEscalationListValidation['response']>;
|
|
7
|
+
resolve(id: string, body?: PipelineEscalationResolveValidation['body']): Promise<PipelineEscalationResolveValidation['response']>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PipelinesEscalations = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
// ─── Escalations ──────────────────────────────────────────────────────────────
|
|
6
|
+
class PipelinesEscalations {
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
async list(querystring) {
|
|
11
|
+
return await this.http.request({
|
|
12
|
+
url: `/pipelines/escalations${(0, utils_1.qs)(querystring)}`,
|
|
13
|
+
method: 'GET'
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
async resolve(id, body) {
|
|
17
|
+
return await this.http.request({
|
|
18
|
+
url: `/pipelines/escalations/${id}/resolve`,
|
|
19
|
+
method: 'POST',
|
|
20
|
+
body
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.PipelinesEscalations = PipelinesEscalations;
|
|
25
|
+
//# sourceMappingURL=escalations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escalations.js","sourceRoot":"","sources":["../../../src/allend/Pipelines/escalations.ts"],"names":[],"mappings":";;;AAIA,uCAAgE;AAEhE,iFAAiF;AAEjF,MAAa,oBAAoB;IAC/B,YAAqB,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAEnC,KAAK,CAAC,IAAI,CAAE,WAA6D;QACvE,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAA+C;YAC3E,GAAG,EAAE,yBAAyB,IAAA,UAAE,EAAE,WAAW,CAAE,EAAE;YACjD,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAE,EAAU,EAAE,IAAkD;QAC3E,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAkD;YAC9E,GAAG,EAAE,0BAA0B,EAAE,UAAU;YAC3C,MAAM,EAAE,MAAM;YACd,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF;AAjBD,oDAiBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PipelineExecutionCreateValidation, PipelineExecutionGetValidation, PipelineExecutionListValidation, PipelineExecutionActionValidation, PipelineExecutionCancelValidation } from '@de./types';
|
|
2
|
+
import { type Http } from '../../utils';
|
|
3
|
+
export declare class PipelinesExecutions {
|
|
4
|
+
private http;
|
|
5
|
+
constructor(http: Http);
|
|
6
|
+
create(body: PipelineExecutionCreateValidation['body']): Promise<PipelineExecutionCreateValidation['response']>;
|
|
7
|
+
list(querystring?: PipelineExecutionListValidation['querystring']): Promise<PipelineExecutionListValidation['response']>;
|
|
8
|
+
get(id: string): Promise<PipelineExecutionGetValidation['response']>;
|
|
9
|
+
start(id: string): Promise<PipelineExecutionActionValidation['response']>;
|
|
10
|
+
cancel(id: string, body: PipelineExecutionCancelValidation['body']): Promise<PipelineExecutionCancelValidation['response']>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PipelinesExecutions = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
// ─── Executions ───────────────────────────────────────────────────────────────
|
|
6
|
+
class PipelinesExecutions {
|
|
7
|
+
constructor(http) {
|
|
8
|
+
this.http = http;
|
|
9
|
+
}
|
|
10
|
+
async create(body) {
|
|
11
|
+
return await this.http.request({
|
|
12
|
+
url: '/pipelines/executions',
|
|
13
|
+
method: 'POST',
|
|
14
|
+
body
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async list(querystring) {
|
|
18
|
+
return await this.http.request({
|
|
19
|
+
url: `/pipelines/executions${(0, utils_1.qs)(querystring)}`,
|
|
20
|
+
method: 'GET'
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async get(id) {
|
|
24
|
+
return await this.http.request({
|
|
25
|
+
url: `/pipelines/executions/${id}`,
|
|
26
|
+
method: 'GET'
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async start(id) {
|
|
30
|
+
return await this.http.request({
|
|
31
|
+
url: `/pipelines/executions/${id}/start`,
|
|
32
|
+
method: 'POST'
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async cancel(id, body) {
|
|
36
|
+
return await this.http.request({
|
|
37
|
+
url: `/pipelines/executions/${id}/cancel`,
|
|
38
|
+
method: 'POST',
|
|
39
|
+
body
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.PipelinesExecutions = PipelinesExecutions;
|
|
44
|
+
//# sourceMappingURL=executions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executions.js","sourceRoot":"","sources":["../../../src/allend/Pipelines/executions.ts"],"names":[],"mappings":";;;AAOA,uCAAgE;AAEhE,iFAAiF;AAEjF,MAAa,mBAAmB;IAC9B,YAAqB,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC;IAEnC,KAAK,CAAC,MAAM,CAAE,IAA+C;QAC3D,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAgD;YAC5E,GAAG,EAAE,uBAAuB;YAC5B,MAAM,EAAE,MAAM;YACd,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CAAE,WAA4D;QACtE,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAA8C;YAC1E,GAAG,EAAE,wBAAwB,IAAA,UAAE,EAAE,WAAW,CAAE,EAAE;YAChD,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,GAAG,CAAE,EAAU;QACnB,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAA6C;YACzE,GAAG,EAAE,yBAAyB,EAAE,EAAE;YAClC,MAAM,EAAE,KAAK;SACd,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,KAAK,CAAE,EAAU;QACrB,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAgD;YAC5E,GAAG,EAAE,yBAAyB,EAAE,QAAQ;YACxC,MAAM,EAAE,MAAM;SACf,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAE,EAAU,EAAE,IAA+C;QACvE,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAgD;YAC5E,GAAG,EAAE,yBAAyB,EAAE,SAAS;YACzC,MAAM,EAAE,MAAM;YACd,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF;AAvCD,kDAuCC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Env, Platform } from '../../types';
|
|
2
|
+
import type { PipelineListValidation, PipelineRetrieveValidation, PipelineDeployValidation, PipelineValidateValidation, PipelineSimulateValidation, PipelineSetStatusValidation } from '@de./types';
|
|
3
|
+
import AccessManager from '../Access';
|
|
4
|
+
import { PipelinesWorkers } from './workers';
|
|
5
|
+
import { PipelinesMonitor } from './monitor';
|
|
6
|
+
import { PipelinesQueries } from './queries';
|
|
7
|
+
import { PipelinesWebhooks } from './webhooks';
|
|
8
|
+
import { PipelinesTemplates } from './templates';
|
|
9
|
+
import { PipelinesAnalytics } from './analytics';
|
|
10
|
+
import { PipelinesExecutions } from './executions';
|
|
11
|
+
import { PipelinesEscalations } from './escalations';
|
|
12
|
+
import { PipelinesInterventions } from './interventions';
|
|
13
|
+
export type PipelinesConfig = {
|
|
14
|
+
context: string;
|
|
15
|
+
accessToken: string;
|
|
16
|
+
env?: Env;
|
|
17
|
+
platform?: Platform;
|
|
18
|
+
remoteOrigin?: string;
|
|
19
|
+
/** Per-request deadline in ms. See `AccessOptions.timeout`. */
|
|
20
|
+
timeout?: number;
|
|
21
|
+
/** Explicit service origin, overriding the env table. See `AccessOptions.baseUrl`. */
|
|
22
|
+
baseUrl?: string;
|
|
23
|
+
version?: number;
|
|
24
|
+
};
|
|
25
|
+
export default class Pipelines extends AccessManager {
|
|
26
|
+
readonly monitor: PipelinesMonitor;
|
|
27
|
+
readonly queries: PipelinesQueries;
|
|
28
|
+
readonly webhooks: PipelinesWebhooks;
|
|
29
|
+
readonly templates: PipelinesTemplates;
|
|
30
|
+
readonly analytics: PipelinesAnalytics;
|
|
31
|
+
readonly executions: PipelinesExecutions;
|
|
32
|
+
readonly escalations: PipelinesEscalations;
|
|
33
|
+
readonly interventions: PipelinesInterventions;
|
|
34
|
+
readonly workers: PipelinesWorkers;
|
|
35
|
+
constructor(config: PipelinesConfig);
|
|
36
|
+
list(querystring?: PipelineListValidation['querystring']): Promise<PipelineListValidation['response']>;
|
|
37
|
+
get(id: string): Promise<PipelineRetrieveValidation['response']>;
|
|
38
|
+
deploy(id: string, body?: PipelineDeployValidation['body']): Promise<PipelineDeployValidation['response']>;
|
|
39
|
+
validate(id: string): Promise<PipelineValidateValidation['response']>;
|
|
40
|
+
simulate(id: string, body?: PipelineSimulateValidation['body']): Promise<PipelineSimulateValidation['response']>;
|
|
41
|
+
setStatus(id: string, status: string): Promise<PipelineSetStatusValidation['response']>;
|
|
42
|
+
}
|