@dork-labs/cloud-api 0.75.1

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 (104) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +192 -0
  3. package/dist/billing.d.ts +328 -0
  4. package/dist/billing.d.ts.map +1 -0
  5. package/dist/billing.js +267 -0
  6. package/dist/billing.js.map +1 -0
  7. package/dist/client.d.ts +130 -0
  8. package/dist/client.d.ts.map +1 -0
  9. package/dist/client.js +192 -0
  10. package/dist/client.js.map +1 -0
  11. package/dist/connections.d.ts +281 -0
  12. package/dist/connections.d.ts.map +1 -0
  13. package/dist/connections.js +241 -0
  14. package/dist/connections.js.map +1 -0
  15. package/dist/index.d.ts +31 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +31 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/inference.d.ts +123 -0
  20. package/dist/inference.d.ts.map +1 -0
  21. package/dist/inference.js +114 -0
  22. package/dist/inference.js.map +1 -0
  23. package/dist/instances.d.ts +60 -0
  24. package/dist/instances.d.ts.map +1 -0
  25. package/dist/instances.js +65 -0
  26. package/dist/instances.js.map +1 -0
  27. package/dist/primitives.d.ts +74 -0
  28. package/dist/primitives.d.ts.map +1 -0
  29. package/dist/primitives.js +98 -0
  30. package/dist/primitives.js.map +1 -0
  31. package/dist/problem.d.ts +96 -0
  32. package/dist/problem.d.ts.map +1 -0
  33. package/dist/problem.js +94 -0
  34. package/dist/problem.js.map +1 -0
  35. package/dist/remote.d.ts +268 -0
  36. package/dist/remote.d.ts.map +1 -0
  37. package/dist/remote.js +267 -0
  38. package/dist/remote.js.map +1 -0
  39. package/dist/routes.d.ts +273 -0
  40. package/dist/routes.d.ts.map +1 -0
  41. package/dist/routes.js +302 -0
  42. package/dist/routes.js.map +1 -0
  43. package/dist/seats.d.ts +529 -0
  44. package/dist/seats.d.ts.map +1 -0
  45. package/dist/seats.js +266 -0
  46. package/dist/seats.js.map +1 -0
  47. package/dist/session.d.ts +135 -0
  48. package/dist/session.d.ts.map +1 -0
  49. package/dist/session.js +143 -0
  50. package/dist/session.js.map +1 -0
  51. package/fixtures/v1/billing/balance-owed.json +16 -0
  52. package/fixtures/v1/billing/balance.json +16 -0
  53. package/fixtures/v1/billing/entitlements-free.json +34 -0
  54. package/fixtures/v1/billing/hosted-page.json +3 -0
  55. package/fixtures/v1/billing/nudge.json +9 -0
  56. package/fixtures/v1/billing/price-list.json +13 -0
  57. package/fixtures/v1/billing/statement.json +5 -0
  58. package/fixtures/v1/billing/usage-by-model.json +21 -0
  59. package/fixtures/v1/connections/catalog.json +12 -0
  60. package/fixtures/v1/connections/events-ack.json +3 -0
  61. package/fixtures/v1/connections/events-pull.json +16 -0
  62. package/fixtures/v1/connections/execution.json +12 -0
  63. package/fixtures/v1/connections/list.json +16 -0
  64. package/fixtures/v1/connections/usage.json +16 -0
  65. package/fixtures/v1/index.json +58 -0
  66. package/fixtures/v1/inference/models.json +17 -0
  67. package/fixtures/v1/inference/token-revoke.json +3 -0
  68. package/fixtures/v1/inference/token.json +14 -0
  69. package/fixtures/v1/instances/heartbeat.json +5 -0
  70. package/fixtures/v1/instances/list.json +15 -0
  71. package/fixtures/v1/instances/revoke.json +3 -0
  72. package/fixtures/v1/problem/handle-tombstoned.json +6 -0
  73. package/fixtures/v1/problem/person-seat-required.json +7 -0
  74. package/fixtures/v1/problem/unauthenticated.json +7 -0
  75. package/fixtures/v1/remote/address.json +5 -0
  76. package/fixtures/v1/remote/command-keepalive.json +4 -0
  77. package/fixtures/v1/remote/command-open.json +6 -0
  78. package/fixtures/v1/remote/commands-ack.json +3 -0
  79. package/fixtures/v1/remote/credential.json +7 -0
  80. package/fixtures/v1/remote/custom-address.json +12 -0
  81. package/fixtures/v1/remote/designation.json +5 -0
  82. package/fixtures/v1/remote/enrolment.json +5 -0
  83. package/fixtures/v1/remote/events.json +3 -0
  84. package/fixtures/v1/remote/open.json +5 -0
  85. package/fixtures/v1/remote/status-closed.json +7 -0
  86. package/fixtures/v1/remote/status-open.json +10 -0
  87. package/fixtures/v1/remote/wake-token.json +5 -0
  88. package/fixtures/v1/seats/addons.json +11 -0
  89. package/fixtures/v1/seats/agent.json +9 -0
  90. package/fixtures/v1/seats/grants.json +20 -0
  91. package/fixtures/v1/seats/inbox-browse.json +17 -0
  92. package/fixtures/v1/seats/inbox-pull.json +17 -0
  93. package/fixtures/v1/seats/invitation.json +9 -0
  94. package/fixtures/v1/seats/members.json +12 -0
  95. package/fixtures/v1/seats/org.json +7 -0
  96. package/fixtures/v1/seats/presence.json +6 -0
  97. package/fixtures/v1/seats/seat.json +21 -0
  98. package/fixtures/v1/session/account-export.json +6 -0
  99. package/fixtures/v1/session/device-code.json +8 -0
  100. package/fixtures/v1/session/device-token-pending.json +4 -0
  101. package/fixtures/v1/session/device-token.json +7 -0
  102. package/fixtures/v1/session/signed-in.json +14 -0
  103. package/fixtures/v1/session/signed-out.json +4 -0
  104. package/package.json +58 -0
@@ -0,0 +1,273 @@
1
+ /**
2
+ * Every path in the `/v1` contract, in one place.
3
+ *
4
+ * The paths are here so a caller never hand-builds one and so the conformance
5
+ * fixtures can name a route without repeating a string. Nothing here is a URL:
6
+ * the origin is a runtime value the caller supplies, and no host appears
7
+ * anywhere in this package.
8
+ */
9
+ /** The `/v1` paths that take no path parameter. */
10
+ export declare const V1_ROUTES: {
11
+ readonly session: "/v1/session";
12
+ readonly account: "/v1/account";
13
+ readonly accountExport: "/v1/account/export";
14
+ readonly deviceCode: "/v1/device/code";
15
+ readonly deviceToken: "/v1/device/token";
16
+ readonly instances: "/v1/instances";
17
+ readonly instancesHeartbeat: "/v1/instances/heartbeat";
18
+ readonly instancesRevoke: "/v1/instances/revoke";
19
+ readonly connections: "/v1/connections";
20
+ readonly connectionsCatalog: "/v1/connections/catalog";
21
+ readonly connectionsUsage: "/v1/connections/usage";
22
+ readonly connectionsAuthenticationFlows: "/v1/connections/authentication-flows";
23
+ readonly connectionsAuthorityCommands: "/v1/connections/authority-commands";
24
+ readonly connectionsExecutions: "/v1/connections/executions";
25
+ readonly connectionsEventsPull: "/v1/connections/events/pull";
26
+ readonly connectionsEventsAck: "/v1/connections/events/ack";
27
+ readonly entitlements: "/v1/entitlements";
28
+ readonly balance: "/v1/balance";
29
+ readonly usage: "/v1/usage";
30
+ readonly priceList: "/v1/price-list";
31
+ readonly nudge: "/v1/nudge";
32
+ readonly checkout: "/v1/checkout";
33
+ readonly topup: "/v1/topup";
34
+ readonly portal: "/v1/portal";
35
+ readonly statement: "/v1/statement";
36
+ readonly inferenceTokens: "/v1/inference/tokens";
37
+ readonly inferenceModels: "/v1/inference/models";
38
+ readonly orgs: "/v1/orgs";
39
+ readonly addresses: "/v1/addresses";
40
+ readonly remoteStatus: "/v1/remote/status";
41
+ readonly remoteOpen: "/v1/remote/open";
42
+ readonly remoteClose: "/v1/remote/close";
43
+ readonly remoteWakeTokens: "/v1/remote/wake-tokens";
44
+ readonly remoteEnrolment: "/v1/remote/enrolment";
45
+ readonly remoteAddress: "/v1/remote/address";
46
+ readonly remoteCustomAddress: "/v1/remote/address/custom";
47
+ readonly remoteCredentialsIssue: "/v1/remote/credentials/issue";
48
+ readonly remoteCredentialsConfirm: "/v1/remote/credentials/confirm";
49
+ readonly remoteCommands: "/v1/remote/commands";
50
+ readonly remoteCommandsAck: "/v1/remote/commands/ack";
51
+ readonly remoteEvents: "/v1/remote/events";
52
+ };
53
+ /** One of the fixed `/v1` paths. */
54
+ export type V1Route = (typeof V1_ROUTES)[keyof typeof V1_ROUTES];
55
+ /**
56
+ * The `/v1` paths that take a path parameter, as builders.
57
+ *
58
+ * Each takes opaque identifiers and returns a path. Identifiers are
59
+ * percent-encoded on the way in, and a dot segment is refused outright, so an
60
+ * identifier cannot change which route is called. See {@link enc} for why
61
+ * percent-encoding alone is not enough.
62
+ */
63
+ export declare const v1Path: {
64
+ /**
65
+ * The route for one connection.
66
+ *
67
+ * @param connectionId - The connection's opaque identifier.
68
+ */
69
+ readonly connection: (connectionId: string) => string;
70
+ /**
71
+ * The usage route for one connection.
72
+ *
73
+ * @param connectionId - The connection's opaque identifier.
74
+ */
75
+ readonly connectionUsage: (connectionId: string) => string;
76
+ /**
77
+ * The route for one toolkit's catalog version.
78
+ *
79
+ * @param toolkit - The toolkit's opaque identifier.
80
+ */
81
+ readonly toolkitVersion: (toolkit: string) => string;
82
+ /**
83
+ * The route for one toolkit's operations.
84
+ *
85
+ * @param toolkit - The toolkit's opaque identifier.
86
+ */
87
+ readonly toolkitOperations: (toolkit: string) => string;
88
+ /**
89
+ * The route for one toolkit's events.
90
+ *
91
+ * @param toolkit - The toolkit's opaque identifier.
92
+ */
93
+ readonly toolkitEvents: (toolkit: string) => string;
94
+ /**
95
+ * The route for one authentication flow.
96
+ *
97
+ * @param flowId - The flow's opaque identifier.
98
+ */
99
+ readonly authenticationFlow: (flowId: string) => string;
100
+ /**
101
+ * The route for one authority command.
102
+ *
103
+ * @param commandId - The command's opaque identifier.
104
+ */
105
+ readonly authorityCommand: (commandId: string) => string;
106
+ /**
107
+ * The route for one execution attempt.
108
+ *
109
+ * @param attemptId - The attempt's opaque identifier.
110
+ */
111
+ readonly execution: (attemptId: string) => string;
112
+ /**
113
+ * The route that relinks one instance to an organization.
114
+ *
115
+ * @param instanceId - The instance's opaque identifier.
116
+ */
117
+ readonly instanceOrg: (instanceId: string) => string;
118
+ /**
119
+ * The revoke route for one minted inference token.
120
+ *
121
+ * @param tokenId - The token's opaque identifier.
122
+ */
123
+ readonly inferenceTokenRevoke: (tokenId: string) => string;
124
+ /**
125
+ * The route for one organization.
126
+ *
127
+ * @param orgId - The organization's opaque identifier.
128
+ */
129
+ readonly org: (orgId: string) => string;
130
+ /**
131
+ * The members route for one organization.
132
+ *
133
+ * @param orgId - The organization's opaque identifier.
134
+ */
135
+ readonly orgMembers: (orgId: string) => string;
136
+ /**
137
+ * The route for one membership.
138
+ *
139
+ * @param orgId - The organization's opaque identifier.
140
+ * @param memberId - The member's opaque identifier.
141
+ */
142
+ readonly orgMember: (orgId: string, memberId: string) => string;
143
+ /**
144
+ * The invitations route for one organization.
145
+ *
146
+ * @param orgId - The organization's opaque identifier.
147
+ */
148
+ readonly orgInvitations: (orgId: string) => string;
149
+ /**
150
+ * The route for one invitation within an organization.
151
+ *
152
+ * @param orgId - The organization's opaque identifier.
153
+ * @param invitationId - The invitation's opaque identifier.
154
+ */
155
+ readonly orgInvitation: (orgId: string, invitationId: string) => string;
156
+ /**
157
+ * The route that accepts one invitation.
158
+ *
159
+ * @param invitationId - The invitation's opaque identifier.
160
+ */
161
+ readonly invitationAccept: (invitationId: string) => string;
162
+ /**
163
+ * The seats route for one organization.
164
+ *
165
+ * @param orgId - The organization's opaque identifier.
166
+ */
167
+ readonly orgSeats: (orgId: string) => string;
168
+ /**
169
+ * The agents route for one organization.
170
+ *
171
+ * @param orgId - The organization's opaque identifier.
172
+ */
173
+ readonly orgAgents: (orgId: string) => string;
174
+ /**
175
+ * The remote-designation route for one organization.
176
+ *
177
+ * @param orgId - The organization's opaque identifier.
178
+ */
179
+ readonly orgRemoteDesignation: (orgId: string) => string;
180
+ /**
181
+ * The route for one agent.
182
+ *
183
+ * @param agentId - The agent's opaque identifier.
184
+ */
185
+ readonly agent: (agentId: string) => string;
186
+ /**
187
+ * The route that approves one agent claim.
188
+ *
189
+ * @param agentId - The agent's opaque identifier.
190
+ * @param claimId - The claim's opaque identifier.
191
+ */
192
+ readonly agentClaimApprove: (agentId: string, claimId: string) => string;
193
+ /**
194
+ * The route for one seat.
195
+ *
196
+ * @param seatId - The seat's opaque identifier.
197
+ */
198
+ readonly seat: (seatId: string) => string;
199
+ /**
200
+ * The assign route for one seat.
201
+ *
202
+ * @param seatId - The seat's opaque identifier.
203
+ */
204
+ readonly seatAssign: (seatId: string) => string;
205
+ /**
206
+ * The suspend route for one seat.
207
+ *
208
+ * @param seatId - The seat's opaque identifier.
209
+ */
210
+ readonly seatSuspend: (seatId: string) => string;
211
+ /**
212
+ * The resume route for one seat.
213
+ *
214
+ * @param seatId - The seat's opaque identifier.
215
+ */
216
+ readonly seatResume: (seatId: string) => string;
217
+ /**
218
+ * The release route for one seat.
219
+ *
220
+ * @param seatId - The seat's opaque identifier.
221
+ */
222
+ readonly seatRelease: (seatId: string) => string;
223
+ /**
224
+ * The grants route for one seat.
225
+ *
226
+ * @param seatId - The seat's opaque identifier.
227
+ */
228
+ readonly seatGrants: (seatId: string) => string;
229
+ /**
230
+ * The add-ons route for one seat.
231
+ *
232
+ * @param seatId - The seat's opaque identifier.
233
+ */
234
+ readonly seatAddons: (seatId: string) => string;
235
+ /**
236
+ * The route for one add-on kind on one seat.
237
+ *
238
+ * @param seatId - The seat's opaque identifier.
239
+ * @param kind - The add-on's opaque identifier.
240
+ */
241
+ readonly seatAddon: (seatId: string, kind: string) => string;
242
+ /**
243
+ * The read-only inbox browse route for one seat.
244
+ *
245
+ * @param seatId - The seat's opaque identifier.
246
+ */
247
+ readonly seatInbox: (seatId: string) => string;
248
+ /**
249
+ * The inbox pull route for one seat.
250
+ *
251
+ * @param seatId - The seat's opaque identifier.
252
+ */
253
+ readonly seatInboxPull: (seatId: string) => string;
254
+ /**
255
+ * The inbox acknowledgement route for one seat.
256
+ *
257
+ * @param seatId - The seat's opaque identifier.
258
+ */
259
+ readonly seatInboxAck: (seatId: string) => string;
260
+ /**
261
+ * The presence route for one seat.
262
+ *
263
+ * @param seatId - The seat's opaque identifier.
264
+ */
265
+ readonly seatPresence: (seatId: string) => string;
266
+ /**
267
+ * The route for one address.
268
+ *
269
+ * @param addressId - The address's opaque identifier.
270
+ */
271
+ readonly address: (addressId: string) => string;
272
+ };
273
+ //# sourceMappingURL=routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mDAAmD;AACnD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,CAAC"}
package/dist/routes.js ADDED
@@ -0,0 +1,302 @@
1
+ /**
2
+ * Every path in the `/v1` contract, in one place.
3
+ *
4
+ * The paths are here so a caller never hand-builds one and so the conformance
5
+ * fixtures can name a route without repeating a string. Nothing here is a URL:
6
+ * the origin is a runtime value the caller supplies, and no host appears
7
+ * anywhere in this package.
8
+ */
9
+ /** The `/v1` paths that take no path parameter. */
10
+ export const V1_ROUTES = {
11
+ session: '/v1/session',
12
+ account: '/v1/account',
13
+ accountExport: '/v1/account/export',
14
+ deviceCode: '/v1/device/code',
15
+ deviceToken: '/v1/device/token',
16
+ instances: '/v1/instances',
17
+ instancesHeartbeat: '/v1/instances/heartbeat',
18
+ instancesRevoke: '/v1/instances/revoke',
19
+ connections: '/v1/connections',
20
+ connectionsCatalog: '/v1/connections/catalog',
21
+ connectionsUsage: '/v1/connections/usage',
22
+ connectionsAuthenticationFlows: '/v1/connections/authentication-flows',
23
+ connectionsAuthorityCommands: '/v1/connections/authority-commands',
24
+ connectionsExecutions: '/v1/connections/executions',
25
+ connectionsEventsPull: '/v1/connections/events/pull',
26
+ connectionsEventsAck: '/v1/connections/events/ack',
27
+ entitlements: '/v1/entitlements',
28
+ balance: '/v1/balance',
29
+ usage: '/v1/usage',
30
+ priceList: '/v1/price-list',
31
+ nudge: '/v1/nudge',
32
+ checkout: '/v1/checkout',
33
+ topup: '/v1/topup',
34
+ portal: '/v1/portal',
35
+ statement: '/v1/statement',
36
+ inferenceTokens: '/v1/inference/tokens',
37
+ inferenceModels: '/v1/inference/models',
38
+ orgs: '/v1/orgs',
39
+ addresses: '/v1/addresses',
40
+ remoteStatus: '/v1/remote/status',
41
+ remoteOpen: '/v1/remote/open',
42
+ remoteClose: '/v1/remote/close',
43
+ remoteWakeTokens: '/v1/remote/wake-tokens',
44
+ remoteEnrolment: '/v1/remote/enrolment',
45
+ remoteAddress: '/v1/remote/address',
46
+ remoteCustomAddress: '/v1/remote/address/custom',
47
+ remoteCredentialsIssue: '/v1/remote/credentials/issue',
48
+ remoteCredentialsConfirm: '/v1/remote/credentials/confirm',
49
+ remoteCommands: '/v1/remote/commands',
50
+ remoteCommandsAck: '/v1/remote/commands/ack',
51
+ remoteEvents: '/v1/remote/events',
52
+ };
53
+ /**
54
+ * The `/v1` paths that take a path parameter, as builders.
55
+ *
56
+ * Each takes opaque identifiers and returns a path. Identifiers are
57
+ * percent-encoded on the way in, and a dot segment is refused outright, so an
58
+ * identifier cannot change which route is called. See {@link enc} for why
59
+ * percent-encoding alone is not enough.
60
+ */
61
+ export const v1Path = {
62
+ /**
63
+ * The route for one connection.
64
+ *
65
+ * @param connectionId - The connection's opaque identifier.
66
+ */
67
+ connection: (connectionId) => `/v1/connections/${enc(connectionId)}`,
68
+ /**
69
+ * The usage route for one connection.
70
+ *
71
+ * @param connectionId - The connection's opaque identifier.
72
+ */
73
+ connectionUsage: (connectionId) => `/v1/connections/${enc(connectionId)}/usage`,
74
+ /**
75
+ * The route for one toolkit's catalog version.
76
+ *
77
+ * @param toolkit - The toolkit's opaque identifier.
78
+ */
79
+ toolkitVersion: (toolkit) => `/v1/connections/toolkits/${enc(toolkit)}/version`,
80
+ /**
81
+ * The route for one toolkit's operations.
82
+ *
83
+ * @param toolkit - The toolkit's opaque identifier.
84
+ */
85
+ toolkitOperations: (toolkit) => `/v1/connections/toolkits/${enc(toolkit)}/operations`,
86
+ /**
87
+ * The route for one toolkit's events.
88
+ *
89
+ * @param toolkit - The toolkit's opaque identifier.
90
+ */
91
+ toolkitEvents: (toolkit) => `/v1/connections/toolkits/${enc(toolkit)}/events`,
92
+ /**
93
+ * The route for one authentication flow.
94
+ *
95
+ * @param flowId - The flow's opaque identifier.
96
+ */
97
+ authenticationFlow: (flowId) => `/v1/connections/authentication-flows/${enc(flowId)}`,
98
+ /**
99
+ * The route for one authority command.
100
+ *
101
+ * @param commandId - The command's opaque identifier.
102
+ */
103
+ authorityCommand: (commandId) => `/v1/connections/authority-commands/${enc(commandId)}`,
104
+ /**
105
+ * The route for one execution attempt.
106
+ *
107
+ * @param attemptId - The attempt's opaque identifier.
108
+ */
109
+ execution: (attemptId) => `/v1/connections/executions/${enc(attemptId)}`,
110
+ /**
111
+ * The route that relinks one instance to an organization.
112
+ *
113
+ * @param instanceId - The instance's opaque identifier.
114
+ */
115
+ instanceOrg: (instanceId) => `/v1/instances/${enc(instanceId)}/org`,
116
+ /**
117
+ * The revoke route for one minted inference token.
118
+ *
119
+ * @param tokenId - The token's opaque identifier.
120
+ */
121
+ inferenceTokenRevoke: (tokenId) => `/v1/inference/tokens/${enc(tokenId)}/revoke`,
122
+ /**
123
+ * The route for one organization.
124
+ *
125
+ * @param orgId - The organization's opaque identifier.
126
+ */
127
+ org: (orgId) => `/v1/orgs/${enc(orgId)}`,
128
+ /**
129
+ * The members route for one organization.
130
+ *
131
+ * @param orgId - The organization's opaque identifier.
132
+ */
133
+ orgMembers: (orgId) => `/v1/orgs/${enc(orgId)}/members`,
134
+ /**
135
+ * The route for one membership.
136
+ *
137
+ * @param orgId - The organization's opaque identifier.
138
+ * @param memberId - The member's opaque identifier.
139
+ */
140
+ orgMember: (orgId, memberId) => `/v1/orgs/${enc(orgId)}/members/${enc(memberId)}`,
141
+ /**
142
+ * The invitations route for one organization.
143
+ *
144
+ * @param orgId - The organization's opaque identifier.
145
+ */
146
+ orgInvitations: (orgId) => `/v1/orgs/${enc(orgId)}/invitations`,
147
+ /**
148
+ * The route for one invitation within an organization.
149
+ *
150
+ * @param orgId - The organization's opaque identifier.
151
+ * @param invitationId - The invitation's opaque identifier.
152
+ */
153
+ orgInvitation: (orgId, invitationId) => `/v1/orgs/${enc(orgId)}/invitations/${enc(invitationId)}`,
154
+ /**
155
+ * The route that accepts one invitation.
156
+ *
157
+ * @param invitationId - The invitation's opaque identifier.
158
+ */
159
+ invitationAccept: (invitationId) => `/v1/invitations/${enc(invitationId)}/accept`,
160
+ /**
161
+ * The seats route for one organization.
162
+ *
163
+ * @param orgId - The organization's opaque identifier.
164
+ */
165
+ orgSeats: (orgId) => `/v1/orgs/${enc(orgId)}/seats`,
166
+ /**
167
+ * The agents route for one organization.
168
+ *
169
+ * @param orgId - The organization's opaque identifier.
170
+ */
171
+ orgAgents: (orgId) => `/v1/orgs/${enc(orgId)}/agents`,
172
+ /**
173
+ * The remote-designation route for one organization.
174
+ *
175
+ * @param orgId - The organization's opaque identifier.
176
+ */
177
+ orgRemoteDesignation: (orgId) => `/v1/orgs/${enc(orgId)}/remote/designation`,
178
+ /**
179
+ * The route for one agent.
180
+ *
181
+ * @param agentId - The agent's opaque identifier.
182
+ */
183
+ agent: (agentId) => `/v1/agents/${enc(agentId)}`,
184
+ /**
185
+ * The route that approves one agent claim.
186
+ *
187
+ * @param agentId - The agent's opaque identifier.
188
+ * @param claimId - The claim's opaque identifier.
189
+ */
190
+ agentClaimApprove: (agentId, claimId) => `/v1/agents/${enc(agentId)}/claims/${enc(claimId)}/approve`,
191
+ /**
192
+ * The route for one seat.
193
+ *
194
+ * @param seatId - The seat's opaque identifier.
195
+ */
196
+ seat: (seatId) => `/v1/seats/${enc(seatId)}`,
197
+ /**
198
+ * The assign route for one seat.
199
+ *
200
+ * @param seatId - The seat's opaque identifier.
201
+ */
202
+ seatAssign: (seatId) => `/v1/seats/${enc(seatId)}/assign`,
203
+ /**
204
+ * The suspend route for one seat.
205
+ *
206
+ * @param seatId - The seat's opaque identifier.
207
+ */
208
+ seatSuspend: (seatId) => `/v1/seats/${enc(seatId)}/suspend`,
209
+ /**
210
+ * The resume route for one seat.
211
+ *
212
+ * @param seatId - The seat's opaque identifier.
213
+ */
214
+ seatResume: (seatId) => `/v1/seats/${enc(seatId)}/resume`,
215
+ /**
216
+ * The release route for one seat.
217
+ *
218
+ * @param seatId - The seat's opaque identifier.
219
+ */
220
+ seatRelease: (seatId) => `/v1/seats/${enc(seatId)}/release`,
221
+ /**
222
+ * The grants route for one seat.
223
+ *
224
+ * @param seatId - The seat's opaque identifier.
225
+ */
226
+ seatGrants: (seatId) => `/v1/seats/${enc(seatId)}/grants`,
227
+ /**
228
+ * The add-ons route for one seat.
229
+ *
230
+ * @param seatId - The seat's opaque identifier.
231
+ */
232
+ seatAddons: (seatId) => `/v1/seats/${enc(seatId)}/addons`,
233
+ /**
234
+ * The route for one add-on kind on one seat.
235
+ *
236
+ * @param seatId - The seat's opaque identifier.
237
+ * @param kind - The add-on's opaque identifier.
238
+ */
239
+ seatAddon: (seatId, kind) => `/v1/seats/${enc(seatId)}/addons/${enc(kind)}`,
240
+ /**
241
+ * The read-only inbox browse route for one seat.
242
+ *
243
+ * @param seatId - The seat's opaque identifier.
244
+ */
245
+ seatInbox: (seatId) => `/v1/seats/${enc(seatId)}/inbox`,
246
+ /**
247
+ * The inbox pull route for one seat.
248
+ *
249
+ * @param seatId - The seat's opaque identifier.
250
+ */
251
+ seatInboxPull: (seatId) => `/v1/seats/${enc(seatId)}/inbox/pull`,
252
+ /**
253
+ * The inbox acknowledgement route for one seat.
254
+ *
255
+ * @param seatId - The seat's opaque identifier.
256
+ */
257
+ seatInboxAck: (seatId) => `/v1/seats/${enc(seatId)}/inbox/ack`,
258
+ /**
259
+ * The presence route for one seat.
260
+ *
261
+ * @param seatId - The seat's opaque identifier.
262
+ */
263
+ seatPresence: (seatId) => `/v1/seats/${enc(seatId)}/presence`,
264
+ /**
265
+ * The route for one address.
266
+ *
267
+ * @param addressId - The address's opaque identifier.
268
+ */
269
+ address: (addressId) => `/v1/addresses/${enc(addressId)}`,
270
+ };
271
+ /**
272
+ * Encodes one opaque identifier for use as a single path segment.
273
+ *
274
+ * Percent-encoding alone does **not** make an identifier safe here, and the
275
+ * reason is worth writing down because it is easy to assume otherwise:
276
+ * `encodeURIComponent('..')` is `'..'`, because a dot is an unreserved
277
+ * character. The dot segment survives encoding intact, and `new URL()` then
278
+ * resolves it — so `v1Path.seatRelease('..')` would build `/v1/seats/../release`
279
+ * and be requested as `/v1/release`, and two dot segments escape `/v1`
280
+ * altogether. An identifier that can move the request to another route is a
281
+ * confused-deputy bug, and several of these identifiers (an add-on kind, a
282
+ * toolkit slug) come from values a caller supplies.
283
+ *
284
+ * So a dot segment is refused rather than encoded. Refusing is right for an
285
+ * identifier the server issued: `.` and `..` are not identifiers this service
286
+ * hands out, so a caller holding one is already in a state no encoding would
287
+ * make correct, and failing loudly at the call site beats silently requesting
288
+ * a different route.
289
+ *
290
+ * @param segment - The opaque identifier to place in one path segment.
291
+ * @throws TypeError - When the identifier is empty or is a dot segment.
292
+ */
293
+ function enc(segment) {
294
+ if (segment === '') {
295
+ throw new TypeError('A route identifier must not be empty.');
296
+ }
297
+ if (segment === '.' || segment === '..') {
298
+ throw new TypeError(`A route identifier must not be a dot segment (received ${JSON.stringify(segment)}); it would change which route is called.`);
299
+ }
300
+ return encodeURIComponent(segment);
301
+ }
302
+ //# sourceMappingURL=routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,mDAAmD;AACnD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,aAAa;IACtB,aAAa,EAAE,oBAAoB;IACnC,UAAU,EAAE,iBAAiB;IAC7B,WAAW,EAAE,kBAAkB;IAC/B,SAAS,EAAE,eAAe;IAC1B,kBAAkB,EAAE,yBAAyB;IAC7C,eAAe,EAAE,sBAAsB;IACvC,WAAW,EAAE,iBAAiB;IAC9B,kBAAkB,EAAE,yBAAyB;IAC7C,gBAAgB,EAAE,uBAAuB;IACzC,8BAA8B,EAAE,sCAAsC;IACtE,4BAA4B,EAAE,oCAAoC;IAClE,qBAAqB,EAAE,4BAA4B;IACnD,qBAAqB,EAAE,6BAA6B;IACpD,oBAAoB,EAAE,4BAA4B;IAClD,YAAY,EAAE,kBAAkB;IAChC,OAAO,EAAE,aAAa;IACtB,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,gBAAgB;IAC3B,KAAK,EAAE,WAAW;IAClB,Q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