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.
- package/README.md +2 -2
- package/dist/cjs/account.js +284 -0
- package/dist/cjs/account.js.map +1 -0
- package/dist/cjs/billing.js +171 -0
- package/dist/cjs/billing.js.map +1 -0
- package/dist/cjs/client.js +1208 -756
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/constants.js +10 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/core/DAPBase.js +4 -1
- package/dist/cjs/core/DAPBase.js.map +1 -1
- package/dist/cjs/core/DAPClient.js +121 -50
- package/dist/cjs/core/DAPClient.js.map +1 -1
- package/dist/cjs/core/TransportBase.js +0 -10
- package/dist/cjs/core/TransportBase.js.map +1 -1
- package/dist/cjs/core/TransportWebSocket.js +30 -19
- package/dist/cjs/core/TransportWebSocket.js.map +1 -1
- package/dist/cjs/database.js +121 -0
- package/dist/cjs/database.js.map +1 -0
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/schema/Question.js +2 -0
- package/dist/cjs/schema/Question.js.map +1 -1
- package/dist/cjs/types/account.js +26 -0
- package/dist/cjs/types/account.js.map +1 -0
- package/dist/cjs/types/billing.js +26 -0
- package/dist/cjs/types/billing.js.map +1 -0
- package/dist/cjs/types/client.js +14 -0
- package/dist/cjs/types/client.js.map +1 -1
- package/dist/cjs/types/cprofile.js +26 -0
- package/dist/cjs/types/cprofile.js.map +1 -0
- package/dist/cjs/types/dashboard.js +26 -0
- package/dist/cjs/types/dashboard.js.map +1 -0
- package/dist/cjs/types/events.js +5 -1
- package/dist/cjs/types/events.js.map +1 -1
- package/dist/cjs/types/index.js +5 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/service.js +85 -0
- package/dist/cjs/types/service.js.map +1 -0
- package/dist/cli/cli/rocketride.js +335 -113
- package/dist/cli/cli/rocketride.js.map +1 -1
- package/dist/cli/client/account.js +284 -0
- package/dist/cli/client/account.js.map +1 -0
- package/dist/cli/client/billing.js +171 -0
- package/dist/cli/client/billing.js.map +1 -0
- package/dist/cli/client/client.js +1208 -756
- package/dist/cli/client/client.js.map +1 -1
- package/dist/cli/client/constants.js +10 -1
- package/dist/cli/client/constants.js.map +1 -1
- package/dist/cli/client/core/DAPBase.js +4 -1
- package/dist/cli/client/core/DAPBase.js.map +1 -1
- package/dist/cli/client/core/DAPClient.js +121 -50
- package/dist/cli/client/core/DAPClient.js.map +1 -1
- package/dist/cli/client/core/TransportBase.js +0 -10
- package/dist/cli/client/core/TransportBase.js.map +1 -1
- package/dist/cli/client/core/TransportWebSocket.js +30 -19
- package/dist/cli/client/core/TransportWebSocket.js.map +1 -1
- package/dist/cli/client/database.js +121 -0
- package/dist/cli/client/database.js.map +1 -0
- package/dist/cli/client/index.js +4 -0
- package/dist/cli/client/index.js.map +1 -1
- package/dist/cli/client/schema/Question.js +2 -0
- package/dist/cli/client/schema/Question.js.map +1 -1
- package/dist/cli/client/types/account.js +26 -0
- package/dist/cli/client/types/account.js.map +1 -0
- package/dist/cli/client/types/billing.js +26 -0
- package/dist/cli/client/types/billing.js.map +1 -0
- package/dist/cli/client/types/client.js +14 -0
- package/dist/cli/client/types/client.js.map +1 -1
- package/dist/cli/client/types/cprofile.js +26 -0
- package/dist/cli/client/types/cprofile.js.map +1 -0
- package/dist/cli/client/types/dashboard.js +26 -0
- package/dist/cli/client/types/dashboard.js.map +1 -0
- package/dist/cli/client/types/events.js +5 -1
- package/dist/cli/client/types/events.js.map +1 -1
- package/dist/cli/client/types/index.js +5 -0
- package/dist/cli/client/types/index.js.map +1 -1
- package/dist/cli/client/types/service.js +85 -0
- package/dist/cli/client/types/service.js.map +1 -0
- package/dist/esm/account.js +280 -0
- package/dist/esm/account.js.map +1 -0
- package/dist/esm/billing.js +167 -0
- package/dist/esm/billing.js.map +1 -0
- package/dist/esm/client.js +1208 -756
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/constants.js +9 -0
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/core/DAPBase.js +4 -1
- package/dist/esm/core/DAPBase.js.map +1 -1
- package/dist/esm/core/DAPClient.js +121 -50
- package/dist/esm/core/DAPClient.js.map +1 -1
- package/dist/esm/core/TransportBase.js +0 -10
- package/dist/esm/core/TransportBase.js.map +1 -1
- package/dist/esm/core/TransportWebSocket.js +30 -19
- package/dist/esm/core/TransportWebSocket.js.map +1 -1
- package/dist/esm/database.js +117 -0
- package/dist/esm/database.js.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/schema/Question.js +2 -0
- package/dist/esm/schema/Question.js.map +1 -1
- package/dist/esm/types/account.js +25 -0
- package/dist/esm/types/account.js.map +1 -0
- package/dist/esm/types/billing.js +25 -0
- package/dist/esm/types/billing.js.map +1 -0
- package/dist/esm/types/client.js +13 -1
- package/dist/esm/types/client.js.map +1 -1
- package/dist/esm/types/cprofile.js +25 -0
- package/dist/esm/types/cprofile.js.map +1 -0
- package/dist/esm/types/dashboard.js +25 -0
- package/dist/esm/types/dashboard.js.map +1 -0
- package/dist/esm/types/events.js +5 -1
- package/dist/esm/types/events.js.map +1 -1
- package/dist/esm/types/index.js +5 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/service.js +82 -0
- package/dist/esm/types/service.js.map +1 -0
- package/dist/types/account.d.ts +209 -0
- package/dist/types/account.d.ts.map +1 -0
- package/dist/types/billing.d.ts +135 -0
- package/dist/types/billing.d.ts.map +1 -0
- package/dist/types/client.d.ts +553 -285
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/constants.d.ts +9 -0
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/core/DAPBase.d.ts.map +1 -1
- package/dist/types/core/DAPClient.d.ts +89 -7
- package/dist/types/core/DAPClient.d.ts.map +1 -1
- package/dist/types/core/TransportBase.d.ts +1 -11
- package/dist/types/core/TransportBase.d.ts.map +1 -1
- package/dist/types/core/TransportWebSocket.d.ts +14 -11
- package/dist/types/core/TransportWebSocket.d.ts.map +1 -1
- package/dist/types/database.d.ts +90 -0
- package/dist/types/database.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/schema/Question.d.ts +3 -1
- package/dist/types/schema/Question.d.ts.map +1 -1
- package/dist/types/types/account.d.ts +171 -0
- package/dist/types/types/account.d.ts.map +1 -0
- package/dist/types/types/billing.d.ts +115 -0
- package/dist/types/types/billing.d.ts.map +1 -0
- package/dist/types/types/client.d.ts +241 -1
- package/dist/types/types/client.d.ts.map +1 -1
- package/dist/types/types/cprofile.d.ts +67 -0
- package/dist/types/types/cprofile.d.ts.map +1 -0
- package/dist/types/types/dashboard.d.ts +198 -0
- package/dist/types/types/dashboard.d.ts.map +1 -0
- package/dist/types/types/events.d.ts +90 -95
- package/dist/types/types/events.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +5 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/pipeline.d.ts +10 -2
- package/dist/types/types/pipeline.d.ts.map +1 -1
- package/dist/types/types/service.d.ts +189 -0
- package/dist/types/types/service.d.ts.map +1 -0
- package/dist/types/types/task.d.ts +5 -1
- package/dist/types/types/task.d.ts.map +1 -1
- package/package.json +12 -7
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
// PROTOCOL CAPABILITY FLAGS
|
|
26
|
+
// ============================================================================
|
|
27
|
+
/**
|
|
28
|
+
* Protocol capability flags for service drivers.
|
|
29
|
+
*
|
|
30
|
+
* Each flag is a single bit in a uint32 bitmask describing what a service
|
|
31
|
+
* driver supports. Values are returned by the engine in the `capabilities`
|
|
32
|
+
* field of a service definition and can be tested with bitwise AND.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const services = await client.getServices();
|
|
37
|
+
* const svc = services.services['my_driver'];
|
|
38
|
+
* if (svc.capabilities & PROTOCOL_CAPS.GPU) {
|
|
39
|
+
* console.log('Driver requires a GPU');
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export var PROTOCOL_CAPS;
|
|
44
|
+
(function (PROTOCOL_CAPS) {
|
|
45
|
+
/** No capabilities */
|
|
46
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["NONE"] = 0] = "NONE";
|
|
47
|
+
/** Supports the file permissions interface */
|
|
48
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["SECURITY"] = 1] = "SECURITY";
|
|
49
|
+
/** Is a filesystem interface */
|
|
50
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["FILESYSTEM"] = 2] = "FILESYSTEM";
|
|
51
|
+
/** Supports the substream interface */
|
|
52
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["SUBSTREAM"] = 4] = "SUBSTREAM";
|
|
53
|
+
/** Uses a network interface */
|
|
54
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["NETWORK"] = 8] = "NETWORK";
|
|
55
|
+
/** Uses datanet or streamnet interfaces */
|
|
56
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["DATANET"] = 16] = "DATANET";
|
|
57
|
+
/** Uses delta queries to track changes */
|
|
58
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["SYNC"] = 32] = "SYNC";
|
|
59
|
+
/** Internal — will not be returned in services.json */
|
|
60
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["INTERNAL"] = 64] = "INTERNAL";
|
|
61
|
+
/** Supports data catalog operations */
|
|
62
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["CATALOG"] = 128] = "CATALOG";
|
|
63
|
+
/** Do not monitor for excessive failures */
|
|
64
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["NOMONITOR"] = 256] = "NOMONITOR";
|
|
65
|
+
/** Source endpoint does not use include */
|
|
66
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["NOINCLUDE"] = 512] = "NOINCLUDE";
|
|
67
|
+
/** Driver supports the invoke function */
|
|
68
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["INVOKE"] = 1024] = "INVOKE";
|
|
69
|
+
/** Driver supports remoting execution */
|
|
70
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["REMOTING"] = 2048] = "REMOTING";
|
|
71
|
+
/** Driver requires a GPU */
|
|
72
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["GPU"] = 4096] = "GPU";
|
|
73
|
+
/** Driver is not SaaS compatible */
|
|
74
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["NOSAAS"] = 8192] = "NOSAAS";
|
|
75
|
+
/** Focus on this driver */
|
|
76
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["FOCUS"] = 16384] = "FOCUS";
|
|
77
|
+
/** Driver is deprecated */
|
|
78
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["DEPRECATED"] = 32768] = "DEPRECATED";
|
|
79
|
+
/** Driver is experimental */
|
|
80
|
+
PROTOCOL_CAPS[PROTOCOL_CAPS["EXPERIMENTAL"] = 65536] = "EXPERIMENTAL";
|
|
81
|
+
})(PROTOCOL_CAPS || (PROTOCOL_CAPS = {}));
|
|
82
|
+
//# 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,MAAM,CAAN,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,KAAb,aAAa,QAsDxB"}
|
|
@@ -0,0 +1,209 @@
|
|
|
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 namespace for the RocketRide TypeScript SDK.
|
|
26
|
+
*
|
|
27
|
+
* Provides typed methods for managing the authenticated user's profile,
|
|
28
|
+
* API keys, organization, members, and teams via DAP commands over the
|
|
29
|
+
* existing WebSocket connection.
|
|
30
|
+
*/
|
|
31
|
+
import type { RocketRideClient } from './client.js';
|
|
32
|
+
import type { ConnectResult } from './types/client.js';
|
|
33
|
+
import type { OrgDetail, ApiKeyRecord, MemberRecord, TeamRecord, TeamDetail, ProfileUpdate, CreateKeyParams, InviteMemberParams, TeamMemberParams } from './types/account.js';
|
|
34
|
+
/**
|
|
35
|
+
* Typed wrapper around the `rrext_account_*` DAP commands.
|
|
36
|
+
*
|
|
37
|
+
* Accessed via `client.account` — not instantiated directly. All methods
|
|
38
|
+
* delegate to {@link RocketRideClient.dap} which handles envelope
|
|
39
|
+
* unwrapping and error propagation.
|
|
40
|
+
*/
|
|
41
|
+
export declare class AccountApi {
|
|
42
|
+
private client;
|
|
43
|
+
/** @param client - The parent RocketRideClient that owns this namespace. */
|
|
44
|
+
constructor(client: RocketRideClient);
|
|
45
|
+
/**
|
|
46
|
+
* Fetches the current user's profile from the server.
|
|
47
|
+
*
|
|
48
|
+
* @returns The user's profile data.
|
|
49
|
+
*/
|
|
50
|
+
getProfile(): Promise<ConnectResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Persists updated profile fields.
|
|
53
|
+
*
|
|
54
|
+
* @param fields - The profile fields to update.
|
|
55
|
+
*/
|
|
56
|
+
updateProfile(fields: ProfileUpdate): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Sets the user's preferred default team.
|
|
59
|
+
*
|
|
60
|
+
* @param teamId - The team ID to set as default.
|
|
61
|
+
*/
|
|
62
|
+
setDefaultTeam(teamId: string): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Permanently deletes the current user's account.
|
|
65
|
+
*/
|
|
66
|
+
deleteAccount(): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Fetches the organization detail for the given org.
|
|
69
|
+
*
|
|
70
|
+
* @param orgId - Organisation UUID. The server may infer the org if omitted.
|
|
71
|
+
* @returns The organization detail (id, name, plan, memberCount, teamCount).
|
|
72
|
+
*/
|
|
73
|
+
getOrg(orgId?: string): Promise<OrgDetail>;
|
|
74
|
+
/**
|
|
75
|
+
* Updates the organization name.
|
|
76
|
+
*
|
|
77
|
+
* @param orgId - Organisation UUID.
|
|
78
|
+
* @param name - The new organization name.
|
|
79
|
+
*/
|
|
80
|
+
updateOrgName(orgId: string, name: string): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Fetches the list of API keys for the current user.
|
|
83
|
+
*
|
|
84
|
+
* @returns Array of API key records.
|
|
85
|
+
*/
|
|
86
|
+
listKeys(): Promise<ApiKeyRecord[]>;
|
|
87
|
+
/**
|
|
88
|
+
* Creates a new API key and returns the raw key string.
|
|
89
|
+
*
|
|
90
|
+
* @param params - Key creation parameters (name, permissions, expiresAt).
|
|
91
|
+
* @returns Object containing the raw key string.
|
|
92
|
+
*/
|
|
93
|
+
createKey(params: CreateKeyParams): Promise<{
|
|
94
|
+
key: string;
|
|
95
|
+
}>;
|
|
96
|
+
/**
|
|
97
|
+
* Revokes an API key by its ID.
|
|
98
|
+
*
|
|
99
|
+
* @param keyId - The key to revoke.
|
|
100
|
+
*/
|
|
101
|
+
revokeKey(keyId: string): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Fetches the flat list of organization members.
|
|
104
|
+
*
|
|
105
|
+
* @param orgId - Organisation UUID.
|
|
106
|
+
* @returns Array of member records.
|
|
107
|
+
*/
|
|
108
|
+
listMembers(orgId: string): Promise<MemberRecord[]>;
|
|
109
|
+
/**
|
|
110
|
+
* Sends an invitation to a new organization member.
|
|
111
|
+
*
|
|
112
|
+
* @param orgId - Organisation UUID.
|
|
113
|
+
* @param params - Invitation parameters (email, givenName, familyName, role).
|
|
114
|
+
*/
|
|
115
|
+
inviteMember(orgId: string, params: InviteMemberParams): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Updates an organization member's role.
|
|
118
|
+
*
|
|
119
|
+
* @param orgId - Organisation UUID.
|
|
120
|
+
* @param userId - The member's user ID.
|
|
121
|
+
* @param role - The new role string.
|
|
122
|
+
*/
|
|
123
|
+
updateMemberRole(orgId: string, userId: string, role: string): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* Removes an organization member.
|
|
126
|
+
*
|
|
127
|
+
* @param orgId - Organisation UUID.
|
|
128
|
+
* @param userId - The member's user ID.
|
|
129
|
+
*/
|
|
130
|
+
removeMember(orgId: string, userId: string): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Fetches the flat list of teams in the organization.
|
|
133
|
+
*
|
|
134
|
+
* @param orgId - Organisation UUID.
|
|
135
|
+
* @returns Array of team summary records.
|
|
136
|
+
*/
|
|
137
|
+
listTeams(orgId: string): Promise<TeamRecord[]>;
|
|
138
|
+
/**
|
|
139
|
+
* Fetches full detail (including member list) for a specific team.
|
|
140
|
+
*
|
|
141
|
+
* @param orgId - Organisation UUID.
|
|
142
|
+
* @param teamId - The team to load.
|
|
143
|
+
* @returns The team detail with nested members.
|
|
144
|
+
*/
|
|
145
|
+
getTeamDetail(orgId: string, teamId: string): Promise<TeamDetail>;
|
|
146
|
+
/**
|
|
147
|
+
* Creates a new team.
|
|
148
|
+
*
|
|
149
|
+
* @param orgId - Organisation UUID.
|
|
150
|
+
* @param name - The team name.
|
|
151
|
+
*/
|
|
152
|
+
createTeam(orgId: string, name: string): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Deletes a team.
|
|
155
|
+
*
|
|
156
|
+
* @param orgId - Organisation UUID.
|
|
157
|
+
* @param teamId - The team to delete.
|
|
158
|
+
*/
|
|
159
|
+
deleteTeam(orgId: string, teamId: string): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Adds a member to a team with specified permissions.
|
|
162
|
+
*
|
|
163
|
+
* @param orgId - Organisation UUID.
|
|
164
|
+
* @param params - Parameters (teamId, userId, permissions).
|
|
165
|
+
*/
|
|
166
|
+
addTeamMember(orgId: string, params: TeamMemberParams): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* Updates a team member's permissions.
|
|
169
|
+
*
|
|
170
|
+
* @param orgId - Organisation UUID.
|
|
171
|
+
* @param params - Parameters (teamId, userId, permissions).
|
|
172
|
+
*/
|
|
173
|
+
updateTeamMemberPerms(orgId: string, params: TeamMemberParams): Promise<void>;
|
|
174
|
+
/**
|
|
175
|
+
* Removes a member from a team.
|
|
176
|
+
*
|
|
177
|
+
* @param orgId - Organisation UUID.
|
|
178
|
+
* @param params - Parameters (teamId, userId).
|
|
179
|
+
*/
|
|
180
|
+
removeTeamMember(orgId: string, params: {
|
|
181
|
+
teamId: string;
|
|
182
|
+
userId: string;
|
|
183
|
+
}): Promise<void>;
|
|
184
|
+
/**
|
|
185
|
+
* Returns the available ROCKETRIDE_* key names from the merged environment.
|
|
186
|
+
* Does not return values — only key names for use in dropdowns.
|
|
187
|
+
*
|
|
188
|
+
* @returns Array of key names (e.g. ['ROCKETRIDE_ANTHROPIC_KEY', 'ROCKETRIDE_OPENAI_KEY']).
|
|
189
|
+
*/
|
|
190
|
+
getEnvironmentKeys(): Promise<string[]>;
|
|
191
|
+
/**
|
|
192
|
+
* Reads the environment dict for a scope (org, team, or user).
|
|
193
|
+
*
|
|
194
|
+
* @param scope - One of 'org', 'team', 'user'.
|
|
195
|
+
* @param scopeId - For org: orgId. For team: teamId. For user: omit (uses current user).
|
|
196
|
+
* @returns Decrypted key-value dict.
|
|
197
|
+
*/
|
|
198
|
+
getEnv(scope: 'org' | 'team' | 'user', scopeId?: string): Promise<Record<string, string>>;
|
|
199
|
+
/**
|
|
200
|
+
* Writes the full environment dict for a scope (org, team, or user).
|
|
201
|
+
* Replaces the entire set of keys at that scope level.
|
|
202
|
+
*
|
|
203
|
+
* @param scope - One of 'org', 'team', 'user'.
|
|
204
|
+
* @param env - Full key-value dict to store.
|
|
205
|
+
* @param scopeId - For org: orgId. For team: teamId. For user: omit.
|
|
206
|
+
*/
|
|
207
|
+
setEnv(scope: 'org' | 'team' | 'user', env: Record<string, string>, scopeId?: string): Promise<void>;
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/client/account.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAM9K;;;;;;GAMG;AACH,qBAAa,UAAU;IAEV,OAAO,CAAC,MAAM;IAD1B,4EAA4E;gBACxD,MAAM,EAAE,gBAAgB;IAM5C;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC;IAI1C;;;;OAIG;IACG,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;;;OAIG;IACG,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAQpC;;;;;OAKG;IACG,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIhD;;;;;OAKG;IACG,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/D;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAKzC;;;;;OAKG;IACG,SA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IAAI,CAAC;IAInF;;;;;OAKG;IACG,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQhG;;;;;OAKG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAK7C;;;;;;OAMG;IACG,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAS/F;;;;;;;OAOG;IACG,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAO1G"}
|
|
@@ -0,0 +1,135 @@
|
|
|
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 namespace for the RocketRide TypeScript SDK.
|
|
26
|
+
*
|
|
27
|
+
* Provides typed methods for managing subscriptions, Stripe checkout
|
|
28
|
+
* sessions, billing portal access, and compute credit wallets via DAP
|
|
29
|
+
* commands over the existing WebSocket connection.
|
|
30
|
+
*/
|
|
31
|
+
import type { RocketRideClient } from './client.js';
|
|
32
|
+
import type { BillingDetail, StripePlan, CreditBalance, CreditPack } from './types/billing.js';
|
|
33
|
+
/**
|
|
34
|
+
* Typed wrapper around the `rrext_account_billing` DAP command.
|
|
35
|
+
*
|
|
36
|
+
* Accessed via `client.billing` — not instantiated directly. All methods
|
|
37
|
+
* delegate to {@link RocketRideClient.dap} which handles envelope
|
|
38
|
+
* unwrapping and error propagation.
|
|
39
|
+
*/
|
|
40
|
+
export declare class BillingApi {
|
|
41
|
+
private client;
|
|
42
|
+
/** @param client - The parent RocketRideClient that owns this namespace. */
|
|
43
|
+
constructor(client: RocketRideClient);
|
|
44
|
+
/**
|
|
45
|
+
* Fetches the per-app subscription details for the given org.
|
|
46
|
+
*
|
|
47
|
+
* @param orgId - Organisation UUID whose subscriptions to load.
|
|
48
|
+
* @returns Array of BillingDetail rows (one per subscribed app).
|
|
49
|
+
*/
|
|
50
|
+
getDetails(orgId: string): Promise<BillingDetail[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Fetches the active subscription plans (prices) for an app.
|
|
53
|
+
*
|
|
54
|
+
* Plans are returned sorted month-first, year-second, formatted for
|
|
55
|
+
* display in the checkout plan picker. The server resolves the app's
|
|
56
|
+
* Stripe product internally and calls `stripe.Price.list()` so pricing
|
|
57
|
+
* changes in the Stripe dashboard are reflected immediately.
|
|
58
|
+
*
|
|
59
|
+
* @param appId - App identifier (e.g. "rocketride.pipeBuilder").
|
|
60
|
+
* @returns Array of StripePlan objects ready for display.
|
|
61
|
+
*/
|
|
62
|
+
getProductPrices(appId: string): Promise<StripePlan[]>;
|
|
63
|
+
/**
|
|
64
|
+
* Creates a Stripe subscription and returns the Stripe Elements client_secret.
|
|
65
|
+
*
|
|
66
|
+
* The returned client_secret is passed to `stripe.confirmPayment()` to
|
|
67
|
+
* complete the checkout without a browser redirect to Stripe.
|
|
68
|
+
*
|
|
69
|
+
* @param orgId - Organisation UUID to subscribe.
|
|
70
|
+
* @param appId - App being subscribed (e.g. "brandi").
|
|
71
|
+
* @param priceId - Stripe price_* identifier for the plan.
|
|
72
|
+
* @returns Object with client_secret for Stripe Elements and subscription_id.
|
|
73
|
+
*/
|
|
74
|
+
createCheckoutSession(orgId: string, appId: string, priceId: string): Promise<{
|
|
75
|
+
clientSecret: string;
|
|
76
|
+
subscriptionId: string;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Creates a Stripe Billing Portal session for managing payment methods.
|
|
80
|
+
*
|
|
81
|
+
* @param orgId - Organisation UUID whose Stripe customer portal to open.
|
|
82
|
+
* @param returnUrl - URL to redirect the user back to after portal interaction.
|
|
83
|
+
* @returns Object with portal URL to redirect the user to.
|
|
84
|
+
*/
|
|
85
|
+
createPortalSession(orgId: string, returnUrl: string): Promise<{
|
|
86
|
+
url: string;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Schedules an app subscription for cancellation at the end of the current period.
|
|
90
|
+
*
|
|
91
|
+
* The user retains access until the period ends. The webhook handler will
|
|
92
|
+
* update `cancel_at_period_end` in the database asynchronously.
|
|
93
|
+
*
|
|
94
|
+
* @param orgId - Organisation UUID that owns the subscription.
|
|
95
|
+
* @param appId - App to cancel (e.g. "brandi").
|
|
96
|
+
* @returns Object with canceled: true on success.
|
|
97
|
+
*/
|
|
98
|
+
cancelSubscription(orgId: string, appId: string): Promise<{
|
|
99
|
+
canceled: boolean;
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Reads the org's compute credit balance.
|
|
103
|
+
*
|
|
104
|
+
* The balance lives in a Redis-backed wallet on the engine side; this
|
|
105
|
+
* call is cheap and safe to poll (~1 req/s is fine for a live widget).
|
|
106
|
+
*
|
|
107
|
+
* @param orgId - Organisation UUID to query.
|
|
108
|
+
* @returns The credit balance with lifetime stats.
|
|
109
|
+
*/
|
|
110
|
+
getCreditBalance(orgId: string): Promise<CreditBalance>;
|
|
111
|
+
/**
|
|
112
|
+
* Loads the purchasable credit packs, sourced from the Stripe catalog
|
|
113
|
+
* that Terraform maintains. Call once on modal mount.
|
|
114
|
+
*
|
|
115
|
+
* @returns Array of credit pack pricing rows.
|
|
116
|
+
*/
|
|
117
|
+
listCreditPacks(): Promise<CreditPack[]>;
|
|
118
|
+
/**
|
|
119
|
+
* Creates a one-off Stripe Checkout session for a credit pack purchase
|
|
120
|
+
* and returns the redirect URL.
|
|
121
|
+
*
|
|
122
|
+
* The frontend redirects the user to Stripe-hosted checkout; on success
|
|
123
|
+
* Stripe redirects back to the app, and the `checkout.session.completed`
|
|
124
|
+
* webhook increments the wallet server-side.
|
|
125
|
+
*
|
|
126
|
+
* @param orgId - Organisation UUID that the credits belong to.
|
|
127
|
+
* @param packId - Pack key returned by {@link listCreditPacks}.
|
|
128
|
+
* @param returnUrl - Where Stripe sends the user after payment.
|
|
129
|
+
* @returns Object with the Stripe checkout URL.
|
|
130
|
+
*/
|
|
131
|
+
createCreditCheckout(orgId: string, packId: string, returnUrl: string): Promise<{
|
|
132
|
+
url: string;
|
|
133
|
+
}>;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingUR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