rocketride 1.0.6 → 1.1.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 (159) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/account.js +284 -0
  3. package/dist/cjs/account.js.map +1 -0
  4. package/dist/cjs/billing.js +171 -0
  5. package/dist/cjs/billing.js.map +1 -0
  6. package/dist/cjs/client.js +1208 -756
  7. package/dist/cjs/client.js.map +1 -1
  8. package/dist/cjs/constants.js +10 -1
  9. package/dist/cjs/constants.js.map +1 -1
  10. package/dist/cjs/core/DAPBase.js +4 -1
  11. package/dist/cjs/core/DAPBase.js.map +1 -1
  12. package/dist/cjs/core/DAPClient.js +121 -50
  13. package/dist/cjs/core/DAPClient.js.map +1 -1
  14. package/dist/cjs/core/TransportBase.js +0 -10
  15. package/dist/cjs/core/TransportBase.js.map +1 -1
  16. package/dist/cjs/core/TransportWebSocket.js +30 -19
  17. package/dist/cjs/core/TransportWebSocket.js.map +1 -1
  18. package/dist/cjs/database.js +121 -0
  19. package/dist/cjs/database.js.map +1 -0
  20. package/dist/cjs/index.js +4 -0
  21. package/dist/cjs/index.js.map +1 -1
  22. package/dist/cjs/schema/Question.js +2 -0
  23. package/dist/cjs/schema/Question.js.map +1 -1
  24. package/dist/cjs/types/account.js +26 -0
  25. package/dist/cjs/types/account.js.map +1 -0
  26. package/dist/cjs/types/billing.js +26 -0
  27. package/dist/cjs/types/billing.js.map +1 -0
  28. package/dist/cjs/types/client.js +14 -0
  29. package/dist/cjs/types/client.js.map +1 -1
  30. package/dist/cjs/types/cprofile.js +26 -0
  31. package/dist/cjs/types/cprofile.js.map +1 -0
  32. package/dist/cjs/types/dashboard.js +26 -0
  33. package/dist/cjs/types/dashboard.js.map +1 -0
  34. package/dist/cjs/types/events.js +5 -1
  35. package/dist/cjs/types/events.js.map +1 -1
  36. package/dist/cjs/types/index.js +5 -0
  37. package/dist/cjs/types/index.js.map +1 -1
  38. package/dist/cjs/types/service.js +85 -0
  39. package/dist/cjs/types/service.js.map +1 -0
  40. package/dist/cli/cli/rocketride.js +335 -113
  41. package/dist/cli/cli/rocketride.js.map +1 -1
  42. package/dist/cli/client/account.js +284 -0
  43. package/dist/cli/client/account.js.map +1 -0
  44. package/dist/cli/client/billing.js +171 -0
  45. package/dist/cli/client/billing.js.map +1 -0
  46. package/dist/cli/client/client.js +1208 -756
  47. package/dist/cli/client/client.js.map +1 -1
  48. package/dist/cli/client/constants.js +10 -1
  49. package/dist/cli/client/constants.js.map +1 -1
  50. package/dist/cli/client/core/DAPBase.js +4 -1
  51. package/dist/cli/client/core/DAPBase.js.map +1 -1
  52. package/dist/cli/client/core/DAPClient.js +121 -50
  53. package/dist/cli/client/core/DAPClient.js.map +1 -1
  54. package/dist/cli/client/core/TransportBase.js +0 -10
  55. package/dist/cli/client/core/TransportBase.js.map +1 -1
  56. package/dist/cli/client/core/TransportWebSocket.js +30 -19
  57. package/dist/cli/client/core/TransportWebSocket.js.map +1 -1
  58. package/dist/cli/client/database.js +121 -0
  59. package/dist/cli/client/database.js.map +1 -0
  60. package/dist/cli/client/index.js +4 -0
  61. package/dist/cli/client/index.js.map +1 -1
  62. package/dist/cli/client/schema/Question.js +2 -0
  63. package/dist/cli/client/schema/Question.js.map +1 -1
  64. package/dist/cli/client/types/account.js +26 -0
  65. package/dist/cli/client/types/account.js.map +1 -0
  66. package/dist/cli/client/types/billing.js +26 -0
  67. package/dist/cli/client/types/billing.js.map +1 -0
  68. package/dist/cli/client/types/client.js +14 -0
  69. package/dist/cli/client/types/client.js.map +1 -1
  70. package/dist/cli/client/types/cprofile.js +26 -0
  71. package/dist/cli/client/types/cprofile.js.map +1 -0
  72. package/dist/cli/client/types/dashboard.js +26 -0
  73. package/dist/cli/client/types/dashboard.js.map +1 -0
  74. package/dist/cli/client/types/events.js +5 -1
  75. package/dist/cli/client/types/events.js.map +1 -1
  76. package/dist/cli/client/types/index.js +5 -0
  77. package/dist/cli/client/types/index.js.map +1 -1
  78. package/dist/cli/client/types/service.js +85 -0
  79. package/dist/cli/client/types/service.js.map +1 -0
  80. package/dist/esm/account.js +280 -0
  81. package/dist/esm/account.js.map +1 -0
  82. package/dist/esm/billing.js +167 -0
  83. package/dist/esm/billing.js.map +1 -0
  84. package/dist/esm/client.js +1208 -756
  85. package/dist/esm/client.js.map +1 -1
  86. package/dist/esm/constants.js +9 -0
  87. package/dist/esm/constants.js.map +1 -1
  88. package/dist/esm/core/DAPBase.js +4 -1
  89. package/dist/esm/core/DAPBase.js.map +1 -1
  90. package/dist/esm/core/DAPClient.js +121 -50
  91. package/dist/esm/core/DAPClient.js.map +1 -1
  92. package/dist/esm/core/TransportBase.js +0 -10
  93. package/dist/esm/core/TransportBase.js.map +1 -1
  94. package/dist/esm/core/TransportWebSocket.js +30 -19
  95. package/dist/esm/core/TransportWebSocket.js.map +1 -1
  96. package/dist/esm/database.js +117 -0
  97. package/dist/esm/database.js.map +1 -0
  98. package/dist/esm/index.js +4 -0
  99. package/dist/esm/index.js.map +1 -1
  100. package/dist/esm/schema/Question.js +2 -0
  101. package/dist/esm/schema/Question.js.map +1 -1
  102. package/dist/esm/types/account.js +25 -0
  103. package/dist/esm/types/account.js.map +1 -0
  104. package/dist/esm/types/billing.js +25 -0
  105. package/dist/esm/types/billing.js.map +1 -0
  106. package/dist/esm/types/client.js +13 -1
  107. package/dist/esm/types/client.js.map +1 -1
  108. package/dist/esm/types/cprofile.js +25 -0
  109. package/dist/esm/types/cprofile.js.map +1 -0
  110. package/dist/esm/types/dashboard.js +25 -0
  111. package/dist/esm/types/dashboard.js.map +1 -0
  112. package/dist/esm/types/events.js +5 -1
  113. package/dist/esm/types/events.js.map +1 -1
  114. package/dist/esm/types/index.js +5 -0
  115. package/dist/esm/types/index.js.map +1 -1
  116. package/dist/esm/types/service.js +82 -0
  117. package/dist/esm/types/service.js.map +1 -0
  118. package/dist/types/account.d.ts +209 -0
  119. package/dist/types/account.d.ts.map +1 -0
  120. package/dist/types/billing.d.ts +135 -0
  121. package/dist/types/billing.d.ts.map +1 -0
  122. package/dist/types/client.d.ts +553 -285
  123. package/dist/types/client.d.ts.map +1 -1
  124. package/dist/types/constants.d.ts +9 -0
  125. package/dist/types/constants.d.ts.map +1 -1
  126. package/dist/types/core/DAPBase.d.ts.map +1 -1
  127. package/dist/types/core/DAPClient.d.ts +89 -7
  128. package/dist/types/core/DAPClient.d.ts.map +1 -1
  129. package/dist/types/core/TransportBase.d.ts +1 -11
  130. package/dist/types/core/TransportBase.d.ts.map +1 -1
  131. package/dist/types/core/TransportWebSocket.d.ts +14 -11
  132. package/dist/types/core/TransportWebSocket.d.ts.map +1 -1
  133. package/dist/types/database.d.ts +90 -0
  134. package/dist/types/database.d.ts.map +1 -0
  135. package/dist/types/index.d.ts +2 -0
  136. package/dist/types/index.d.ts.map +1 -1
  137. package/dist/types/schema/Question.d.ts +3 -1
  138. package/dist/types/schema/Question.d.ts.map +1 -1
  139. package/dist/types/types/account.d.ts +171 -0
  140. package/dist/types/types/account.d.ts.map +1 -0
  141. package/dist/types/types/billing.d.ts +115 -0
  142. package/dist/types/types/billing.d.ts.map +1 -0
  143. package/dist/types/types/client.d.ts +241 -1
  144. package/dist/types/types/client.d.ts.map +1 -1
  145. package/dist/types/types/cprofile.d.ts +67 -0
  146. package/dist/types/types/cprofile.d.ts.map +1 -0
  147. package/dist/types/types/dashboard.d.ts +198 -0
  148. package/dist/types/types/dashboard.d.ts.map +1 -0
  149. package/dist/types/types/events.d.ts +90 -95
  150. package/dist/types/types/events.d.ts.map +1 -1
  151. package/dist/types/types/index.d.ts +5 -0
  152. package/dist/types/types/index.d.ts.map +1 -1
  153. package/dist/types/types/pipeline.d.ts +10 -2
  154. package/dist/types/types/pipeline.d.ts.map +1 -1
  155. package/dist/types/types/service.d.ts +189 -0
  156. package/dist/types/types/service.d.ts.map +1 -0
  157. package/dist/types/types/task.d.ts +5 -1
  158. package/dist/types/types/task.d.ts.map +1 -1
  159. package/package.json +12 -7
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client/types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;AAEH;;;;GAIG;AAEH,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client/types/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;;;;;;;;AAEH;;;;GAIG;AAEH,+CAA6B;AAC7B,+CAA6B;AAC7B,8CAA4B;AAC5B,gDAA8B;AAC9B,iDAA+B;AAC/B,4CAA0B;AAC1B,8CAA4B;AAC5B,gDAA8B;AAC9B,+CAA6B;AAC7B,4CAA0B"}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ /**
3
+ * MIT License
4
+ *
5
+ * Copyright (c) 2026 Aparavi Software AG
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.PROTOCOL_CAPS = void 0;
27
+ // ============================================================================
28
+ // PROTOCOL CAPABILITY FLAGS
29
+ // ============================================================================
30
+ /**
31
+ * Protocol capability flags for service drivers.
32
+ *
33
+ * Each flag is a single bit in a uint32 bitmask describing what a service
34
+ * driver supports. Values are returned by the engine in the `capabilities`
35
+ * field of a service definition and can be tested with bitwise AND.
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * const services = await client.getServices();
40
+ * const svc = services.services['my_driver'];
41
+ * if (svc.capabilities & PROTOCOL_CAPS.GPU) {
42
+ * console.log('Driver requires a GPU');
43
+ * }
44
+ * ```
45
+ */
46
+ var PROTOCOL_CAPS;
47
+ (function (PROTOCOL_CAPS) {
48
+ /** No capabilities */
49
+ PROTOCOL_CAPS[PROTOCOL_CAPS["NONE"] = 0] = "NONE";
50
+ /** Supports the file permissions interface */
51
+ PROTOCOL_CAPS[PROTOCOL_CAPS["SECURITY"] = 1] = "SECURITY";
52
+ /** Is a filesystem interface */
53
+ PROTOCOL_CAPS[PROTOCOL_CAPS["FILESYSTEM"] = 2] = "FILESYSTEM";
54
+ /** Supports the substream interface */
55
+ PROTOCOL_CAPS[PROTOCOL_CAPS["SUBSTREAM"] = 4] = "SUBSTREAM";
56
+ /** Uses a network interface */
57
+ PROTOCOL_CAPS[PROTOCOL_CAPS["NETWORK"] = 8] = "NETWORK";
58
+ /** Uses datanet or streamnet interfaces */
59
+ PROTOCOL_CAPS[PROTOCOL_CAPS["DATANET"] = 16] = "DATANET";
60
+ /** Uses delta queries to track changes */
61
+ PROTOCOL_CAPS[PROTOCOL_CAPS["SYNC"] = 32] = "SYNC";
62
+ /** Internal — will not be returned in services.json */
63
+ PROTOCOL_CAPS[PROTOCOL_CAPS["INTERNAL"] = 64] = "INTERNAL";
64
+ /** Supports data catalog operations */
65
+ PROTOCOL_CAPS[PROTOCOL_CAPS["CATALOG"] = 128] = "CATALOG";
66
+ /** Do not monitor for excessive failures */
67
+ PROTOCOL_CAPS[PROTOCOL_CAPS["NOMONITOR"] = 256] = "NOMONITOR";
68
+ /** Source endpoint does not use include */
69
+ PROTOCOL_CAPS[PROTOCOL_CAPS["NOINCLUDE"] = 512] = "NOINCLUDE";
70
+ /** Driver supports the invoke function */
71
+ PROTOCOL_CAPS[PROTOCOL_CAPS["INVOKE"] = 1024] = "INVOKE";
72
+ /** Driver supports remoting execution */
73
+ PROTOCOL_CAPS[PROTOCOL_CAPS["REMOTING"] = 2048] = "REMOTING";
74
+ /** Driver requires a GPU */
75
+ PROTOCOL_CAPS[PROTOCOL_CAPS["GPU"] = 4096] = "GPU";
76
+ /** Driver is not SaaS compatible */
77
+ PROTOCOL_CAPS[PROTOCOL_CAPS["NOSAAS"] = 8192] = "NOSAAS";
78
+ /** Focus on this driver */
79
+ PROTOCOL_CAPS[PROTOCOL_CAPS["FOCUS"] = 16384] = "FOCUS";
80
+ /** Driver is deprecated */
81
+ PROTOCOL_CAPS[PROTOCOL_CAPS["DEPRECATED"] = 32768] = "DEPRECATED";
82
+ /** Driver is experimental */
83
+ PROTOCOL_CAPS[PROTOCOL_CAPS["EXPERIMENTAL"] = 65536] = "EXPERIMENTAL";
84
+ })(PROTOCOL_CAPS || (exports.PROTOCOL_CAPS = PROTOCOL_CAPS = {}));
85
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../src/client/types/service.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AA8HH,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E;;;;;;;;;;;;;;;GAeG;AACH,IAAY,aAsDX;AAtDD,WAAY,aAAa;IACxB,sBAAsB;IACtB,iDAAQ,CAAA;IAER,8CAA8C;IAC9C,yDAAiB,CAAA;IAEjB,gCAAgC;IAChC,6DAAmB,CAAA;IAEnB,uCAAuC;IACvC,2DAAkB,CAAA;IAElB,+BAA+B;IAC/B,uDAAgB,CAAA;IAEhB,2CAA2C;IAC3C,wDAAgB,CAAA;IAEhB,0CAA0C;IAC1C,kDAAa,CAAA;IAEb,uDAAuD;IACvD,0DAAiB,CAAA;IAEjB,uCAAuC;IACvC,yDAAgB,CAAA;IAEhB,4CAA4C;IAC5C,6DAAkB,CAAA;IAElB,2CAA2C;IAC3C,6DAAkB,CAAA;IAElB,0CAA0C;IAC1C,wDAAgB,CAAA;IAEhB,yCAAyC;IACzC,4DAAkB,CAAA;IAElB,4BAA4B;IAC5B,kDAAa,CAAA;IAEb,oCAAoC;IACpC,wDAAgB,CAAA;IAEhB,2BAA2B;IAC3B,uDAAe,CAAA;IAEf,2BAA2B;IAC3B,iEAAoB,CAAA;IAEpB,6BAA6B;IAC7B,qEAAsB,CAAA;AACvB,CAAC,EAtDW,aAAa,6BAAb,aAAa,QAsDxB"}
@@ -0,0 +1,280 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2026 Aparavi Software AG
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ // =============================================================================
25
+ // ACCOUNT API CLASS
26
+ // =============================================================================
27
+ /**
28
+ * Typed wrapper around the `rrext_account_*` DAP commands.
29
+ *
30
+ * Accessed via `client.account` — not instantiated directly. All methods
31
+ * delegate to {@link RocketRideClient.dap} which handles envelope
32
+ * unwrapping and error propagation.
33
+ */
34
+ export class AccountApi {
35
+ /** @param client - The parent RocketRideClient that owns this namespace. */
36
+ constructor(client) {
37
+ this.client = client;
38
+ }
39
+ // =========================================================================
40
+ // PROFILE
41
+ // =========================================================================
42
+ /**
43
+ * Fetches the current user's profile from the server.
44
+ *
45
+ * @returns The user's profile data.
46
+ */
47
+ async getProfile() {
48
+ return this.client.call('rrext_account_me', { subcommand: 'get' });
49
+ }
50
+ /**
51
+ * Persists updated profile fields.
52
+ *
53
+ * @param fields - The profile fields to update.
54
+ */
55
+ async updateProfile(fields) {
56
+ await this.client.call('rrext_account_me', { subcommand: 'update', ...fields });
57
+ }
58
+ /**
59
+ * Sets the user's preferred default team.
60
+ *
61
+ * @param teamId - The team ID to set as default.
62
+ */
63
+ async setDefaultTeam(teamId) {
64
+ await this.client.call('rrext_account_me', { subcommand: 'set_default_team', teamId });
65
+ }
66
+ /**
67
+ * Permanently deletes the current user's account.
68
+ */
69
+ async deleteAccount() {
70
+ await this.client.call('rrext_account_me', { subcommand: 'delete' });
71
+ }
72
+ // =========================================================================
73
+ // ORGANIZATION
74
+ // =========================================================================
75
+ /**
76
+ * Fetches the organization detail for the given org.
77
+ *
78
+ * @param orgId - Organisation UUID. The server may infer the org if omitted.
79
+ * @returns The organization detail (id, name, plan, memberCount, teamCount).
80
+ */
81
+ async getOrg(orgId) {
82
+ return this.client.call('rrext_account_org', { subcommand: 'get', ...(orgId ? { orgId } : {}) });
83
+ }
84
+ /**
85
+ * Updates the organization name.
86
+ *
87
+ * @param orgId - Organisation UUID.
88
+ * @param name - The new organization name.
89
+ */
90
+ async updateOrgName(orgId, name) {
91
+ await this.client.call('rrext_account_org', { subcommand: 'update', orgId, name });
92
+ }
93
+ // =========================================================================
94
+ // API KEYS
95
+ // =========================================================================
96
+ /**
97
+ * Fetches the list of API keys for the current user.
98
+ *
99
+ * @returns Array of API key records.
100
+ */
101
+ async listKeys() {
102
+ const body = await this.client.call('rrext_account_keys', { subcommand: 'list' });
103
+ return body.keys ?? [];
104
+ }
105
+ /**
106
+ * Creates a new API key and returns the raw key string.
107
+ *
108
+ * @param params - Key creation parameters (name, permissions, expiresAt).
109
+ * @returns Object containing the raw key string.
110
+ */
111
+ async createKey(params) {
112
+ const body = await this.client.call('rrext_account_keys', { subcommand: 'create', ...params });
113
+ return { key: body.key };
114
+ }
115
+ /**
116
+ * Revokes an API key by its ID.
117
+ *
118
+ * @param keyId - The key to revoke.
119
+ */
120
+ async revokeKey(keyId) {
121
+ await this.client.call('rrext_account_keys', { subcommand: 'revoke', keyId });
122
+ }
123
+ // =========================================================================
124
+ // MEMBERS
125
+ // =========================================================================
126
+ /**
127
+ * Fetches the flat list of organization members.
128
+ *
129
+ * @param orgId - Organisation UUID.
130
+ * @returns Array of member records.
131
+ */
132
+ async listMembers(orgId) {
133
+ const body = await this.client.call('rrext_account_members', { subcommand: 'list', orgId });
134
+ return body.members ?? [];
135
+ }
136
+ /**
137
+ * Sends an invitation to a new organization member.
138
+ *
139
+ * @param orgId - Organisation UUID.
140
+ * @param params - Invitation parameters (email, givenName, familyName, role).
141
+ */
142
+ async inviteMember(orgId, params) {
143
+ await this.client.call('rrext_account_members', { subcommand: 'invite', orgId, ...params });
144
+ }
145
+ /**
146
+ * Updates an organization member's role.
147
+ *
148
+ * @param orgId - Organisation UUID.
149
+ * @param userId - The member's user ID.
150
+ * @param role - The new role string.
151
+ */
152
+ async updateMemberRole(orgId, userId, role) {
153
+ await this.client.call('rrext_account_members', { subcommand: 'update', orgId, userId, role });
154
+ }
155
+ /**
156
+ * Removes an organization member.
157
+ *
158
+ * @param orgId - Organisation UUID.
159
+ * @param userId - The member's user ID.
160
+ */
161
+ async removeMember(orgId, userId) {
162
+ await this.client.call('rrext_account_members', { subcommand: 'delete', orgId, userId });
163
+ }
164
+ // =========================================================================
165
+ // TEAMS
166
+ // =========================================================================
167
+ /**
168
+ * Fetches the flat list of teams in the organization.
169
+ *
170
+ * @param orgId - Organisation UUID.
171
+ * @returns Array of team summary records.
172
+ */
173
+ async listTeams(orgId) {
174
+ const body = await this.client.call('rrext_account_teams', { subcommand: 'list', orgId });
175
+ return body.teams ?? [];
176
+ }
177
+ /**
178
+ * Fetches full detail (including member list) for a specific team.
179
+ *
180
+ * @param orgId - Organisation UUID.
181
+ * @param teamId - The team to load.
182
+ * @returns The team detail with nested members.
183
+ */
184
+ async getTeamDetail(orgId, teamId) {
185
+ return this.client.call('rrext_account_teams', { subcommand: 'get', orgId, teamId });
186
+ }
187
+ /**
188
+ * Creates a new team.
189
+ *
190
+ * @param orgId - Organisation UUID.
191
+ * @param name - The team name.
192
+ */
193
+ async createTeam(orgId, name) {
194
+ await this.client.call('rrext_account_teams', { subcommand: 'create', orgId, name });
195
+ }
196
+ /**
197
+ * Deletes a team.
198
+ *
199
+ * @param orgId - Organisation UUID.
200
+ * @param teamId - The team to delete.
201
+ */
202
+ async deleteTeam(orgId, teamId) {
203
+ await this.client.call('rrext_account_teams', { subcommand: 'delete', orgId, teamId });
204
+ }
205
+ /**
206
+ * Adds a member to a team with specified permissions.
207
+ *
208
+ * @param orgId - Organisation UUID.
209
+ * @param params - Parameters (teamId, userId, permissions).
210
+ */
211
+ async addTeamMember(orgId, params) {
212
+ await this.client.call('rrext_account_teams', { subcommand: 'add_member', orgId, ...params });
213
+ }
214
+ /**
215
+ * Updates a team member's permissions.
216
+ *
217
+ * @param orgId - Organisation UUID.
218
+ * @param params - Parameters (teamId, userId, permissions).
219
+ */
220
+ async updateTeamMemberPerms(orgId, params) {
221
+ await this.client.call('rrext_account_teams', { subcommand: 'update_member', orgId, ...params });
222
+ }
223
+ /**
224
+ * Removes a member from a team.
225
+ *
226
+ * @param orgId - Organisation UUID.
227
+ * @param params - Parameters (teamId, userId).
228
+ */
229
+ async removeTeamMember(orgId, params) {
230
+ await this.client.call('rrext_account_teams', { subcommand: 'delete_member', orgId, ...params });
231
+ }
232
+ // =========================================================================
233
+ // ENVIRONMENT SECRETS
234
+ // =========================================================================
235
+ /**
236
+ * Returns the available ROCKETRIDE_* key names from the merged environment.
237
+ * Does not return values — only key names for use in dropdowns.
238
+ *
239
+ * @returns Array of key names (e.g. ['ROCKETRIDE_ANTHROPIC_KEY', 'ROCKETRIDE_OPENAI_KEY']).
240
+ */
241
+ async getEnvironmentKeys() {
242
+ const body = await this.client.call('rrext_account_me', { subcommand: 'env_keys' });
243
+ return body.keys ?? [];
244
+ }
245
+ /**
246
+ * Reads the environment dict for a scope (org, team, or user).
247
+ *
248
+ * @param scope - One of 'org', 'team', 'user'.
249
+ * @param scopeId - For org: orgId. For team: teamId. For user: omit (uses current user).
250
+ * @returns Decrypted key-value dict.
251
+ */
252
+ async getEnv(scope, scopeId) {
253
+ const command = scope === 'org' ? 'rrext_account_org' : scope === 'team' ? 'rrext_account_teams' : 'rrext_account_me';
254
+ const args = { subcommand: 'get_env' };
255
+ if (scope === 'org' && scopeId)
256
+ args.orgId = scopeId;
257
+ if (scope === 'team' && scopeId)
258
+ args.teamId = scopeId;
259
+ const body = await this.client.call(command, args);
260
+ return body.env ?? {};
261
+ }
262
+ /**
263
+ * Writes the full environment dict for a scope (org, team, or user).
264
+ * Replaces the entire set of keys at that scope level.
265
+ *
266
+ * @param scope - One of 'org', 'team', 'user'.
267
+ * @param env - Full key-value dict to store.
268
+ * @param scopeId - For org: orgId. For team: teamId. For user: omit.
269
+ */
270
+ async setEnv(scope, env, scopeId) {
271
+ const command = scope === 'org' ? 'rrext_account_org' : scope === 'team' ? 'rrext_account_teams' : 'rrext_account_me';
272
+ const args = { subcommand: 'set_env', env };
273
+ if (scope === 'org' && scopeId)
274
+ args.orgId = scopeId;
275
+ if (scope === 'team' && scopeId)
276
+ args.teamId = scopeId;
277
+ await this.client.call(command, args);
278
+ }
279
+ }
280
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/client/account.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAcH,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,OAAO,UAAU;IACtB,4EAA4E;IAC5E,YAAoB,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;IAAG,CAAC;IAEhD,4EAA4E;IAC5E,UAAU;IACV,4EAA4E;IAE5E;;;;OAIG;IACH,KAAK,CAAC,UAAU;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAgB,kBAAkB,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,MAAqB;QACxC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;IACjF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,cAAc,CAAC,MAAc;QAClC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAAC;IACxF,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa;QAClB,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtE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rE,IAAI,KAAK,KAAK,KAAK,IAAI,OAAO;YAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;QACrD,IAAI,KAAK,KAAK,MAAM,IAAI,OAAO;YAAE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;QACvD,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC;CACD"}
@@ -0,0 +1,167 @@
1
+ /**
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2026 Aparavi Software AG
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ // =============================================================================
25
+ // BILLING API CLASS
26
+ // =============================================================================
27
+ /**
28
+ * Typed wrapper around the `rrext_account_billing` DAP command.
29
+ *
30
+ * Accessed via `client.billing` — not instantiated directly. All methods
31
+ * delegate to {@link RocketRideClient.dap} which handles envelope
32
+ * unwrapping and error propagation.
33
+ */
34
+ export class BillingApi {
35
+ /** @param client - The parent RocketRideClient that owns this namespace. */
36
+ constructor(client) {
37
+ this.client = client;
38
+ }
39
+ // =========================================================================
40
+ // SUBSCRIPTION OPERATIONS
41
+ // =========================================================================
42
+ /**
43
+ * Fetches the per-app subscription details for the given org.
44
+ *
45
+ * @param orgId - Organisation UUID whose subscriptions to load.
46
+ * @returns Array of BillingDetail rows (one per subscribed app).
47
+ */
48
+ async getDetails(orgId) {
49
+ const body = await this.client.call('rrext_account_billing', { subcommand: 'list', orgId });
50
+ return body.subscriptions ?? [];
51
+ }
52
+ /**
53
+ * Fetches the active subscription plans (prices) for an app.
54
+ *
55
+ * Plans are returned sorted month-first, year-second, formatted for
56
+ * display in the checkout plan picker. The server resolves the app's
57
+ * Stripe product internally and calls `stripe.Price.list()` so pricing
58
+ * changes in the Stripe dashboard are reflected immediately.
59
+ *
60
+ * @param appId - App identifier (e.g. "rocketride.pipeBuilder").
61
+ * @returns Array of StripePlan objects ready for display.
62
+ */
63
+ async getProductPrices(appId) {
64
+ const body = await this.client.call('rrext_account_billing', { subcommand: 'prices', appId });
65
+ return body.plans ?? [];
66
+ }
67
+ /**
68
+ * Creates a Stripe subscription and returns the Stripe Elements client_secret.
69
+ *
70
+ * The returned client_secret is passed to `stripe.confirmPayment()` to
71
+ * complete the checkout without a browser redirect to Stripe.
72
+ *
73
+ * @param orgId - Organisation UUID to subscribe.
74
+ * @param appId - App being subscribed (e.g. "brandi").
75
+ * @param priceId - Stripe price_* identifier for the plan.
76
+ * @returns Object with client_secret for Stripe Elements and subscription_id.
77
+ */
78
+ async createCheckoutSession(orgId, appId, priceId) {
79
+ return this.client.call('rrext_account_billing', {
80
+ subcommand: 'subscribe',
81
+ orgId,
82
+ appId,
83
+ priceId,
84
+ });
85
+ }
86
+ /**
87
+ * Creates a Stripe Billing Portal session for managing payment methods.
88
+ *
89
+ * @param orgId - Organisation UUID whose Stripe customer portal to open.
90
+ * @param returnUrl - URL to redirect the user back to after portal interaction.
91
+ * @returns Object with portal URL to redirect the user to.
92
+ */
93
+ async createPortalSession(orgId, returnUrl) {
94
+ return this.client.call('rrext_account_billing', {
95
+ subcommand: 'portal',
96
+ orgId,
97
+ returnUrl,
98
+ });
99
+ }
100
+ /**
101
+ * Schedules an app subscription for cancellation at the end of the current period.
102
+ *
103
+ * The user retains access until the period ends. The webhook handler will
104
+ * update `cancel_at_period_end` in the database asynchronously.
105
+ *
106
+ * @param orgId - Organisation UUID that owns the subscription.
107
+ * @param appId - App to cancel (e.g. "brandi").
108
+ * @returns Object with canceled: true on success.
109
+ */
110
+ async cancelSubscription(orgId, appId) {
111
+ return this.client.call('rrext_account_billing', {
112
+ subcommand: 'cancel',
113
+ orgId,
114
+ appId,
115
+ });
116
+ }
117
+ // =========================================================================
118
+ // COMPUTE CREDITS WALLET
119
+ // =========================================================================
120
+ /**
121
+ * Reads the org's compute credit balance.
122
+ *
123
+ * The balance lives in a Redis-backed wallet on the engine side; this
124
+ * call is cheap and safe to poll (~1 req/s is fine for a live widget).
125
+ *
126
+ * @param orgId - Organisation UUID to query.
127
+ * @returns The credit balance with lifetime stats.
128
+ */
129
+ async getCreditBalance(orgId) {
130
+ return this.client.call('rrext_account_billing', {
131
+ subcommand: 'credits_balance',
132
+ orgId,
133
+ });
134
+ }
135
+ /**
136
+ * Loads the purchasable credit packs, sourced from the Stripe catalog
137
+ * that Terraform maintains. Call once on modal mount.
138
+ *
139
+ * @returns Array of credit pack pricing rows.
140
+ */
141
+ async listCreditPacks() {
142
+ const body = await this.client.call('rrext_account_billing', { subcommand: 'credits_packs' });
143
+ return body.packs ?? [];
144
+ }
145
+ /**
146
+ * Creates a one-off Stripe Checkout session for a credit pack purchase
147
+ * and returns the redirect URL.
148
+ *
149
+ * The frontend redirects the user to Stripe-hosted checkout; on success
150
+ * Stripe redirects back to the app, and the `checkout.session.completed`
151
+ * webhook increments the wallet server-side.
152
+ *
153
+ * @param orgId - Organisation UUID that the credits belong to.
154
+ * @param packId - Pack key returned by {@link listCreditPacks}.
155
+ * @param returnUrl - Where Stripe sends the user after payment.
156
+ * @returns Object with the Stripe checkout URL.
157
+ */
158
+ async createCreditCheckout(orgId, packId, returnUrl) {
159
+ return this.client.call('rrext_account_billing', {
160
+ subcommand: 'credits_checkout',
161
+ orgId,
162
+ packId,
163
+ returnUrl,
164
+ });
165
+ }
166
+ }
167
+ //# sourceMappingURL=billing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.js","sourceRoot":"","sources":["../../src/client/billing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAaH,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,OAAO,UAAU;IACtB,4EAA4E;IAC5E,YAAoB,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;IAAG,CAAC;IAEhD,4EAA4E;IAC5E,0BAA0B;IAC1B,4EAA4E;IAE5E;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CAAC,KAAa;QAC7B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5F,OAAO,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC;IACjC,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,gBAAgB,CAAC,KAAa;QACnC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9F,OAAO,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;IACzB,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,qBAAqB,CAAC,KAAa,EAAE,KAAa,EAAE,OAAe;QACxE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAmD,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