@scalemule/sdk 0.0.82 → 0.0.84
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/dist/index.d.mts +38 -1
- package/dist/index.d.ts +38 -1
- package/dist/index.js +590 -324
- package/dist/index.mjs +587 -324
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -456,6 +456,47 @@ async function resolveAnonymousId(storage) {
|
|
|
456
456
|
return fresh;
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
+
// src/utils/path.ts
|
|
460
|
+
var INVALID_PATH_SEGMENT = "invalid_path_segment";
|
|
461
|
+
var INVALID_PATH = "invalid_path";
|
|
462
|
+
var ScaleMulePathError = class extends Error {
|
|
463
|
+
constructor(message) {
|
|
464
|
+
super(message);
|
|
465
|
+
this.code = INVALID_PATH_SEGMENT;
|
|
466
|
+
this.status = 400;
|
|
467
|
+
this.name = "ScaleMulePathError";
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
var CONTROL_CHARS = /[\u0000-\u001f\u007f]/;
|
|
471
|
+
function pathSegment(value, name = "id") {
|
|
472
|
+
let text;
|
|
473
|
+
if (typeof value === "string") {
|
|
474
|
+
text = value;
|
|
475
|
+
} else if (typeof value === "number" && Number.isFinite(value)) {
|
|
476
|
+
text = String(value);
|
|
477
|
+
} else {
|
|
478
|
+
throw new ScaleMulePathError(`${name} must be a string`);
|
|
479
|
+
}
|
|
480
|
+
if (text.length === 0) throw new ScaleMulePathError(`${name} must not be empty`);
|
|
481
|
+
if (text === "." || text === "..") throw new ScaleMulePathError(`${name} must not be "." or ".."`);
|
|
482
|
+
if (/[/\\%?#]/.test(text) || CONTROL_CHARS.test(text)) {
|
|
483
|
+
throw new ScaleMulePathError(`${name} contains a character that is not allowed in a path segment`);
|
|
484
|
+
}
|
|
485
|
+
return encodeURIComponent(text);
|
|
486
|
+
}
|
|
487
|
+
function findUnsafePathReason(path) {
|
|
488
|
+
if (typeof path !== "string") return "path must be a string";
|
|
489
|
+
const end = path.search(/[?#]/);
|
|
490
|
+
const pathPart = end === -1 ? path : path.slice(0, end);
|
|
491
|
+
if (CONTROL_CHARS.test(pathPart)) return "path contains a control character";
|
|
492
|
+
if (pathPart.includes("\\")) return "path contains a backslash";
|
|
493
|
+
if (/%(25)*(2e|2f|5c)/i.test(pathPart)) return "path contains an encoded dot, slash or backslash";
|
|
494
|
+
for (const segment2 of pathPart.split("/")) {
|
|
495
|
+
if (segment2 === "." || segment2 === "..") return 'path contains a "." or ".." segment';
|
|
496
|
+
}
|
|
497
|
+
return null;
|
|
498
|
+
}
|
|
499
|
+
|
|
459
500
|
// src/client.ts
|
|
460
501
|
var SDK_VERSION = "0.0.1";
|
|
461
502
|
var DEFAULT_TIMEOUT = 3e4;
|
|
@@ -1052,6 +1093,10 @@ var ScaleMuleClient = class {
|
|
|
1052
1093
|
// Core Request Method
|
|
1053
1094
|
// --------------------------------------------------------------------------
|
|
1054
1095
|
async request(path, init = {}) {
|
|
1096
|
+
const unsafePath = findUnsafePathReason(path);
|
|
1097
|
+
if (unsafePath) {
|
|
1098
|
+
return { data: null, error: { code: INVALID_PATH, message: `Refused request: ${unsafePath}`, status: 400 } };
|
|
1099
|
+
}
|
|
1055
1100
|
const url = `${this.baseUrl}${path}`;
|
|
1056
1101
|
const method = (init.method || "GET").toUpperCase();
|
|
1057
1102
|
const timeout = init.timeout || this.defaultTimeout;
|
|
@@ -1265,6 +1310,10 @@ var ScaleMuleClient = class {
|
|
|
1265
1310
|
}
|
|
1266
1311
|
return fd;
|
|
1267
1312
|
};
|
|
1313
|
+
const unsafePath = findUnsafePathReason(path);
|
|
1314
|
+
if (unsafePath) {
|
|
1315
|
+
return { data: null, error: { code: INVALID_PATH, message: `Refused upload: ${unsafePath}`, status: 400 } };
|
|
1316
|
+
}
|
|
1268
1317
|
const url = `${this.baseUrl}${path}`;
|
|
1269
1318
|
if (this.debug) console.log(`[ScaleMule] UPLOAD ${path}`);
|
|
1270
1319
|
if (options?.signal?.aborted) {
|
|
@@ -1770,7 +1819,7 @@ var AuthSessionsApi = class extends ServiceModule {
|
|
|
1770
1819
|
return this._get("");
|
|
1771
1820
|
}
|
|
1772
1821
|
async revoke(sessionId) {
|
|
1773
|
-
return this.del(`/${sessionId}`);
|
|
1822
|
+
return this.del(`/${pathSegment(sessionId, "sessionId")}`);
|
|
1774
1823
|
}
|
|
1775
1824
|
async revokeAll() {
|
|
1776
1825
|
return this.del("/others");
|
|
@@ -1785,13 +1834,13 @@ var AuthDevicesApi = class extends ServiceModule {
|
|
|
1785
1834
|
return this._get("");
|
|
1786
1835
|
}
|
|
1787
1836
|
async trust(deviceId) {
|
|
1788
|
-
return this.post(`/${deviceId}/trust`);
|
|
1837
|
+
return this.post(`/${pathSegment(deviceId, "deviceId")}/trust`);
|
|
1789
1838
|
}
|
|
1790
1839
|
async block(deviceId) {
|
|
1791
|
-
return this.post(`/${deviceId}/block`);
|
|
1840
|
+
return this.post(`/${pathSegment(deviceId, "deviceId")}/block`);
|
|
1792
1841
|
}
|
|
1793
1842
|
async delete(deviceId) {
|
|
1794
|
-
return this.del(`/${deviceId}`);
|
|
1843
|
+
return this.del(`/${pathSegment(deviceId, "deviceId")}`);
|
|
1795
1844
|
}
|
|
1796
1845
|
};
|
|
1797
1846
|
var AuthLoginHistoryApi = class extends ServiceModule {
|
|
@@ -1933,7 +1982,7 @@ var AuthService = class extends ServiceModule {
|
|
|
1933
1982
|
* reads are blocked at the gateway via the x-app-id header scope.
|
|
1934
1983
|
*/
|
|
1935
1984
|
async getUser(userId, options) {
|
|
1936
|
-
return this._get(`/users/${
|
|
1985
|
+
return this._get(`/users/${pathSegment(userId, "userId")}`, options);
|
|
1937
1986
|
}
|
|
1938
1987
|
/** Refresh the session. Alias: refreshToken() */
|
|
1939
1988
|
async refreshSession(data, options) {
|
|
@@ -2070,11 +2119,17 @@ var AuthService = class extends ServiceModule {
|
|
|
2070
2119
|
// OAuth
|
|
2071
2120
|
// --------------------------------------------------------------------------
|
|
2072
2121
|
async getOAuthUrl(provider, redirectUri, options) {
|
|
2073
|
-
return this._get(
|
|
2122
|
+
return this._get(
|
|
2123
|
+
this.withQuery(`/oauth/${pathSegment(provider, "provider")}/authorize`, { redirect_uri: redirectUri }),
|
|
2124
|
+
options
|
|
2125
|
+
);
|
|
2074
2126
|
}
|
|
2075
2127
|
async handleOAuthCallback(data, options) {
|
|
2076
2128
|
const { provider, ...rest } = data;
|
|
2077
|
-
const result = await this._get(
|
|
2129
|
+
const result = await this._get(
|
|
2130
|
+
this.withQuery(`/oauth/${pathSegment(provider, "provider")}/callback`, rest),
|
|
2131
|
+
options
|
|
2132
|
+
);
|
|
2078
2133
|
if (result.data && this.client.isAccountSwitcherEnabled()) {
|
|
2079
2134
|
await this.client.addKnownAccount({
|
|
2080
2135
|
userId: result.data.user.id,
|
|
@@ -2091,7 +2146,7 @@ var AuthService = class extends ServiceModule {
|
|
|
2091
2146
|
return this._get("/oauth/providers", options);
|
|
2092
2147
|
}
|
|
2093
2148
|
async unlinkOAuthProvider(provider, options) {
|
|
2094
|
-
return this.del(`/oauth/providers/${provider}`, options);
|
|
2149
|
+
return this.del(`/oauth/providers/${pathSegment(provider, "provider")}`, options);
|
|
2095
2150
|
}
|
|
2096
2151
|
// --------------------------------------------------------------------------
|
|
2097
2152
|
// Token Management
|
|
@@ -3130,7 +3185,7 @@ var StorageService = class extends ServiceModule {
|
|
|
3130
3185
|
// --------------------------------------------------------------------------
|
|
3131
3186
|
/** Get file metadata (no signed URL). */
|
|
3132
3187
|
async getInfo(fileId, options) {
|
|
3133
|
-
return this._get(`/files/${fileId}/info`, options);
|
|
3188
|
+
return this._get(`/files/${pathSegment(fileId, "fileId")}/info`, options);
|
|
3134
3189
|
}
|
|
3135
3190
|
/**
|
|
3136
3191
|
* Get the calling app's storage + media settings — content policy,
|
|
@@ -3174,7 +3229,7 @@ var StorageService = class extends ServiceModule {
|
|
|
3174
3229
|
* ```
|
|
3175
3230
|
*/
|
|
3176
3231
|
async getFileStatus(fileId, options) {
|
|
3177
|
-
return this._get(`/files/${fileId}/status`, options);
|
|
3232
|
+
return this._get(`/files/${pathSegment(fileId, "fileId")}/status`, options);
|
|
3178
3233
|
}
|
|
3179
3234
|
/**
|
|
3180
3235
|
* Read the application's active media policy. Lightweight endpoint
|
|
@@ -3195,7 +3250,7 @@ var StorageService = class extends ServiceModule {
|
|
|
3195
3250
|
* Returns CloudFront signed URL (fast, ~1us) or S3 presigned fallback.
|
|
3196
3251
|
*/
|
|
3197
3252
|
async getViewUrl(fileId, options) {
|
|
3198
|
-
return this.post(`/signed-url/view/${fileId}`, {}, options);
|
|
3253
|
+
return this.post(`/signed-url/view/${pathSegment(fileId, "fileId")}`, {}, options);
|
|
3199
3254
|
}
|
|
3200
3255
|
/**
|
|
3201
3256
|
* Get signed view URLs for multiple files (batch, up to 100).
|
|
@@ -3210,11 +3265,11 @@ var StorageService = class extends ServiceModule {
|
|
|
3210
3265
|
* Get a signed download URL (Content-Disposition: attachment).
|
|
3211
3266
|
*/
|
|
3212
3267
|
async getDownloadUrl(fileId, options) {
|
|
3213
|
-
return this.post(`/signed-url/download/${fileId}`, void 0, options);
|
|
3268
|
+
return this.post(`/signed-url/download/${pathSegment(fileId, "fileId")}`, void 0, options);
|
|
3214
3269
|
}
|
|
3215
3270
|
/** Delete a file (soft delete). */
|
|
3216
3271
|
async delete(fileId, options) {
|
|
3217
|
-
return this.del(`/files/${fileId}`, options);
|
|
3272
|
+
return this.del(`/files/${pathSegment(fileId, "fileId")}`, options);
|
|
3218
3273
|
}
|
|
3219
3274
|
/** List the current user's files (paginated). */
|
|
3220
3275
|
async list(params, options) {
|
|
@@ -3222,7 +3277,7 @@ var StorageService = class extends ServiceModule {
|
|
|
3222
3277
|
}
|
|
3223
3278
|
/** Check file view/access status. */
|
|
3224
3279
|
async getViewStatus(fileId, options) {
|
|
3225
|
-
return this._get(`/files/${fileId}/view-status`, options);
|
|
3280
|
+
return this._get(`/files/${pathSegment(fileId, "fileId")}/view-status`, options);
|
|
3226
3281
|
}
|
|
3227
3282
|
/**
|
|
3228
3283
|
* Update a file's visibility.
|
|
@@ -3243,7 +3298,7 @@ var StorageService = class extends ServiceModule {
|
|
|
3243
3298
|
async updateVisibility(fileId, visibility, options) {
|
|
3244
3299
|
const body = typeof visibility === "boolean" ? { is_public: visibility } : { visibility };
|
|
3245
3300
|
return this.patch(
|
|
3246
|
-
`/files/${fileId}/visibility`,
|
|
3301
|
+
`/files/${pathSegment(fileId, "fileId")}/visibility`,
|
|
3247
3302
|
body,
|
|
3248
3303
|
options
|
|
3249
3304
|
);
|
|
@@ -4186,11 +4241,15 @@ var RealtimeService = class extends ServiceModule {
|
|
|
4186
4241
|
}
|
|
4187
4242
|
/** Broadcast to a specific channel. */
|
|
4188
4243
|
async broadcastToChannel(channel, event, data, options) {
|
|
4189
|
-
return this.post(
|
|
4244
|
+
return this.post(
|
|
4245
|
+
`/broadcast/channel/${pathSegment(channel, "channel")}`,
|
|
4246
|
+
{ event, data },
|
|
4247
|
+
options
|
|
4248
|
+
);
|
|
4190
4249
|
}
|
|
4191
4250
|
/** Send to a specific user's connections. */
|
|
4192
4251
|
async sendToUser(userId, event, data, options) {
|
|
4193
|
-
return this.post(`/broadcast/user/${userId}`, { event, data }, options);
|
|
4252
|
+
return this.post(`/broadcast/user/${pathSegment(userId, "userId")}`, { event, data }, options);
|
|
4194
4253
|
}
|
|
4195
4254
|
// --------------------------------------------------------------------------
|
|
4196
4255
|
// Connection Lifecycle
|
|
@@ -4603,7 +4662,7 @@ var VideoService = class extends ServiceModule {
|
|
|
4603
4662
|
}
|
|
4604
4663
|
}
|
|
4605
4664
|
const completeResult = await this.post(
|
|
4606
|
-
`/${video_id}/upload-complete`,
|
|
4665
|
+
`/${pathSegment(video_id, "video_id")}/upload-complete`,
|
|
4607
4666
|
{
|
|
4608
4667
|
upload_id,
|
|
4609
4668
|
parts
|
|
@@ -4617,7 +4676,7 @@ var VideoService = class extends ServiceModule {
|
|
|
4617
4676
|
// --------------------------------------------------------------------------
|
|
4618
4677
|
/** Get video metadata and status. */
|
|
4619
4678
|
async get(videoId, options) {
|
|
4620
|
-
return super._get(`/${videoId}`, options);
|
|
4679
|
+
return super._get(`/${pathSegment(videoId, "videoId")}`, options);
|
|
4621
4680
|
}
|
|
4622
4681
|
/**
|
|
4623
4682
|
* Register a video from a file already uploaded to scalemule-storage.
|
|
@@ -4722,7 +4781,7 @@ var VideoService = class extends ServiceModule {
|
|
|
4722
4781
|
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
4723
4782
|
const result = await this.get(videoId, requestOptions);
|
|
4724
4783
|
if (result.data?.status === "ready") {
|
|
4725
|
-
return `${this.client.getBaseUrl()}${this.basePath}/${videoId}/playlist.m3u8`;
|
|
4784
|
+
return `${this.client.getBaseUrl()}${this.basePath}/${pathSegment(videoId, "videoId")}/playlist.m3u8`;
|
|
4726
4785
|
}
|
|
4727
4786
|
await new Promise((r) => setTimeout(r, intervalMs));
|
|
4728
4787
|
}
|
|
@@ -4735,7 +4794,7 @@ var VideoService = class extends ServiceModule {
|
|
|
4735
4794
|
async getStreamUrl(videoId) {
|
|
4736
4795
|
const baseUrl = this.client.getBaseUrl();
|
|
4737
4796
|
return {
|
|
4738
|
-
data: { url: `${baseUrl}${this.basePath}/${videoId}/playlist.m3u8` },
|
|
4797
|
+
data: { url: `${baseUrl}${this.basePath}/${pathSegment(videoId, "videoId")}/playlist.m3u8` },
|
|
4739
4798
|
error: null
|
|
4740
4799
|
};
|
|
4741
4800
|
}
|
|
@@ -4743,12 +4802,12 @@ var VideoService = class extends ServiceModule {
|
|
|
4743
4802
|
* Track a playback event (view, play, pause, seek, complete, etc.).
|
|
4744
4803
|
*/
|
|
4745
4804
|
async trackPlayback(videoId, event, options) {
|
|
4746
|
-
return this.post(`/${videoId}/track`, event, options);
|
|
4805
|
+
return this.post(`/${pathSegment(videoId, "videoId")}/track`, event, options);
|
|
4747
4806
|
}
|
|
4748
4807
|
/** Get video analytics (views, watch time, etc.). */
|
|
4749
4808
|
async getAnalytics(videoId, options) {
|
|
4750
4809
|
return super._get(
|
|
4751
|
-
`/${videoId}/analytics`,
|
|
4810
|
+
`/${pathSegment(videoId, "videoId")}/analytics`,
|
|
4752
4811
|
options
|
|
4753
4812
|
);
|
|
4754
4813
|
}
|
|
@@ -4757,7 +4816,11 @@ var VideoService = class extends ServiceModule {
|
|
|
4757
4816
|
* Public videos get 7-day signed URLs; private get 1-hour signed URLs.
|
|
4758
4817
|
*/
|
|
4759
4818
|
async updateAccessMode(videoId, accessMode, options) {
|
|
4760
|
-
return this.patch(
|
|
4819
|
+
return this.patch(
|
|
4820
|
+
`/${pathSegment(videoId, "videoId")}`,
|
|
4821
|
+
{ access_mode: accessMode },
|
|
4822
|
+
options
|
|
4823
|
+
);
|
|
4761
4824
|
}
|
|
4762
4825
|
// --------------------------------------------------------------------------
|
|
4763
4826
|
// Legacy methods (backward compat)
|
|
@@ -4780,7 +4843,7 @@ var VideoService = class extends ServiceModule {
|
|
|
4780
4843
|
async uploadPart(videoId, uploadId, partNumber, chunk, signal) {
|
|
4781
4844
|
const formData = new FormData();
|
|
4782
4845
|
formData.append("file", chunk);
|
|
4783
|
-
const path = `${this.basePath}/${videoId}/upload-part?upload_id=${encodeURIComponent(uploadId)}&part_number=${partNumber}`;
|
|
4846
|
+
const path = `${this.basePath}/${pathSegment(videoId, "videoId")}/upload-part?upload_id=${encodeURIComponent(uploadId)}&part_number=${partNumber}`;
|
|
4784
4847
|
const headers = {
|
|
4785
4848
|
"x-api-key": this.client.getApiKey()
|
|
4786
4849
|
};
|
|
@@ -4838,22 +4901,32 @@ var DataService = class extends ServiceModule {
|
|
|
4838
4901
|
return this._get("/collections", options);
|
|
4839
4902
|
}
|
|
4840
4903
|
async deleteCollection(name, options) {
|
|
4841
|
-
return this.del(`/collections/${name}`, options);
|
|
4904
|
+
return this.del(`/collections/${pathSegment(name, "name")}`, options);
|
|
4842
4905
|
}
|
|
4843
4906
|
// --------------------------------------------------------------------------
|
|
4844
4907
|
// Documents — CRUD
|
|
4845
4908
|
// --------------------------------------------------------------------------
|
|
4846
4909
|
async create(collection, data, options) {
|
|
4847
|
-
return this.post(`/${collection}/documents`, { data }, options);
|
|
4910
|
+
return this.post(`/${pathSegment(collection, "collection")}/documents`, { data }, options);
|
|
4848
4911
|
}
|
|
4849
4912
|
async get(collection, docId, options) {
|
|
4850
|
-
return this._get(
|
|
4913
|
+
return this._get(
|
|
4914
|
+
`/${pathSegment(collection, "collection")}/documents/${pathSegment(docId, "docId")}`,
|
|
4915
|
+
options
|
|
4916
|
+
);
|
|
4851
4917
|
}
|
|
4852
4918
|
async update(collection, docId, data, options) {
|
|
4853
|
-
return this.patch(
|
|
4919
|
+
return this.patch(
|
|
4920
|
+
`/${pathSegment(collection, "collection")}/documents/${pathSegment(docId, "docId")}`,
|
|
4921
|
+
{ data },
|
|
4922
|
+
options
|
|
4923
|
+
);
|
|
4854
4924
|
}
|
|
4855
4925
|
async delete(collection, docId, options) {
|
|
4856
|
-
return this.del(
|
|
4926
|
+
return this.del(
|
|
4927
|
+
`/${pathSegment(collection, "collection")}/documents/${pathSegment(docId, "docId")}`,
|
|
4928
|
+
options
|
|
4929
|
+
);
|
|
4857
4930
|
}
|
|
4858
4931
|
// --------------------------------------------------------------------------
|
|
4859
4932
|
// Documents — Query & Aggregate
|
|
@@ -4871,7 +4944,11 @@ var DataService = class extends ServiceModule {
|
|
|
4871
4944
|
page: options?.page ?? 1,
|
|
4872
4945
|
per_page: options?.perPage ?? 20
|
|
4873
4946
|
};
|
|
4874
|
-
const response = await this.post(
|
|
4947
|
+
const response = await this.post(
|
|
4948
|
+
`/${pathSegment(collection, "collection")}/query`,
|
|
4949
|
+
body,
|
|
4950
|
+
requestOptions
|
|
4951
|
+
);
|
|
4875
4952
|
if (response.error) {
|
|
4876
4953
|
return {
|
|
4877
4954
|
data: [],
|
|
@@ -4895,10 +4972,10 @@ var DataService = class extends ServiceModule {
|
|
|
4895
4972
|
};
|
|
4896
4973
|
}
|
|
4897
4974
|
async aggregate(collection, options, requestOptions) {
|
|
4898
|
-
return this.post(`/${collection}/aggregate`, options, requestOptions);
|
|
4975
|
+
return this.post(`/${pathSegment(collection, "collection")}/aggregate`, options, requestOptions);
|
|
4899
4976
|
}
|
|
4900
4977
|
async myDocuments(collection, options, requestOptions) {
|
|
4901
|
-
return this._list(`/${collection}/my-documents`, options, requestOptions);
|
|
4978
|
+
return this._list(`/${pathSegment(collection, "collection")}/my-documents`, options, requestOptions);
|
|
4902
4979
|
}
|
|
4903
4980
|
// --------------------------------------------------------------------------
|
|
4904
4981
|
// Legacy methods (backward compat)
|
|
@@ -4941,61 +5018,89 @@ var ChatService = class extends ServiceModule {
|
|
|
4941
5018
|
return this._list("/conversations", params, requestOptions);
|
|
4942
5019
|
}
|
|
4943
5020
|
async getConversation(id, options) {
|
|
4944
|
-
return this._get(`/conversations/${id}`, options);
|
|
5021
|
+
return this._get(`/conversations/${pathSegment(id, "id")}`, options);
|
|
4945
5022
|
}
|
|
4946
5023
|
async addParticipant(conversationId, userId, options) {
|
|
4947
|
-
return this.post(
|
|
5024
|
+
return this.post(
|
|
5025
|
+
`/conversations/${pathSegment(conversationId, "conversationId")}/participants`,
|
|
5026
|
+
{ user_id: userId },
|
|
5027
|
+
options
|
|
5028
|
+
);
|
|
4948
5029
|
}
|
|
4949
5030
|
async removeParticipant(conversationId, userId, options) {
|
|
4950
|
-
return this.del(
|
|
5031
|
+
return this.del(
|
|
5032
|
+
`/conversations/${pathSegment(conversationId, "conversationId")}/participants/${pathSegment(userId, "userId")}`,
|
|
5033
|
+
options
|
|
5034
|
+
);
|
|
4951
5035
|
}
|
|
4952
5036
|
// --------------------------------------------------------------------------
|
|
4953
5037
|
// Messages
|
|
4954
5038
|
// --------------------------------------------------------------------------
|
|
4955
5039
|
async sendMessage(conversationId, data, options) {
|
|
4956
|
-
return this.post(
|
|
5040
|
+
return this.post(
|
|
5041
|
+
`/conversations/${pathSegment(conversationId, "conversationId")}/messages`,
|
|
5042
|
+
data,
|
|
5043
|
+
options
|
|
5044
|
+
);
|
|
4957
5045
|
}
|
|
4958
5046
|
async getThreadReplies(messageId, params, requestOptions) {
|
|
4959
|
-
return this._get(
|
|
5047
|
+
return this._get(
|
|
5048
|
+
this.withQuery(`/messages/${pathSegment(messageId, "messageId")}/replies`, params),
|
|
5049
|
+
requestOptions
|
|
5050
|
+
);
|
|
4960
5051
|
}
|
|
4961
5052
|
async getMessages(conversationId, options, requestOptions) {
|
|
4962
5053
|
return this._get(
|
|
4963
|
-
this.withQuery(`/conversations/${conversationId}/messages`, options),
|
|
5054
|
+
this.withQuery(`/conversations/${pathSegment(conversationId, "conversationId")}/messages`, options),
|
|
4964
5055
|
requestOptions
|
|
4965
5056
|
);
|
|
4966
5057
|
}
|
|
4967
5058
|
async editMessage(messageId, data, options) {
|
|
4968
|
-
return this.patch(`/messages/${messageId}`, data, options);
|
|
5059
|
+
return this.patch(`/messages/${pathSegment(messageId, "messageId")}`, data, options);
|
|
4969
5060
|
}
|
|
4970
5061
|
async deleteMessage(messageId, options) {
|
|
4971
|
-
return this.del(`/messages/${messageId}`, options);
|
|
5062
|
+
return this.del(`/messages/${pathSegment(messageId, "messageId")}`, options);
|
|
4972
5063
|
}
|
|
4973
5064
|
async addReaction(messageId, data, options) {
|
|
4974
|
-
return this.post(`/messages/${messageId}/reactions`, data, options);
|
|
5065
|
+
return this.post(`/messages/${pathSegment(messageId, "messageId")}/reactions`, data, options);
|
|
4975
5066
|
}
|
|
4976
5067
|
// --------------------------------------------------------------------------
|
|
4977
5068
|
// Pins
|
|
4978
5069
|
// --------------------------------------------------------------------------
|
|
4979
5070
|
async pinMessage(messageId, options) {
|
|
4980
|
-
return this.post(`/messages/${messageId}/pin`, void 0, options);
|
|
5071
|
+
return this.post(`/messages/${pathSegment(messageId, "messageId")}/pin`, void 0, options);
|
|
4981
5072
|
}
|
|
4982
5073
|
async unpinMessage(messageId, options) {
|
|
4983
|
-
return this.del(`/messages/${messageId}/pin`, options);
|
|
5074
|
+
return this.del(`/messages/${pathSegment(messageId, "messageId")}/pin`, options);
|
|
4984
5075
|
}
|
|
4985
5076
|
async getPinnedMessages(conversationId, options) {
|
|
4986
|
-
return this._get(
|
|
5077
|
+
return this._get(
|
|
5078
|
+
`/conversations/${pathSegment(conversationId, "conversationId")}/pins`,
|
|
5079
|
+
options
|
|
5080
|
+
);
|
|
4987
5081
|
}
|
|
4988
5082
|
// --------------------------------------------------------------------------
|
|
4989
5083
|
// Typing & Read Receipts
|
|
4990
5084
|
// --------------------------------------------------------------------------
|
|
4991
5085
|
async sendTyping(conversationId, options) {
|
|
4992
|
-
return this.post(
|
|
5086
|
+
return this.post(
|
|
5087
|
+
`/conversations/${pathSegment(conversationId, "conversationId")}/typing`,
|
|
5088
|
+
void 0,
|
|
5089
|
+
options
|
|
5090
|
+
);
|
|
4993
5091
|
}
|
|
4994
5092
|
async markRead(conversationId, options) {
|
|
4995
|
-
return this.post(
|
|
5093
|
+
return this.post(
|
|
5094
|
+
`/conversations/${pathSegment(conversationId, "conversationId")}/read`,
|
|
5095
|
+
void 0,
|
|
5096
|
+
options
|
|
5097
|
+
);
|
|
4996
5098
|
}
|
|
4997
5099
|
async getReadStatus(conversationId, options) {
|
|
4998
|
-
return this._get(
|
|
5100
|
+
return this._get(
|
|
5101
|
+
`/conversations/${pathSegment(conversationId, "conversationId")}/read-status`,
|
|
5102
|
+
options
|
|
5103
|
+
);
|
|
4999
5104
|
}
|
|
5000
5105
|
// --------------------------------------------------------------------------
|
|
5001
5106
|
// Legacy methods (backward compat)
|
|
@@ -5019,37 +5124,37 @@ var ConferenceService = class extends ServiceModule {
|
|
|
5019
5124
|
return this.post("/calls", data, options);
|
|
5020
5125
|
}
|
|
5021
5126
|
async getCall(callId, options) {
|
|
5022
|
-
return this._get(`/calls/${callId}`, options);
|
|
5127
|
+
return this._get(`/calls/${pathSegment(callId, "callId")}`, options);
|
|
5023
5128
|
}
|
|
5024
5129
|
async listCalls(params, options) {
|
|
5025
5130
|
return this._get(this.withQuery("/calls", params), options);
|
|
5026
5131
|
}
|
|
5027
5132
|
async endCall(callId, options) {
|
|
5028
|
-
return this.post(`/calls/${callId}/end`, void 0, options);
|
|
5133
|
+
return this.post(`/calls/${pathSegment(callId, "callId")}/end`, void 0, options);
|
|
5029
5134
|
}
|
|
5030
5135
|
// --------------------------------------------------------------------------
|
|
5031
5136
|
// Participants
|
|
5032
5137
|
// --------------------------------------------------------------------------
|
|
5033
5138
|
async joinCall(callId, options) {
|
|
5034
|
-
return this.post(`/calls/${callId}/join`, void 0, options);
|
|
5139
|
+
return this.post(`/calls/${pathSegment(callId, "callId")}/join`, void 0, options);
|
|
5035
5140
|
}
|
|
5036
5141
|
async leaveCall(callId, options) {
|
|
5037
|
-
return this.post(`/calls/${callId}/leave`, void 0, options);
|
|
5142
|
+
return this.post(`/calls/${pathSegment(callId, "callId")}/leave`, void 0, options);
|
|
5038
5143
|
}
|
|
5039
5144
|
async listParticipants(callId, options) {
|
|
5040
|
-
return this._get(`/calls/${callId}/participants`, options);
|
|
5145
|
+
return this._get(`/calls/${pathSegment(callId, "callId")}/participants`, options);
|
|
5041
5146
|
}
|
|
5042
5147
|
// --------------------------------------------------------------------------
|
|
5043
5148
|
// Recording
|
|
5044
5149
|
// --------------------------------------------------------------------------
|
|
5045
5150
|
async startRecording(callId, options) {
|
|
5046
|
-
return this.post(`/calls/${callId}/recording/start`, void 0, options);
|
|
5151
|
+
return this.post(`/calls/${pathSegment(callId, "callId")}/recording/start`, void 0, options);
|
|
5047
5152
|
}
|
|
5048
5153
|
async stopRecording(callId, options) {
|
|
5049
|
-
return this.post(`/calls/${callId}/recording/stop`, void 0, options);
|
|
5154
|
+
return this.post(`/calls/${pathSegment(callId, "callId")}/recording/stop`, void 0, options);
|
|
5050
5155
|
}
|
|
5051
5156
|
async consentToRecording(callId, options) {
|
|
5052
|
-
return this.post(`/calls/${callId}/recording/consent`, void 0, options);
|
|
5157
|
+
return this.post(`/calls/${pathSegment(callId, "callId")}/recording/consent`, void 0, options);
|
|
5053
5158
|
}
|
|
5054
5159
|
// --------------------------------------------------------------------------
|
|
5055
5160
|
// Settings
|
|
@@ -5064,7 +5169,7 @@ var ConferenceService = class extends ServiceModule {
|
|
|
5064
5169
|
// Stats
|
|
5065
5170
|
// --------------------------------------------------------------------------
|
|
5066
5171
|
async submitStats(callId, stats, options) {
|
|
5067
|
-
return this.post(`/calls/${callId}/stats`, stats, options);
|
|
5172
|
+
return this.post(`/calls/${pathSegment(callId, "callId")}/stats`, stats, options);
|
|
5068
5173
|
}
|
|
5069
5174
|
};
|
|
5070
5175
|
|
|
@@ -5085,19 +5190,19 @@ var SocialService = class extends ServiceModule {
|
|
|
5085
5190
|
// Follow / Unfollow
|
|
5086
5191
|
// --------------------------------------------------------------------------
|
|
5087
5192
|
async follow(userId, options) {
|
|
5088
|
-
return this.post(`/users/${userId}/follow`, void 0, options);
|
|
5193
|
+
return this.post(`/users/${pathSegment(userId, "userId")}/follow`, void 0, options);
|
|
5089
5194
|
}
|
|
5090
5195
|
async unfollow(userId, options) {
|
|
5091
|
-
return this.del(`/users/${userId}/follow`, options);
|
|
5196
|
+
return this.del(`/users/${pathSegment(userId, "userId")}/follow`, options);
|
|
5092
5197
|
}
|
|
5093
5198
|
async getFollowers(userId, params, requestOptions) {
|
|
5094
|
-
return this._list(`/users/${userId}/followers`, params, requestOptions);
|
|
5199
|
+
return this._list(`/users/${pathSegment(userId, "userId")}/followers`, params, requestOptions);
|
|
5095
5200
|
}
|
|
5096
5201
|
async getFollowing(userId, params, requestOptions) {
|
|
5097
|
-
return this._list(`/users/${userId}/following`, params, requestOptions);
|
|
5202
|
+
return this._list(`/users/${pathSegment(userId, "userId")}/following`, params, requestOptions);
|
|
5098
5203
|
}
|
|
5099
5204
|
async getFollowStatus(userId, options) {
|
|
5100
|
-
return this._get(`/users/${userId}/follow-status`, options);
|
|
5205
|
+
return this._get(`/users/${pathSegment(userId, "userId")}/follow-status`, options);
|
|
5101
5206
|
}
|
|
5102
5207
|
// --------------------------------------------------------------------------
|
|
5103
5208
|
// Posts
|
|
@@ -5106,13 +5211,13 @@ var SocialService = class extends ServiceModule {
|
|
|
5106
5211
|
return this.post("/posts", data, options);
|
|
5107
5212
|
}
|
|
5108
5213
|
async getPost(postId, options) {
|
|
5109
|
-
return this._get(`/posts/${postId}`, options);
|
|
5214
|
+
return this._get(`/posts/${pathSegment(postId, "postId")}`, options);
|
|
5110
5215
|
}
|
|
5111
5216
|
async deletePost(postId, options) {
|
|
5112
|
-
return this.del(`/posts/${postId}`, options);
|
|
5217
|
+
return this.del(`/posts/${pathSegment(postId, "postId")}`, options);
|
|
5113
5218
|
}
|
|
5114
5219
|
async getUserPosts(userId, params, requestOptions) {
|
|
5115
|
-
return this._list(`/users/${userId}/posts`, params, requestOptions);
|
|
5220
|
+
return this._list(`/users/${pathSegment(userId, "userId")}/posts`, params, requestOptions);
|
|
5116
5221
|
}
|
|
5117
5222
|
async getFeed(options, requestOptions) {
|
|
5118
5223
|
return this._list("/feed", options, requestOptions);
|
|
@@ -5121,13 +5226,24 @@ var SocialService = class extends ServiceModule {
|
|
|
5121
5226
|
// Likes
|
|
5122
5227
|
// --------------------------------------------------------------------------
|
|
5123
5228
|
async like(targetType, targetId, options) {
|
|
5124
|
-
return this.post(
|
|
5229
|
+
return this.post(
|
|
5230
|
+
`/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/like`,
|
|
5231
|
+
void 0,
|
|
5232
|
+
options
|
|
5233
|
+
);
|
|
5125
5234
|
}
|
|
5126
5235
|
async unlike(targetType, targetId, options) {
|
|
5127
|
-
return this.del(
|
|
5236
|
+
return this.del(
|
|
5237
|
+
`/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/like`,
|
|
5238
|
+
options
|
|
5239
|
+
);
|
|
5128
5240
|
}
|
|
5129
5241
|
async getLikes(targetType, targetId, params, requestOptions) {
|
|
5130
|
-
return this._list(
|
|
5242
|
+
return this._list(
|
|
5243
|
+
`/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/likes`,
|
|
5244
|
+
params,
|
|
5245
|
+
requestOptions
|
|
5246
|
+
);
|
|
5131
5247
|
}
|
|
5132
5248
|
// --------------------------------------------------------------------------
|
|
5133
5249
|
// Voting (bipolar — up/down with score)
|
|
@@ -5145,7 +5261,11 @@ var SocialService = class extends ServiceModule {
|
|
|
5145
5261
|
* Requires an authenticated session; anonymous calls return 401.
|
|
5146
5262
|
*/
|
|
5147
5263
|
async vote(targetType, targetId, value, options) {
|
|
5148
|
-
return this.put(
|
|
5264
|
+
return this.put(
|
|
5265
|
+
`/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/vote`,
|
|
5266
|
+
{ value },
|
|
5267
|
+
options
|
|
5268
|
+
);
|
|
5149
5269
|
}
|
|
5150
5270
|
/**
|
|
5151
5271
|
* Read the caller's current vote on a target plus the aggregate counts.
|
|
@@ -5154,7 +5274,10 @@ var SocialService = class extends ServiceModule {
|
|
|
5154
5274
|
* Requires an authenticated session.
|
|
5155
5275
|
*/
|
|
5156
5276
|
async getVote(targetType, targetId, options) {
|
|
5157
|
-
return this._get(
|
|
5277
|
+
return this._get(
|
|
5278
|
+
`/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/vote`,
|
|
5279
|
+
options
|
|
5280
|
+
);
|
|
5158
5281
|
}
|
|
5159
5282
|
// --------------------------------------------------------------------------
|
|
5160
5283
|
// View counters
|
|
@@ -5171,22 +5294,29 @@ var SocialService = class extends ServiceModule {
|
|
|
5171
5294
|
*/
|
|
5172
5295
|
async recordView(targetType, targetId, viewerFingerprint, options) {
|
|
5173
5296
|
const body = viewerFingerprint ? { viewer_fingerprint: viewerFingerprint } : {};
|
|
5174
|
-
return this.post(
|
|
5297
|
+
return this.post(
|
|
5298
|
+
`/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/views`,
|
|
5299
|
+
body,
|
|
5300
|
+
options
|
|
5301
|
+
);
|
|
5175
5302
|
}
|
|
5176
5303
|
/**
|
|
5177
5304
|
* Read view counters for a target.
|
|
5178
5305
|
*/
|
|
5179
5306
|
async getViews(targetType, targetId, options) {
|
|
5180
|
-
return this._get(
|
|
5307
|
+
return this._get(
|
|
5308
|
+
`/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/views`,
|
|
5309
|
+
options
|
|
5310
|
+
);
|
|
5181
5311
|
}
|
|
5182
5312
|
// --------------------------------------------------------------------------
|
|
5183
5313
|
// Comments
|
|
5184
5314
|
// --------------------------------------------------------------------------
|
|
5185
5315
|
async comment(postId, data, options) {
|
|
5186
|
-
return this.post(`/posts/${postId}/comments`, data, options);
|
|
5316
|
+
return this.post(`/posts/${pathSegment(postId, "postId")}/comments`, data, options);
|
|
5187
5317
|
}
|
|
5188
5318
|
async getComments(postId, params, requestOptions) {
|
|
5189
|
-
return this._list(`/posts/${postId}/comments`, params, requestOptions);
|
|
5319
|
+
return this._list(`/posts/${pathSegment(postId, "postId")}/comments`, params, requestOptions);
|
|
5190
5320
|
}
|
|
5191
5321
|
// --------------------------------------------------------------------------
|
|
5192
5322
|
// Activity Feed
|
|
@@ -5195,7 +5325,7 @@ var SocialService = class extends ServiceModule {
|
|
|
5195
5325
|
return this._list("/activity", params, requestOptions);
|
|
5196
5326
|
}
|
|
5197
5327
|
async markActivityRead(activityId, options) {
|
|
5198
|
-
return this.patch(`/activity/${activityId}/read`, {}, options);
|
|
5328
|
+
return this.patch(`/activity/${pathSegment(activityId, "activityId")}/read`, {}, options);
|
|
5199
5329
|
}
|
|
5200
5330
|
async markAllRead(options) {
|
|
5201
5331
|
return this.patch("/activity/read-all", {}, options);
|
|
@@ -5246,10 +5376,10 @@ var SocialPolicyService = class extends ServiceModule {
|
|
|
5246
5376
|
return this.decideAction("connect_request", actor, target, options);
|
|
5247
5377
|
}
|
|
5248
5378
|
getSettings(identityId, options) {
|
|
5249
|
-
return this._get(`/settings/${identityId}`, options);
|
|
5379
|
+
return this._get(`/settings/${pathSegment(identityId, "identityId")}`, options);
|
|
5250
5380
|
}
|
|
5251
5381
|
updateSettings(identityId, request, options) {
|
|
5252
|
-
return this.patch(`/settings/${identityId}`, request, options);
|
|
5382
|
+
return this.patch(`/settings/${pathSegment(identityId, "identityId")}`, request, options);
|
|
5253
5383
|
}
|
|
5254
5384
|
createRelationship(request, options) {
|
|
5255
5385
|
return this.post("/relationships", request, options);
|
|
@@ -5258,7 +5388,7 @@ var SocialPolicyService = class extends ServiceModule {
|
|
|
5258
5388
|
return this._get(this.withQuery("/relationships", toQueryParams(params)), options);
|
|
5259
5389
|
}
|
|
5260
5390
|
deleteRelationship(relationshipId, options) {
|
|
5261
|
-
return this.del(`/relationships/${relationshipId}`, options);
|
|
5391
|
+
return this.del(`/relationships/${pathSegment(relationshipId, "relationshipId")}`, options);
|
|
5262
5392
|
}
|
|
5263
5393
|
createContactRequest(request, options) {
|
|
5264
5394
|
return this.post("/contact-requests", request, options);
|
|
@@ -5276,16 +5406,32 @@ var SocialPolicyService = class extends ServiceModule {
|
|
|
5276
5406
|
);
|
|
5277
5407
|
}
|
|
5278
5408
|
acceptContactRequest(requestId, options) {
|
|
5279
|
-
return this.post(
|
|
5409
|
+
return this.post(
|
|
5410
|
+
`/contact-requests/${pathSegment(requestId, "requestId")}/accept`,
|
|
5411
|
+
void 0,
|
|
5412
|
+
options
|
|
5413
|
+
);
|
|
5280
5414
|
}
|
|
5281
5415
|
ignoreContactRequest(requestId, options) {
|
|
5282
|
-
return this.post(
|
|
5416
|
+
return this.post(
|
|
5417
|
+
`/contact-requests/${pathSegment(requestId, "requestId")}/ignore`,
|
|
5418
|
+
void 0,
|
|
5419
|
+
options
|
|
5420
|
+
);
|
|
5283
5421
|
}
|
|
5284
5422
|
declineContactRequest(requestId, options) {
|
|
5285
|
-
return this.post(
|
|
5423
|
+
return this.post(
|
|
5424
|
+
`/contact-requests/${pathSegment(requestId, "requestId")}/decline`,
|
|
5425
|
+
void 0,
|
|
5426
|
+
options
|
|
5427
|
+
);
|
|
5286
5428
|
}
|
|
5287
5429
|
reportContactRequest(requestId, options) {
|
|
5288
|
-
return this.post(
|
|
5430
|
+
return this.post(
|
|
5431
|
+
`/contact-requests/${pathSegment(requestId, "requestId")}/report`,
|
|
5432
|
+
void 0,
|
|
5433
|
+
options
|
|
5434
|
+
);
|
|
5289
5435
|
}
|
|
5290
5436
|
block(request, options) {
|
|
5291
5437
|
return this.post("/block", request, options);
|
|
@@ -5429,7 +5575,7 @@ var BillingService = class extends ServiceModule {
|
|
|
5429
5575
|
// openapi/scalemule-money-billing-v1.yaml.
|
|
5430
5576
|
// --------------------------------------------------------------------------
|
|
5431
5577
|
accountBase(accountId) {
|
|
5432
|
-
return `/v1/billing/accounts/${
|
|
5578
|
+
return `/v1/billing/accounts/${pathSegment(accountId, "accountId")}`;
|
|
5433
5579
|
}
|
|
5434
5580
|
async getAccountCustomer(req, options) {
|
|
5435
5581
|
const path = this.withQuery(`${this.accountBase(req.account_id)}/customer`, {
|
|
@@ -5451,14 +5597,14 @@ var BillingService = class extends ServiceModule {
|
|
|
5451
5597
|
}
|
|
5452
5598
|
async detachAccountPaymentMethod(req, paymentMethodId, options) {
|
|
5453
5599
|
const path = this.withQuery(
|
|
5454
|
-
`${this.accountBase(req.account_id)}/payment-methods/${
|
|
5600
|
+
`${this.accountBase(req.account_id)}/payment-methods/${pathSegment(paymentMethodId, "paymentMethodId")}`,
|
|
5455
5601
|
{ billing_mode: req.billing_mode }
|
|
5456
5602
|
);
|
|
5457
5603
|
return this.client.del(path, options);
|
|
5458
5604
|
}
|
|
5459
5605
|
async setDefaultAccountPaymentMethod(req, paymentMethodId, options) {
|
|
5460
5606
|
const path = this.withQuery(
|
|
5461
|
-
`${this.accountBase(req.account_id)}/payment-methods/${
|
|
5607
|
+
`${this.accountBase(req.account_id)}/payment-methods/${pathSegment(paymentMethodId, "paymentMethodId")}/default`,
|
|
5462
5608
|
{ billing_mode: req.billing_mode }
|
|
5463
5609
|
);
|
|
5464
5610
|
return this.client.put(path, void 0, options);
|
|
@@ -5472,7 +5618,7 @@ var BillingService = class extends ServiceModule {
|
|
|
5472
5618
|
return this.client.get(path, options);
|
|
5473
5619
|
}
|
|
5474
5620
|
async getAccountInvoice(req, invoiceId, options) {
|
|
5475
|
-
const path = this.withQuery(`${this.accountBase(req.account_id)}/invoices/${
|
|
5621
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/invoices/${pathSegment(invoiceId, "invoiceId")}`, {
|
|
5476
5622
|
billing_mode: req.billing_mode
|
|
5477
5623
|
});
|
|
5478
5624
|
return this.client.get(path, options);
|
|
@@ -5528,13 +5674,13 @@ var BillingService = class extends ServiceModule {
|
|
|
5528
5674
|
return this._list("/invoices", params, options);
|
|
5529
5675
|
}
|
|
5530
5676
|
async getInvoice(id, options) {
|
|
5531
|
-
return this._get(`/invoices/${id}`, options);
|
|
5677
|
+
return this._get(`/invoices/${pathSegment(id, "id")}`, options);
|
|
5532
5678
|
}
|
|
5533
5679
|
async payInvoice(id, options) {
|
|
5534
|
-
return this.post(`/invoices/${id}/pay`, void 0, options);
|
|
5680
|
+
return this.post(`/invoices/${pathSegment(id, "id")}/pay`, void 0, options);
|
|
5535
5681
|
}
|
|
5536
5682
|
async getInvoicePdf(id, options) {
|
|
5537
|
-
return this._get(`/invoices/${id}/pdf`, options);
|
|
5683
|
+
return this._get(`/invoices/${pathSegment(id, "id")}/pdf`, options);
|
|
5538
5684
|
}
|
|
5539
5685
|
// --------------------------------------------------------------------------
|
|
5540
5686
|
// Connected Accounts (Marketplace)
|
|
@@ -5543,20 +5689,24 @@ var BillingService = class extends ServiceModule {
|
|
|
5543
5689
|
return this.post("/connected-accounts", data, options);
|
|
5544
5690
|
}
|
|
5545
5691
|
async getConnectedAccount(id, options) {
|
|
5546
|
-
return this._get(`/connected-accounts/${id}`, options);
|
|
5692
|
+
return this._get(`/connected-accounts/${pathSegment(id, "id")}`, options);
|
|
5547
5693
|
}
|
|
5548
5694
|
async getMyConnectedAccount(options) {
|
|
5549
5695
|
return this._get("/connected-accounts/me", options);
|
|
5550
5696
|
}
|
|
5551
5697
|
async createOnboardingLink(id, data, options) {
|
|
5552
|
-
return this.post(`/connected-accounts/${id}/onboarding-link`, data, options);
|
|
5698
|
+
return this.post(`/connected-accounts/${pathSegment(id, "id")}/onboarding-link`, data, options);
|
|
5553
5699
|
}
|
|
5554
5700
|
async getAccountBalance(id, options) {
|
|
5555
5701
|
void options;
|
|
5556
5702
|
return this.retiredSurface(`/v1/money/billing/connected-accounts/${id}/balance`);
|
|
5557
5703
|
}
|
|
5558
5704
|
async createAccountSession(id, options) {
|
|
5559
|
-
return this.post(
|
|
5705
|
+
return this.post(
|
|
5706
|
+
`/connected-accounts/${pathSegment(id, "id")}/account-session`,
|
|
5707
|
+
void 0,
|
|
5708
|
+
options
|
|
5709
|
+
);
|
|
5560
5710
|
}
|
|
5561
5711
|
// --------------------------------------------------------------------------
|
|
5562
5712
|
// Config
|
|
@@ -5598,10 +5748,17 @@ var BillingService = class extends ServiceModule {
|
|
|
5598
5748
|
return this.retiredSurface(`/v1/money/billing/connected-accounts/${accountId}/payouts`);
|
|
5599
5749
|
}
|
|
5600
5750
|
async getPayoutSchedule(accountId, options) {
|
|
5601
|
-
return this._get(
|
|
5751
|
+
return this._get(
|
|
5752
|
+
`/connected-accounts/${pathSegment(accountId, "accountId")}/payout-schedule`,
|
|
5753
|
+
options
|
|
5754
|
+
);
|
|
5602
5755
|
}
|
|
5603
5756
|
async setPayoutSchedule(accountId, data, options) {
|
|
5604
|
-
return this.put(
|
|
5757
|
+
return this.put(
|
|
5758
|
+
`/connected-accounts/${pathSegment(accountId, "accountId")}/payout-schedule`,
|
|
5759
|
+
data,
|
|
5760
|
+
options
|
|
5761
|
+
);
|
|
5605
5762
|
}
|
|
5606
5763
|
// --------------------------------------------------------------------------
|
|
5607
5764
|
// Ledger
|
|
@@ -5812,7 +5969,7 @@ var AnalyticsService = class extends ServiceModule {
|
|
|
5812
5969
|
return this._get("/funnels");
|
|
5813
5970
|
}
|
|
5814
5971
|
async getFunnelConversions(id) {
|
|
5815
|
-
return this._get(`/funnels/${id}/conversions`);
|
|
5972
|
+
return this._get(`/funnels/${pathSegment(id, "id")}/conversions`);
|
|
5816
5973
|
}
|
|
5817
5974
|
// --------------------------------------------------------------------------
|
|
5818
5975
|
// Custom Metrics
|
|
@@ -5875,47 +6032,47 @@ var FlagsService = class extends ServiceModule {
|
|
|
5875
6032
|
);
|
|
5876
6033
|
}
|
|
5877
6034
|
async get(id, options) {
|
|
5878
|
-
return this._get(`/${id}`, options);
|
|
6035
|
+
return this._get(`/${pathSegment(id, "id")}`, options);
|
|
5879
6036
|
}
|
|
5880
6037
|
async create(data, params, options) {
|
|
5881
6038
|
const path = this.withQuery("", { application_id: params?.applicationId });
|
|
5882
6039
|
return this.post(path, data, options);
|
|
5883
6040
|
}
|
|
5884
6041
|
async update(id, data, options) {
|
|
5885
|
-
return this.patch(`/${id}`, data, options);
|
|
6042
|
+
return this.patch(`/${pathSegment(id, "id")}`, data, options);
|
|
5886
6043
|
}
|
|
5887
6044
|
async archive(id, options) {
|
|
5888
|
-
return this.del(`/${id}`, options);
|
|
6045
|
+
return this.del(`/${pathSegment(id, "id")}`, options);
|
|
5889
6046
|
}
|
|
5890
6047
|
async activate(id, options) {
|
|
5891
|
-
return this.post(`/${id}/activate`, void 0, options);
|
|
6048
|
+
return this.post(`/${pathSegment(id, "id")}/activate`, void 0, options);
|
|
5892
6049
|
}
|
|
5893
6050
|
async deactivate(id, options) {
|
|
5894
|
-
return this.post(`/${id}/deactivate`, void 0, options);
|
|
6051
|
+
return this.post(`/${pathSegment(id, "id")}/deactivate`, void 0, options);
|
|
5895
6052
|
}
|
|
5896
6053
|
async listRules(id, options) {
|
|
5897
|
-
return this._get(`/${id}/rules`, options);
|
|
6054
|
+
return this._get(`/${pathSegment(id, "id")}/rules`, options);
|
|
5898
6055
|
}
|
|
5899
6056
|
async createRule(id, data, options) {
|
|
5900
|
-
return this.post(`/${id}/rules`, data, options);
|
|
6057
|
+
return this.post(`/${pathSegment(id, "id")}/rules`, data, options);
|
|
5901
6058
|
}
|
|
5902
6059
|
async updateRule(id, data, options) {
|
|
5903
|
-
return this.patch(`/rules/${id}`, data, options);
|
|
6060
|
+
return this.patch(`/rules/${pathSegment(id, "id")}`, data, options);
|
|
5904
6061
|
}
|
|
5905
6062
|
async deleteRule(id, options) {
|
|
5906
|
-
return this.del(`/rules/${id}`, options);
|
|
6063
|
+
return this.del(`/rules/${pathSegment(id, "id")}`, options);
|
|
5907
6064
|
}
|
|
5908
6065
|
async listVariants(id, options) {
|
|
5909
|
-
return this._get(`/${id}/variants`, options);
|
|
6066
|
+
return this._get(`/${pathSegment(id, "id")}/variants`, options);
|
|
5910
6067
|
}
|
|
5911
6068
|
async createVariant(id, data, options) {
|
|
5912
|
-
return this.post(`/${id}/variants`, data, options);
|
|
6069
|
+
return this.post(`/${pathSegment(id, "id")}/variants`, data, options);
|
|
5913
6070
|
}
|
|
5914
6071
|
async updateVariant(id, data, options) {
|
|
5915
|
-
return this.patch(`/variants/${id}`, data, options);
|
|
6072
|
+
return this.patch(`/variants/${pathSegment(id, "id")}`, data, options);
|
|
5916
6073
|
}
|
|
5917
6074
|
async deleteVariant(id, options) {
|
|
5918
|
-
return this.del(`/variants/${id}`, options);
|
|
6075
|
+
return this.del(`/variants/${pathSegment(id, "id")}`, options);
|
|
5919
6076
|
}
|
|
5920
6077
|
async listSegments(params, options) {
|
|
5921
6078
|
return this._get(this.withQuery("/segments", { application_id: params?.applicationId }), options);
|
|
@@ -5928,19 +6085,23 @@ var FlagsService = class extends ServiceModule {
|
|
|
5928
6085
|
);
|
|
5929
6086
|
}
|
|
5930
6087
|
async updateSegment(id, data, options) {
|
|
5931
|
-
return this.patch(`/segments/${id}`, data, options);
|
|
6088
|
+
return this.patch(`/segments/${pathSegment(id, "id")}`, data, options);
|
|
5932
6089
|
}
|
|
5933
6090
|
async deleteSegment(id, options) {
|
|
5934
|
-
return this.del(`/segments/${id}`, options);
|
|
6091
|
+
return this.del(`/segments/${pathSegment(id, "id")}`, options);
|
|
5935
6092
|
}
|
|
5936
6093
|
async listEnvironments(id, options) {
|
|
5937
|
-
return this._get(`/${id}/environments`, options);
|
|
6094
|
+
return this._get(`/${pathSegment(id, "id")}/environments`, options);
|
|
5938
6095
|
}
|
|
5939
6096
|
async upsertEnvironment(id, environment, data, options) {
|
|
5940
|
-
return this.put(
|
|
6097
|
+
return this.put(
|
|
6098
|
+
`/${pathSegment(id, "id")}/environments/${pathSegment(environment, "environment")}`,
|
|
6099
|
+
data,
|
|
6100
|
+
options
|
|
6101
|
+
);
|
|
5941
6102
|
}
|
|
5942
6103
|
async listAudit(id, limit, options) {
|
|
5943
|
-
return this._get(this.withQuery(`/${id}/audit`, { limit }), options);
|
|
6104
|
+
return this._get(this.withQuery(`/${pathSegment(id, "id")}/audit`, { limit }), options);
|
|
5944
6105
|
}
|
|
5945
6106
|
};
|
|
5946
6107
|
|
|
@@ -5957,7 +6118,7 @@ var CommunicationService = class extends ServiceModule {
|
|
|
5957
6118
|
return this.post("/email/send", data, options);
|
|
5958
6119
|
}
|
|
5959
6120
|
async sendEmailTemplate(template, data, options) {
|
|
5960
|
-
return this.post(`/email/templates/${template}/send`, data, options);
|
|
6121
|
+
return this.post(`/email/templates/${pathSegment(template, "template")}/send`, data, options);
|
|
5961
6122
|
}
|
|
5962
6123
|
// --------------------------------------------------------------------------
|
|
5963
6124
|
// SMS
|
|
@@ -5966,7 +6127,7 @@ var CommunicationService = class extends ServiceModule {
|
|
|
5966
6127
|
return this.post("/sms/send", data, options);
|
|
5967
6128
|
}
|
|
5968
6129
|
async sendSmsTemplate(template, data, options) {
|
|
5969
|
-
return this.post(`/sms/templates/${template}/send`, data, options);
|
|
6130
|
+
return this.post(`/sms/templates/${pathSegment(template, "template")}/send`, data, options);
|
|
5970
6131
|
}
|
|
5971
6132
|
// --------------------------------------------------------------------------
|
|
5972
6133
|
// Push Notifications — Send
|
|
@@ -5982,20 +6143,20 @@ var CommunicationService = class extends ServiceModule {
|
|
|
5982
6143
|
}
|
|
5983
6144
|
/** @deprecated Use unregisterPushTokenById() for web push tokens */
|
|
5984
6145
|
async unregisterPushToken(token, options) {
|
|
5985
|
-
return this.del(`/push/tokens/${token}`, options);
|
|
6146
|
+
return this.del(`/push/tokens/${pathSegment(token, "token")}`, options);
|
|
5986
6147
|
}
|
|
5987
6148
|
async unregisterPushTokenById(id, options) {
|
|
5988
|
-
const result = await this.del(`/push/tokens/by-id/${id}`, options);
|
|
6149
|
+
const result = await this.del(`/push/tokens/by-id/${pathSegment(id, "id")}`, options);
|
|
5989
6150
|
if (result.data && typeof result.data === "object" && !("id" in result.data)) {
|
|
5990
6151
|
return { data: void 0, error: null };
|
|
5991
6152
|
}
|
|
5992
6153
|
return result;
|
|
5993
6154
|
}
|
|
5994
6155
|
async associatePushTokenUserById(id, options) {
|
|
5995
|
-
return this.put(`/push/tokens/by-id/${id}/user`, {}, options);
|
|
6156
|
+
return this.put(`/push/tokens/by-id/${pathSegment(id, "id")}/user`, {}, options);
|
|
5996
6157
|
}
|
|
5997
6158
|
async disassociatePushTokenUser(id, options) {
|
|
5998
|
-
const result = await this.del(`/push/tokens/by-id/${id}/user`, options);
|
|
6159
|
+
const result = await this.del(`/push/tokens/by-id/${pathSegment(id, "id")}/user`, options);
|
|
5999
6160
|
if (result.data && typeof result.data === "object" && !("id" in result.data)) {
|
|
6000
6161
|
return { data: void 0, error: null };
|
|
6001
6162
|
}
|
|
@@ -6014,10 +6175,10 @@ var CommunicationService = class extends ServiceModule {
|
|
|
6014
6175
|
return this._get("/push/topics", options);
|
|
6015
6176
|
}
|
|
6016
6177
|
async subscribeTopic(topicId, data, options) {
|
|
6017
|
-
return this.post(`/push/topics/${topicId}/subscribe`, data || {}, options);
|
|
6178
|
+
return this.post(`/push/topics/${pathSegment(topicId, "topicId")}/subscribe`, data || {}, options);
|
|
6018
6179
|
}
|
|
6019
6180
|
async unsubscribeTopic(topicId, options) {
|
|
6020
|
-
return this.del(`/push/topics/${topicId}/subscribe`, options);
|
|
6181
|
+
return this.del(`/push/topics/${pathSegment(topicId, "topicId")}/subscribe`, options);
|
|
6021
6182
|
}
|
|
6022
6183
|
async listSubscriptions(options) {
|
|
6023
6184
|
return this._get("/push/subscriptions", options);
|
|
@@ -6035,7 +6196,7 @@ var CommunicationService = class extends ServiceModule {
|
|
|
6035
6196
|
// Message Status
|
|
6036
6197
|
// --------------------------------------------------------------------------
|
|
6037
6198
|
async getMessageStatus(id, options) {
|
|
6038
|
-
return this._get(`/messages/${id}`, options);
|
|
6199
|
+
return this._get(`/messages/${pathSegment(id, "id")}`, options);
|
|
6039
6200
|
}
|
|
6040
6201
|
// --------------------------------------------------------------------------
|
|
6041
6202
|
// Legacy methods (backward compat)
|
|
@@ -6098,7 +6259,7 @@ var NotificationsService = class extends ServiceModule {
|
|
|
6098
6259
|
* Mark a single notification as read.
|
|
6099
6260
|
*/
|
|
6100
6261
|
async markRead(id, options) {
|
|
6101
|
-
return this.patch(`/${id}/read`, void 0, options);
|
|
6262
|
+
return this.patch(`/${pathSegment(id, "id")}/read`, void 0, options);
|
|
6102
6263
|
}
|
|
6103
6264
|
/**
|
|
6104
6265
|
* Mark all notifications as read.
|
|
@@ -6110,7 +6271,7 @@ var NotificationsService = class extends ServiceModule {
|
|
|
6110
6271
|
* Dismiss a notification (soft delete).
|
|
6111
6272
|
*/
|
|
6112
6273
|
async dismiss(id, options) {
|
|
6113
|
-
return this.del(`/${id}`, options);
|
|
6274
|
+
return this.del(`/${pathSegment(id, "id")}`, options);
|
|
6114
6275
|
}
|
|
6115
6276
|
};
|
|
6116
6277
|
|
|
@@ -6420,34 +6581,34 @@ var SchedulerService = class extends ServiceModule {
|
|
|
6420
6581
|
return this._list("/jobs", params, requestOptions);
|
|
6421
6582
|
}
|
|
6422
6583
|
async getJob(id, options) {
|
|
6423
|
-
return this._get(`/jobs/${id}`, options);
|
|
6584
|
+
return this._get(`/jobs/${pathSegment(id, "id")}`, options);
|
|
6424
6585
|
}
|
|
6425
6586
|
async updateJob(id, data, options) {
|
|
6426
|
-
return this.patch(`/jobs/${id}`, data, options);
|
|
6587
|
+
return this.patch(`/jobs/${pathSegment(id, "id")}`, data, options);
|
|
6427
6588
|
}
|
|
6428
6589
|
async deleteJob(id, options) {
|
|
6429
|
-
return this.del(`/jobs/${id}`, options);
|
|
6590
|
+
return this.del(`/jobs/${pathSegment(id, "id")}`, options);
|
|
6430
6591
|
}
|
|
6431
6592
|
// --------------------------------------------------------------------------
|
|
6432
6593
|
// Job Control
|
|
6433
6594
|
// --------------------------------------------------------------------------
|
|
6434
6595
|
async pauseJob(id, options) {
|
|
6435
|
-
return this.post(`/jobs/${id}/pause`, void 0, options);
|
|
6596
|
+
return this.post(`/jobs/${pathSegment(id, "id")}/pause`, void 0, options);
|
|
6436
6597
|
}
|
|
6437
6598
|
async resumeJob(id, options) {
|
|
6438
|
-
return this.post(`/jobs/${id}/resume`, void 0, options);
|
|
6599
|
+
return this.post(`/jobs/${pathSegment(id, "id")}/resume`, void 0, options);
|
|
6439
6600
|
}
|
|
6440
6601
|
async runNow(id, options) {
|
|
6441
|
-
return this.post(`/jobs/${id}/run-now`, void 0, options);
|
|
6602
|
+
return this.post(`/jobs/${pathSegment(id, "id")}/run-now`, void 0, options);
|
|
6442
6603
|
}
|
|
6443
6604
|
// --------------------------------------------------------------------------
|
|
6444
6605
|
// Execution History & Stats
|
|
6445
6606
|
// --------------------------------------------------------------------------
|
|
6446
6607
|
async getExecutions(jobId, params, requestOptions) {
|
|
6447
|
-
return this._list(`/jobs/${jobId}/executions`, params, requestOptions);
|
|
6608
|
+
return this._list(`/jobs/${pathSegment(jobId, "jobId")}/executions`, params, requestOptions);
|
|
6448
6609
|
}
|
|
6449
6610
|
async getStats(jobId, options) {
|
|
6450
|
-
return this._get(`/jobs/${jobId}/stats`, options);
|
|
6611
|
+
return this._get(`/jobs/${pathSegment(jobId, "jobId")}/stats`, options);
|
|
6451
6612
|
}
|
|
6452
6613
|
};
|
|
6453
6614
|
|
|
@@ -6470,7 +6631,7 @@ var DecisionsService = class extends ServiceModule {
|
|
|
6470
6631
|
*/
|
|
6471
6632
|
async evaluate(decisionKey, inputs, options, requestOptions) {
|
|
6472
6633
|
return this.post(
|
|
6473
|
-
`/evaluate/${
|
|
6634
|
+
`/evaluate/${pathSegment(decisionKey, "decisionKey")}`,
|
|
6474
6635
|
{ inputs, options: options ?? {} },
|
|
6475
6636
|
requestOptions
|
|
6476
6637
|
);
|
|
@@ -6481,12 +6642,12 @@ var DecisionsService = class extends ServiceModule {
|
|
|
6481
6642
|
}
|
|
6482
6643
|
/** Fetch a stored receipt (end users only see their own). */
|
|
6483
6644
|
async getReceipt(receiptId, requestOptions) {
|
|
6484
|
-
return this._get(`/receipts/${
|
|
6645
|
+
return this._get(`/receipts/${pathSegment(receiptId, "receiptId")}`, requestOptions);
|
|
6485
6646
|
}
|
|
6486
6647
|
/** Server-side verification of a stored receipt against the receipt ring. */
|
|
6487
6648
|
async verifyReceipt(receiptId, requestOptions) {
|
|
6488
6649
|
return this.post(
|
|
6489
|
-
`/receipts/${
|
|
6650
|
+
`/receipts/${pathSegment(receiptId, "receiptId")}/verify`,
|
|
6490
6651
|
void 0,
|
|
6491
6652
|
requestOptions
|
|
6492
6653
|
);
|
|
@@ -6515,6 +6676,13 @@ var AiService = class {
|
|
|
6515
6676
|
get runs() {
|
|
6516
6677
|
return this.ai.runs;
|
|
6517
6678
|
}
|
|
6679
|
+
/**
|
|
6680
|
+
* Operation selection: `list`, `setPreference`, `clearPreference`,
|
|
6681
|
+
* `getSettings`, `updateSettings`. Option keys only; never agent or model ids.
|
|
6682
|
+
*/
|
|
6683
|
+
get operations() {
|
|
6684
|
+
return this.ai.operations;
|
|
6685
|
+
}
|
|
6518
6686
|
/** Summarize text and wait for the typed result. */
|
|
6519
6687
|
summarize(input, options) {
|
|
6520
6688
|
return this.ai.summarize(input, options);
|
|
@@ -6536,7 +6704,7 @@ var BookingsService = class extends ServiceModule {
|
|
|
6536
6704
|
return this.post("/quotes", input, requestOptions);
|
|
6537
6705
|
}
|
|
6538
6706
|
async getQuote(quoteId, requestOptions) {
|
|
6539
|
-
return this._get(`/quotes/${
|
|
6707
|
+
return this._get(`/quotes/${pathSegment(quoteId, "quoteId")}`, requestOptions);
|
|
6540
6708
|
}
|
|
6541
6709
|
/**
|
|
6542
6710
|
* Accept a quote with a verified deposit receipt. Bookings re-verifies the
|
|
@@ -6544,15 +6712,15 @@ var BookingsService = class extends ServiceModule {
|
|
|
6544
6712
|
* and deposit on the quote.
|
|
6545
6713
|
*/
|
|
6546
6714
|
async acceptQuote(quoteId, input, requestOptions) {
|
|
6547
|
-
return this.post(`/quotes/${
|
|
6715
|
+
return this.post(`/quotes/${pathSegment(quoteId, "quoteId")}/accept`, input, requestOptions);
|
|
6548
6716
|
}
|
|
6549
6717
|
async getCustomerStats(customerRef, requestOptions) {
|
|
6550
|
-
return this._get(`/customers/${
|
|
6718
|
+
return this._get(`/customers/${pathSegment(customerRef, "customerRef")}/stats`, requestOptions);
|
|
6551
6719
|
}
|
|
6552
6720
|
/** Host/admin: mark a booking completed (maintains the customer stats projection). */
|
|
6553
6721
|
async completeBooking(bookingId, reason, requestOptions) {
|
|
6554
6722
|
return this.post(
|
|
6555
|
-
`/dashboard/bookings/${
|
|
6723
|
+
`/dashboard/bookings/${pathSegment(bookingId, "bookingId")}/complete`,
|
|
6556
6724
|
{ reason },
|
|
6557
6725
|
requestOptions
|
|
6558
6726
|
);
|
|
@@ -6560,7 +6728,7 @@ var BookingsService = class extends ServiceModule {
|
|
|
6560
6728
|
/** Host/admin: mark a booking as a no-show (maintains the customer stats projection). */
|
|
6561
6729
|
async markNoShow(bookingId, reason, requestOptions) {
|
|
6562
6730
|
return this.post(
|
|
6563
|
-
`/dashboard/bookings/${
|
|
6731
|
+
`/dashboard/bookings/${pathSegment(bookingId, "bookingId")}/no-show`,
|
|
6564
6732
|
{ reason },
|
|
6565
6733
|
requestOptions
|
|
6566
6734
|
);
|
|
@@ -6594,10 +6762,14 @@ var PermissionsService = class extends ServiceModule {
|
|
|
6594
6762
|
return this._get("/roles", options);
|
|
6595
6763
|
}
|
|
6596
6764
|
async assignPermissions(roleId, permissions, options) {
|
|
6597
|
-
return this.post(`/roles/${roleId}/permissions`, { permissions }, options);
|
|
6765
|
+
return this.post(`/roles/${pathSegment(roleId, "roleId")}/permissions`, { permissions }, options);
|
|
6598
6766
|
}
|
|
6599
6767
|
async assignRole(userId, roleId, options) {
|
|
6600
|
-
return this.post(
|
|
6768
|
+
return this.post(
|
|
6769
|
+
`/users/${pathSegment(userId, "userId")}/roles`,
|
|
6770
|
+
{ role_id: roleId },
|
|
6771
|
+
options
|
|
6772
|
+
);
|
|
6601
6773
|
}
|
|
6602
6774
|
// --------------------------------------------------------------------------
|
|
6603
6775
|
// Permission Checks (unified — supports both member and user identity types)
|
|
@@ -6636,7 +6808,7 @@ var PermissionsService = class extends ServiceModule {
|
|
|
6636
6808
|
return this._get(`/matrix?${params.toString()}`, options);
|
|
6637
6809
|
}
|
|
6638
6810
|
async getUserPermissions(userId, options) {
|
|
6639
|
-
return this._get(`/users/${userId}/permissions`, options);
|
|
6811
|
+
return this._get(`/users/${pathSegment(userId, "userId")}/permissions`, options);
|
|
6640
6812
|
}
|
|
6641
6813
|
// --------------------------------------------------------------------------
|
|
6642
6814
|
// Policies
|
|
@@ -6682,52 +6854,59 @@ var WorkspacesService = class extends ServiceModule {
|
|
|
6682
6854
|
return this._list("/mine", params, options);
|
|
6683
6855
|
}
|
|
6684
6856
|
async get(id, options) {
|
|
6685
|
-
return this._get(`/${id}`, options);
|
|
6857
|
+
return this._get(`/${pathSegment(id, "id")}`, options);
|
|
6686
6858
|
}
|
|
6687
6859
|
async update(id, data, options) {
|
|
6688
|
-
return this.patch(`/${id}`, data, options);
|
|
6860
|
+
return this.patch(`/${pathSegment(id, "id")}`, data, options);
|
|
6689
6861
|
}
|
|
6690
6862
|
async delete(id, options) {
|
|
6691
|
-
return this.del(`/${id}`, options);
|
|
6863
|
+
return this.del(`/${pathSegment(id, "id")}`, options);
|
|
6692
6864
|
}
|
|
6693
6865
|
// --------------------------------------------------------------------------
|
|
6694
6866
|
// Members
|
|
6695
6867
|
// --------------------------------------------------------------------------
|
|
6696
6868
|
async listMembers(workspaceId, params, requestOptions) {
|
|
6697
|
-
return this._list(`/${workspaceId}/members`, params, requestOptions);
|
|
6869
|
+
return this._list(`/${pathSegment(workspaceId, "workspaceId")}/members`, params, requestOptions);
|
|
6698
6870
|
}
|
|
6699
6871
|
async addMember(workspaceId, data, options) {
|
|
6700
|
-
return this.post(`/${workspaceId}/members`, data, options);
|
|
6872
|
+
return this.post(`/${pathSegment(workspaceId, "workspaceId")}/members`, data, options);
|
|
6701
6873
|
}
|
|
6702
6874
|
async updateMember(workspaceId, userId, data, options) {
|
|
6703
|
-
return this.patch(
|
|
6875
|
+
return this.patch(
|
|
6876
|
+
`/${pathSegment(workspaceId, "workspaceId")}/members/${pathSegment(userId, "userId")}`,
|
|
6877
|
+
data,
|
|
6878
|
+
options
|
|
6879
|
+
);
|
|
6704
6880
|
}
|
|
6705
6881
|
async removeMember(workspaceId, userId, options) {
|
|
6706
|
-
return this.del(
|
|
6882
|
+
return this.del(
|
|
6883
|
+
`/${pathSegment(workspaceId, "workspaceId")}/members/${pathSegment(userId, "userId")}`,
|
|
6884
|
+
options
|
|
6885
|
+
);
|
|
6707
6886
|
}
|
|
6708
6887
|
// --------------------------------------------------------------------------
|
|
6709
6888
|
// Invitations
|
|
6710
6889
|
// --------------------------------------------------------------------------
|
|
6711
6890
|
async invite(workspaceId, data, options) {
|
|
6712
|
-
return this.post(`/${workspaceId}/invitations`, data, options);
|
|
6891
|
+
return this.post(`/${pathSegment(workspaceId, "workspaceId")}/invitations`, data, options);
|
|
6713
6892
|
}
|
|
6714
6893
|
async listInvitations(workspaceId, options) {
|
|
6715
|
-
return this._get(`/${workspaceId}/invitations`, options);
|
|
6894
|
+
return this._get(`/${pathSegment(workspaceId, "workspaceId")}/invitations`, options);
|
|
6716
6895
|
}
|
|
6717
6896
|
async acceptInvitation(token, options) {
|
|
6718
|
-
return this.post(`/invitations/${token}/accept`, void 0, options);
|
|
6897
|
+
return this.post(`/invitations/${pathSegment(token, "token")}/accept`, void 0, options);
|
|
6719
6898
|
}
|
|
6720
6899
|
async cancelInvitation(id, options) {
|
|
6721
|
-
return this.del(`/invitations/${id}`, options);
|
|
6900
|
+
return this.del(`/invitations/${pathSegment(id, "id")}`, options);
|
|
6722
6901
|
}
|
|
6723
6902
|
// --------------------------------------------------------------------------
|
|
6724
6903
|
// SSO (workspace-only)
|
|
6725
6904
|
// --------------------------------------------------------------------------
|
|
6726
6905
|
async configureSso(workspaceId, data, options) {
|
|
6727
|
-
return this.post(`/${workspaceId}/sso/configure`, data, options);
|
|
6906
|
+
return this.post(`/${pathSegment(workspaceId, "workspaceId")}/sso/configure`, data, options);
|
|
6728
6907
|
}
|
|
6729
6908
|
async getSso(workspaceId, options) {
|
|
6730
|
-
return this._get(`/${workspaceId}/sso`, options);
|
|
6909
|
+
return this._get(`/${pathSegment(workspaceId, "workspaceId")}/sso`, options);
|
|
6731
6910
|
}
|
|
6732
6911
|
};
|
|
6733
6912
|
|
|
@@ -6750,43 +6929,50 @@ var TeamsService = class extends ServiceModule {
|
|
|
6750
6929
|
return this._list("/mine", params, options);
|
|
6751
6930
|
}
|
|
6752
6931
|
async get(id, options) {
|
|
6753
|
-
return this._get(`/${id}`, options);
|
|
6932
|
+
return this._get(`/${pathSegment(id, "id")}`, options);
|
|
6754
6933
|
}
|
|
6755
6934
|
async update(id, data, options) {
|
|
6756
|
-
return this.patch(`/${id}`, data, options);
|
|
6935
|
+
return this.patch(`/${pathSegment(id, "id")}`, data, options);
|
|
6757
6936
|
}
|
|
6758
6937
|
async delete(id, options) {
|
|
6759
|
-
return this.del(`/${id}`, options);
|
|
6938
|
+
return this.del(`/${pathSegment(id, "id")}`, options);
|
|
6760
6939
|
}
|
|
6761
6940
|
// --------------------------------------------------------------------------
|
|
6762
6941
|
// Members
|
|
6763
6942
|
// --------------------------------------------------------------------------
|
|
6764
6943
|
async listMembers(teamId, params, requestOptions) {
|
|
6765
|
-
return this._list(`/${teamId}/members`, params, requestOptions);
|
|
6944
|
+
return this._list(`/${pathSegment(teamId, "teamId")}/members`, params, requestOptions);
|
|
6766
6945
|
}
|
|
6767
6946
|
async addMember(teamId, data, options) {
|
|
6768
|
-
return this.post(`/${teamId}/members`, data, options);
|
|
6947
|
+
return this.post(`/${pathSegment(teamId, "teamId")}/members`, data, options);
|
|
6769
6948
|
}
|
|
6770
6949
|
async updateMember(teamId, userId, data, options) {
|
|
6771
|
-
return this.patch(
|
|
6950
|
+
return this.patch(
|
|
6951
|
+
`/${pathSegment(teamId, "teamId")}/members/${pathSegment(userId, "userId")}`,
|
|
6952
|
+
data,
|
|
6953
|
+
options
|
|
6954
|
+
);
|
|
6772
6955
|
}
|
|
6773
6956
|
async removeMember(teamId, userId, options) {
|
|
6774
|
-
return this.del(
|
|
6957
|
+
return this.del(
|
|
6958
|
+
`/${pathSegment(teamId, "teamId")}/members/${pathSegment(userId, "userId")}`,
|
|
6959
|
+
options
|
|
6960
|
+
);
|
|
6775
6961
|
}
|
|
6776
6962
|
// --------------------------------------------------------------------------
|
|
6777
6963
|
// Invitations
|
|
6778
6964
|
// --------------------------------------------------------------------------
|
|
6779
6965
|
async invite(teamId, data, options) {
|
|
6780
|
-
return this.post(`/${teamId}/invitations`, data, options);
|
|
6966
|
+
return this.post(`/${pathSegment(teamId, "teamId")}/invitations`, data, options);
|
|
6781
6967
|
}
|
|
6782
6968
|
async listInvitations(teamId, options) {
|
|
6783
|
-
return this._get(`/${teamId}/invitations`, options);
|
|
6969
|
+
return this._get(`/${pathSegment(teamId, "teamId")}/invitations`, options);
|
|
6784
6970
|
}
|
|
6785
6971
|
async acceptInvitation(token, options) {
|
|
6786
|
-
return this.post(`/invitations/${token}/accept`, void 0, options);
|
|
6972
|
+
return this.post(`/invitations/${pathSegment(token, "token")}/accept`, void 0, options);
|
|
6787
6973
|
}
|
|
6788
6974
|
async cancelInvitation(id, options) {
|
|
6789
|
-
return this.del(`/invitations/${id}`, options);
|
|
6975
|
+
return this.del(`/invitations/${pathSegment(id, "id")}`, options);
|
|
6790
6976
|
}
|
|
6791
6977
|
};
|
|
6792
6978
|
|
|
@@ -6800,22 +6986,31 @@ var GraphService = class extends ServiceModule {
|
|
|
6800
6986
|
return this.post("/nodes", data, requestOptions);
|
|
6801
6987
|
}
|
|
6802
6988
|
async updateNode(nodeId, data, requestOptions) {
|
|
6803
|
-
return this.patch(`/nodes/${nodeId}`, data, requestOptions);
|
|
6989
|
+
return this.patch(`/nodes/${pathSegment(nodeId, "nodeId")}`, data, requestOptions);
|
|
6804
6990
|
}
|
|
6805
6991
|
async createEdge(data, requestOptions) {
|
|
6806
6992
|
return this.post("/edges", data, requestOptions);
|
|
6807
6993
|
}
|
|
6808
6994
|
async getEdges(nodeId, options, requestOptions) {
|
|
6809
|
-
return this._get(
|
|
6995
|
+
return this._get(
|
|
6996
|
+
this.withQuery(`/nodes/${pathSegment(nodeId, "nodeId")}/edges`, options),
|
|
6997
|
+
requestOptions
|
|
6998
|
+
);
|
|
6810
6999
|
}
|
|
6811
7000
|
async traverse(nodeId, options, requestOptions) {
|
|
6812
|
-
return this._get(
|
|
7001
|
+
return this._get(
|
|
7002
|
+
this.withQuery(`/nodes/${pathSegment(nodeId, "nodeId")}/traverse`, options),
|
|
7003
|
+
requestOptions
|
|
7004
|
+
);
|
|
6813
7005
|
}
|
|
6814
7006
|
async shortestPath(options, requestOptions) {
|
|
6815
7007
|
return this.post("/shortest-path", options, requestOptions);
|
|
6816
7008
|
}
|
|
6817
7009
|
async neighbors(nodeId, options, requestOptions) {
|
|
6818
|
-
return this._get(
|
|
7010
|
+
return this._get(
|
|
7011
|
+
this.withQuery(`/nodes/${pathSegment(nodeId, "nodeId")}/neighbors`, options),
|
|
7012
|
+
requestOptions
|
|
7013
|
+
);
|
|
6819
7014
|
}
|
|
6820
7015
|
async pageRank(options, requestOptions) {
|
|
6821
7016
|
return this.post("/algorithms/pagerank", options, requestOptions);
|
|
@@ -6841,28 +7036,28 @@ var FunctionsService = class extends ServiceModule {
|
|
|
6841
7036
|
return this._get("", options);
|
|
6842
7037
|
}
|
|
6843
7038
|
async get(name, options) {
|
|
6844
|
-
return this._get(`/${name}`, options);
|
|
7039
|
+
return this._get(`/${pathSegment(name, "name")}`, options);
|
|
6845
7040
|
}
|
|
6846
7041
|
async update(name, data, options) {
|
|
6847
|
-
return this.patch(`/${name}`, data, options);
|
|
7042
|
+
return this.patch(`/${pathSegment(name, "name")}`, data, options);
|
|
6848
7043
|
}
|
|
6849
7044
|
async delete(name, options) {
|
|
6850
|
-
return this.del(`/${name}`, options);
|
|
7045
|
+
return this.del(`/${pathSegment(name, "name")}`, options);
|
|
6851
7046
|
}
|
|
6852
7047
|
async invoke(name, payload, options) {
|
|
6853
|
-
return this.post(`/${name}/invoke`, payload, options);
|
|
7048
|
+
return this.post(`/${pathSegment(name, "name")}/invoke`, payload, options);
|
|
6854
7049
|
}
|
|
6855
7050
|
async invokeAsync(name, payload, options) {
|
|
6856
|
-
return this.post(`/${name}/invoke-async`, payload, options);
|
|
7051
|
+
return this.post(`/${pathSegment(name, "name")}/invoke-async`, payload, options);
|
|
6857
7052
|
}
|
|
6858
7053
|
async getLogs(name, options) {
|
|
6859
|
-
return this._get(`/${name}/logs`, options);
|
|
7054
|
+
return this._get(`/${pathSegment(name, "name")}/logs`, options);
|
|
6860
7055
|
}
|
|
6861
7056
|
async getExecutions(name, params, requestOptions) {
|
|
6862
|
-
return this._list(`/${name}/executions`, params, requestOptions);
|
|
7057
|
+
return this._list(`/${pathSegment(name, "name")}/executions`, params, requestOptions);
|
|
6863
7058
|
}
|
|
6864
7059
|
async getMetrics(name, options) {
|
|
6865
|
-
return this._get(`/${name}/metrics`, options);
|
|
7060
|
+
return this._get(`/${pathSegment(name, "name")}/metrics`, options);
|
|
6866
7061
|
}
|
|
6867
7062
|
/** @deprecated Use deploy() instead */
|
|
6868
7063
|
async deployFunction(data) {
|
|
@@ -6884,13 +7079,13 @@ var ListingsService = class extends ServiceModule {
|
|
|
6884
7079
|
return this.post("", data, options);
|
|
6885
7080
|
}
|
|
6886
7081
|
async get(id, options) {
|
|
6887
|
-
return this._get(`/${id}`, options);
|
|
7082
|
+
return this._get(`/${pathSegment(id, "id")}`, options);
|
|
6888
7083
|
}
|
|
6889
7084
|
async update(id, data, options) {
|
|
6890
|
-
return this.patch(`/${id}`, data, options);
|
|
7085
|
+
return this.patch(`/${pathSegment(id, "id")}`, data, options);
|
|
6891
7086
|
}
|
|
6892
7087
|
async delete(id, options) {
|
|
6893
|
-
return this.del(`/${id}`, options);
|
|
7088
|
+
return this.del(`/${pathSegment(id, "id")}`, options);
|
|
6894
7089
|
}
|
|
6895
7090
|
async search(query, filters, options) {
|
|
6896
7091
|
return this._get(this.withQuery("/search", { query, ...filters }), options);
|
|
@@ -6899,19 +7094,19 @@ var ListingsService = class extends ServiceModule {
|
|
|
6899
7094
|
return this._get(this.withQuery("/nearby", nearbyOptions), options);
|
|
6900
7095
|
}
|
|
6901
7096
|
async getByCategory(category, params, requestOptions) {
|
|
6902
|
-
return this._list(`/categories/${category}`, params, requestOptions);
|
|
7097
|
+
return this._list(`/categories/${pathSegment(category, "category")}`, params, requestOptions);
|
|
6903
7098
|
}
|
|
6904
7099
|
async favorite(listingId, options) {
|
|
6905
|
-
return this.post(`/${listingId}/favorite`, void 0, options);
|
|
7100
|
+
return this.post(`/${pathSegment(listingId, "listingId")}/favorite`, void 0, options);
|
|
6906
7101
|
}
|
|
6907
7102
|
async unfavorite(listingId, options) {
|
|
6908
|
-
return this.del(`/${listingId}/favorite`, options);
|
|
7103
|
+
return this.del(`/${pathSegment(listingId, "listingId")}/favorite`, options);
|
|
6909
7104
|
}
|
|
6910
7105
|
async getFavorites(params, requestOptions) {
|
|
6911
7106
|
return this._list("/favorites", params, requestOptions);
|
|
6912
7107
|
}
|
|
6913
7108
|
async trackView(listingId, options) {
|
|
6914
|
-
return this.post(`/${listingId}/view`, void 0, options);
|
|
7109
|
+
return this.post(`/${pathSegment(listingId, "listingId")}/view`, void 0, options);
|
|
6915
7110
|
}
|
|
6916
7111
|
/** @deprecated Use create() instead */
|
|
6917
7112
|
async createListing(data) {
|
|
@@ -6928,7 +7123,7 @@ var ListingsService = class extends ServiceModule {
|
|
|
6928
7123
|
};
|
|
6929
7124
|
|
|
6930
7125
|
// src/services/community-maps.ts
|
|
6931
|
-
var segment = (value) =>
|
|
7126
|
+
var segment = (value) => pathSegment(value);
|
|
6932
7127
|
function devicePositionPayload(p) {
|
|
6933
7128
|
return {
|
|
6934
7129
|
latitude: p.latitude,
|
|
@@ -6962,7 +7157,7 @@ var CommunityMapsService = class extends ServiceModule {
|
|
|
6962
7157
|
}
|
|
6963
7158
|
listOwnSubmissions(slug, after, options) {
|
|
6964
7159
|
return this._get(
|
|
6965
|
-
"/collections/" + segment(slug) + "/submissions" + (after ? "?after=" +
|
|
7160
|
+
"/collections/" + segment(slug) + "/submissions" + (after ? "?after=" + encodeURIComponent(after) : ""),
|
|
6966
7161
|
options
|
|
6967
7162
|
);
|
|
6968
7163
|
}
|
|
@@ -7155,13 +7350,13 @@ var LocalIntelligenceService = class extends ServiceModule {
|
|
|
7155
7350
|
this.basePath = "/v1/news";
|
|
7156
7351
|
}
|
|
7157
7352
|
scope(publication) {
|
|
7158
|
-
return `/intelligence/publications/${
|
|
7353
|
+
return `/intelligence/publications/${pathSegment(publication, "publication")}`;
|
|
7159
7354
|
}
|
|
7160
7355
|
records(publication, params = {}, options) {
|
|
7161
7356
|
return this._get(this.withQuery(`${this.scope(publication)}/records`, params), options);
|
|
7162
7357
|
}
|
|
7163
7358
|
get(publication, record, options) {
|
|
7164
|
-
return this._get(`${this.scope(publication)}/records/${
|
|
7359
|
+
return this._get(`${this.scope(publication)}/records/${pathSegment(record, "record")}`, options);
|
|
7165
7360
|
}
|
|
7166
7361
|
changes(publication, params = {}, options) {
|
|
7167
7362
|
return this._get(this.withQuery(`${this.scope(publication)}/changes`, params), options);
|
|
@@ -7188,24 +7383,24 @@ var LocalIntelligenceService = class extends ServiceModule {
|
|
|
7188
7383
|
}
|
|
7189
7384
|
feedback(publication, record, recordRevision, outcome, options) {
|
|
7190
7385
|
return this.post(
|
|
7191
|
-
`${this.scope(publication)}/records/${
|
|
7386
|
+
`${this.scope(publication)}/records/${pathSegment(record, "record")}/feedback`,
|
|
7192
7387
|
{ record_revision: recordRevision, outcome },
|
|
7193
7388
|
options
|
|
7194
7389
|
);
|
|
7195
7390
|
}
|
|
7196
7391
|
deleteFeedback(publication, record, options) {
|
|
7197
|
-
return this.del(`${this.scope(publication)}/records/${
|
|
7392
|
+
return this.del(`${this.scope(publication)}/records/${pathSegment(record, "record")}/feedback`, options);
|
|
7198
7393
|
}
|
|
7199
7394
|
/** Requires a human editor with publication publish authority. */
|
|
7200
7395
|
release(publication, input, idempotencyKey, options) {
|
|
7201
|
-
return this.post(`/publications/${
|
|
7396
|
+
return this.post(`/publications/${pathSegment(publication, "publication")}/intelligence`, input, {
|
|
7202
7397
|
...options,
|
|
7203
7398
|
headers: { ...options?.headers, "idempotency-key": idempotencyKey }
|
|
7204
7399
|
});
|
|
7205
7400
|
}
|
|
7206
7401
|
withdraw(publication, record, expectedRevision, reason, options) {
|
|
7207
7402
|
return this.post(
|
|
7208
|
-
`/publications/${
|
|
7403
|
+
`/publications/${pathSegment(publication, "publication")}/intelligence/${pathSegment(record, "record")}/withdraw`,
|
|
7209
7404
|
{ expected_revision: expectedRevision, reason },
|
|
7210
7405
|
options
|
|
7211
7406
|
);
|
|
@@ -7252,29 +7447,29 @@ var PollsService = class extends ServiceModule {
|
|
|
7252
7447
|
return this._get(this.withQuery("/manage", params), options);
|
|
7253
7448
|
}
|
|
7254
7449
|
async get(id, options) {
|
|
7255
|
-
return this._get(`/manage/${
|
|
7450
|
+
return this._get(`/manage/${pathSegment(id, "id")}`, options);
|
|
7256
7451
|
}
|
|
7257
7452
|
async update(id, data, options) {
|
|
7258
|
-
return this.patch(`/manage/${
|
|
7453
|
+
return this.patch(`/manage/${pathSegment(id, "id")}`, data, options);
|
|
7259
7454
|
}
|
|
7260
7455
|
async publish(id, options) {
|
|
7261
|
-
return this.post(`/manage/${
|
|
7456
|
+
return this.post(`/manage/${pathSegment(id, "id")}/publish`, {}, options);
|
|
7262
7457
|
}
|
|
7263
7458
|
async close(id, options) {
|
|
7264
|
-
return this.post(`/manage/${
|
|
7459
|
+
return this.post(`/manage/${pathSegment(id, "id")}/close`, {}, options);
|
|
7265
7460
|
}
|
|
7266
7461
|
async listPublic(params, options) {
|
|
7267
7462
|
return this._get(this.withQuery("/public", params), options);
|
|
7268
7463
|
}
|
|
7269
7464
|
async getPublic(slug, params, options) {
|
|
7270
7465
|
return this._get(
|
|
7271
|
-
this.withQuery(`/public/${
|
|
7466
|
+
this.withQuery(`/public/${pathSegment(slug, "slug")}`, params),
|
|
7272
7467
|
options
|
|
7273
7468
|
);
|
|
7274
7469
|
}
|
|
7275
7470
|
async vote(slug, choiceId, voterKey, options) {
|
|
7276
7471
|
return this.post(
|
|
7277
|
-
`/public/${
|
|
7472
|
+
`/public/${pathSegment(slug, "slug")}/votes`,
|
|
7278
7473
|
{
|
|
7279
7474
|
choice_id: choiceId,
|
|
7280
7475
|
voter_key: voterKey
|
|
@@ -7315,28 +7510,28 @@ var EventsService = class extends ServiceModule {
|
|
|
7315
7510
|
return this.post("", data, options);
|
|
7316
7511
|
}
|
|
7317
7512
|
async get(eventId, options) {
|
|
7318
|
-
return this._get(`/${eventId}`, options);
|
|
7513
|
+
return this._get(`/${pathSegment(eventId, "eventId")}`, options);
|
|
7319
7514
|
}
|
|
7320
7515
|
async update(eventId, data, options) {
|
|
7321
|
-
return this.patch(`/${eventId}`, data, options);
|
|
7516
|
+
return this.patch(`/${pathSegment(eventId, "eventId")}`, data, options);
|
|
7322
7517
|
}
|
|
7323
7518
|
async delete(eventId, options) {
|
|
7324
|
-
return this.del(`/${eventId}`, options);
|
|
7519
|
+
return this.del(`/${pathSegment(eventId, "eventId")}`, options);
|
|
7325
7520
|
}
|
|
7326
7521
|
async list(filters, requestOptions) {
|
|
7327
7522
|
return this._list("", filters, requestOptions);
|
|
7328
7523
|
}
|
|
7329
7524
|
async register(eventId, options) {
|
|
7330
|
-
return this.post(`/${eventId}/register`, void 0, options);
|
|
7525
|
+
return this.post(`/${pathSegment(eventId, "eventId")}/register`, void 0, options);
|
|
7331
7526
|
}
|
|
7332
7527
|
async unregister(eventId, options) {
|
|
7333
|
-
return this.del(`/${eventId}/register`, options);
|
|
7528
|
+
return this.del(`/${pathSegment(eventId, "eventId")}/register`, options);
|
|
7334
7529
|
}
|
|
7335
7530
|
async getAttendees(eventId, params, requestOptions) {
|
|
7336
|
-
return this._list(`/${eventId}/attendees`, params, requestOptions);
|
|
7531
|
+
return this._list(`/${pathSegment(eventId, "eventId")}/attendees`, params, requestOptions);
|
|
7337
7532
|
}
|
|
7338
7533
|
async checkIn(eventId, options) {
|
|
7339
|
-
return this.post(`/${eventId}/check-in`, void 0, options);
|
|
7534
|
+
return this.post(`/${pathSegment(eventId, "eventId")}/check-in`, void 0, options);
|
|
7340
7535
|
}
|
|
7341
7536
|
/** @deprecated Use create() instead */
|
|
7342
7537
|
async createEvent(data) {
|
|
@@ -7358,22 +7553,38 @@ var LeaderboardService = class extends ServiceModule {
|
|
|
7358
7553
|
return this.post("", data, options);
|
|
7359
7554
|
}
|
|
7360
7555
|
async submitScore(boardId, data, options) {
|
|
7361
|
-
return this.post(`/${boardId}/scores`, data, options);
|
|
7556
|
+
return this.post(`/${pathSegment(boardId, "boardId")}/scores`, data, options);
|
|
7362
7557
|
}
|
|
7363
7558
|
async getRankings(boardId, rankingOptions, requestOptions) {
|
|
7364
|
-
return this._get(
|
|
7559
|
+
return this._get(
|
|
7560
|
+
this.withQuery(`/${pathSegment(boardId, "boardId")}/rankings`, rankingOptions),
|
|
7561
|
+
requestOptions
|
|
7562
|
+
);
|
|
7365
7563
|
}
|
|
7366
7564
|
async getUserRank(boardId, userId, options) {
|
|
7367
|
-
return this._get(
|
|
7565
|
+
return this._get(
|
|
7566
|
+
`/${pathSegment(boardId, "boardId")}/users/${pathSegment(userId, "userId")}/rank`,
|
|
7567
|
+
options
|
|
7568
|
+
);
|
|
7368
7569
|
}
|
|
7369
7570
|
async getUserHistory(boardId, userId, options) {
|
|
7370
|
-
return this._get(
|
|
7571
|
+
return this._get(
|
|
7572
|
+
`/${pathSegment(boardId, "boardId")}/users/${pathSegment(userId, "userId")}/history`,
|
|
7573
|
+
options
|
|
7574
|
+
);
|
|
7371
7575
|
}
|
|
7372
7576
|
async updateScore(boardId, userId, data, options) {
|
|
7373
|
-
return this.patch(
|
|
7577
|
+
return this.patch(
|
|
7578
|
+
`/${pathSegment(boardId, "boardId")}/users/${pathSegment(userId, "userId")}/score`,
|
|
7579
|
+
data,
|
|
7580
|
+
options
|
|
7581
|
+
);
|
|
7374
7582
|
}
|
|
7375
7583
|
async deleteScore(boardId, userId, options) {
|
|
7376
|
-
return this.del(
|
|
7584
|
+
return this.del(
|
|
7585
|
+
`/${pathSegment(boardId, "boardId")}/users/${pathSegment(userId, "userId")}/score`,
|
|
7586
|
+
options
|
|
7587
|
+
);
|
|
7377
7588
|
}
|
|
7378
7589
|
};
|
|
7379
7590
|
|
|
@@ -7390,13 +7601,13 @@ var WebhooksService = class extends ServiceModule {
|
|
|
7390
7601
|
return this._get("", options);
|
|
7391
7602
|
}
|
|
7392
7603
|
async get(id, options) {
|
|
7393
|
-
return this._get(`/${id}`, options);
|
|
7604
|
+
return this._get(`/${pathSegment(id, "id")}`, options);
|
|
7394
7605
|
}
|
|
7395
7606
|
async update(id, data, options) {
|
|
7396
|
-
return this.patch(`/${id}`, data, options);
|
|
7607
|
+
return this.patch(`/${pathSegment(id, "id")}`, data, options);
|
|
7397
7608
|
}
|
|
7398
7609
|
async delete(id, options) {
|
|
7399
|
-
return this.del(`/${id}`, options);
|
|
7610
|
+
return this.del(`/${pathSegment(id, "id")}`, options);
|
|
7400
7611
|
}
|
|
7401
7612
|
async listEvents(options) {
|
|
7402
7613
|
return this._get("/events", options);
|
|
@@ -7428,7 +7639,7 @@ var NewslettersService = class extends ServiceModule {
|
|
|
7428
7639
|
/** Signs a reader up. Call from the reader's browser so their own evidence is recorded. */
|
|
7429
7640
|
async subscribe(slug, input, options) {
|
|
7430
7641
|
return this.post(
|
|
7431
|
-
`/lists/${
|
|
7642
|
+
`/lists/${pathSegment(slug, "slug")}/subscriptions`,
|
|
7432
7643
|
{ channel: "email", ...input },
|
|
7433
7644
|
{ skipRetry: true, ...options }
|
|
7434
7645
|
);
|
|
@@ -7474,7 +7685,10 @@ var SearchService = class extends ServiceModule {
|
|
|
7474
7685
|
return this.post("/documents", { index: indexName, ...document2 }, options);
|
|
7475
7686
|
}
|
|
7476
7687
|
async removeDocument(indexName, docId, options) {
|
|
7477
|
-
return this.del(
|
|
7688
|
+
return this.del(
|
|
7689
|
+
`/documents/${pathSegment(indexName, "indexName")}/${pathSegment(docId, "docId")}`,
|
|
7690
|
+
options
|
|
7691
|
+
);
|
|
7478
7692
|
}
|
|
7479
7693
|
/** @deprecated Use query() instead */
|
|
7480
7694
|
async search(queryStr, options) {
|
|
@@ -7509,22 +7723,22 @@ var PhotoService = class extends ServiceModule {
|
|
|
7509
7723
|
});
|
|
7510
7724
|
}
|
|
7511
7725
|
async transform(photoId, transformations, options) {
|
|
7512
|
-
return this.post(`/${photoId}/transform`, transformations, options);
|
|
7726
|
+
return this.post(`/${pathSegment(photoId, "photoId")}/transform`, transformations, options);
|
|
7513
7727
|
}
|
|
7514
7728
|
async get(id, options) {
|
|
7515
|
-
return this._get(`/${id}`, options);
|
|
7729
|
+
return this._get(`/${pathSegment(id, "id")}`, options);
|
|
7516
7730
|
}
|
|
7517
7731
|
async delete(id, options) {
|
|
7518
|
-
return this.del(`/${id}`, options);
|
|
7732
|
+
return this.del(`/${pathSegment(id, "id")}`, options);
|
|
7519
7733
|
}
|
|
7520
7734
|
async getPresets(options) {
|
|
7521
7735
|
return this._get("/presets", options);
|
|
7522
7736
|
}
|
|
7523
7737
|
async getManifest(id, params, options) {
|
|
7524
|
-
return this._get(this.withQuery(`/${id}/manifest`, params), options);
|
|
7738
|
+
return this._get(this.withQuery(`/${pathSegment(id, "id")}/manifest`, params), options);
|
|
7525
7739
|
}
|
|
7526
7740
|
async getPublicManifest(id, params, options) {
|
|
7527
|
-
return this._get(this.withQuery(`/public/${id}/manifest`, params), options);
|
|
7741
|
+
return this._get(this.withQuery(`/public/${pathSegment(id, "id")}/manifest`, params), options);
|
|
7528
7742
|
}
|
|
7529
7743
|
/**
|
|
7530
7744
|
* Build an absolute URL for the on-demand transform endpoint.
|
|
@@ -7541,7 +7755,7 @@ var PhotoService = class extends ServiceModule {
|
|
|
7541
7755
|
if (options?.format) params.set("format", options.format);
|
|
7542
7756
|
if (options?.quality) params.set("quality", String(options.quality));
|
|
7543
7757
|
const qs = params.toString();
|
|
7544
|
-
return `${this.client.getBaseUrl()}${this.basePath}/${photoId}/transform${qs ? `?${qs}` : ""}`;
|
|
7758
|
+
return `${this.client.getBaseUrl()}${this.basePath}/${pathSegment(photoId, "photoId")}/transform${qs ? `?${qs}` : ""}`;
|
|
7545
7759
|
}
|
|
7546
7760
|
/**
|
|
7547
7761
|
* Build an absolute URL for the **public** transform endpoint —
|
|
@@ -7576,7 +7790,7 @@ var PhotoService = class extends ServiceModule {
|
|
|
7576
7790
|
if (options?.format) params.set("format", options.format);
|
|
7577
7791
|
if (options?.quality) params.set("quality", String(options.quality));
|
|
7578
7792
|
const qs = params.toString();
|
|
7579
|
-
return `${this.client.getBaseUrl()}${this.basePath}/public/${photoId}/transform${qs ? `?${qs}` : ""}`;
|
|
7793
|
+
return `${this.client.getBaseUrl()}${this.basePath}/public/${pathSegment(photoId, "photoId")}/transform${qs ? `?${qs}` : ""}`;
|
|
7580
7794
|
}
|
|
7581
7795
|
/**
|
|
7582
7796
|
* Get a transform URL optimized for the given display area.
|
|
@@ -7975,7 +8189,7 @@ var MediaService = class extends ServiceModule {
|
|
|
7975
8189
|
}
|
|
7976
8190
|
async releaseQuarantine(fileId, reason = "Released via @scalemule/sdk media.releaseQuarantine()", options) {
|
|
7977
8191
|
const response = await this.client.post(
|
|
7978
|
-
`/v1/storage/admin/files/${fileId}/scan-override`,
|
|
8192
|
+
`/v1/storage/admin/files/${pathSegment(fileId, "fileId")}/scan-override`,
|
|
7979
8193
|
{ scan_status: "clean", reason },
|
|
7980
8194
|
options
|
|
7981
8195
|
);
|
|
@@ -8453,7 +8667,7 @@ var TtsService = class extends ServiceModule {
|
|
|
8453
8667
|
);
|
|
8454
8668
|
}
|
|
8455
8669
|
async getJob(id, options) {
|
|
8456
|
-
return this._get(`/jobs/${id}`, options);
|
|
8670
|
+
return this._get(`/jobs/${pathSegment(id, "id")}`, options);
|
|
8457
8671
|
}
|
|
8458
8672
|
async listVoices(params, options) {
|
|
8459
8673
|
return this._get(this.withQuery("/voices", { provider: params?.provider }), options);
|
|
@@ -8470,13 +8684,13 @@ var DeadLetterApi = class extends ServiceModule {
|
|
|
8470
8684
|
return this._get("", options);
|
|
8471
8685
|
}
|
|
8472
8686
|
async get(id, options) {
|
|
8473
|
-
return this._get(`/${id}`, options);
|
|
8687
|
+
return this._get(`/${pathSegment(id, "id")}`, options);
|
|
8474
8688
|
}
|
|
8475
8689
|
async retry(id, options) {
|
|
8476
|
-
return this.post(`/${id}/retry`, void 0, options);
|
|
8690
|
+
return this.post(`/${pathSegment(id, "id")}/retry`, void 0, options);
|
|
8477
8691
|
}
|
|
8478
8692
|
async delete(id, options) {
|
|
8479
|
-
return this.del(`/${id}`, options);
|
|
8693
|
+
return this.del(`/${pathSegment(id, "id")}`, options);
|
|
8480
8694
|
}
|
|
8481
8695
|
};
|
|
8482
8696
|
var QueueService = class extends ServiceModule {
|
|
@@ -8489,7 +8703,7 @@ var QueueService = class extends ServiceModule {
|
|
|
8489
8703
|
return this.post("/jobs", data, options);
|
|
8490
8704
|
}
|
|
8491
8705
|
async getJob(id, options) {
|
|
8492
|
-
return this._get(`/jobs/${id}`, options);
|
|
8706
|
+
return this._get(`/jobs/${pathSegment(id, "id")}`, options);
|
|
8493
8707
|
}
|
|
8494
8708
|
};
|
|
8495
8709
|
|
|
@@ -8500,13 +8714,13 @@ var CacheService = class extends ServiceModule {
|
|
|
8500
8714
|
this.basePath = "/v1/cache";
|
|
8501
8715
|
}
|
|
8502
8716
|
async get(key, options) {
|
|
8503
|
-
return this._get(`/${key}`, options);
|
|
8717
|
+
return this._get(`/${pathSegment(key, "key")}`, options);
|
|
8504
8718
|
}
|
|
8505
8719
|
async set(key, value, ttl, options) {
|
|
8506
8720
|
return this.post("", { key, value, ttl }, options);
|
|
8507
8721
|
}
|
|
8508
8722
|
async delete(key, options) {
|
|
8509
|
-
return this.del(`/${key}`, options);
|
|
8723
|
+
return this.del(`/${pathSegment(key, "key")}`, options);
|
|
8510
8724
|
}
|
|
8511
8725
|
async flush(options) {
|
|
8512
8726
|
return this.del("", options);
|
|
@@ -8558,10 +8772,10 @@ var ComplianceService = class extends ServiceModule {
|
|
|
8558
8772
|
return this.post("/consent/v2", data, options);
|
|
8559
8773
|
}
|
|
8560
8774
|
async getUserConsents(userId, options) {
|
|
8561
|
-
return this._get(`/consent/v2/${userId}`, options);
|
|
8775
|
+
return this._get(`/consent/v2/${pathSegment(userId, "userId")}`, options);
|
|
8562
8776
|
}
|
|
8563
8777
|
async withdrawConsent(consentId, data, options) {
|
|
8564
|
-
return this.put(`/consent/v2/${consentId}/withdraw`, data || {}, options);
|
|
8778
|
+
return this.put(`/consent/v2/${pathSegment(consentId, "consentId")}/withdraw`, data || {}, options);
|
|
8565
8779
|
}
|
|
8566
8780
|
// --- Data Subject Requests ---
|
|
8567
8781
|
async createDataSubjectRequest(data, options) {
|
|
@@ -8571,16 +8785,16 @@ var ComplianceService = class extends ServiceModule {
|
|
|
8571
8785
|
return this._get(`/dsr${this.qs(params)}`, requestOptions);
|
|
8572
8786
|
}
|
|
8573
8787
|
async getDataSubjectRequest(id, options) {
|
|
8574
|
-
return this._get(`/dsr/${id}`, options);
|
|
8788
|
+
return this._get(`/dsr/${pathSegment(id, "id")}`, options);
|
|
8575
8789
|
}
|
|
8576
8790
|
async updateDsrStatus(id, data, options) {
|
|
8577
|
-
return this.put(`/dsr/${id}/status`, data, options);
|
|
8791
|
+
return this.put(`/dsr/${pathSegment(id, "id")}/status`, data, options);
|
|
8578
8792
|
}
|
|
8579
8793
|
async createDsrAction(dsrId, data, options) {
|
|
8580
|
-
return this.post(`/dsr/${dsrId}/actions`, data, options);
|
|
8794
|
+
return this.post(`/dsr/${pathSegment(dsrId, "dsrId")}/actions`, data, options);
|
|
8581
8795
|
}
|
|
8582
8796
|
async listDsrActions(dsrId, options) {
|
|
8583
|
-
return this._get(`/dsr/${dsrId}/actions`, options);
|
|
8797
|
+
return this._get(`/dsr/${pathSegment(dsrId, "dsrId")}/actions`, options);
|
|
8584
8798
|
}
|
|
8585
8799
|
// --- Data Breaches ---
|
|
8586
8800
|
async reportBreach(data, options) {
|
|
@@ -8590,10 +8804,10 @@ var ComplianceService = class extends ServiceModule {
|
|
|
8590
8804
|
return this._get(`/breaches${this.qs(params)}`, requestOptions);
|
|
8591
8805
|
}
|
|
8592
8806
|
async getBreach(id, options) {
|
|
8593
|
-
return this._get(`/breaches/${id}`, options);
|
|
8807
|
+
return this._get(`/breaches/${pathSegment(id, "id")}`, options);
|
|
8594
8808
|
}
|
|
8595
8809
|
async updateBreach(id, data, options) {
|
|
8596
|
-
return this.put(`/breaches/${id}`, data, options);
|
|
8810
|
+
return this.put(`/breaches/${pathSegment(id, "id")}`, data, options);
|
|
8597
8811
|
}
|
|
8598
8812
|
// --- Retention Policies ---
|
|
8599
8813
|
async listRetentionPolicies(options) {
|
|
@@ -8610,10 +8824,10 @@ var ComplianceService = class extends ServiceModule {
|
|
|
8610
8824
|
return this._get(`/processing-activities${this.qs(params)}`, requestOptions);
|
|
8611
8825
|
}
|
|
8612
8826
|
async getProcessingActivity(id, options) {
|
|
8613
|
-
return this._get(`/processing-activities/${id}`, options);
|
|
8827
|
+
return this._get(`/processing-activities/${pathSegment(id, "id")}`, options);
|
|
8614
8828
|
}
|
|
8615
8829
|
async updateProcessingActivity(id, data, options) {
|
|
8616
|
-
return this.put(`/processing-activities/${id}`, data, options);
|
|
8830
|
+
return this.put(`/processing-activities/${pathSegment(id, "id")}`, data, options);
|
|
8617
8831
|
}
|
|
8618
8832
|
};
|
|
8619
8833
|
|
|
@@ -8627,10 +8841,10 @@ var OrchestratorService = class extends ServiceModule {
|
|
|
8627
8841
|
return this.post("/workflows", data, options);
|
|
8628
8842
|
}
|
|
8629
8843
|
async execute(workflowId, input, options) {
|
|
8630
|
-
return this.post(`/workflows/${workflowId}/execute`, input, options);
|
|
8844
|
+
return this.post(`/workflows/${pathSegment(workflowId, "workflowId")}/execute`, input, options);
|
|
8631
8845
|
}
|
|
8632
8846
|
async getExecution(executionId, options) {
|
|
8633
|
-
return this._get(`/executions/${executionId}`, options);
|
|
8847
|
+
return this._get(`/executions/${pathSegment(executionId, "executionId")}`, options);
|
|
8634
8848
|
}
|
|
8635
8849
|
/** @deprecated Use execute() instead */
|
|
8636
8850
|
async executeWorkflow(workflowId, input) {
|
|
@@ -8671,7 +8885,7 @@ var IdentityService = class extends ServiceModule {
|
|
|
8671
8885
|
return this._get("/api-keys", options);
|
|
8672
8886
|
}
|
|
8673
8887
|
async revokeApiKey(id, options) {
|
|
8674
|
-
return this.del(`/api-keys/${id}`, options);
|
|
8888
|
+
return this.del(`/api-keys/${pathSegment(id, "id")}`, options);
|
|
8675
8889
|
}
|
|
8676
8890
|
/**
|
|
8677
8891
|
* Explicitly link an anonymous_id to the current authenticated user.
|
|
@@ -8697,7 +8911,7 @@ var CatalogService = class extends ServiceModule {
|
|
|
8697
8911
|
return this._get("/services", options);
|
|
8698
8912
|
}
|
|
8699
8913
|
async getServiceHealth(name, options) {
|
|
8700
|
-
return this._get(`/services/${name}/health`, options);
|
|
8914
|
+
return this._get(`/services/${pathSegment(name, "name")}/health`, options);
|
|
8701
8915
|
}
|
|
8702
8916
|
};
|
|
8703
8917
|
|
|
@@ -8714,13 +8928,13 @@ var FlagContentService = class extends ServiceModule {
|
|
|
8714
8928
|
return this._get(this.withQuery("/flags/check", params), requestOptions);
|
|
8715
8929
|
}
|
|
8716
8930
|
async getFlag(id, options) {
|
|
8717
|
-
return this._get(`/flags/${id}`, options);
|
|
8931
|
+
return this._get(`/flags/${pathSegment(id, "id")}`, options);
|
|
8718
8932
|
}
|
|
8719
8933
|
async submitAppeal(data, options) {
|
|
8720
8934
|
return this.post("/appeals", data, options);
|
|
8721
8935
|
}
|
|
8722
8936
|
async getAppeal(id, options) {
|
|
8723
|
-
return this._get(`/appeals/${id}`, options);
|
|
8937
|
+
return this._get(`/appeals/${pathSegment(id, "id")}`, options);
|
|
8724
8938
|
}
|
|
8725
8939
|
};
|
|
8726
8940
|
|
|
@@ -8736,11 +8950,11 @@ var CreatorMakerService = class extends ServiceModule {
|
|
|
8736
8950
|
}
|
|
8737
8951
|
/** Get a generation job by ID. */
|
|
8738
8952
|
async getJob(jobId, options) {
|
|
8739
|
-
return this._get(`/jobs/${jobId}`, options);
|
|
8953
|
+
return this._get(`/jobs/${pathSegment(jobId, "jobId")}`, options);
|
|
8740
8954
|
}
|
|
8741
8955
|
/** Long-poll for job completion (server holds up to 30s). */
|
|
8742
8956
|
async pollJob(jobId, options) {
|
|
8743
|
-
return this._get(`/jobs/${jobId}/poll`, {
|
|
8957
|
+
return this._get(`/jobs/${pathSegment(jobId, "jobId")}/poll`, {
|
|
8744
8958
|
...options,
|
|
8745
8959
|
timeout: 35e3
|
|
8746
8960
|
});
|
|
@@ -8751,15 +8965,15 @@ var CreatorMakerService = class extends ServiceModule {
|
|
|
8751
8965
|
}
|
|
8752
8966
|
/** Cancel a pending or queued job. */
|
|
8753
8967
|
async cancelJob(jobId, options) {
|
|
8754
|
-
return this.post(`/jobs/${jobId}/cancel`, void 0, options);
|
|
8968
|
+
return this.post(`/jobs/${pathSegment(jobId, "jobId")}/cancel`, void 0, options);
|
|
8755
8969
|
}
|
|
8756
8970
|
/** Retry a failed job. */
|
|
8757
8971
|
async retryJob(jobId, options) {
|
|
8758
|
-
return this.post(`/jobs/${jobId}/retry`, void 0, options);
|
|
8972
|
+
return this.post(`/jobs/${pathSegment(jobId, "jobId")}/retry`, void 0, options);
|
|
8759
8973
|
}
|
|
8760
8974
|
/** Generate variations of a completed job. */
|
|
8761
8975
|
async generateVariations(jobId, options) {
|
|
8762
|
-
return this.post(`/jobs/${jobId}/variations`, void 0, options);
|
|
8976
|
+
return this.post(`/jobs/${pathSegment(jobId, "jobId")}/variations`, void 0, options);
|
|
8763
8977
|
}
|
|
8764
8978
|
/** List available style presets, optionally filtered by mode. */
|
|
8765
8979
|
async listPresets(params, options) {
|
|
@@ -8767,7 +8981,7 @@ var CreatorMakerService = class extends ServiceModule {
|
|
|
8767
8981
|
}
|
|
8768
8982
|
/** Get a style preset by slug. */
|
|
8769
8983
|
async getPreset(slug, options) {
|
|
8770
|
-
return this._get(`/presets/${slug}`, options);
|
|
8984
|
+
return this._get(`/presets/${pathSegment(slug, "slug")}`, options);
|
|
8771
8985
|
}
|
|
8772
8986
|
/** Create a project. */
|
|
8773
8987
|
async createProject(data, options) {
|
|
@@ -8783,11 +8997,11 @@ var CreatorMakerService = class extends ServiceModule {
|
|
|
8783
8997
|
}
|
|
8784
8998
|
/** Get a generation output by ID. */
|
|
8785
8999
|
async getOutput(outputId, options) {
|
|
8786
|
-
return this._get(`/outputs/${outputId}`, options);
|
|
9000
|
+
return this._get(`/outputs/${pathSegment(outputId, "outputId")}`, options);
|
|
8787
9001
|
}
|
|
8788
9002
|
/** Get a download URL for a generation output. */
|
|
8789
9003
|
async getDownloadUrl(outputId, options) {
|
|
8790
|
-
return this._get(`/outputs/${outputId}/download`, options);
|
|
9004
|
+
return this._get(`/outputs/${pathSegment(outputId, "outputId")}/download`, options);
|
|
8791
9005
|
}
|
|
8792
9006
|
};
|
|
8793
9007
|
|
|
@@ -8807,10 +9021,10 @@ var AgentAuthService = class extends ServiceModule {
|
|
|
8807
9021
|
return this.post("/agent-tokens", data, options);
|
|
8808
9022
|
}
|
|
8809
9023
|
async revokeToken(id, options) {
|
|
8810
|
-
return this.del(`/agent-tokens/${id}`, options);
|
|
9024
|
+
return this.del(`/agent-tokens/${pathSegment(id, "id")}`, options);
|
|
8811
9025
|
}
|
|
8812
9026
|
async rotateToken(id, options) {
|
|
8813
|
-
return this.post(`/agent-tokens/${id}/rotate`, void 0, options);
|
|
9027
|
+
return this.post(`/agent-tokens/${pathSegment(id, "id")}/rotate`, void 0, options);
|
|
8814
9028
|
}
|
|
8815
9029
|
async exchangeToken(data, options) {
|
|
8816
9030
|
return this.post("/agent-tokens/exchange", data, options);
|
|
@@ -8822,7 +9036,7 @@ var AgentAuthService = class extends ServiceModule {
|
|
|
8822
9036
|
return this.post("/agent-signing-keys", data, options);
|
|
8823
9037
|
}
|
|
8824
9038
|
async revokeSigningKey(id, options) {
|
|
8825
|
-
return this.del(`/agent-signing-keys/${id}`, options);
|
|
9039
|
+
return this.del(`/agent-signing-keys/${pathSegment(id, "id")}`, options);
|
|
8826
9040
|
}
|
|
8827
9041
|
async getProfile(options) {
|
|
8828
9042
|
return this._get("/agent-profile", options);
|
|
@@ -8831,10 +9045,10 @@ var AgentAuthService = class extends ServiceModule {
|
|
|
8831
9045
|
return this.patch("/agent-profile", data, options);
|
|
8832
9046
|
}
|
|
8833
9047
|
async getSecurityPolicy(appId, options) {
|
|
8834
|
-
return this._get(`/applications/${appId}/agent-security`, options);
|
|
9048
|
+
return this._get(`/applications/${pathSegment(appId, "appId")}/agent-security`, options);
|
|
8835
9049
|
}
|
|
8836
9050
|
async updateSecurityPolicy(appId, data, options) {
|
|
8837
|
-
return this.put(`/applications/${appId}/agent-security`, data, options);
|
|
9051
|
+
return this.put(`/applications/${pathSegment(appId, "appId")}/agent-security`, data, options);
|
|
8838
9052
|
}
|
|
8839
9053
|
};
|
|
8840
9054
|
|
|
@@ -8849,7 +9063,7 @@ var AgentsService = class extends ServiceModule {
|
|
|
8849
9063
|
return this.post("/register-agent", data, options);
|
|
8850
9064
|
}
|
|
8851
9065
|
async deactivateAgent(id, options) {
|
|
8852
|
-
return this.post(`/agents/${id}/deactivate`, void 0, options);
|
|
9066
|
+
return this.post(`/agents/${pathSegment(id, "id")}/deactivate`, void 0, options);
|
|
8853
9067
|
}
|
|
8854
9068
|
// Agent CRUD
|
|
8855
9069
|
async create(data, options) {
|
|
@@ -8859,16 +9073,16 @@ var AgentsService = class extends ServiceModule {
|
|
|
8859
9073
|
return this._list("/agents", params, options);
|
|
8860
9074
|
}
|
|
8861
9075
|
async get(id, options) {
|
|
8862
|
-
return this._get(`/agents/${id}`, options);
|
|
9076
|
+
return this._get(`/agents/${pathSegment(id, "id")}`, options);
|
|
8863
9077
|
}
|
|
8864
9078
|
async update(id, data, options) {
|
|
8865
|
-
return this.patch(`/agents/${id}`, data, options);
|
|
9079
|
+
return this.patch(`/agents/${pathSegment(id, "id")}`, data, options);
|
|
8866
9080
|
}
|
|
8867
9081
|
async remove(id, options) {
|
|
8868
|
-
return this.del(`/agents/${id}`, options);
|
|
9082
|
+
return this.del(`/agents/${pathSegment(id, "id")}`, options);
|
|
8869
9083
|
}
|
|
8870
9084
|
async setDefaultWorkspace(id, data, options) {
|
|
8871
|
-
return this.post(`/agents/${id}/set-default-workspace`, data, options);
|
|
9085
|
+
return this.post(`/agents/${pathSegment(id, "id")}/set-default-workspace`, data, options);
|
|
8872
9086
|
}
|
|
8873
9087
|
// Runtime Templates
|
|
8874
9088
|
async createTemplate(data, options) {
|
|
@@ -8879,15 +9093,15 @@ var AgentsService = class extends ServiceModule {
|
|
|
8879
9093
|
}
|
|
8880
9094
|
async getTemplate(id, options) {
|
|
8881
9095
|
return this._get(
|
|
8882
|
-
`/runtime-templates/${id}`,
|
|
9096
|
+
`/runtime-templates/${pathSegment(id, "id")}`,
|
|
8883
9097
|
options
|
|
8884
9098
|
);
|
|
8885
9099
|
}
|
|
8886
9100
|
async createTemplateVersion(id, data, options) {
|
|
8887
|
-
return this.post(`/runtime-templates/${id}/versions`, data, options);
|
|
9101
|
+
return this.post(`/runtime-templates/${pathSegment(id, "id")}/versions`, data, options);
|
|
8888
9102
|
}
|
|
8889
9103
|
async listTemplateVersions(id, options) {
|
|
8890
|
-
return this._get(`/runtime-templates/${id}/versions`, options);
|
|
9104
|
+
return this._get(`/runtime-templates/${pathSegment(id, "id")}/versions`, options);
|
|
8891
9105
|
}
|
|
8892
9106
|
// Workspaces
|
|
8893
9107
|
async createWorkspace(data, options) {
|
|
@@ -8897,13 +9111,13 @@ var AgentsService = class extends ServiceModule {
|
|
|
8897
9111
|
return this._list("/workspaces", params, options);
|
|
8898
9112
|
}
|
|
8899
9113
|
async getWorkspace(id, options) {
|
|
8900
|
-
return this._get(`/workspaces/${id}`, options);
|
|
9114
|
+
return this._get(`/workspaces/${pathSegment(id, "id")}`, options);
|
|
8901
9115
|
}
|
|
8902
9116
|
async updateWorkspace(id, data, options) {
|
|
8903
|
-
return this.patch(`/workspaces/${id}`, data, options);
|
|
9117
|
+
return this.patch(`/workspaces/${pathSegment(id, "id")}`, data, options);
|
|
8904
9118
|
}
|
|
8905
9119
|
async addOsAccount(workspaceId, data, options) {
|
|
8906
|
-
return this.post(`/workspaces/${workspaceId}/os-accounts`, data, options);
|
|
9120
|
+
return this.post(`/workspaces/${pathSegment(workspaceId, "workspaceId")}/os-accounts`, data, options);
|
|
8907
9121
|
}
|
|
8908
9122
|
};
|
|
8909
9123
|
|
|
@@ -8924,49 +9138,66 @@ var AgentProjectsService = class extends ServiceModule {
|
|
|
8924
9138
|
return this._list("/projects", params, options);
|
|
8925
9139
|
}
|
|
8926
9140
|
async getProject(id, applicationId, options) {
|
|
8927
|
-
return this._get(this.withAppId(`/projects/${id}`, applicationId), options);
|
|
9141
|
+
return this._get(this.withAppId(`/projects/${pathSegment(id, "id")}`, applicationId), options);
|
|
8928
9142
|
}
|
|
8929
9143
|
async updateProject(id, data, applicationId, options) {
|
|
8930
|
-
return this.patch(this.withAppId(`/projects/${id}`, applicationId), data, options);
|
|
9144
|
+
return this.patch(this.withAppId(`/projects/${pathSegment(id, "id")}`, applicationId), data, options);
|
|
8931
9145
|
}
|
|
8932
9146
|
// Members (use auth user_id)
|
|
8933
9147
|
async addMember(projectId, data, applicationId, options) {
|
|
8934
|
-
return this.post(
|
|
9148
|
+
return this.post(
|
|
9149
|
+
this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/members`, applicationId),
|
|
9150
|
+
data,
|
|
9151
|
+
options
|
|
9152
|
+
);
|
|
8935
9153
|
}
|
|
8936
9154
|
async listMembers(projectId, params, options) {
|
|
8937
9155
|
const qs = {};
|
|
8938
9156
|
if (params?.application_id) qs.application_id = params.application_id;
|
|
8939
9157
|
if (params?.hydrate) qs.hydrate = "true";
|
|
8940
|
-
const path = Object.keys(qs).length ? this.withQuery(`/projects/${projectId}/members`, qs) : `/projects/${projectId}/members`;
|
|
9158
|
+
const path = Object.keys(qs).length ? this.withQuery(`/projects/${pathSegment(projectId, "projectId")}/members`, qs) : `/projects/${pathSegment(projectId, "projectId")}/members`;
|
|
8941
9159
|
const result = await this._get(path, options);
|
|
8942
9160
|
return { data: result.data?.members ?? [], error: result.error };
|
|
8943
9161
|
}
|
|
8944
9162
|
async updateMember(projectId, userId, data, applicationId, options) {
|
|
8945
9163
|
return this.patch(
|
|
8946
|
-
this.withAppId(
|
|
9164
|
+
this.withAppId(
|
|
9165
|
+
`/projects/${pathSegment(projectId, "projectId")}/members/${pathSegment(userId, "userId")}`,
|
|
9166
|
+
applicationId
|
|
9167
|
+
),
|
|
8947
9168
|
data,
|
|
8948
9169
|
options
|
|
8949
9170
|
);
|
|
8950
9171
|
}
|
|
8951
9172
|
async removeMember(projectId, userId, applicationId, options) {
|
|
8952
|
-
return this.del(
|
|
9173
|
+
return this.del(
|
|
9174
|
+
this.withAppId(
|
|
9175
|
+
`/projects/${pathSegment(projectId, "projectId")}/members/${pathSegment(userId, "userId")}`,
|
|
9176
|
+
applicationId
|
|
9177
|
+
),
|
|
9178
|
+
options
|
|
9179
|
+
);
|
|
8953
9180
|
}
|
|
8954
9181
|
// Tasks
|
|
8955
9182
|
async createTask(projectId, data, applicationId, options) {
|
|
8956
|
-
return this.post(
|
|
9183
|
+
return this.post(
|
|
9184
|
+
this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/tasks`, applicationId),
|
|
9185
|
+
data,
|
|
9186
|
+
options
|
|
9187
|
+
);
|
|
8957
9188
|
}
|
|
8958
9189
|
async listTasks(projectId, params, options) {
|
|
8959
|
-
return this._list(`/projects/${projectId}/tasks`, params, options);
|
|
9190
|
+
return this._list(`/projects/${pathSegment(projectId, "projectId")}/tasks`, params, options);
|
|
8960
9191
|
}
|
|
8961
9192
|
async getTask(id, applicationId, options) {
|
|
8962
|
-
return this._get(this.withAppId(`/tasks/${id}`, applicationId), options);
|
|
9193
|
+
return this._get(this.withAppId(`/tasks/${pathSegment(id, "id")}`, applicationId), options);
|
|
8963
9194
|
}
|
|
8964
9195
|
async updateTask(id, data, applicationId, options) {
|
|
8965
|
-
return this.patch(this.withAppId(`/tasks/${id}`, applicationId), data, options);
|
|
9196
|
+
return this.patch(this.withAppId(`/tasks/${pathSegment(id, "id")}`, applicationId), data, options);
|
|
8966
9197
|
}
|
|
8967
9198
|
async reorderTasks(projectId, taskIds, applicationId, options) {
|
|
8968
9199
|
return this.post(
|
|
8969
|
-
this.withAppId(`/projects/${projectId}/tasks/reorder`, applicationId),
|
|
9200
|
+
this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/tasks/reorder`, applicationId),
|
|
8970
9201
|
{ task_ids: taskIds },
|
|
8971
9202
|
options
|
|
8972
9203
|
);
|
|
@@ -8985,88 +9216,113 @@ var AgentProjectsService = class extends ServiceModule {
|
|
|
8985
9216
|
}
|
|
8986
9217
|
async claim(taskId, agentId, applicationId, options) {
|
|
8987
9218
|
return this.post(
|
|
8988
|
-
this.withAppId(`/tasks/${taskId}/claim`, applicationId),
|
|
9219
|
+
this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/claim`, applicationId),
|
|
8989
9220
|
{ agent_id: agentId },
|
|
8990
9221
|
options
|
|
8991
9222
|
);
|
|
8992
9223
|
}
|
|
8993
9224
|
async heartbeat(taskId, agentId, applicationId, options) {
|
|
8994
9225
|
return this.post(
|
|
8995
|
-
this.withAppId(`/tasks/${taskId}/heartbeat`, applicationId),
|
|
9226
|
+
this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/heartbeat`, applicationId),
|
|
8996
9227
|
{ agent_id: agentId },
|
|
8997
9228
|
options
|
|
8998
9229
|
);
|
|
8999
9230
|
}
|
|
9000
9231
|
async startTask(taskId, agentId, applicationId, options) {
|
|
9001
9232
|
return this.post(
|
|
9002
|
-
this.withAppId(`/tasks/${taskId}/start`, applicationId),
|
|
9233
|
+
this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/start`, applicationId),
|
|
9003
9234
|
{ agent_id: agentId },
|
|
9004
9235
|
options
|
|
9005
9236
|
);
|
|
9006
9237
|
}
|
|
9007
9238
|
async submit(taskId, data, applicationId, options) {
|
|
9008
|
-
return this.post(
|
|
9239
|
+
return this.post(
|
|
9240
|
+
this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/submit`, applicationId),
|
|
9241
|
+
data,
|
|
9242
|
+
options
|
|
9243
|
+
);
|
|
9009
9244
|
}
|
|
9010
9245
|
async block(taskId, data, applicationId, options) {
|
|
9011
|
-
return this.post(
|
|
9246
|
+
return this.post(
|
|
9247
|
+
this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/block`, applicationId),
|
|
9248
|
+
data,
|
|
9249
|
+
options
|
|
9250
|
+
);
|
|
9012
9251
|
}
|
|
9013
9252
|
// Assignment
|
|
9014
9253
|
async assignAgent(taskId, data, applicationId, options) {
|
|
9015
|
-
return this.post(this.withAppId(`/tasks/${taskId}/assign`, applicationId), data, options);
|
|
9254
|
+
return this.post(this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/assign`, applicationId), data, options);
|
|
9016
9255
|
}
|
|
9017
9256
|
async unassignAgent(taskId, agentId, applicationId, options) {
|
|
9018
|
-
return this.del(
|
|
9257
|
+
return this.del(
|
|
9258
|
+
this.withAppId(
|
|
9259
|
+
`/tasks/${pathSegment(taskId, "taskId")}/assign/${pathSegment(agentId, "agentId")}`,
|
|
9260
|
+
applicationId
|
|
9261
|
+
),
|
|
9262
|
+
options
|
|
9263
|
+
);
|
|
9019
9264
|
}
|
|
9020
9265
|
// History
|
|
9021
9266
|
async listAttempts(taskId, applicationId, options) {
|
|
9022
9267
|
const result = await this._get(
|
|
9023
|
-
this.withAppId(`/tasks/${taskId}/attempts`, applicationId),
|
|
9268
|
+
this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/attempts`, applicationId),
|
|
9024
9269
|
options
|
|
9025
9270
|
);
|
|
9026
9271
|
return { data: result.data?.attempts ?? [], error: result.error };
|
|
9027
9272
|
}
|
|
9028
9273
|
async listTransitions(taskId, applicationId, options) {
|
|
9029
9274
|
const result = await this._get(
|
|
9030
|
-
this.withAppId(`/tasks/${taskId}/transitions`, applicationId),
|
|
9275
|
+
this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/transitions`, applicationId),
|
|
9031
9276
|
options
|
|
9032
9277
|
);
|
|
9033
9278
|
return { data: result.data?.transitions ?? [], error: result.error };
|
|
9034
9279
|
}
|
|
9035
9280
|
// Documents
|
|
9036
9281
|
async createDocument(projectId, data, applicationId, options) {
|
|
9037
|
-
return this.post(
|
|
9282
|
+
return this.post(
|
|
9283
|
+
this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/documents`, applicationId),
|
|
9284
|
+
data,
|
|
9285
|
+
options
|
|
9286
|
+
);
|
|
9038
9287
|
}
|
|
9039
9288
|
async listDocuments(projectId, applicationId, options) {
|
|
9040
9289
|
const result = await this._get(
|
|
9041
|
-
this.withAppId(`/projects/${projectId}/documents`, applicationId),
|
|
9290
|
+
this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/documents`, applicationId),
|
|
9042
9291
|
options
|
|
9043
9292
|
);
|
|
9044
9293
|
return { data: result.data?.documents ?? [], error: result.error };
|
|
9045
9294
|
}
|
|
9046
9295
|
async deleteDocument(documentId, applicationId, options) {
|
|
9047
|
-
return this.del(
|
|
9296
|
+
return this.del(
|
|
9297
|
+
this.withAppId(`/documents/${pathSegment(documentId, "documentId")}`, applicationId),
|
|
9298
|
+
options
|
|
9299
|
+
);
|
|
9048
9300
|
}
|
|
9049
9301
|
// Pipelines
|
|
9050
9302
|
async createPipeline(projectId, data, applicationId, options) {
|
|
9051
|
-
return this.post(
|
|
9303
|
+
return this.post(
|
|
9304
|
+
this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/pipelines`, applicationId),
|
|
9305
|
+
data,
|
|
9306
|
+
options
|
|
9307
|
+
);
|
|
9052
9308
|
}
|
|
9053
9309
|
async listPipelines(projectId, applicationId, options) {
|
|
9054
9310
|
const result = await this._get(
|
|
9055
|
-
this.withAppId(`/projects/${projectId}/pipelines`, applicationId),
|
|
9311
|
+
this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/pipelines`, applicationId),
|
|
9056
9312
|
options
|
|
9057
9313
|
);
|
|
9058
9314
|
return { data: result.data?.pipelines ?? [], error: result.error };
|
|
9059
9315
|
}
|
|
9060
9316
|
async createPipelineVersion(pipelineId, data, applicationId, options) {
|
|
9061
9317
|
return this.post(
|
|
9062
|
-
this.withAppId(`/pipelines/${pipelineId}/versions`, applicationId),
|
|
9318
|
+
this.withAppId(`/pipelines/${pathSegment(pipelineId, "pipelineId")}/versions`, applicationId),
|
|
9063
9319
|
data,
|
|
9064
9320
|
options
|
|
9065
9321
|
);
|
|
9066
9322
|
}
|
|
9067
9323
|
async listPipelineVersions(pipelineId, applicationId, options) {
|
|
9068
9324
|
const result = await this._get(
|
|
9069
|
-
this.withAppId(`/pipelines/${pipelineId}/versions`, applicationId),
|
|
9325
|
+
this.withAppId(`/pipelines/${pathSegment(pipelineId, "pipelineId")}/versions`, applicationId),
|
|
9070
9326
|
options
|
|
9071
9327
|
);
|
|
9072
9328
|
return { data: result.data?.versions ?? [], error: result.error };
|
|
@@ -9085,20 +9341,20 @@ var AgentProjectsService = class extends ServiceModule {
|
|
|
9085
9341
|
return { data: result.data?.grants ?? result.data ?? [], error: result.error };
|
|
9086
9342
|
}
|
|
9087
9343
|
async getGrant(id, options) {
|
|
9088
|
-
return this._get(`/project-grants/${id}`, options);
|
|
9344
|
+
return this._get(`/project-grants/${pathSegment(id, "id")}`, options);
|
|
9089
9345
|
}
|
|
9090
9346
|
/** Public endpoint — no auth required. Returns masked email + project name. */
|
|
9091
9347
|
async getGrantInfo(id, options) {
|
|
9092
|
-
return this._get(`/project-grants/${id}/info`, { skipAuth: true, ...options });
|
|
9348
|
+
return this._get(`/project-grants/${pathSegment(id, "id")}/info`, { skipAuth: true, ...options });
|
|
9093
9349
|
}
|
|
9094
9350
|
async revokeGrant(id, options) {
|
|
9095
|
-
return this.del(`/project-grants/${id}`, options);
|
|
9351
|
+
return this.del(`/project-grants/${pathSegment(id, "id")}`, options);
|
|
9096
9352
|
}
|
|
9097
9353
|
async resendGrantInvitation(id, data, options) {
|
|
9098
|
-
return this.post(`/project-grants/${id}/resend`, data, options);
|
|
9354
|
+
return this.post(`/project-grants/${pathSegment(id, "id")}/resend`, data, options);
|
|
9099
9355
|
}
|
|
9100
9356
|
async redeemGrant(id, options) {
|
|
9101
|
-
return this.post(`/project-grants/${id}/redeem`, void 0, options);
|
|
9357
|
+
return this.post(`/project-grants/${pathSegment(id, "id")}/redeem`, void 0, options);
|
|
9102
9358
|
}
|
|
9103
9359
|
};
|
|
9104
9360
|
|
|
@@ -9116,13 +9372,13 @@ var AgentToolsService = class extends ServiceModule {
|
|
|
9116
9372
|
return this._list("/tools", params, options);
|
|
9117
9373
|
}
|
|
9118
9374
|
async getTool(id, options) {
|
|
9119
|
-
return this._get(`/tools/${id}`, options);
|
|
9375
|
+
return this._get(`/tools/${pathSegment(id, "id")}`, options);
|
|
9120
9376
|
}
|
|
9121
9377
|
async createCapability(toolId, data, options) {
|
|
9122
|
-
return this.post(`/tools/${toolId}/capabilities`, data, options);
|
|
9378
|
+
return this.post(`/tools/${pathSegment(toolId, "toolId")}/capabilities`, data, options);
|
|
9123
9379
|
}
|
|
9124
9380
|
async listCapabilities(toolId, options) {
|
|
9125
|
-
return this._get(`/tools/${toolId}/capabilities`, options);
|
|
9381
|
+
return this._get(`/tools/${pathSegment(toolId, "toolId")}/capabilities`, options);
|
|
9126
9382
|
}
|
|
9127
9383
|
// Tool Integrations
|
|
9128
9384
|
async createIntegration(data, options) {
|
|
@@ -9132,7 +9388,7 @@ var AgentToolsService = class extends ServiceModule {
|
|
|
9132
9388
|
return this._list("/tool-integrations", params, options);
|
|
9133
9389
|
}
|
|
9134
9390
|
async updateIntegration(id, data, options) {
|
|
9135
|
-
return this.patch(`/tool-integrations/${id}`, data, options);
|
|
9391
|
+
return this.patch(`/tool-integrations/${pathSegment(id, "id")}`, data, options);
|
|
9136
9392
|
}
|
|
9137
9393
|
// Credentials
|
|
9138
9394
|
async createCredential(data, options) {
|
|
@@ -9142,13 +9398,17 @@ var AgentToolsService = class extends ServiceModule {
|
|
|
9142
9398
|
return this._list("/credentials", params, options);
|
|
9143
9399
|
}
|
|
9144
9400
|
async updateCredential(id, data, options) {
|
|
9145
|
-
return this.patch(`/credentials/${id}`, data, options);
|
|
9401
|
+
return this.patch(`/credentials/${pathSegment(id, "id")}`, data, options);
|
|
9146
9402
|
}
|
|
9147
9403
|
async createScope(credentialId, data, options) {
|
|
9148
|
-
return this.post(
|
|
9404
|
+
return this.post(
|
|
9405
|
+
`/credentials/${pathSegment(credentialId, "credentialId")}/scopes`,
|
|
9406
|
+
data,
|
|
9407
|
+
options
|
|
9408
|
+
);
|
|
9149
9409
|
}
|
|
9150
9410
|
async listScopes(credentialId, options) {
|
|
9151
|
-
return this._get(`/credentials/${credentialId}/scopes`, options);
|
|
9411
|
+
return this._get(`/credentials/${pathSegment(credentialId, "credentialId")}/scopes`, options);
|
|
9152
9412
|
}
|
|
9153
9413
|
// Entitlements
|
|
9154
9414
|
async grantEntitlement(data, options) {
|
|
@@ -9158,7 +9418,7 @@ var AgentToolsService = class extends ServiceModule {
|
|
|
9158
9418
|
return this._list("/agent-tool-entitlements", params, options);
|
|
9159
9419
|
}
|
|
9160
9420
|
async revokeEntitlement(id, options) {
|
|
9161
|
-
return this.del(`/agent-tool-entitlements/${id}`, options);
|
|
9421
|
+
return this.del(`/agent-tool-entitlements/${pathSegment(id, "id")}`, options);
|
|
9162
9422
|
}
|
|
9163
9423
|
async authorizeAction(data, options) {
|
|
9164
9424
|
return this.post("/authorize-action", data, options);
|
|
@@ -9200,13 +9460,13 @@ var AgentModelsService = class extends ServiceModule {
|
|
|
9200
9460
|
return this._list("/models", params, options);
|
|
9201
9461
|
}
|
|
9202
9462
|
async getModel(id, options) {
|
|
9203
|
-
return this._get(`/models/${id}`, options);
|
|
9463
|
+
return this._get(`/models/${pathSegment(id, "id")}`, options);
|
|
9204
9464
|
}
|
|
9205
9465
|
async createPricing(modelId, data, options) {
|
|
9206
|
-
return this.post(`/models/${modelId}/pricing`, data, options);
|
|
9466
|
+
return this.post(`/models/${pathSegment(modelId, "modelId")}/pricing`, data, options);
|
|
9207
9467
|
}
|
|
9208
9468
|
async listPricing(modelId, options) {
|
|
9209
|
-
return this._get(`/models/${modelId}/pricing`, options);
|
|
9469
|
+
return this._get(`/models/${pathSegment(modelId, "modelId")}/pricing`, options);
|
|
9210
9470
|
}
|
|
9211
9471
|
// Entitlements
|
|
9212
9472
|
async createEntitlement(data, options) {
|
|
@@ -9216,7 +9476,7 @@ var AgentModelsService = class extends ServiceModule {
|
|
|
9216
9476
|
return this._list("/model-entitlements", params, options);
|
|
9217
9477
|
}
|
|
9218
9478
|
async deleteEntitlement(id, options) {
|
|
9219
|
-
return this.del(`/model-entitlements/${id}`, options);
|
|
9479
|
+
return this.del(`/model-entitlements/${pathSegment(id, "id")}`, options);
|
|
9220
9480
|
}
|
|
9221
9481
|
// Usage & Reporting
|
|
9222
9482
|
async recordUsage(data, options) {
|
|
@@ -9247,27 +9507,27 @@ var AgentSessionsService = class extends ServiceModule {
|
|
|
9247
9507
|
return this._list("/sessions", params, options);
|
|
9248
9508
|
}
|
|
9249
9509
|
async getSession(id, options) {
|
|
9250
|
-
return this._get(`/sessions/${id}`, options);
|
|
9510
|
+
return this._get(`/sessions/${pathSegment(id, "id")}`, options);
|
|
9251
9511
|
}
|
|
9252
9512
|
async startSession(id, options) {
|
|
9253
|
-
return this.post(`/sessions/${id}/start`, void 0, options);
|
|
9513
|
+
return this.post(`/sessions/${pathSegment(id, "id")}/start`, void 0, options);
|
|
9254
9514
|
}
|
|
9255
9515
|
async endSession(id, data, options) {
|
|
9256
|
-
return this.post(`/sessions/${id}/end`, data, options);
|
|
9516
|
+
return this.post(`/sessions/${pathSegment(id, "id")}/end`, data, options);
|
|
9257
9517
|
}
|
|
9258
9518
|
// Logs
|
|
9259
9519
|
async appendLog(sessionId, data, options) {
|
|
9260
|
-
return this.post(`/sessions/${sessionId}/logs`, data, options);
|
|
9520
|
+
return this.post(`/sessions/${pathSegment(sessionId, "sessionId")}/logs`, data, options);
|
|
9261
9521
|
}
|
|
9262
9522
|
async listLogs(sessionId, options) {
|
|
9263
|
-
return this._get(`/sessions/${sessionId}/logs`, options);
|
|
9523
|
+
return this._get(`/sessions/${pathSegment(sessionId, "sessionId")}/logs`, options);
|
|
9264
9524
|
}
|
|
9265
9525
|
// Artifacts
|
|
9266
9526
|
async addArtifact(sessionId, data, options) {
|
|
9267
|
-
return this.post(`/sessions/${sessionId}/artifacts`, data, options);
|
|
9527
|
+
return this.post(`/sessions/${pathSegment(sessionId, "sessionId")}/artifacts`, data, options);
|
|
9268
9528
|
}
|
|
9269
9529
|
async listArtifacts(sessionId, options) {
|
|
9270
|
-
return this._get(`/sessions/${sessionId}/artifacts`, options);
|
|
9530
|
+
return this._get(`/sessions/${pathSegment(sessionId, "sessionId")}/artifacts`, options);
|
|
9271
9531
|
}
|
|
9272
9532
|
};
|
|
9273
9533
|
|
|
@@ -9619,6 +9879,7 @@ export {
|
|
|
9619
9879
|
STORAGE_KEYS,
|
|
9620
9880
|
ScaleMule,
|
|
9621
9881
|
ScaleMuleClient,
|
|
9882
|
+
ScaleMulePathError,
|
|
9622
9883
|
SchedulerService,
|
|
9623
9884
|
SearchService,
|
|
9624
9885
|
ServiceModule,
|
|
@@ -9652,6 +9913,7 @@ export {
|
|
|
9652
9913
|
extractClientContext,
|
|
9653
9914
|
findPhoneCountryByCode,
|
|
9654
9915
|
findPhoneCountryByDialCode,
|
|
9916
|
+
findUnsafePathReason,
|
|
9655
9917
|
generateAnonymousId,
|
|
9656
9918
|
generateUploadSessionId,
|
|
9657
9919
|
getMeasuredBandwidthMbps,
|
|
@@ -9663,6 +9925,7 @@ export {
|
|
|
9663
9925
|
normalizeAndValidatePhone,
|
|
9664
9926
|
normalizeExperiments,
|
|
9665
9927
|
normalizePhoneNumber,
|
|
9928
|
+
pathSegment,
|
|
9666
9929
|
pollSharePercent,
|
|
9667
9930
|
pollVoterKey,
|
|
9668
9931
|
prepareCommunityMapAttachment,
|