@elaraai/e3-cloud-client 0.0.0-stage → 1.0.89-alpha.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.
Files changed (63) hide show
  1. package/LICENSE.md +54 -0
  2. package/README.md +238 -2
  3. package/dist/src/admin-users.d.ts +36 -0
  4. package/dist/src/admin-users.d.ts.map +1 -0
  5. package/dist/src/admin-users.js +56 -0
  6. package/dist/src/admin-users.js.map +1 -0
  7. package/dist/src/apps.d.ts +210 -0
  8. package/dist/src/apps.d.ts.map +1 -0
  9. package/dist/src/apps.js +265 -0
  10. package/dist/src/apps.js.map +1 -0
  11. package/dist/src/deployment-settings.d.ts +63 -0
  12. package/dist/src/deployment-settings.d.ts.map +1 -0
  13. package/dist/src/deployment-settings.js +79 -0
  14. package/dist/src/deployment-settings.js.map +1 -0
  15. package/dist/src/feedback.d.ts +132 -0
  16. package/dist/src/feedback.d.ts.map +1 -0
  17. package/dist/src/feedback.js +166 -0
  18. package/dist/src/feedback.js.map +1 -0
  19. package/dist/src/history.d.ts +126 -0
  20. package/dist/src/history.d.ts.map +1 -0
  21. package/dist/src/history.js +144 -0
  22. package/dist/src/history.js.map +1 -0
  23. package/dist/src/index.d.ts +64 -0
  24. package/dist/src/index.d.ts.map +1 -0
  25. package/dist/src/index.js +67 -0
  26. package/dist/src/index.js.map +1 -0
  27. package/dist/src/invitations.d.ts +17 -0
  28. package/dist/src/invitations.d.ts.map +1 -0
  29. package/dist/src/invitations.js +31 -0
  30. package/dist/src/invitations.js.map +1 -0
  31. package/dist/src/me.d.ts +11 -0
  32. package/dist/src/me.d.ts.map +1 -0
  33. package/dist/src/me.js +18 -0
  34. package/dist/src/me.js.map +1 -0
  35. package/dist/src/records.d.ts +127 -0
  36. package/dist/src/records.d.ts.map +1 -0
  37. package/dist/src/records.js +226 -0
  38. package/dist/src/records.js.map +1 -0
  39. package/dist/src/roles.d.ts +72 -0
  40. package/dist/src/roles.d.ts.map +1 -0
  41. package/dist/src/roles.js +95 -0
  42. package/dist/src/roles.js.map +1 -0
  43. package/dist/src/schedules.d.ts +25 -0
  44. package/dist/src/schedules.d.ts.map +1 -0
  45. package/dist/src/schedules.js +45 -0
  46. package/dist/src/schedules.js.map +1 -0
  47. package/dist/src/secrets.d.ts +20 -0
  48. package/dist/src/secrets.d.ts.map +1 -0
  49. package/dist/src/secrets.js +37 -0
  50. package/dist/src/secrets.js.map +1 -0
  51. package/dist/src/task-configs.d.ts +101 -0
  52. package/dist/src/task-configs.d.ts.map +1 -0
  53. package/dist/src/task-configs.js +157 -0
  54. package/dist/src/task-configs.js.map +1 -0
  55. package/dist/src/user-settings.d.ts +34 -0
  56. package/dist/src/user-settings.d.ts.map +1 -0
  57. package/dist/src/user-settings.js +83 -0
  58. package/dist/src/user-settings.js.map +1 -0
  59. package/dist/src/users.d.ts +84 -0
  60. package/dist/src/users.d.ts.map +1 -0
  61. package/dist/src/users.js +100 -0
  62. package/dist/src/users.js.map +1 -0
  63. package/package.json +23 -3
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Feedback on components: notes users send from a workspace-scoped
7
+ * page about a part of it, kept per workspace, numbered `FB-<number>`.
8
+ *
9
+ * - Owners and admins, and a user in a workspace they are granted an app of,
10
+ * ask whether it takes feedback ({@link getFeedbackSettings}), send a note
11
+ * ({@link addFeedback}), list their own ({@link listMyFeedback}) and read
12
+ * one of their own whole ({@link getFeedback}, {@link feedbackScreenshotUrl}).
13
+ * - The repository's owners and the deployment's admins list the
14
+ * workspace's notes ({@link listFeedback}), read any, close and reopen them
15
+ * ({@link closeFeedback}, {@link reopenFeedback}), and turn feedback on or
16
+ * off ({@link putFeedbackSettings}).
17
+ *
18
+ * A send while feedback is off throws `ApiError` with code
19
+ * `feedback_disabled`; a note that is not there, `not_found`; another sender's
20
+ * note, `forbidden`.
21
+ */
22
+ import { NullType } from '@elaraai/east';
23
+ import { FeedbackListType, FeedbackMineType, FeedbackNoteType, FeedbackScreenshotUrlType, FeedbackSendRequestType, FeedbackSentType, FeedbackSettingsType, } from '@elaraai/e3-cloud-types';
24
+ import { get, post, put } from '@elaraai/e3-api-client';
25
+ const enc = encodeURIComponent;
26
+ const feedbackBase = (repo, ws) => `/repos/${enc(repo)}/workspaces/${enc(ws)}/feedback`;
27
+ /** A query string of the parameters that are set, with its `?`, or nothing. */
28
+ function queryOf(params) {
29
+ const query = new URLSearchParams();
30
+ for (const [name, value] of Object.entries(params)) {
31
+ if (value !== undefined)
32
+ query.set(name, String(value));
33
+ }
34
+ const text = query.toString();
35
+ return text === '' ? '' : `?${text}`;
36
+ }
37
+ /**
38
+ * Whether a workspace takes feedback. The UI asks once per workspace page.
39
+ *
40
+ * @param url - Base URL of the e3 API server
41
+ * @param repo - Repository name
42
+ * @param ws - Workspace name
43
+ * @param options - Request options including auth token
44
+ * @returns `{ enabled }`
45
+ */
46
+ export async function getFeedbackSettings(url, repo, ws, options) {
47
+ return get(url, `${feedbackBase(repo, ws)}/settings`, FeedbackSettingsType, options);
48
+ }
49
+ /**
50
+ * Turn a workspace's feedback on or off (owner or admin). Its notes are kept
51
+ * either way, and numbering goes on where it stopped.
52
+ *
53
+ * @param url - Base URL of the e3 API server
54
+ * @param repo - Repository name
55
+ * @param ws - Workspace name
56
+ * @param enabled - Whether the workspace takes feedback
57
+ * @param options - Request options including auth token
58
+ * @returns The workspace's settings, as set
59
+ */
60
+ export async function putFeedbackSettings(url, repo, ws, enabled, options) {
61
+ return put(url, `${feedbackBase(repo, ws)}/settings`, { enabled }, FeedbackSettingsType, FeedbackSettingsType, options);
62
+ }
63
+ /**
64
+ * Send a note: its text, the page, the part, the data behind the view and the
65
+ * screenshot, in one body. The server adds the sender and the time.
66
+ *
67
+ * @param url - Base URL of the e3 API server
68
+ * @param repo - Repository name
69
+ * @param ws - Workspace name
70
+ * @param request - The note and its context
71
+ * @param options - Request options including auth token
72
+ * @returns The note's id (`FB-<number>`) and number
73
+ * @throws {ApiError} `feedback_disabled` while the workspace takes no
74
+ * feedback; `bad_request` naming a field past its limit
75
+ */
76
+ export async function addFeedback(url, repo, ws, request, options) {
77
+ return post(url, feedbackBase(repo, ws), request, FeedbackSendRequestType, FeedbackSentType, options);
78
+ }
79
+ /**
80
+ * A page of the caller's own notes of one status, newest first, each as a
81
+ * summary (its first 200 characters).
82
+ *
83
+ * @param url - Base URL of the e3 API server
84
+ * @param repo - Repository name
85
+ * @param ws - Workspace name
86
+ * @param options - Request options including auth token
87
+ * @param page - The status, the page's size and the cursor
88
+ * @returns The page and the next page's cursor
89
+ */
90
+ export async function listMyFeedback(url, repo, ws, options, page = {}) {
91
+ return get(url, `${feedbackBase(repo, ws)}/mine${queryOf({ ...page })}`, FeedbackMineType, options);
92
+ }
93
+ /**
94
+ * A page of a workspace's notes of one status, newest first, each whole, and
95
+ * how many are open and closed (owner or admin).
96
+ *
97
+ * @param url - Base URL of the e3 API server
98
+ * @param repo - Repository name
99
+ * @param ws - Workspace name
100
+ * @param options - Request options including auth token
101
+ * @param page - The status, the page's size and the cursor
102
+ * @returns The page, the next page's cursor, and the counts
103
+ */
104
+ export async function listFeedback(url, repo, ws, options, page = {}) {
105
+ return get(url, `${feedbackBase(repo, ws)}${queryOf({ ...page })}`, FeedbackListType, options);
106
+ }
107
+ /**
108
+ * A note, whole (owner or admin, or its sender).
109
+ *
110
+ * @param url - Base URL of the e3 API server
111
+ * @param repo - Repository name
112
+ * @param ws - Workspace name
113
+ * @param number - The note's number
114
+ * @param options - Request options including auth token
115
+ * @param opts - Its status, when known
116
+ * @returns The note
117
+ * @throws {ApiError} `not_found` when the workspace has no such note (of that status)
118
+ */
119
+ export async function getFeedback(url, repo, ws, number, options, opts = {}) {
120
+ return get(url, `${feedbackBase(repo, ws)}/${number}${queryOf({ status: opts.status })}`, FeedbackNoteType, options);
121
+ }
122
+ /**
123
+ * Where a note's screenshot can be read: a URL good for 15 minutes, fetched
124
+ * without the API's auth (owner or admin, or its sender).
125
+ *
126
+ * @param url - Base URL of the e3 API server
127
+ * @param repo - Repository name
128
+ * @param ws - Workspace name
129
+ * @param number - The note's number
130
+ * @param options - Request options including auth token
131
+ * @param opts - Its status, when known
132
+ * @returns The URL
133
+ * @throws {ApiError} `not_found` when the note is not there, or was sent
134
+ * without a screenshot
135
+ */
136
+ export async function feedbackScreenshotUrl(url, repo, ws, number, options, opts = {}) {
137
+ const answer = await get(url, `${feedbackBase(repo, ws)}/${number}/screenshot${queryOf({ status: opts.status })}`, FeedbackScreenshotUrlType, options);
138
+ return answer.url;
139
+ }
140
+ /**
141
+ * Close a note (owner or admin). Closing a closed note changes nothing.
142
+ *
143
+ * @param url - Base URL of the e3 API server
144
+ * @param repo - Repository name
145
+ * @param ws - Workspace name
146
+ * @param number - The note's number
147
+ * @param options - Request options including auth token
148
+ * @returns The note, closed
149
+ */
150
+ export async function closeFeedback(url, repo, ws, number, options) {
151
+ return post(url, `${feedbackBase(repo, ws)}/${number}/close`, null, NullType, FeedbackNoteType, options);
152
+ }
153
+ /**
154
+ * Reopen a note (owner or admin). Reopening an open note changes nothing.
155
+ *
156
+ * @param url - Base URL of the e3 API server
157
+ * @param repo - Repository name
158
+ * @param ws - Workspace name
159
+ * @param number - The note's number
160
+ * @param options - Request options including auth token
161
+ * @returns The note, open
162
+ */
163
+ export async function reopenFeedback(url, repo, ws, number, options) {
164
+ return post(url, `${feedbackBase(repo, ws)}/${number}/reopen`, null, NullType, FeedbackNoteType, options);
165
+ }
166
+ //# sourceMappingURL=feedback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback.js","sourceRoot":"","sources":["../../src/feedback.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,yB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
+ * A workspace's history: its releases, rollbacks, deploys, app deploys
7
+ * and copies, each naming the package and apps it left the workspace running;
8
+ * and its staging, which protects it.
9
+ */
10
+ import { type AddStagingRequest, type AddStagingResponse, type RepositoryReleaseSettings, type RepositoryHistory, type ReleaseRequest, type ReleaseResponse, type RollbackRequest, type StagingLink, type WorkspaceHistoryEntry, type WorkspaceHistoryPage, type WorkspaceReleaseSettings } from '@elaraai/e3-cloud-types';
11
+ import { type RequestOptions } from '@elaraai/e3-api-client';
12
+ /** Which page of a workspace's history to read. */
13
+ export interface WorkspaceHistoryOptions {
14
+ /** The page's size (server default 25, at most 100) */
15
+ limit?: number;
16
+ /** The previous page's `next` */
17
+ before?: string;
18
+ }
19
+ /**
20
+ * A page of a workspace's history, newest first: each entry's kind, the
21
+ * package and apps it left running, who did it, its plan in words and how it
22
+ * ended. Owners and admins read it.
23
+ *
24
+ * @param url - Base URL of the e3 API server
25
+ * @param repo - Repository name
26
+ * @param ws - Workspace name
27
+ * @param options - Request options including auth token
28
+ * @param page - The page's size and the cursor
29
+ * @returns The page, and the next page's cursor
30
+ */
31
+ export declare function workspaceHistory(url: string, repo: string, ws: string, options: RequestOptions, page?: WorkspaceHistoryOptions): Promise<WorkspaceHistoryPage>;
32
+ /**
33
+ * Each workspace of a repository that has a history, in brief, in one request
34
+ * (owner or admin): its newest entry, its newest under way and its newest
35
+ * completed change, what a list of the repository's workspaces says of each.
36
+ *
37
+ * @param url - Base URL of the e3 API server
38
+ * @param repo - Repository name
39
+ * @param options - Request options including auth token
40
+ * @returns Each workspace with a history, by name
41
+ */
42
+ export declare function repositoryHistory(url: string, repo: string, options: RequestOptions): Promise<RepositoryHistory>;
43
+ /**
44
+ * An entry of a workspace's history, by its id.
45
+ *
46
+ * @param url - Base URL of the e3 API server
47
+ * @param repo - Repository name
48
+ * @param ws - Workspace name
49
+ * @param id - The entry's id
50
+ * @param options - Request options including auth token
51
+ * @returns The entry
52
+ */
53
+ export declare function workspaceHistoryEntry(url: string, repo: string, ws: string, id: string, options: RequestOptions): Promise<WorkspaceHistoryEntry>;
54
+ /**
55
+ * Releases another workspace to this one, or answers the plan (owner or
56
+ * admin): the target gets exactly the package and app versions the
57
+ * source runs, by hash, keeping its edited inputs and migrating its records
58
+ * as e3's deploy does; the datasets named are carried from the source.
59
+ *
60
+ * @param url - Base URL of the e3 API server
61
+ * @param repo - Repository name
62
+ * @param target - The workspace released to
63
+ * @param request - The workspace released, what to carry, whether to remove apps it lacks, and whether only to plan
64
+ * @param options - Request options including auth token
65
+ * @returns `planned`; `refused`, its problems in the plan; `released`, its
66
+ * apps switched; or `releasing`, naming the deploy job `appDeployWait` waits on
67
+ */
68
+ export declare function releaseWorkspace(url: string, repo: string, target: string, request: ReleaseRequest, options: RequestOptions): Promise<ReleaseResponse>;
69
+ /**
70
+ * Rolls a workspace back to an entry of its history, or answers the plan
71
+ * (owner or admin): the entry's package and apps, exactly.
72
+ *
73
+ * @param url - Base URL of the e3 API server
74
+ * @param repo - Repository name
75
+ * @param ws - Workspace name
76
+ * @param request - The entry (none for the newest completed one that differs from what the workspace runs), and whether only to plan
77
+ * @param options - Request options including auth token
78
+ * @returns As {@link releaseWorkspace}
79
+ */
80
+ export declare function rollbackWorkspace(url: string, repo: string, ws: string, request: RollbackRequest, options: RequestOptions): Promise<ReleaseResponse>;
81
+ /**
82
+ * Where a workspace releases to.
83
+ *
84
+ * @param url - Base URL of the e3 API server
85
+ * @param repo - Repository name
86
+ * @param ws - Workspace name
87
+ * @param options - Request options including auth token
88
+ * @returns Its release settings
89
+ */
90
+ export declare function getReleaseSettings(url: string, repo: string, ws: string, options: RequestOptions): Promise<WorkspaceReleaseSettings>;
91
+ /**
92
+ * Adds a staging to a workspace, which is protected from then on (owner or
93
+ * admin): the staging starts as a copy of the workspace as
94
+ * it is now (made, or replacing a workspace of its name whole), or as the
95
+ * workspace of its name stands. Ask with `plan: true` to read what it would
96
+ * do, and change nothing.
97
+ *
98
+ * @param url - Base URL of the e3 API server
99
+ * @param repo - Repository name
100
+ * @param live - The workspace the staging releases to
101
+ * @param request - The staging's name, how it starts, and whether to plan only
102
+ * @param options - Request options including auth token
103
+ * @returns Its plan, asked for or done
104
+ */
105
+ export declare function addStaging(url: string, repo: string, live: string, request: AddStagingRequest, options: RequestOptions): Promise<AddStagingResponse>;
106
+ /**
107
+ * Stops a workspace's staging, which is no longer protected (admins only):
108
+ * nothing is deleted, and the workspace's history records who stopped it.
109
+ *
110
+ * @param url - Base URL of the e3 API server
111
+ * @param repo - Repository name
112
+ * @param live - The workspace whose staging stops
113
+ * @param options - Request options including auth token
114
+ * @returns The staging and the workspace it released to
115
+ */
116
+ export declare function stopStaging(url: string, repo: string, live: string, options: RequestOptions): Promise<StagingLink>;
117
+ /**
118
+ * Where each workspace of a repository releases to.
119
+ *
120
+ * @param url - Base URL of the e3 API server
121
+ * @param repo - Repository name
122
+ * @param options - Request options including auth token
123
+ * @returns Each workspace whose setting is set, and the workspace it releases to
124
+ */
125
+ export declare function getRepositoryReleaseSettings(url: string, repo: string, options: RequestOptions): Promise<RepositoryReleaseSettings>;
126
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/history.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EAYL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC9B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI7E,mDAAmD;AACnD,MAAM,WAAW,uBAAuB;IACtC,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC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CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAE1J;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,CAExH;AAED;;;;;;;GAOG;AACH,wBAAsB,4BAA4B,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAEzI"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ /**
6
+ * A workspace's history: its releases, rollbacks, deploys, app deploys
7
+ * and copies, each naming the package and apps it left the workspace running;
8
+ * and its staging, which protects it.
9
+ */
10
+ import { AddStagingRequestType, AddStagingResponseType, ReleaseRequestType, ReleaseResponseType, RollbackRequestType, StagingLinkType, WorkspaceHistoryEntryType, WorkspaceHistoryPageType, WorkspaceReleaseSettingsType, RepositoryReleaseSettingsType, RepositoryHistoryType, } from '@elaraai/e3-cloud-types';
11
+ import { del, get, post } from '@elaraai/e3-api-client';
12
+ const enc = encodeURIComponent;
13
+ /**
14
+ * A page of a workspace's history, newest first: each entry's kind, the
15
+ * package and apps it left running, who did it, its plan in words and how it
16
+ * ended. Owners and admins read it.
17
+ *
18
+ * @param url - Base URL of the e3 API server
19
+ * @param repo - Repository name
20
+ * @param ws - Workspace name
21
+ * @param options - Request options including auth token
22
+ * @param page - The page's size and the cursor
23
+ * @returns The page, and the next page's cursor
24
+ */
25
+ export async function workspaceHistory(url, repo, ws, options, page = {}) {
26
+ const query = new URLSearchParams();
27
+ if (page.limit !== undefined)
28
+ query.set('limit', String(page.limit));
29
+ if (page.before !== undefined)
30
+ query.set('before', page.before);
31
+ const text = query.toString();
32
+ return get(url, `/repos/${enc(repo)}/workspaces/${enc(ws)}/history${text === '' ? '' : `?${text}`}`, WorkspaceHistoryPageType, options);
33
+ }
34
+ /**
35
+ * Each workspace of a repository that has a history, in brief, in one request
36
+ * (owner or admin): its newest entry, its newest under way and its newest
37
+ * completed change, what a list of the repository's workspaces says of each.
38
+ *
39
+ * @param url - Base URL of the e3 API server
40
+ * @param repo - Repository name
41
+ * @param options - Request options including auth token
42
+ * @returns Each workspace with a history, by name
43
+ */
44
+ export async function repositoryHistory(url, repo, options) {
45
+ return get(url, `/repos/${enc(repo)}/history`, RepositoryHistoryType, options);
46
+ }
47
+ /**
48
+ * An entry of a workspace's history, by its id.
49
+ *
50
+ * @param url - Base URL of the e3 API server
51
+ * @param repo - Repository name
52
+ * @param ws - Workspace name
53
+ * @param id - The entry's id
54
+ * @param options - Request options including auth token
55
+ * @returns The entry
56
+ */
57
+ export async function workspaceHistoryEntry(url, repo, ws, id, options) {
58
+ return get(url, `/repos/${enc(repo)}/workspaces/${enc(ws)}/history/${enc(id)}`, WorkspaceHistoryEntryType, options);
59
+ }
60
+ /**
61
+ * Releases another workspace to this one, or answers the plan (owner or
62
+ * admin): the target gets exactly the package and app versions the
63
+ * source runs, by hash, keeping its edited inputs and migrating its records
64
+ * as e3's deploy does; the datasets named are carried from the source.
65
+ *
66
+ * @param url - Base URL of the e3 API server
67
+ * @param repo - Repository name
68
+ * @param target - The workspace released to
69
+ * @param request - The workspace released, what to carry, whether to remove apps it lacks, and whether only to plan
70
+ * @param options - Request options including auth token
71
+ * @returns `planned`; `refused`, its problems in the plan; `released`, its
72
+ * apps switched; or `releasing`, naming the deploy job `appDeployWait` waits on
73
+ */
74
+ export async function releaseWorkspace(url, repo, target, request, options) {
75
+ return post(url, `/repos/${enc(repo)}/workspaces/${enc(target)}/releases`, request, ReleaseRequestType, ReleaseResponseType, options);
76
+ }
77
+ /**
78
+ * Rolls a workspace back to an entry of its history, or answers the plan
79
+ * (owner or admin): the entry's package and apps, exactly.
80
+ *
81
+ * @param url - Base URL of the e3 API server
82
+ * @param repo - Repository name
83
+ * @param ws - Workspace name
84
+ * @param request - The entry (none for the newest completed one that differs from what the workspace runs), and whether only to plan
85
+ * @param options - Request options including auth token
86
+ * @returns As {@link releaseWorkspace}
87
+ */
88
+ export async function rollbackWorkspace(url, repo, ws, request, options) {
89
+ return post(url, `/repos/${enc(repo)}/workspaces/${enc(ws)}/rollback`, request, RollbackRequestType, ReleaseResponseType, options);
90
+ }
91
+ /**
92
+ * Where a workspace releases to.
93
+ *
94
+ * @param url - Base URL of the e3 API server
95
+ * @param repo - Repository name
96
+ * @param ws - Workspace name
97
+ * @param options - Request options including auth token
98
+ * @returns Its release settings
99
+ */
100
+ export async function getReleaseSettings(url, repo, ws, options) {
101
+ return get(url, `/repos/${enc(repo)}/workspaces/${enc(ws)}/releases/settings`, WorkspaceReleaseSettingsType, options);
102
+ }
103
+ /**
104
+ * Adds a staging to a workspace, which is protected from then on (owner or
105
+ * admin): the staging starts as a copy of the workspace as
106
+ * it is now (made, or replacing a workspace of its name whole), or as the
107
+ * workspace of its name stands. Ask with `plan: true` to read what it would
108
+ * do, and change nothing.
109
+ *
110
+ * @param url - Base URL of the e3 API server
111
+ * @param repo - Repository name
112
+ * @param live - The workspace the staging releases to
113
+ * @param request - The staging's name, how it starts, and whether to plan only
114
+ * @param options - Request options including auth token
115
+ * @returns Its plan, asked for or done
116
+ */
117
+ export async function addStaging(url, repo, live, request, options) {
118
+ return post(url, `/repos/${enc(repo)}/workspaces/${enc(live)}/staging`, request, AddStagingRequestType, AddStagingResponseType, options);
119
+ }
120
+ /**
121
+ * Stops a workspace's staging, which is no longer protected (admins only):
122
+ * nothing is deleted, and the workspace's history records who stopped it.
123
+ *
124
+ * @param url - Base URL of the e3 API server
125
+ * @param repo - Repository name
126
+ * @param live - The workspace whose staging stops
127
+ * @param options - Request options including auth token
128
+ * @returns The staging and the workspace it released to
129
+ */
130
+ export async function stopStaging(url, repo, live, options) {
131
+ return del(url, `/repos/${enc(repo)}/workspaces/${enc(live)}/staging`, StagingLinkType, options);
132
+ }
133
+ /**
134
+ * Where each workspace of a repository releases to.
135
+ *
136
+ * @param url - Base URL of the e3 API server
137
+ * @param repo - Repository name
138
+ * @param options - Request options including auth token
139
+ * @returns Each workspace whose setting is set, and the workspace it releases to
140
+ */
141
+ export async function getRepositoryReleaseSettings(url, repo, options) {
142
+ return get(url, `/repos/${enc(repo)}/release-settings`, RepositoryReleaseSettingsType, options);
143
+ }
144
+ //# sourceMappingURL=history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/history.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,qBAAqB,GAYtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAuB,MAAM,wBAAwB,CAAC;AAE7E,MAAM,GAAG,GAAG,kBAAkB,CAAC;AAU/B;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAAW,EAAE,IAAY,EAAE,EAAU,EAAE,OAAuB,EAAE,OAAgC,EAAE;IACvI,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;IACpC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACrE,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;QAAE,KAAK,CAAC,GAAG,C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6B,EAAE,OAAO,CAAC,CAAC;AAClG,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ /**
6
+ * e3-cloud-client: HTTP client library for e3 admin API
7
+ *
8
+ * This package provides a typed HTTP client for interacting with the e3 admin API,
9
+ * building on e3-api-client's HTTP utilities.
10
+ *
11
+ * Features:
12
+ * - Type-safe request/response handling using East types
13
+ * - BEAST2 binary serialization format
14
+ * - Exception-based error handling (throws ApiError on failures)
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * import { whoami, repoUsers, addUser, ApiError } from '@elaraai/e3-cloud-client';
19
+ * import { variant } from '@elaraai/east';
20
+ *
21
+ * const options = { token: accessToken };
22
+ *
23
+ * // Get current user
24
+ * const me = await whoami('https://e3.example.com', options);
25
+ *
26
+ * // Add a user holding the built-in All apps role
27
+ * try {
28
+ * const user = await addUser(
29
+ * 'https://e3.example.com',
30
+ * 'my-repo',
31
+ * { email: 'bob@example.com', role: variant('user', { roles: ['All apps'] }) },
32
+ * options
33
+ * );
34
+ * } catch (error) {
35
+ * if (error instanceof ApiError) {
36
+ * console.error(`Failed: ${error.code}`);
37
+ * }
38
+ * }
39
+ * ```
40
+ */
41
+ export { ApiError, AuthError, type RequestOptions } from '@elaraai/e3-api-client';
42
+ export { whoami, repoUsers, addUser, removeUser, repoInvitations, revokeRepoInvitation } from './users.js';
43
+ export { getSchedule, setSchedule, removeSchedule, listSchedules } from './schedules.js';
44
+ export { listCompute, getCompute, setCompute, setComputeBatch, removeCompute, listTimeout, getTimeout, setTimeout, setTimeoutBatch, removeTimeout, removeTimeoutBatch, listTaskConfigs, listDelegation, setDelegation, removeDelegation, listFunctionDelegation, setFunctionDelegation, removeFunctionDelegation, getWidth, setWidth, removeWidth, repositorySettings, } from './task-configs.js';
45
+ export { getUserSettings, putUserSettings, deleteUserSettings } from './user-settings.js';
46
+ export { listSecrets, putSecret, deleteSecret } from './secrets.js';
47
+ export { listInvitations, revokeInvitation, isInvitedSentinel } from './invitations.js';
48
+ export { listAdminUsers, disableUser, enableUser, lookupPeople } from './admin-users.js';
49
+ export { myMemberships } from './me.js';
50
+ export { listRoles, getRole, putRole, deleteRole, myAccess, previewRole } from './roles.js';
51
+ export type { Person, PersonList, RepositorySettings, WorkspaceSettings, WorkspaceLastRun, RepoRole, RepoUser, AddUserRequest, WhoamiResponse, AuthzErrorCode, Schedule, ScheduleRequest, ComputeSize, ComputeConfigMap, TaskTimeout, TimeoutConfigMap, TaskConfigs, } from '@elaraai/e3-cloud-types';
52
+ export { getDelegationPolicy, setDelegationPolicy, getRackSecurityPolicy, setRackSecurityPolicy, listRacks, enrollRack, deregisterRack, rackActivity, approveRackBoot, ApproveBootRequestType, EnrollmentTokenType, type EnrollmentToken, } from './deployment-settings.js';
53
+ export { listRecordInfos, recordAudit, recordStateAt, recordStatePage, recordValueChunks, rollbackRecord, listRecordBackups, createRecordBackup, restoreRecordBackup, recordBackupDownload, recordBackupStream, recordBackupValue, deleteRecordBackup, type RecordClientSource, type RecordStateAt, } from './records.js';
54
+ export type { RecordList, RecordInfo, RecordAuditPage, RecordAuditEntry, RecordBackupInfo, RecordBackupList, RecordBackupDownload, } from '@elaraai/e3-cloud-types';
55
+ export { getFeedbackSettings, putFeedbackSettings, addFeedback, listMyFeedback, listFeedback, getFeedback, feedbackScreenshotUrl, closeFeedback, reopenFeedback, type FeedbackStatusName, type FeedbackListOptions, type FeedbackNoteOptions, } from './feedback.js';
56
+ export { feedbackId, FEEDBACK_NOTE_MAX_CHARS, FEEDBACK_TEXT_MAX_CHARS, FEEDBACK_URL_MAX_CHARS, FEEDBACK_SHORT_MAX_CHARS, FEEDBACK_DATASETS_MAX, FEEDBACK_NOTE_MAX_BYTES, FEEDBACK_SCREENSHOT_MAX_BYTES, FEEDBACK_SCREENSHOT_TYPES, FEEDBACK_SUMMARY_CHARS, FEEDBACK_PAGE_DEFAULT, FEEDBACK_PAGE_MAX, } from '@elaraai/e3-cloud-types';
57
+ export type { FeedbackSendRequest, FeedbackSent, FeedbackPage, FeedbackPart, FeedbackPartKind, FeedbackScope, FeedbackRect, FeedbackPoint, FeedbackData, FeedbackImage, FeedbackScreenshotRequest, FeedbackNote, FeedbackSender, FeedbackScreenshot, FeedbackStatus, FeedbackSummary, FeedbackList, FeedbackMine, FeedbackCounts, FeedbackSettings, } from '@elaraai/e3-cloud-types';
58
+ export { workspaceHistory, workspaceHistoryEntry, repositoryHistory, releaseWorkspace, rollbackWorkspace, getReleaseSettings, getRepositoryReleaseSettings, addStaging, stopStaging, type WorkspaceHistoryOptions, } from './history.js';
59
+ export { WORKSPACE_HISTORY_PAGE_DEFAULT, WORKSPACE_HISTORY_PAGE_MAX, RELEASE_CARRY_MAX, releaseProblemText, releasePlanRefusalLines, workspaceProtectedText, historyKindChangesWorkspace, } from '@elaraai/e3-cloud-types';
60
+ export type { RepositoryHistory, WorkspaceHistorySummary, WorkspaceHistoryApp, WorkspaceHistoryEntry, WorkspaceHistoryKind, WorkspaceHistoryOutcome, WorkspaceHistoryPage, ReleaseApp, ReleaseAppChange, ReleaseAppVersion, ReleaseCarry, ReleaseCarryKind, ReleasePlan, ReleaseProblem, ReleaseRequest, ReleaseResponse, ReleaseSource, RollbackRequest, WorkspaceReleaseSettings, RepositoryReleaseSettings, ReleaseUndone, StagingStart, StagingApp, StagingRuns, AddStagingRequest, StagingPlan, AddStagingResponse, StagingLink, } from '@elaraai/e3-cloud-types';
61
+ export { adminAppList, repositoryAppList, appDeployWait, appList, myAppList, myAppRebuilds, appGet, appVersions, appUpload, appDeploy, appsDeploy, appRemove, type AdminAppListOptions, type AppDeployAsk, type AppsDeployAsk, type AppRemoveOptions, type AppDeployWaitOptions, type AppVersionsOptions, } from './apps.js';
62
+ export { APP_VERSIONS_KEPT, APP_OBJECT_MAX_BYTES, APP_DEPLOY_MAX, appProblemText, appProblemLines, appProblemsText, appDeployRefusedText, } from '@elaraai/e3-cloud-types';
63
+ export type { AdminAppPage, AppRebuilds, RepositoryApps, WorkspaceLastRelease, AppSummary, AppList, AppVersion, AppVersionPage, AppNav, AppStaged, AppSource, AppDeployRequest, AppsDeployRequest, AppDeployResponse, AppDeployKind, AppRemoved, AppProblem, AppProblems, } from '@elaraai/e3-cloud-types';
64
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGlF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EACL,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EACnE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,kBAAkB,EACvF,eAAe,EACf,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAC/C,sBAAsB,EAAE,qBAAqB,EAAE,wBAAwB,EACvE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAC/B,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,c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AAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,OAAO,EACP,SAAS,EACT,aAAa,EACb,MAAM,EACN,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,eAAe,EACf,eAAe,EACf,oBAAoB,GACrB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,UAAU,EACV,OAAO,EACP,UAAU,EACV,cAAc,EACd,MAAM,EACN,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,UAAU,EACV,WAAW,GACZ,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ /**
6
+ * e3-cloud-client: HTTP client library for e3 admin API
7
+ *
8
+ * This package provides a typed HTTP client for interacting with the e3 admin API,
9
+ * building on e3-api-client's HTTP utilities.
10
+ *
11
+ * Features:
12
+ * - Type-safe request/response handling using East types
13
+ * - BEAST2 binary serialization format
14
+ * - Exception-based error handling (throws ApiError on failures)
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * import { whoami, repoUsers, addUser, ApiError } from '@elaraai/e3-cloud-client';
19
+ * import { variant } from '@elaraai/east';
20
+ *
21
+ * const options = { token: accessToken };
22
+ *
23
+ * // Get current user
24
+ * const me = await whoami('https://e3.example.com', options);
25
+ *
26
+ * // Add a user holding the built-in All apps role
27
+ * try {
28
+ * const user = await addUser(
29
+ * 'https://e3.example.com',
30
+ * 'my-repo',
31
+ * { email: 'bob@example.com', role: variant('user', { roles: ['All apps'] }) },
32
+ * options
33
+ * );
34
+ * } catch (error) {
35
+ * if (error instanceof ApiError) {
36
+ * console.error(`Failed: ${error.code}`);
37
+ * }
38
+ * }
39
+ * ```
40
+ */
41
+ // Re-export HTTP utilities from e3-api-client
42
+ export { ApiError, AuthError } from '@elaraai/e3-api-client';
43
+ // API functions
44
+ export { whoami, repoUsers, addUser, removeUser, repoInvitations, revokeRepoInvitation } from './users.js';
45
+ export { getSchedule, setSchedule, removeSchedule, listSchedules } from './schedules.js';
46
+ export { listCompute, getCompute, setCompute, setComputeBatch, removeCompute, listTimeout, getTimeout, setTimeout, setTimeoutBatch, removeTimeout, removeTimeoutBatch, listTaskConfigs, listDelegation, setDelegation, removeDelegation, listFunctionDelegation, setFunctionDelegation, removeFunctionDelegation, getWidth, setWidth, removeWidth, repositorySettings, } from './task-configs.js';
47
+ export { getUserSettings, putUserSettings, deleteUserSettings } from './user-settings.js';
48
+ export { listSecrets, putSecret, deleteSecret } from './secrets.js';
49
+ export { listInvitations, revokeInvitation, isInvitedSentinel } from './invitations.js';
50
+ export { listAdminUsers, disableUser, enableUser, lookupPeople } from './admin-users.js';
51
+ export { myMemberships } from './me.js';
52
+ // Business roles: a repository's roles, and what the caller's grant them
53
+ export { listRoles, getRole, putRole, deleteRole, myAccess, previewRole } from './roles.js';
54
+ export { getDelegationPolicy, setDelegationPolicy, getRackSecurityPolicy, setRackSecurityPolicy, listRacks, enrollRack, deregisterRack, rackActivity, approveRackBoot, ApproveBootRequestType, EnrollmentTokenType, } from './deployment-settings.js';
55
+ // Record history, rollback & backups
56
+ export { listRecordInfos, recordAudit, recordStateAt, recordStatePage, recordValueChunks, rollbackRecord, listRecordBackups, createRecordBackup, restoreRecordBackup, recordBackupDownload, recordBackupStream, recordBackupValue, deleteRecordBackup, } from './records.js';
57
+ // Feedback on components
58
+ export { getFeedbackSettings, putFeedbackSettings, addFeedback, listMyFeedback, listFeedback, getFeedback, feedbackScreenshotUrl, closeFeedback, reopenFeedback, } from './feedback.js';
59
+ export { feedbackId, FEEDBACK_NOTE_MAX_CHARS, FEEDBACK_TEXT_MAX_CHARS, FEEDBACK_URL_MAX_CHARS, FEEDBACK_SHORT_MAX_CHARS, FEEDBACK_DATASETS_MAX, FEEDBACK_NOTE_MAX_BYTES, FEEDBACK_SCREENSHOT_MAX_BYTES, FEEDBACK_SCREENSHOT_TYPES, FEEDBACK_SUMMARY_CHARS, FEEDBACK_PAGE_DEFAULT, FEEDBACK_PAGE_MAX, } from '@elaraai/e3-cloud-types';
60
+ // A workspace's history: its releases, rollbacks, deploys, app deploys
61
+ // and copies; and its staging, which protects it
62
+ export { workspaceHistory, workspaceHistoryEntry, repositoryHistory, releaseWorkspace, rollbackWorkspace, getReleaseSettings, getRepositoryReleaseSettings, addStaging, stopStaging, } from './history.js';
63
+ export { WORKSPACE_HISTORY_PAGE_DEFAULT, WORKSPACE_HISTORY_PAGE_MAX, RELEASE_CARRY_MAX, releaseProblemText, releasePlanRefusalLines, workspaceProtectedText, historyKindChangesWorkspace, } from '@elaraai/e3-cloud-types';
64
+ // Apps: a workspace's apps, an upload of an app object, deploys, versions and removal; yours across your repositories, and those to rebuild; a repository's and the deployment's
65
+ export { adminAppList, repositoryAppList, appDeployWait, appList, myAppList, myAppRebuilds, appGet, appVersions, appUpload, appDeploy, appsDeploy, appRemove, } from './apps.js';
66
+ export { APP_VERSIONS_KEPT, APP_OBJECT_MAX_BYTES, APP_DEPLOY_MAX, appProblemText, appProblemLines, appProblemsText, appDeployRefusedText, } from '@elaraai/e3-cloud-types';
67
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,8CAA8C;AAC9C,OAAO,EAAE,QAAQ,EAAE,S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yB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ import { type InvitationList } from '@elaraai/e3-cloud-types';
6
+ import { type RequestOptions } from '@elaraai/e3-api-client';
7
+ /**
8
+ * List all invitations (admin only), newest first.
9
+ */
10
+ export declare function listInvitations(url: string, options: RequestOptions): Promise<InvitationList>;
11
+ /**
12
+ * Revoke a pending invitation (admin only). No-op on absent/claimed.
13
+ */
14
+ export declare function revokeInvitation(url: string, email: string, options: RequestOptions): Promise<void>;
15
+ /** Whether an add-user response denotes a recorded invitation (not yet a member). */
16
+ export declare function isInvitedSentinel(userId: string): boolean;
17
+ //# sourceMappingURL=invitations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["../../src/invitations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEvE;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAEnG;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzG;AAED,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD"}