@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,51 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
QueryGetPricingValidation,
|
|
3
|
+
QueryEstimateCostValidation,
|
|
4
|
+
QueryComparePricingValidation,
|
|
5
|
+
QueryPricingInvalidateCacheValidation,
|
|
6
|
+
QueryPricingCacheStatsValidation
|
|
7
|
+
} from '@de./types'
|
|
8
|
+
import { type Http, type Res, type Data } from '../../utils'
|
|
9
|
+
|
|
10
|
+
// ─── Pricing ──────────────────────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
export class QueriesPricing {
|
|
13
|
+
constructor( private http: Http ){}
|
|
14
|
+
|
|
15
|
+
async get( lsp: string, serviceId: string ): Promise<QueryGetPricingValidation['response']> {
|
|
16
|
+
return await this.http.request<QueryGetPricingValidation['response']>({
|
|
17
|
+
url: `/queries/pricing/${lsp}/${serviceId}`,
|
|
18
|
+
method: 'GET'
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async estimate( body: QueryEstimateCostValidation['body'] ): Promise<QueryEstimateCostValidation['response']> {
|
|
23
|
+
return await this.http.request<QueryEstimateCostValidation['response']>({
|
|
24
|
+
url: '/queries/pricing/estimate',
|
|
25
|
+
method: 'POST',
|
|
26
|
+
body
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async compare( body: QueryComparePricingValidation['body'] ): Promise<QueryComparePricingValidation['response']> {
|
|
31
|
+
return await this.http.request<QueryComparePricingValidation['response']>({
|
|
32
|
+
url: '/queries/pricing/compare',
|
|
33
|
+
method: 'POST',
|
|
34
|
+
body
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async invalidateCache( lsp: string, serviceId: string ): Promise<QueryPricingInvalidateCacheValidation['response']> {
|
|
39
|
+
return await this.http.request<QueryPricingInvalidateCacheValidation['response']>({
|
|
40
|
+
url: `/queries/pricing/cache/${lsp}/${serviceId}`,
|
|
41
|
+
method: 'DELETE'
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async cacheStats(): Promise<QueryPricingCacheStatsValidation['response']> {
|
|
46
|
+
return await this.http.request<QueryPricingCacheStatsValidation['response']>({
|
|
47
|
+
url: '/queries/pricing/cache/stats',
|
|
48
|
+
method: 'GET'
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import type { RTLocation , Message, Peer
|
|
1
|
+
import type { RTLocation , Message, Peer } from '../../types'
|
|
2
2
|
import type { SocketAuthCredentials } from '../../types/auth'
|
|
3
3
|
import type { AccessOptions } from '../../types/access'
|
|
4
|
+
|
|
4
5
|
import io, { Socket } from 'socket.io-client'
|
|
5
6
|
import AccessManager from '../Access'
|
|
7
|
+
import { baseURL } from '../../baseUrl'
|
|
6
8
|
|
|
7
|
-
export default class
|
|
9
|
+
export default class Realtime extends AccessManager {
|
|
8
10
|
private nsp?: Socket
|
|
9
11
|
private iosHost: string
|
|
10
12
|
|
|
11
13
|
constructor( access: AccessOptions ){
|
|
12
14
|
super( access, 'API' )
|
|
13
|
-
|
|
14
15
|
// Socket server host
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
// An explicit origin governs the socket as it governs the requests.
|
|
17
|
+
this.iosHost = access.baseUrl?.replace( /\/+$/, '' )
|
|
18
|
+
|| baseURL('RTS', access.env, access.devHostname )
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
connect( clientId: string ): Promise<void> {
|
|
@@ -57,20 +58,20 @@ export default class Event extends AccessManager {
|
|
|
57
58
|
return this
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
onRoute( fn: ( data: any ) => void ){
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
onStage( fn: ( data: OrderStage ) => void ){
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
onLocation( fn: ( location: RTLocation ) => void ){
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
onMessage( fn: ( payload: Message ) => void ){
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
61
|
+
// onRoute( fn: ( data: any ) => void ){
|
|
62
|
+
// this.nsp?.on('ROUTE-CHANGE', fn )
|
|
63
|
+
// return this
|
|
64
|
+
// }
|
|
65
|
+
// onStage( fn: ( data: OrderStage ) => void ){
|
|
66
|
+
// this.nsp?.on('STAGE-CHANGE', fn )
|
|
67
|
+
// return this
|
|
68
|
+
// }
|
|
69
|
+
// onLocation( fn: ( location: RTLocation ) => void ){
|
|
70
|
+
// this.nsp?.on('LOCATION-CHANGE', fn )
|
|
71
|
+
// return this
|
|
72
|
+
// }
|
|
73
|
+
// onMessage( fn: ( payload: Message ) => void ){
|
|
74
|
+
// this.nsp?.on('MESSAGE', fn )
|
|
75
|
+
// return this
|
|
76
|
+
// }
|
|
76
77
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SharedAccountKnowsValidation,
|
|
3
|
+
SharedAccountRetrieveValidation
|
|
4
|
+
} from '@de./types/shared/account'
|
|
5
|
+
import type { UserContextType } from '@de./types'
|
|
6
|
+
import type { Http, Res, Data } from '../../utils'
|
|
7
|
+
|
|
8
|
+
export default class SharedAccount {
|
|
9
|
+
constructor( private http: Http, private ctype: UserContextType ){}
|
|
10
|
+
|
|
11
|
+
async knows(): Promise<SharedAccountKnowsValidation['response']> {
|
|
12
|
+
return await this.http.request<SharedAccountKnowsValidation['response']>({
|
|
13
|
+
url: `/${this.ctype.toLowerCase()}/account/knows`,
|
|
14
|
+
method: 'GET'
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async retrieve(): Promise<SharedAccountRetrieveValidation['response']> {
|
|
19
|
+
return await this.http.request<SharedAccountRetrieveValidation['response']>({
|
|
20
|
+
url: `/${this.ctype.toLowerCase()}/account`,
|
|
21
|
+
method: 'GET'
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SharedBucketCreateValidation,
|
|
3
|
+
SharedBucketRetrieveValidation,
|
|
4
|
+
SharedBucketFetchValidation,
|
|
5
|
+
SharedBucketUpdateValidation,
|
|
6
|
+
SharedBucketRemoveValidation,
|
|
7
|
+
SharedBucketAssignValidation,
|
|
8
|
+
SharedBucketUnassignValidation,
|
|
9
|
+
SharedBucketLockOrUnlockValidation,
|
|
10
|
+
SharedBucketAddOrRemoveItemValidation,
|
|
11
|
+
SharedBucketFetchItemsValidation,
|
|
12
|
+
SharedBucketPackagedValidation
|
|
13
|
+
} from '@de./types/shared/bucket'
|
|
14
|
+
import type { UserContextType } from '@de./types'
|
|
15
|
+
import { type Http, type Res, type Data } from '../../utils'
|
|
16
|
+
|
|
17
|
+
export default class SharedBuckets {
|
|
18
|
+
constructor( private http: Http, private ctype: UserContextType ){}
|
|
19
|
+
|
|
20
|
+
async create( body: SharedBucketCreateValidation['body'] ): Promise<SharedBucketCreateValidation['response']> {
|
|
21
|
+
return await this.http.request<SharedBucketCreateValidation['response']>({
|
|
22
|
+
url: `/${this.ctype.toLowerCase()}/buckets`,
|
|
23
|
+
method: 'POST',
|
|
24
|
+
body
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async list(): Promise<SharedBucketFetchValidation['response']> {
|
|
29
|
+
return await this.http.request<SharedBucketFetchValidation['response']>({
|
|
30
|
+
url: `/${this.ctype.toLowerCase()}/buckets`,
|
|
31
|
+
method: 'GET'
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async retrieve( reference: string ): Promise<SharedBucketRetrieveValidation['response']> {
|
|
36
|
+
return await this.http.request<SharedBucketRetrieveValidation['response']>({
|
|
37
|
+
url: `/${this.ctype.toLowerCase()}/buckets/${reference}`,
|
|
38
|
+
method: 'GET'
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async update( reference: string, body: SharedBucketUpdateValidation['body'] ): Promise<SharedBucketUpdateValidation['response']> {
|
|
43
|
+
return await this.http.request<SharedBucketUpdateValidation['response']>({
|
|
44
|
+
url: `/${this.ctype.toLowerCase()}/buckets/${reference}`,
|
|
45
|
+
method: 'PATCH',
|
|
46
|
+
body
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async remove( reference: string ): Promise<SharedBucketRemoveValidation['response']> {
|
|
51
|
+
return await this.http.request<SharedBucketRemoveValidation['response']>({
|
|
52
|
+
url: `/${this.ctype.toLowerCase()}/buckets/${reference}`,
|
|
53
|
+
method: 'DELETE'
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async assign( reference: string, to: SharedBucketAssignValidation['params']['to'], body: SharedBucketAssignValidation['body'] ): Promise<SharedBucketAssignValidation['response']> {
|
|
58
|
+
return await this.http.request<SharedBucketAssignValidation['response']>({
|
|
59
|
+
url: `/${this.ctype.toLowerCase()}/buckets/${reference}/assign/${to}`,
|
|
60
|
+
method: 'POST',
|
|
61
|
+
body
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async unassign( reference: string, to: SharedBucketUnassignValidation['params']['to'], body: SharedBucketUnassignValidation['body'] ): Promise<SharedBucketUnassignValidation['response']> {
|
|
66
|
+
return await this.http.request<SharedBucketUnassignValidation['response']>({
|
|
67
|
+
url: `/${this.ctype.toLowerCase()}/buckets/${reference}/unassign/${to}`,
|
|
68
|
+
method: 'POST',
|
|
69
|
+
body
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async lock( reference: string ): Promise<SharedBucketLockOrUnlockValidation['response']> {
|
|
74
|
+
return await this.http.request<SharedBucketLockOrUnlockValidation['response']>({
|
|
75
|
+
url: `/${this.ctype.toLowerCase()}/buckets/${reference}/lock`,
|
|
76
|
+
method: 'PATCH'
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async unlock( reference: string ): Promise<SharedBucketLockOrUnlockValidation['response']> {
|
|
81
|
+
return await this.http.request<SharedBucketLockOrUnlockValidation['response']>({
|
|
82
|
+
url: `/${this.ctype.toLowerCase()}/buckets/${reference}/unlock`,
|
|
83
|
+
method: 'PATCH'
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async addItem( reference: string, body: SharedBucketAddOrRemoveItemValidation['body'] ): Promise<SharedBucketAddOrRemoveItemValidation['response']> {
|
|
88
|
+
return await this.http.request<SharedBucketAddOrRemoveItemValidation['response']>({
|
|
89
|
+
url: `/${this.ctype.toLowerCase()}/buckets/${reference}/items`,
|
|
90
|
+
method: 'POST',
|
|
91
|
+
body
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async removeItem( reference: string, body: SharedBucketAddOrRemoveItemValidation['body'] ): Promise<SharedBucketAddOrRemoveItemValidation['response']> {
|
|
96
|
+
return await this.http.request<SharedBucketAddOrRemoveItemValidation['response']>({
|
|
97
|
+
url: `/${this.ctype.toLowerCase()}/buckets/${reference}/items`,
|
|
98
|
+
method: 'DELETE',
|
|
99
|
+
body
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async listItems( reference: string ): Promise<SharedBucketFetchItemsValidation['response']> {
|
|
104
|
+
return await this.http.request<SharedBucketFetchItemsValidation['response']>({
|
|
105
|
+
url: `/${this.ctype.toLowerCase()}/buckets/${reference}/items`,
|
|
106
|
+
method: 'GET'
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
async markPackaged( reference: string, body: SharedBucketPackagedValidation['body'] ): Promise<SharedBucketPackagedValidation['response']> {
|
|
111
|
+
return await this.http.request<SharedBucketPackagedValidation['response']>({
|
|
112
|
+
url: `/${this.ctype.toLowerCase()}/buckets/${reference}/packaged`,
|
|
113
|
+
method: 'POST',
|
|
114
|
+
body
|
|
115
|
+
})
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AccessOptions } from '../../types/access'
|
|
2
|
+
import type { UserContextType } from '@de./types'
|
|
3
|
+
import AccessManager from '../Access'
|
|
4
|
+
import SharedFAQs from './faqs'
|
|
5
|
+
import SharedUsers from './users'
|
|
6
|
+
import SharedAccount from './account'
|
|
7
|
+
import SharedInvitation from './invitation'
|
|
8
|
+
|
|
9
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
//
|
|
11
|
+
// SharedContextClient: base for context-scoped service clients (LSP, DEV, CSP, IoTSP).
|
|
12
|
+
//
|
|
13
|
+
// Wires the shared sub-clients that de.arch reassigns under every user context
|
|
14
|
+
// (faqs, users, account, invitation) — mirroring the per-service route reassignment
|
|
15
|
+
// in de.arch's *(ctype) route factories. Context-selective resources — operators
|
|
16
|
+
// (OperatorContextType only) and buckets — are added by the concrete client where valid.
|
|
17
|
+
//
|
|
18
|
+
// The public API stays flat: consumers use `client.faqs`, `client.users`, etc.
|
|
19
|
+
//
|
|
20
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
21
|
+
|
|
22
|
+
export default abstract class SharedContextClient<C extends UserContextType> extends AccessManager {
|
|
23
|
+
readonly faqs: SharedFAQs
|
|
24
|
+
readonly users: SharedUsers
|
|
25
|
+
readonly account: SharedAccount
|
|
26
|
+
readonly invitation: SharedInvitation<C>
|
|
27
|
+
|
|
28
|
+
constructor( access: AccessOptions, ctype: C ){
|
|
29
|
+
super( access, 'API' )
|
|
30
|
+
|
|
31
|
+
this.faqs = new SharedFAQs( this, ctype )
|
|
32
|
+
this.users = new SharedUsers( this, ctype )
|
|
33
|
+
this.account = new SharedAccount( this, ctype )
|
|
34
|
+
this.invitation = new SharedInvitation<C>( this, ctype )
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SharedFAQAddValidation,
|
|
3
|
+
SharedFAQRetrieveValidation,
|
|
4
|
+
SharedFAQFetchValidation,
|
|
5
|
+
SharedFAQSearchValidation,
|
|
6
|
+
SharedFAQUpdateValidation,
|
|
7
|
+
SharedFAQRemoveValidation,
|
|
8
|
+
SharedFAQAddServiceContextValidation,
|
|
9
|
+
SharedFAQRemoveServiceContextValidation,
|
|
10
|
+
SharedFAQArchiveOrRestoreValidation,
|
|
11
|
+
SharedFAQLockOrUnlockValidation
|
|
12
|
+
} from '@de./types/shared/faq'
|
|
13
|
+
import type { UserContextType } from '@de./types'
|
|
14
|
+
import { qs, type Http, type Res, type Data } from '../../utils'
|
|
15
|
+
|
|
16
|
+
export default class SharedFAQs {
|
|
17
|
+
constructor( private http: Http, private ctype: UserContextType ){}
|
|
18
|
+
|
|
19
|
+
async add( body: SharedFAQAddValidation['body'] ): Promise<SharedFAQAddValidation['response']> {
|
|
20
|
+
return await this.http.request<SharedFAQAddValidation['response']>({
|
|
21
|
+
url: `/${this.ctype.toLowerCase()}/faqs`,
|
|
22
|
+
method: 'POST',
|
|
23
|
+
body
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async list( querystring?: SharedFAQFetchValidation['querystring'] ): Promise<SharedFAQFetchValidation['response']> {
|
|
28
|
+
return await this.http.request<SharedFAQFetchValidation['response']>({
|
|
29
|
+
url: `/${this.ctype.toLowerCase()}/faqs${qs( querystring )}`,
|
|
30
|
+
method: 'GET'
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async retrieve( reference: string ): Promise<SharedFAQRetrieveValidation['response']> {
|
|
35
|
+
return await this.http.request<SharedFAQRetrieveValidation['response']>({
|
|
36
|
+
url: `/${this.ctype.toLowerCase()}/faqs/${reference}`,
|
|
37
|
+
method: 'GET'
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async search( querystring: SharedFAQSearchValidation['querystring'] ): Promise<SharedFAQSearchValidation['response']> {
|
|
42
|
+
return await this.http.request<SharedFAQSearchValidation['response']>({
|
|
43
|
+
url: `/${this.ctype.toLowerCase()}/faqs/search${qs( querystring )}`,
|
|
44
|
+
method: 'GET'
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async update( reference: string, body: SharedFAQUpdateValidation['body'] ): Promise<SharedFAQUpdateValidation['response']> {
|
|
49
|
+
return await this.http.request<SharedFAQUpdateValidation['response']>({
|
|
50
|
+
url: `/${this.ctype.toLowerCase()}/faqs/${reference}`,
|
|
51
|
+
method: 'PATCH',
|
|
52
|
+
body
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async remove( reference: string ): Promise<SharedFAQRemoveValidation['response']> {
|
|
57
|
+
return await this.http.request<SharedFAQRemoveValidation['response']>({
|
|
58
|
+
url: `/${this.ctype.toLowerCase()}/faqs/${reference}`,
|
|
59
|
+
method: 'DELETE'
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async addServiceContext( reference: string, body: SharedFAQAddServiceContextValidation['body'] ): Promise<SharedFAQAddServiceContextValidation['response']> {
|
|
64
|
+
return await this.http.request<SharedFAQAddServiceContextValidation['response']>({
|
|
65
|
+
url: `/${this.ctype.toLowerCase()}/faqs/${reference}/context`,
|
|
66
|
+
method: 'POST',
|
|
67
|
+
body
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async removeServiceContext( reference: string, body: SharedFAQRemoveServiceContextValidation['body'] ): Promise<SharedFAQRemoveServiceContextValidation['response']> {
|
|
72
|
+
return await this.http.request<SharedFAQRemoveServiceContextValidation['response']>({
|
|
73
|
+
url: `/${this.ctype.toLowerCase()}/faqs/${reference}/context`,
|
|
74
|
+
method: 'DELETE',
|
|
75
|
+
body
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async archive( reference: string ): Promise<SharedFAQArchiveOrRestoreValidation['response']> {
|
|
80
|
+
return await this.http.request<SharedFAQArchiveOrRestoreValidation['response']>({
|
|
81
|
+
url: `/${this.ctype.toLowerCase()}/faqs/${reference}/archive`,
|
|
82
|
+
method: 'PATCH'
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async restore( reference: string ): Promise<SharedFAQArchiveOrRestoreValidation['response']> {
|
|
87
|
+
return await this.http.request<SharedFAQArchiveOrRestoreValidation['response']>({
|
|
88
|
+
url: `/${this.ctype.toLowerCase()}/faqs/${reference}/restore`,
|
|
89
|
+
method: 'PATCH'
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async lock( reference: string ): Promise<SharedFAQLockOrUnlockValidation['response']> {
|
|
94
|
+
return await this.http.request<SharedFAQLockOrUnlockValidation['response']>({
|
|
95
|
+
url: `/${this.ctype.toLowerCase()}/faqs/${reference}/lock`,
|
|
96
|
+
method: 'PATCH'
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async unlock( reference: string ): Promise<SharedFAQLockOrUnlockValidation['response']> {
|
|
101
|
+
return await this.http.request<SharedFAQLockOrUnlockValidation['response']>({
|
|
102
|
+
url: `/${this.ctype.toLowerCase()}/faqs/${reference}/unlock`,
|
|
103
|
+
method: 'PATCH'
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DEVSharedInvitationSendValidation,
|
|
3
|
+
DEVSharedInvitationCancelValidation,
|
|
4
|
+
DEVSharedInvitationAcceptValidation,
|
|
5
|
+
CSPSharedInvitationSendValidation,
|
|
6
|
+
CSPSharedInvitationCancelValidation,
|
|
7
|
+
CSPSharedInvitationAcceptValidation,
|
|
8
|
+
LSPSharedInvitationSendValidation,
|
|
9
|
+
LSPSharedInvitationCancelValidation,
|
|
10
|
+
LSPSharedInvitationAcceptValidation
|
|
11
|
+
} from '@de./types/shared/invitation'
|
|
12
|
+
import type { UserContextType } from '@de./types'
|
|
13
|
+
import { type Http, type Res, type Data } from '../../utils'
|
|
14
|
+
|
|
15
|
+
// ─── Validation map ───────────────────────────────────────────────────────────
|
|
16
|
+
|
|
17
|
+
type InvitationV<C extends UserContextType> = {
|
|
18
|
+
DEV: {
|
|
19
|
+
send: DEVSharedInvitationSendValidation
|
|
20
|
+
cancel: DEVSharedInvitationCancelValidation
|
|
21
|
+
accept: DEVSharedInvitationAcceptValidation
|
|
22
|
+
}
|
|
23
|
+
CSP: {
|
|
24
|
+
send: CSPSharedInvitationSendValidation
|
|
25
|
+
cancel: CSPSharedInvitationCancelValidation
|
|
26
|
+
accept: CSPSharedInvitationAcceptValidation
|
|
27
|
+
}
|
|
28
|
+
LSP: {
|
|
29
|
+
send: LSPSharedInvitationSendValidation
|
|
30
|
+
cancel: LSPSharedInvitationCancelValidation
|
|
31
|
+
accept: LSPSharedInvitationAcceptValidation
|
|
32
|
+
}
|
|
33
|
+
IoTSP: {
|
|
34
|
+
send: LSPSharedInvitationSendValidation
|
|
35
|
+
cancel: LSPSharedInvitationCancelValidation
|
|
36
|
+
accept: LSPSharedInvitationAcceptValidation
|
|
37
|
+
}
|
|
38
|
+
}[C]
|
|
39
|
+
|
|
40
|
+
// ─── Class ────────────────────────────────────────────────────────────────────
|
|
41
|
+
|
|
42
|
+
export default class SharedInvitation<C extends UserContextType> {
|
|
43
|
+
/**
|
|
44
|
+
* Lowercased, like every other shared client.
|
|
45
|
+
*
|
|
46
|
+
* This one took the context type as a raw `prefix` and used it verbatim, so
|
|
47
|
+
* an LSP client addressed `/LSP/invitation/agent` — de.arch mounts `/lsp`,
|
|
48
|
+
* and every invitation a workspace ever sent through the SDK came back 404.
|
|
49
|
+
*/
|
|
50
|
+
constructor( private http: Http, private ctype: UserContextType ){}
|
|
51
|
+
|
|
52
|
+
private get prefix(): string { return this.ctype.toLowerCase() }
|
|
53
|
+
|
|
54
|
+
async send( as: string, body: InvitationV<C>['send']['body'] ): Promise<InvitationV<C>['send']['response']> {
|
|
55
|
+
return await this.http.request<InvitationV<C>['send']['response']>({
|
|
56
|
+
url: `/${this.prefix}/invitation/${as}`,
|
|
57
|
+
method: 'POST',
|
|
58
|
+
body
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async cancel( body: InvitationV<C>['cancel']['body'] ): Promise<InvitationV<C>['cancel']['response']> {
|
|
63
|
+
return await this.http.request<InvitationV<C>['cancel']['response']>({
|
|
64
|
+
url: `/${this.prefix}/invitation/cancel`,
|
|
65
|
+
method: 'POST',
|
|
66
|
+
body
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async accept( body: InvitationV<C>['accept']['body'] ): Promise<InvitationV<C>['accept']['response']> {
|
|
71
|
+
return await this.http.request<InvitationV<C>['accept']['response']>({
|
|
72
|
+
url: `/${this.prefix}/invitation/accept`,
|
|
73
|
+
method: 'POST',
|
|
74
|
+
body
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DEVSharedOperatorRetrieveValidation,
|
|
3
|
+
DEVSharedOperatorFetchValidation,
|
|
4
|
+
DEVSharedOperatorUpdateValidation,
|
|
5
|
+
DEVSharedOperatorRemoveValidation,
|
|
6
|
+
CSPSharedOperatorRetrieveValidation,
|
|
7
|
+
CSPSharedOperatorFetchValidation,
|
|
8
|
+
CSPSharedOperatorUpdateValidation,
|
|
9
|
+
CSPSharedOperatorRemoveValidation,
|
|
10
|
+
LSPSharedOperatorRetrieveValidation,
|
|
11
|
+
LSPSharedOperatorFetchValidation,
|
|
12
|
+
LSPSharedOperatorUpdateValidation,
|
|
13
|
+
LSPSharedOperatorRemoveValidation,
|
|
14
|
+
IoTSPSharedOperatorRetrieveValidation,
|
|
15
|
+
IoTSPSharedOperatorFetchValidation,
|
|
16
|
+
IoTSPSharedOperatorUpdateValidation,
|
|
17
|
+
IoTSPSharedOperatorRemoveValidation
|
|
18
|
+
} from '@de./types/shared/operator'
|
|
19
|
+
import { qs, type Http, type Res, type Data } from '../../utils'
|
|
20
|
+
import type { OperatorContextType } from '@de./types'
|
|
21
|
+
|
|
22
|
+
// ─── Validation map ───────────────────────────────────────────────────────────
|
|
23
|
+
|
|
24
|
+
type OperatorV<C extends OperatorContextType> = {
|
|
25
|
+
DEV: {
|
|
26
|
+
retrieve: DEVSharedOperatorRetrieveValidation
|
|
27
|
+
fetch: DEVSharedOperatorFetchValidation
|
|
28
|
+
update: DEVSharedOperatorUpdateValidation
|
|
29
|
+
remove: DEVSharedOperatorRemoveValidation
|
|
30
|
+
}
|
|
31
|
+
CSP: {
|
|
32
|
+
retrieve: CSPSharedOperatorRetrieveValidation
|
|
33
|
+
fetch: CSPSharedOperatorFetchValidation
|
|
34
|
+
update: CSPSharedOperatorUpdateValidation
|
|
35
|
+
remove: CSPSharedOperatorRemoveValidation
|
|
36
|
+
}
|
|
37
|
+
LSP: {
|
|
38
|
+
retrieve: LSPSharedOperatorRetrieveValidation
|
|
39
|
+
fetch: LSPSharedOperatorFetchValidation
|
|
40
|
+
update: LSPSharedOperatorUpdateValidation
|
|
41
|
+
remove: LSPSharedOperatorRemoveValidation
|
|
42
|
+
}
|
|
43
|
+
IoTSP: {
|
|
44
|
+
retrieve: IoTSPSharedOperatorRetrieveValidation
|
|
45
|
+
fetch: IoTSPSharedOperatorFetchValidation
|
|
46
|
+
update: IoTSPSharedOperatorUpdateValidation
|
|
47
|
+
remove: IoTSPSharedOperatorRemoveValidation
|
|
48
|
+
}
|
|
49
|
+
}[C]
|
|
50
|
+
|
|
51
|
+
// ─── Class ────────────────────────────────────────────────────────────────────
|
|
52
|
+
|
|
53
|
+
export default class SharedOperators<C extends OperatorContextType> {
|
|
54
|
+
constructor( private http: Http, private ctype: OperatorContextType ){}
|
|
55
|
+
|
|
56
|
+
async list( querystring?: OperatorV<C>['fetch']['querystring'] ): Promise<OperatorV<C>['fetch']['response']> {
|
|
57
|
+
return await this.http.request<OperatorV<C>['fetch']['response']>({
|
|
58
|
+
url: `/${this.ctype.toLowerCase()}/operators${qs( querystring )}`,
|
|
59
|
+
method: 'GET'
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async retrieve( id: string ): Promise<OperatorV<C>['retrieve']['response']> {
|
|
64
|
+
return await this.http.request<OperatorV<C>['retrieve']['response']>({
|
|
65
|
+
url: `/${this.ctype.toLowerCase()}/operators/${id}`,
|
|
66
|
+
method: 'GET'
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async update( id: string, body: OperatorV<C>['update']['body'] ): Promise<OperatorV<C>['update']['response']> {
|
|
71
|
+
return await this.http.request<OperatorV<C>['update']['response']>({
|
|
72
|
+
url: `/${this.ctype.toLowerCase()}/operators/${id}`,
|
|
73
|
+
method: 'PATCH',
|
|
74
|
+
body
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async remove( id: string ): Promise<OperatorV<C>['remove']['response']> {
|
|
79
|
+
return await this.http.request<OperatorV<C>['remove']['response']>({
|
|
80
|
+
url: `/${this.ctype.toLowerCase()}/operators/${id}`,
|
|
81
|
+
method: 'DELETE'
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SharedUserRetrieveValidation,
|
|
3
|
+
SharedUserFetchValidation,
|
|
4
|
+
SharedUserRemoveValidation
|
|
5
|
+
} from '@de./types/shared/user'
|
|
6
|
+
import type { ContextType } from '@de./types'
|
|
7
|
+
import { qs, type Http, type Res, type Data } from '../../utils'
|
|
8
|
+
|
|
9
|
+
export default class SharedUsers {
|
|
10
|
+
constructor( private http: Http, private ctype: ContextType ){}
|
|
11
|
+
|
|
12
|
+
async list( querystring?: SharedUserFetchValidation['querystring'] ): Promise<SharedUserFetchValidation['response']> {
|
|
13
|
+
return await this.http.request<SharedUserFetchValidation['response']>({
|
|
14
|
+
url: `/${this.ctype.toLowerCase()}/users${qs( querystring )}`,
|
|
15
|
+
method: 'GET'
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async retrieve( uid: string ): Promise<SharedUserRetrieveValidation['response']> {
|
|
20
|
+
return await this.http.request<SharedUserRetrieveValidation['response']>({
|
|
21
|
+
url: `/${this.ctype.toLowerCase()}/users/${uid}`,
|
|
22
|
+
method: 'GET'
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async remove( uid: string ): Promise<SharedUserRemoveValidation['response']> {
|
|
27
|
+
return await this.http.request<SharedUserRemoveValidation['response']>({
|
|
28
|
+
url: `/${this.ctype.toLowerCase()}/users/${uid}`,
|
|
29
|
+
method: 'DELETE'
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { AccessOptions } from '../../types/access'
|
|
2
|
+
import type { SharedTrackingSessionValidation } from '@de./types/shared/tracking'
|
|
3
|
+
import AccessManager from '../Access'
|
|
4
|
+
import { qs, type Res, type Data } from '../../utils'
|
|
5
|
+
|
|
6
|
+
export type TrackingConfig = {
|
|
7
|
+
accessToken: string
|
|
8
|
+
context: string
|
|
9
|
+
env?: 'dev' | 'staging' | 'prod'
|
|
10
|
+
platform?: 'web' | 'mobile' | 'server' | 'proxy'
|
|
11
|
+
remoteOrigin?: string
|
|
12
|
+
/** Per-request deadline in ms. See `AccessOptions.timeout`. */
|
|
13
|
+
timeout?: number
|
|
14
|
+
/** Explicit service origin, overriding the env table. See `AccessOptions.baseUrl`. */
|
|
15
|
+
baseUrl?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
19
|
+
//
|
|
20
|
+
// Tracking: shared tracking API — de.arch /tracking routes.
|
|
21
|
+
// Issues join-room tokens for Socket.IO real-time order tracking.
|
|
22
|
+
//
|
|
23
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
24
|
+
|
|
25
|
+
export default class Tracking extends AccessManager {
|
|
26
|
+
constructor( config: TrackingConfig ){
|
|
27
|
+
if( !config.accessToken ) throw new Error('Undefined accessToken. See https://doc.dedot.io/sdk/auth')
|
|
28
|
+
if( !config.context ) throw new Error('Undefined context. See https://doc.dedot.io/sdk/tracking')
|
|
29
|
+
|
|
30
|
+
const access: AccessOptions = {
|
|
31
|
+
context: config.context,
|
|
32
|
+
accessToken: config.accessToken,
|
|
33
|
+
env: config.env || 'dev',
|
|
34
|
+
platform: config.platform || 'proxy',
|
|
35
|
+
remoteOrigin: config.remoteOrigin,
|
|
36
|
+
timeout: config.timeout,
|
|
37
|
+
baseUrl: config.baseUrl
|
|
38
|
+
}
|
|
39
|
+
super( access, 'API' )
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async getSession( reference: string, role: SharedTrackingSessionValidation['querystring']['role'] ): Promise<SharedTrackingSessionValidation['response']> {
|
|
43
|
+
return await this.request<SharedTrackingSessionValidation['response']>({
|
|
44
|
+
url: `/tracking/${reference}${qs({ role })}`,
|
|
45
|
+
method: 'GET'
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
}
|