@base44-preview/sdk 0.8.44-pr.265.a1a63b2 → 0.8.44-pr.267.4549331

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.
@@ -1,566 +0,0 @@
1
- /**
2
- * Where a build turn stands.
3
- *
4
- * `blocked` is not a failure and not a question: the turn stopped on a condition
5
- * no answer clears — being out of credits is the one that exists today — and it
6
- * resumes once that condition does. `reason` says which.
7
- */
8
- export type BuilderStatus = "idle" | "running" | "waiting" | "blocked" | "error";
9
- /**
10
- * Why a turn is suspended, and therefore what to render.
11
- *
12
- * All three are answerable with {@link BuilderSession.respond | respond()}, and each
13
- * wants a different affordance: a form, a picker, an approve/reject. Being out of
14
- * credits is deliberately *not* one of these — it is `blocked`, because no
15
- * response resolves it.
16
- */
17
- export type BuilderWaitingKind = "input" | "choice" | "approval";
18
- /**
19
- * The waitpoint holding a turn open.
20
- */
21
- export interface BuilderWaitingOn {
22
- /** What kind of answer resolves it. */
23
- kind: BuilderWaitingKind;
24
- /** The id to answer with. It is the tool call's id, and it goes stale when the turn moves on. */
25
- waitpointId: string;
26
- /** The tool that asked, when the server names one. Display only. */
27
- toolName?: string;
28
- }
29
- /**
30
- * A builder session's current state.
31
- */
32
- export interface BuilderState {
33
- /** Where the turn stands. */
34
- status: BuilderStatus;
35
- /** Present only while `status` is `"waiting"`. */
36
- waitingOn?: BuilderWaitingOn;
37
- /** Why a `blocked` turn is blocked. `"quota"` is out of credits. */
38
- reason?: string;
39
- /** The turn this state belongs to, so a state arriving after a reconnect can be told from a stale one. */
40
- turnId?: string;
41
- /** Where an `error` came from. Diagnostic, not a code to branch on. */
42
- errorSource?: string;
43
- /**
44
- * What went wrong, in prose.
45
- *
46
- * Carried by an `error` raised after the write already returned — a turn that
47
- * dies outside a request has no response to fail, so without this the stream
48
- * would simply stop, which is indistinguishable from a slow build.
49
- */
50
- detail?: string;
51
- }
52
- /**
53
- * One tool call inside a streamed message.
54
- */
55
- export interface BuilderToolCall {
56
- /** The call's id. When this call is a waitpoint, this is the `waitpointId` to answer with. */
57
- id: string;
58
- /** The tool's name. */
59
- name: string;
60
- /** The call's lifecycle state, as the builder reports it. */
61
- status: string;
62
- /** Whether this call is waiting on a person. */
63
- requiresUserInput: boolean;
64
- /** What kind of answer it wants, when it is waiting. */
65
- waitingOnKind: BuilderWaitingKind | null;
66
- /**
67
- * The call's arguments, as the raw JSON string the model produced.
68
- *
69
- * A string rather than a parsed object because it arrives mid-generation and
70
- * is therefore often incomplete JSON — parsing it before the call settles
71
- * throws. Published at all because an interrupt is otherwise unanswerable:
72
- * the questions to pick between, the secrets to fill in and the packages to
73
- * approve all live here.
74
- *
75
- * Empty when the tool's display projection withholds its details.
76
- */
77
- arguments: string;
78
- /** How the builder itself renders this call, when it says. `null` when it does not. */
79
- display: Record<string, unknown> | null;
80
- }
81
- /**
82
- * One message in a build conversation.
83
- *
84
- * The same shape from the stream and from {@link BuilderSessionReader.listMessages | listMessages()},
85
- * so reconciling after an outage cannot produce a different transcript than the
86
- * one that was streamed.
87
- */
88
- export interface BuilderMessage {
89
- /** The message's id, and the key it is replaced under. */
90
- messageId: string;
91
- /** Who wrote it. A partner's own user messages come back on the stream too. */
92
- role: "assistant" | "user";
93
- /** The message text. */
94
- content: string;
95
- /** The tool calls this message carries. */
96
- toolCalls: BuilderToolCall[];
97
- }
98
- /**
99
- * The event types a builder session emits.
100
- */
101
- export type BuilderEventType = "state.changed" | "turn.started" | "turn.finished" | "message.updated" | "error" | "conversation.reset" | "files.changed";
102
- /** Fields every event carries. */
103
- interface BuilderEventBase {
104
- /**
105
- * The journal sequence. Monotonic per session, and the resume cursor — the SDK
106
- * tracks it for you across reconnects.
107
- */
108
- seq: string;
109
- /** The turn this event belongs to. Absent on the two out-of-turn directives. */
110
- turnId?: string;
111
- }
112
- /**
113
- * One event from a builder session.
114
- *
115
- * A discriminated union: switch on `type` and `data` narrows with it.
116
- *
117
- * **`message.updated` is a snapshot, not a delta.** The builder flushes the whole
118
- * in-progress assistant message on every tick, so the contract is last-write-wins
119
- * per `messageId` — replace what you hold, never append. Text still arrives
120
- * progressively; there is simply no delta event.
121
- * {@link BuilderSessionReader.streamText | streamText()} is the append-shaped view,
122
- * for UIs that want one.
123
- */
124
- export type BuilderEvent = ({
125
- /** A turn started, finished, changed state, or failed. */
126
- type: "turn.started" | "turn.finished" | "state.changed" | "error";
127
- data: BuilderState;
128
- } & BuilderEventBase) | ({
129
- /** A message was written or rewritten. Replace what you hold for this `messageId`. */
130
- type: "message.updated";
131
- data: BuilderMessage;
132
- } & BuilderEventBase) | ({
133
- /**
134
- * The conversation was rewritten underneath you (a checkpoint restore, a
135
- * branch sync), or the app's files changed outside a turn. Both carry no
136
- * data: the only useful response is to re-read.
137
- */
138
- type: "conversation.reset" | "files.changed";
139
- data: Record<string, never>;
140
- } & BuilderEventBase);
141
- /**
142
- * An answer to a waitpoint.
143
- *
144
- * Discriminated on `kind`, which is checked against the *live* waitpoint: sending
145
- * an approval to a question is a 409 rather than a silent coercion. `waitpointId`
146
- * comes from {@link BuilderWaitingOn.waitpointId}, and a stale one is also a 409 —
147
- * so read the current state rather than remembering an id across turns.
148
- */
149
- export type BuilderResponse = {
150
- /** Answering an approval: a decision, and nothing else. */
151
- kind: "approval";
152
- /** The waitpoint to answer. */
153
- waitpointId: string;
154
- /** Whether to proceed. */
155
- approved: boolean;
156
- } | {
157
- /** Answering a question or a picker: the answer itself. */
158
- kind: "input" | "choice";
159
- /** The waitpoint to answer. */
160
- waitpointId: string;
161
- /**
162
- * The answer.
163
- *
164
- * Omitting it *declines* the question, which is the only sensible reading
165
- * of "no answer" — not a way to send an empty one.
166
- */
167
- value?: Record<string, unknown>;
168
- };
169
- /** Options for {@link BuilderSession.sendMessage | sendMessage()}. */
170
- export interface SendBuilderMessageOptions {
171
- /** Attachments, as URLs the builder can fetch. */
172
- fileUrls?: string[];
173
- /**
174
- * A key that makes a retry safe.
175
- *
176
- * A turn costs real credits, and retrying a 202 that never arrived is the
177
- * normal reaction to a timeout — so name the turn and a retry rejoins it
178
- * instead of buying a second one. It becomes the `turnId`.
179
- *
180
- * Without one the server assigns an id and you keep followability but lose
181
- * retry safety. The SDK does not invent one, because a key it generated would
182
- * differ on the retry and protect nothing.
183
- */
184
- idempotencyKey?: string;
185
- }
186
- /** Options for {@link BuilderSession.respond | respond()}. */
187
- export interface RespondToBuilderOptions {
188
- /** See {@link SendBuilderMessageOptions.idempotencyKey}. */
189
- idempotencyKey?: string;
190
- }
191
- /** The turn a write started. */
192
- export interface BuilderTurnRef {
193
- /** The session the turn runs in. Always the app id. */
194
- sessionId: string;
195
- /**
196
- * The turn's id.
197
- *
198
- * Carried on every event the turn emits, and the id
199
- * {@link BuilderSessionReader.getTurn | getTurn()} and
200
- * {@link BuilderSessionReader.waitForTurn | waitForTurn()} take.
201
- */
202
- turnId: string;
203
- }
204
- /** One turn's outcome. */
205
- export interface BuilderTurn {
206
- /** The turn asked about. */
207
- turnId: string;
208
- /** Whether this is the turn running right now, rather than a settled one read back from the journal. */
209
- live: boolean;
210
- /** The state the turn is in, or the last one it reached. */
211
- state: BuilderState;
212
- }
213
- /** Options for {@link BuilderSession.createGrant | createGrant()}. */
214
- export interface CreateBuilderGrantOptions {
215
- /**
216
- * How long the grant lives.
217
- *
218
- * Short on purpose. Minting is the steady state, not a one-off, and a build
219
- * routinely outlives one grant.
220
- *
221
- * @defaultValue `900` (15 minutes), server-side. Maximum `3600`.
222
- */
223
- ttlSeconds?: number;
224
- /**
225
- * Your own identifier for whoever the grant is for.
226
- *
227
- * Opaque, never interpreted, and read on no authorization path — it rides the
228
- * grant only so your logs and ours line up.
229
- */
230
- subject?: string;
231
- }
232
- /**
233
- * A read-only credential for one builder session.
234
- *
235
- * The only Base44 credential that should ever reach a browser: it cannot send a
236
- * message, answer a waitpoint, cancel a turn, or touch any other app. That
237
- * asymmetry is the design — reads go browser to Base44 directly, writes go
238
- * through your server — and it is why a leaked grant cannot spend your credits.
239
- */
240
- export interface BuilderGrant {
241
- /** The session it reads. Always the app id. */
242
- sessionId: string;
243
- /** The grant's id, for {@link BuilderSession.revokeGrant | revokeGrant()}. */
244
- grantId: string;
245
- /** The token itself. Hand this to the browser; hand it nothing else. */
246
- token: string;
247
- /** Seconds until it expires. Re-mint before then rather than after. */
248
- expiresIn: number;
249
- /** When it expires, as an ISO timestamp. */
250
- expiresAt: string;
251
- /** The stream endpoint, absolute. Useful for a client that is not this SDK. */
252
- eventsUrl: string;
253
- }
254
- /** Options for {@link BuilderSessionReader.listMessages | listMessages()}. */
255
- export interface ListBuilderMessagesOptions {
256
- /**
257
- * The cursor from a previous page's `nextAfter`.
258
- *
259
- * A timestamp seek rather than an offset, so a message appended while you walk
260
- * cannot shift the pages beneath you.
261
- */
262
- after?: string;
263
- /**
264
- * How many rows to read.
265
- *
266
- * Internal messages are dropped from the rendered page, so a page can hold
267
- * fewer than this and still have a next cursor. Follow `nextAfter` rather than
268
- * counting.
269
- *
270
- * @defaultValue `50`, server-side. Maximum `200`.
271
- */
272
- limit?: number;
273
- }
274
- /** One page of conversation history. */
275
- export interface BuilderMessagePage {
276
- /** The page, oldest first. */
277
- messages: BuilderMessage[];
278
- /** The cursor for the next page, or `null` at the end of the history. */
279
- nextAfter: string | null;
280
- }
281
- /** Options for the subscription forms. */
282
- export interface SubscribeToBuilderOptions {
283
- /**
284
- * Where to resume from.
285
- *
286
- * Only needed to resume across *process* restarts: within one subscription the
287
- * SDK tracks the cursor itself, so a dropped connection already resumes where
288
- * it left off. Persist the `seq` of the last event you handled and pass it here
289
- * to pick a build back up after a deploy.
290
- *
291
- * Omitted, the stream replays the whole retained window — which converges,
292
- * since messages are last-write-wins, but re-delivers everything first.
293
- */
294
- lastEventId?: string;
295
- /**
296
- * Called when the stream cannot continue.
297
- *
298
- * Reconnects are handled for you and are not reported here. This fires only
299
- * when the SDK gives up: a credential the server rejects, a session it will not
300
- * serve, or an abort. The subscription is over by the time it runs.
301
- */
302
- onError?: (error: Error) => void;
303
- /** Stops the subscription when aborted, the same as calling the returned unsubscribe. */
304
- signal?: AbortSignal;
305
- }
306
- /** Options for {@link BuilderSessionReader.waitForTurn | waitForTurn()}. */
307
- export interface WaitForTurnOptions {
308
- /** Gives up waiting when aborted. The turn itself is unaffected — use {@link BuilderSession.cancel | cancel()} to stop it. */
309
- signal?: AbortSignal;
310
- }
311
- /**
312
- * A builder session, read-only.
313
- *
314
- * What a grant can do. Obtained from
315
- * {@link createBuilderSession | createBuilderSession()}, which is the browser's entry
316
- * point; the server-side {@link BuilderSession} adds the writes on top.
317
- */
318
- export interface BuilderSessionReader {
319
- /** The app this session builds. A builder session *is* an app — there is no separate session to open. */
320
- readonly appId: string;
321
- /**
322
- * The session's current state.
323
- *
324
- * The supported polling floor, for a client that cannot hold a connection open.
325
- * Anything that can should {@link BuilderSessionReader.subscribe | subscribe()}
326
- * instead — this answers from the app itself on every call.
327
- *
328
- * @returns Where the build stands right now.
329
- */
330
- getState(): Promise<BuilderState>;
331
- /**
332
- * Reads conversation history, newest page first and oldest-first within a page.
333
- *
334
- * For reconciling after an outage longer than the stream's replay window. A
335
- * client that stayed connected has already been told everything this returns.
336
- *
337
- * @param options - Cursor and page size.
338
- * @returns One page, plus the cursor to follow it with.
339
- *
340
- * @example
341
- * ```typescript
342
- * let after: string | null | undefined = undefined;
343
- * do {
344
- * const page = await builder.listMessages({ after });
345
- * render(page.messages);
346
- * after = page.nextAfter;
347
- * } while (after);
348
- * ```
349
- */
350
- listMessages(options?: ListBuilderMessagesOptions): Promise<BuilderMessagePage>;
351
- /**
352
- * One turn's outcome, so a write's `turnId` is followable without the stream.
353
- *
354
- * A live turn is answered from the app; a finished one from the journal. A turn
355
- * older than the journal's retention window is a 404 rather than a guess.
356
- *
357
- * @param turnId - The turn to read.
358
- * @returns The turn's state, and whether it is still running.
359
- *
360
- * @throws {Base44Error} 404 if the turn is not in the retained window.
361
- */
362
- getTurn(turnId: string): Promise<BuilderTurn>;
363
- /**
364
- * Waits for a turn to stop, and resolves with the state it stopped in.
365
- *
366
- * The answer for a long-lived worker: a write returns as soon as the turn is
367
- * accepted, and this is how you await the result without holding an HTTP
368
- * request open through the whole build. A serverless function should not use
369
- * it — it cannot outlive the turn.
370
- *
371
- * Watches the stream rather than polling, and checks the turn once on the way
372
- * in, so a turn that finished between the write and this call still resolves.
373
- *
374
- * Resolves on `idle`, `error` *and* `blocked` — a build that ran out of credits
375
- * has stopped, and waiting for it to finish would wait forever.
376
- *
377
- * @param turnId - The turn to wait for, from {@link BuilderTurnRef.turnId}.
378
- * @param options - An abort signal.
379
- * @returns The state the turn came to rest in.
380
- *
381
- * @example
382
- * ```typescript
383
- * const { turnId } = await builder.sendMessage('add a footer');
384
- * const outcome = await builder.waitForTurn(turnId);
385
- * if (outcome.status === 'waiting') await answer(outcome.waitingOn);
386
- * ```
387
- */
388
- waitForTurn(turnId: string, options?: WaitForTurnOptions): Promise<BuilderState>;
389
- /**
390
- * Streams the build, calling back on every event.
391
- *
392
- * The primary form, and the same shape as every other realtime call in the
393
- * package: a callback in, an unsubscribe out. Reconnects and resumes on its
394
- * own — a dropped connection replays what it missed rather than losing it, so
395
- * a deploy on either side does not cost you state.
396
- *
397
- * Event types the SDK does not recognise are dropped rather than passed
398
- * through. That is the contract's own rule for clients, applied once here
399
- * instead of in every partner's switch; a new event type reaches you after an
400
- * SDK upgrade.
401
- *
402
- * @param onEvent - Called with each event, in order.
403
- * @param options - Resume point, error callback, abort signal.
404
- * @returns Call it to stop. Idempotent.
405
- *
406
- * @example
407
- * ```typescript
408
- * const unsubscribe = builder.subscribe((event) => {
409
- * switch (event.type) {
410
- * case 'message.updated': upsert(event.data); break; // by messageId
411
- * case 'state.changed': setStatus(event.data); break;
412
- * case 'turn.finished': markDone(event.turnId); break;
413
- * case 'conversation.reset': refetchHistory(); break;
414
- * }
415
- * });
416
- *
417
- * // Later:
418
- * unsubscribe();
419
- * ```
420
- */
421
- subscribe(onEvent: (event: BuilderEvent) => void, options?: SubscribeToBuilderOptions): () => void;
422
- /**
423
- * The same stream, as an async iterable.
424
- *
425
- * The second accessor over one subscription, for code shaped as a loop rather
426
- * than a callback. Leaving the loop — `break`, `return`, or a throw —
427
- * unsubscribes.
428
- *
429
- * Events queue while the body of your loop is awaiting, so a slow consumer
430
- * falls behind rather than dropping events. Keep the body fast, or take a copy
431
- * and hand it off.
432
- *
433
- * @param options - Resume point and abort signal.
434
- * @returns Every event, in order, until you stop iterating.
435
- *
436
- * @example
437
- * ```typescript
438
- * for await (const event of builder.stream()) {
439
- * if (event.type === 'turn.finished') break;
440
- * }
441
- * ```
442
- */
443
- stream(options?: SubscribeToBuilderOptions): AsyncIterable<BuilderEvent>;
444
- /**
445
- * The assistant's prose, as text to append.
446
- *
447
- * `message.updated` is a snapshot, so rendering it into a chat UI that appends
448
- * would repeat the whole message on every tick. This yields only what each
449
- * snapshot *added*, which is what a streaming chat surface takes.
450
- *
451
- * A snapshot that is not an extension of what came before means the message was
452
- * rewritten — a retry, an edit — so a paragraph break is emitted and the new
453
- * text follows, rather than trying to patch history a chat platform has already
454
- * made immutable.
455
- *
456
- * Ends when the turn does. Tool calls and waitpoints are not text and are not
457
- * yielded: read them from {@link BuilderSessionReader.subscribe | subscribe()} or
458
- * {@link BuilderSessionReader.getState | getState()} and render them as whatever
459
- * your surface calls a card.
460
- *
461
- * @param options - Resume point and abort signal.
462
- * @returns Text to append, in order, until the turn ends.
463
- *
464
- * @example
465
- * ```typescript
466
- * for await (const chunk of builder.streamText()) {
467
- * process.stdout.write(chunk);
468
- * }
469
- * ```
470
- */
471
- streamText(options?: SubscribeToBuilderOptions): AsyncIterable<string>;
472
- }
473
- /**
474
- * A builder session, with the writes.
475
- *
476
- * What a principal's own credential can do, and therefore what belongs on your
477
- * server. Obtained from {@link PrincipalClient.builder | asPrincipal(id).builder(appId)}.
478
- *
479
- * Every write returns as soon as the turn is *accepted*, not when it is done: a
480
- * build takes minutes and no caller should hold a request open through one. The
481
- * turn's progress arrives on the stream, and
482
- * {@link BuilderSessionReader.waitForTurn | waitForTurn()} is how a long-lived
483
- * worker awaits the end of it.
484
- */
485
- export interface BuilderSession extends BuilderSessionReader {
486
- /**
487
- * Starts a build turn.
488
- *
489
- * @param content - What to tell the builder.
490
- * @param options - Attachments and an idempotency key.
491
- * @returns The turn's id, immediately. The turn itself has not run yet.
492
- *
493
- * @throws {Base44Error} 409 if a turn is already running, or if a waitpoint is
494
- * unanswered — the two have different remedies, so they are told apart.
495
- *
496
- * @example
497
- * ```typescript
498
- * const { turnId } = await builder.sendMessage('add a footer', {
499
- * idempotencyKey: requestId,
500
- * });
501
- * ```
502
- */
503
- sendMessage(content: string, options?: SendBuilderMessageOptions): Promise<BuilderTurnRef>;
504
- /**
505
- * Answers the waitpoint holding the turn open, and resumes it.
506
- *
507
- * @param response - The answer, discriminated on the waitpoint's kind.
508
- * @param options - An idempotency key.
509
- * @returns The resumed turn's id.
510
- *
511
- * @throws {Base44Error} 409 if the session is not waiting, if the id names a
512
- * waitpoint that has moved on, or if the kind does not match the live one.
513
- *
514
- * @example
515
- * ```typescript
516
- * const { waitingOn } = await builder.getState();
517
- * if (waitingOn?.kind === 'approval') {
518
- * await builder.respond({ ...waitingOn, approved: true });
519
- * }
520
- * ```
521
- */
522
- respond(response: BuilderResponse, options?: RespondToBuilderOptions): Promise<BuilderTurnRef>;
523
- /**
524
- * Stops the running turn.
525
- *
526
- * Unlike the other writes this one is not deferred: stopping is fast and a
527
- * caller needs to know it landed, so resolving *is* the confirmation.
528
- *
529
- * Returns nothing rather than the state. The endpoint answers with the
530
- * builder's own internal status vocabulary, which the rest of this surface
531
- * deliberately renames, and the settled state arrives on the stream — or from
532
- * {@link BuilderSessionReader.getState | getState()} — in the public one.
533
- */
534
- cancel(): Promise<void>;
535
- /**
536
- * Mints a read-only grant for this session.
537
- *
538
- * This is what a browser gets. It reads one session and can write nothing, so
539
- * the stream can go browser-to-Base44 directly — off your serverless function
540
- * path, where holding an SSE connection open is a problem — while every write
541
- * still goes through your server.
542
- *
543
- * @param options - TTL and an opaque subject.
544
- * @returns The grant, including the token to hand over.
545
- *
546
- * @example
547
- * ```typescript
548
- * // POST /api/base44/grant, on your server
549
- * const userId = await requireSession(req);
550
- * const grant = await base44.asPrincipal(userId).builder(appId)
551
- * .createGrant({ ttlSeconds: 900 });
552
- * return Response.json(grant);
553
- * ```
554
- */
555
- createGrant(options?: CreateBuilderGrantOptions): Promise<BuilderGrant>;
556
- /**
557
- * Withdraws a grant before it expires.
558
- *
559
- * Idempotent, and says nothing about whether the id was real — confirming which
560
- * ids exist would leak the grants of every session in the workspace.
561
- *
562
- * @param grantId - The grant to revoke.
563
- */
564
- revokeGrant(grantId: string): Promise<void>;
565
- }
566
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- import type { AxiosInstance } from "axios";
2
- import type { PlatformsModule } from "./platforms.types.js";
3
- /**
4
- * Creates the platforms module.
5
- *
6
- * Takes the *provision* client specifically, not the mint client. The two keys
7
- * are separated so that no code path holding the hot-path key can create or
8
- * destroy principals, and passing one client here is what keeps that true.
9
- *
10
- * @param axios - An Axios instance carrying the `service_users:provision` key.
11
- * @returns The platforms module.
12
- * @internal
13
- */
14
- export declare function createPlatformsModule(axios: AxiosInstance): PlatformsModule;
@@ -1,41 +0,0 @@
1
- /**
2
- * Creates the platforms module.
3
- *
4
- * Takes the *provision* client specifically, not the mint client. The two keys
5
- * are separated so that no code path holding the hot-path key can create or
6
- * destroy principals, and passing one client here is what keeps that true.
7
- *
8
- * @param axios - An Axios instance carrying the `service_users:provision` key.
9
- * @returns The platforms module.
10
- * @internal
11
- */
12
- export function createPlatformsModule(axios) {
13
- return {
14
- async provisionPrincipal(params) {
15
- const body = {
16
- service_external_id: params.externalId,
17
- };
18
- // Omitted rather than sent as null: the server applies its own defaults
19
- // for both, and `role` in particular is clamped to a ceiling.
20
- if (params.displayName !== undefined)
21
- body.display_name = params.displayName;
22
- if (params.role !== undefined)
23
- body.role = params.role;
24
- const response = await axios.post("/api/service/users", body);
25
- return {
26
- externalId: response.service_external_id,
27
- userId: response.user_id,
28
- email: response.email,
29
- role: response.role,
30
- created: response.created,
31
- };
32
- },
33
- async deprovisionPrincipal(externalId) {
34
- const response = await axios.delete(`/api/service/users/${encodeURIComponent(externalId)}`);
35
- return {
36
- externalId: response.service_external_id,
37
- removed: response.removed,
38
- };
39
- },
40
- };
41
- }