@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,100 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ /**
6
+ * User management API functions using BEAST2 format.
7
+ */
8
+ import { ArrayType, NullType } from '@elaraai/east';
9
+ import { RepoUserType, RepoInvitationListType, WhoamiResponseType, AddUserRequestType, } from '@elaraai/e3-cloud-types';
10
+ import { get, post, del } from '@elaraai/e3-api-client';
11
+ /**
12
+ * Get current user info.
13
+ *
14
+ * @param url - The base URL of the e3 server (e.g., 'https://e3.example.com')
15
+ * @param options - Request options including authentication token
16
+ * @returns The current user's identity and admin status
17
+ * @throws {ApiError} On application-level errors
18
+ * @throws {AuthError} On 401 Unauthorized
19
+ */
20
+ export async function whoami(url, options) {
21
+ return get(url, `/whoami`, WhoamiResponseType, options);
22
+ }
23
+ /**
24
+ * List users with access to a repository.
25
+ *
26
+ * Requires: owner role on the repository.
27
+ *
28
+ * @param url - The base URL of the e3 server
29
+ * @param repo - The repository name
30
+ * @param options - Request options including authentication token
31
+ * @returns List of users with access to the repository
32
+ * @throws {ApiError} On application-level errors
33
+ * @throws {AuthError} On 401 Unauthorized
34
+ */
35
+ export async function repoUsers(url, repo, options) {
36
+ return get(url, `/repos/${encodeURIComponent(repo)}/users`, ArrayType(RepoUserType), options);
37
+ }
38
+ /**
39
+ * Add a user to a repository.
40
+ *
41
+ * Requires: owner role on the repository.
42
+ *
43
+ * @param url - The base URL of the e3 server
44
+ * @param repo - The repository name
45
+ * @param request - The add user request containing email and role
46
+ * @param options - Request options including authentication token
47
+ * @returns The newly added user
48
+ * @throws {ApiError} On application-level errors (e.g., user_not_found, forbidden)
49
+ * @throws {AuthError} On 401 Unauthorized
50
+ */
51
+ export async function addUser(url, repo, request, options) {
52
+ return post(url, `/repos/${encodeURIComponent(repo)}/users`, request, AddUserRequestType, RepoUserType, options);
53
+ }
54
+ /**
55
+ * Remove a user from a repository.
56
+ *
57
+ * Requires: owner role on the repository.
58
+ *
59
+ * @param url - The base URL of the e3 server
60
+ * @param repo - The repository name
61
+ * @param userId - The user ID to remove
62
+ * @param options - Request options including authentication token
63
+ * @throws {ApiError} On application-level errors (e.g., forbidden, last_owner)
64
+ * @throws {AuthError} On 401 Unauthorized
65
+ */
66
+ export async function removeUser(url, repo, userId, options) {
67
+ await del(url, `/repos/${encodeURIComponent(repo)}/users/${encodeURIComponent(userId)}`, NullType, options);
68
+ }
69
+ /**
70
+ * The people added to a repository who have not signed in yet: its pending
71
+ * invitations, each with the role its claim gives. Owner or admin.
72
+ * Their roles change as any person's do, by adding them again (`addUser`
73
+ * upserts an invitation's grant).
74
+ *
75
+ * @param url - The base URL of the e3 server
76
+ * @param repo - The repository name
77
+ * @param options - Request options including authentication token
78
+ * @returns The invitations, newest first
79
+ * @throws {ApiError} On application-level errors (e.g., forbidden)
80
+ * @throws {AuthError} On 401 Unauthorized
81
+ */
82
+ export async function repoInvitations(url, repo, options) {
83
+ return get(url, `/repos/${encodeURIComponent(repo)}/invitations`, RepoInvitationListType, options);
84
+ }
85
+ /**
86
+ * Takes a repository's grant out of a pending invitation: someone added who
87
+ * has not signed in yet gets no access to it at their first sign-in.
88
+ * Owner or admin.
89
+ *
90
+ * @param url - The base URL of the e3 server
91
+ * @param repo - The repository name
92
+ * @param email - The invitee's email
93
+ * @param options - Request options including authentication token
94
+ * @throws {ApiError} On application-level errors (e.g., forbidden, user_not_found for no pending invitation)
95
+ * @throws {AuthError} On 401 Unauthorized
96
+ */
97
+ export async function revokeRepoInvitation(url, repo, email, options) {
98
+ await del(url, `/repos/${encodeURIComponent(repo)}/invitations/${encodeURIComponent(email)}`, NullType, options);
99
+ }
100
+ //# sourceMappingURL=users.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/users.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,GAKnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAuB,MAAM,wBAAwB,CAAC;AAE7E;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,GAAW,EACX,OAAuB;IAEvB,OAAO,GAAG,CAAC,GAAG,EAAE,SAAS,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,GAAW,EACX,IAAY,EACZ,OAAuB;IAEvB,OAAO,GAAG,CACR,GAAG,EACH,UAAU,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAC1C,SAAS,CAAC,YAAY,CAAC,EACvB,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,GAAW,EACX,IAAY,EACZ,OAAuB,EACvB,OAAuB;IAEvB,OAAO,IAAI,CACT,GAAG,EACH,UAAU,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAC1C,OAAO,EACP,kBAAkB,EAClB,YAAY,EACZ,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,GAAW,EACX,IAAY,EACZ,MAAc,EACd,OAAuB;IAEvB,MAAM,GAAG,CACP,GAAG,EACH,UAAU,kBAAkB,CAAC,IAAI,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE,EACxE,QAAQ,EACR,OAAO,CACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAW,EAAE,IAAY,EAAE,OAAuB;IACtF,OAAO,GAAG,CAAC,GAAG,EAAE,UAAU,kBAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,sBAAsB,EAAE,OAAO,CAAC,CAAC;AACrG,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,GAAW,EAAE,IAAY,EAAE,KAAa,EAAE,OAAuB;IAC1G,MAAM,GAAG,CAAC,GAAG,EAAE,UAAU,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@elaraai/e3-cloud-client",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.89-alpha.0",
4
+ "type": "module",
5
+ "description": "HTTP client library for the e3 cloud API",
6
+ "license": "BUSL-1.1",
7
+ "main": "dist/src/index.js",
8
+ "types": "dist/src/index.d.ts",
9
+ "dependencies": {
10
+ "@elaraai/e3-api-client": "1.0.89",
11
+ "@elaraai/e3-types": "1.0.89",
12
+ "@elaraai/e3-cloud-types": "1.0.89-alpha.0"
13
+ },
14
+ "peerDependencies": {
15
+ "@elaraai/east": "1.0.89"
16
+ },
17
+ "files": [
18
+ "dist/src",
19
+ "!dist/src/**/*.spec.*",
20
+ "README.md",
21
+ "LICENSE.md"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public"
25
+ }
6
26
  }