obi-sdk 0.19.110 → 0.19.112
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/index.js +1 -1
- package/dist/obi-sdk.standalone.iife.js +1 -1
- package/dist/src/sdk.d.ts +29 -0
- package/package.json +1 -1
package/dist/src/sdk.d.ts
CHANGED
|
@@ -36,6 +36,13 @@ export type ObiSDKEvents = {
|
|
|
36
36
|
withMicrophone?: boolean;
|
|
37
37
|
isDeepPlanStart?: boolean;
|
|
38
38
|
}) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Emitted when the server enters (active=true) or leaves (active=false)
|
|
41
|
+
* maintenance lockout (HTTP 503). Lets the embedding page react to a region
|
|
42
|
+
* cutover — e.g. show its own banner. Retry is manual only (no polling); call
|
|
43
|
+
* {@link ObiSDK.retryInitialise} to re-attempt.
|
|
44
|
+
*/
|
|
45
|
+
maintenance: (active: boolean) => void;
|
|
39
46
|
};
|
|
40
47
|
export type InitialiseArgs = {
|
|
41
48
|
queuedCommands?: Command[];
|
|
@@ -45,6 +52,8 @@ export declare class ObiSDK extends EventEmitter<ObiSDKEvents> {
|
|
|
45
52
|
client: ObiClient | null;
|
|
46
53
|
isActive: boolean;
|
|
47
54
|
productUnavailable: boolean;
|
|
55
|
+
/** True while the server is in maintenance lockout (HTTP 503). Manual retry only. */
|
|
56
|
+
maintenance: boolean;
|
|
48
57
|
primaryColour: string;
|
|
49
58
|
passivePlanUuid: string | null;
|
|
50
59
|
widgetDisplay?: string;
|
|
@@ -68,6 +77,7 @@ export declare class ObiSDK extends EventEmitter<ObiSDKEvents> {
|
|
|
68
77
|
private hasCompletedFirstRealInitialise;
|
|
69
78
|
private initialiseInFlight;
|
|
70
79
|
private nextSidePanelStartRequestId;
|
|
80
|
+
private unsubscribeMaintenance;
|
|
71
81
|
/**
|
|
72
82
|
* Creates a client that should persist for the lifetime of the SDK.
|
|
73
83
|
* Resumes an ongoing session if one exists.
|
|
@@ -157,6 +167,25 @@ export declare class ObiSDK extends EventEmitter<ObiSDKEvents> {
|
|
|
157
167
|
private runInitialise;
|
|
158
168
|
mountWidget(): void;
|
|
159
169
|
private extractHttpStatus;
|
|
170
|
+
/**
|
|
171
|
+
* Enter maintenance-lockout state (HTTP 503 / DB region cutover). Surfaces a
|
|
172
|
+
* message in the widget and emits a `maintenance` event so the embedding page
|
|
173
|
+
* can react. Idempotent: repeated 503s (from the shared onMaintenance hook and
|
|
174
|
+
* the init 503 branch) only surface once. Recovery is manual — call
|
|
175
|
+
* {@link ObiSDK.retryInitialise}; the SDK does not poll.
|
|
176
|
+
*/
|
|
177
|
+
private enterMaintenance;
|
|
178
|
+
/**
|
|
179
|
+
* Leave maintenance-lockout state once a request succeeds again (e.g. a manual
|
|
180
|
+
* retry). Idempotent; emits `maintenance` with `false` only on a real transition.
|
|
181
|
+
*/
|
|
182
|
+
private exitMaintenance;
|
|
183
|
+
/**
|
|
184
|
+
* Manually re-attempt initialisation after a maintenance lockout (HTTP 503).
|
|
185
|
+
* Wire this to a retry affordance in the host page or widget UI. Resolves to
|
|
186
|
+
* true when the server is reachable again. No automatic polling is performed.
|
|
187
|
+
*/
|
|
188
|
+
retryInitialise(): Promise<boolean>;
|
|
160
189
|
/**
|
|
161
190
|
* Display a transient popover message above the widget.
|
|
162
191
|
* Does not open menus or alter session/plan state.
|