@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.js CHANGED
@@ -361,6 +361,7 @@ __export(index_exports, {
361
361
  STORAGE_KEYS: () => STORAGE_KEYS,
362
362
  ScaleMule: () => ScaleMule,
363
363
  ScaleMuleClient: () => ScaleMuleClient,
364
+ ScaleMulePathError: () => ScaleMulePathError,
364
365
  SchedulerService: () => SchedulerService,
365
366
  SearchService: () => SearchService,
366
367
  ServiceModule: () => ServiceModule,
@@ -394,6 +395,7 @@ __export(index_exports, {
394
395
  extractClientContext: () => extractClientContext,
395
396
  findPhoneCountryByCode: () => findPhoneCountryByCode,
396
397
  findPhoneCountryByDialCode: () => findPhoneCountryByDialCode,
398
+ findUnsafePathReason: () => findUnsafePathReason,
397
399
  generateAnonymousId: () => generateAnonymousId,
398
400
  generateUploadSessionId: () => generateUploadSessionId,
399
401
  getMeasuredBandwidthMbps: () => getMeasuredBandwidthMbps,
@@ -405,6 +407,7 @@ __export(index_exports, {
405
407
  normalizeAndValidatePhone: () => normalizeAndValidatePhone,
406
408
  normalizeExperiments: () => normalizeExperiments,
407
409
  normalizePhoneNumber: () => normalizePhoneNumber,
410
+ pathSegment: () => pathSegment,
408
411
  pollSharePercent: () => pollSharePercent,
409
412
  pollVoterKey: () => pollVoterKey,
410
413
  prepareCommunityMapAttachment: () => prepareCommunityMapAttachment,
@@ -595,6 +598,47 @@ async function resolveAnonymousId(storage) {
595
598
  return fresh;
596
599
  }
597
600
 
601
+ // src/utils/path.ts
602
+ var INVALID_PATH_SEGMENT = "invalid_path_segment";
603
+ var INVALID_PATH = "invalid_path";
604
+ var ScaleMulePathError = class extends Error {
605
+ constructor(message) {
606
+ super(message);
607
+ this.code = INVALID_PATH_SEGMENT;
608
+ this.status = 400;
609
+ this.name = "ScaleMulePathError";
610
+ }
611
+ };
612
+ var CONTROL_CHARS = /[\u0000-\u001f\u007f]/;
613
+ function pathSegment(value, name = "id") {
614
+ let text;
615
+ if (typeof value === "string") {
616
+ text = value;
617
+ } else if (typeof value === "number" && Number.isFinite(value)) {
618
+ text = String(value);
619
+ } else {
620
+ throw new ScaleMulePathError(`${name} must be a string`);
621
+ }
622
+ if (text.length === 0) throw new ScaleMulePathError(`${name} must not be empty`);
623
+ if (text === "." || text === "..") throw new ScaleMulePathError(`${name} must not be "." or ".."`);
624
+ if (/[/\\%?#]/.test(text) || CONTROL_CHARS.test(text)) {
625
+ throw new ScaleMulePathError(`${name} contains a character that is not allowed in a path segment`);
626
+ }
627
+ return encodeURIComponent(text);
628
+ }
629
+ function findUnsafePathReason(path) {
630
+ if (typeof path !== "string") return "path must be a string";
631
+ const end = path.search(/[?#]/);
632
+ const pathPart = end === -1 ? path : path.slice(0, end);
633
+ if (CONTROL_CHARS.test(pathPart)) return "path contains a control character";
634
+ if (pathPart.includes("\\")) return "path contains a backslash";
635
+ if (/%(25)*(2e|2f|5c)/i.test(pathPart)) return "path contains an encoded dot, slash or backslash";
636
+ for (const segment2 of pathPart.split("/")) {
637
+ if (segment2 === "." || segment2 === "..") return 'path contains a "." or ".." segment';
638
+ }
639
+ return null;
640
+ }
641
+
598
642
  // src/client.ts
599
643
  var SDK_VERSION = "0.0.1";
600
644
  var DEFAULT_TIMEOUT = 3e4;
@@ -1191,6 +1235,10 @@ var ScaleMuleClient = class {
1191
1235
  // Core Request Method
1192
1236
  // --------------------------------------------------------------------------
1193
1237
  async request(path, init = {}) {
1238
+ const unsafePath = findUnsafePathReason(path);
1239
+ if (unsafePath) {
1240
+ return { data: null, error: { code: INVALID_PATH, message: `Refused request: ${unsafePath}`, status: 400 } };
1241
+ }
1194
1242
  const url = `${this.baseUrl}${path}`;
1195
1243
  const method = (init.method || "GET").toUpperCase();
1196
1244
  const timeout = init.timeout || this.defaultTimeout;
@@ -1404,6 +1452,10 @@ var ScaleMuleClient = class {
1404
1452
  }
1405
1453
  return fd;
1406
1454
  };
1455
+ const unsafePath = findUnsafePathReason(path);
1456
+ if (unsafePath) {
1457
+ return { data: null, error: { code: INVALID_PATH, message: `Refused upload: ${unsafePath}`, status: 400 } };
1458
+ }
1407
1459
  const url = `${this.baseUrl}${path}`;
1408
1460
  if (this.debug) console.log(`[ScaleMule] UPLOAD ${path}`);
1409
1461
  if (options?.signal?.aborted) {
@@ -1909,7 +1961,7 @@ var AuthSessionsApi = class extends ServiceModule {
1909
1961
  return this._get("");
1910
1962
  }
1911
1963
  async revoke(sessionId) {
1912
- return this.del(`/${sessionId}`);
1964
+ return this.del(`/${pathSegment(sessionId, "sessionId")}`);
1913
1965
  }
1914
1966
  async revokeAll() {
1915
1967
  return this.del("/others");
@@ -1924,13 +1976,13 @@ var AuthDevicesApi = class extends ServiceModule {
1924
1976
  return this._get("");
1925
1977
  }
1926
1978
  async trust(deviceId) {
1927
- return this.post(`/${deviceId}/trust`);
1979
+ return this.post(`/${pathSegment(deviceId, "deviceId")}/trust`);
1928
1980
  }
1929
1981
  async block(deviceId) {
1930
- return this.post(`/${deviceId}/block`);
1982
+ return this.post(`/${pathSegment(deviceId, "deviceId")}/block`);
1931
1983
  }
1932
1984
  async delete(deviceId) {
1933
- return this.del(`/${deviceId}`);
1985
+ return this.del(`/${pathSegment(deviceId, "deviceId")}`);
1934
1986
  }
1935
1987
  };
1936
1988
  var AuthLoginHistoryApi = class extends ServiceModule {
@@ -2072,7 +2124,7 @@ var AuthService = class extends ServiceModule {
2072
2124
  * reads are blocked at the gateway via the x-app-id header scope.
2073
2125
  */
2074
2126
  async getUser(userId, options) {
2075
- return this._get(`/users/${encodeURIComponent(userId)}`, options);
2127
+ return this._get(`/users/${pathSegment(userId, "userId")}`, options);
2076
2128
  }
2077
2129
  /** Refresh the session. Alias: refreshToken() */
2078
2130
  async refreshSession(data, options) {
@@ -2209,11 +2261,17 @@ var AuthService = class extends ServiceModule {
2209
2261
  // OAuth
2210
2262
  // --------------------------------------------------------------------------
2211
2263
  async getOAuthUrl(provider, redirectUri, options) {
2212
- return this._get(this.withQuery(`/oauth/${provider}/authorize`, { redirect_uri: redirectUri }), options);
2264
+ return this._get(
2265
+ this.withQuery(`/oauth/${pathSegment(provider, "provider")}/authorize`, { redirect_uri: redirectUri }),
2266
+ options
2267
+ );
2213
2268
  }
2214
2269
  async handleOAuthCallback(data, options) {
2215
2270
  const { provider, ...rest } = data;
2216
- const result = await this._get(this.withQuery(`/oauth/${provider}/callback`, rest), options);
2271
+ const result = await this._get(
2272
+ this.withQuery(`/oauth/${pathSegment(provider, "provider")}/callback`, rest),
2273
+ options
2274
+ );
2217
2275
  if (result.data && this.client.isAccountSwitcherEnabled()) {
2218
2276
  await this.client.addKnownAccount({
2219
2277
  userId: result.data.user.id,
@@ -2230,7 +2288,7 @@ var AuthService = class extends ServiceModule {
2230
2288
  return this._get("/oauth/providers", options);
2231
2289
  }
2232
2290
  async unlinkOAuthProvider(provider, options) {
2233
- return this.del(`/oauth/providers/${provider}`, options);
2291
+ return this.del(`/oauth/providers/${pathSegment(provider, "provider")}`, options);
2234
2292
  }
2235
2293
  // --------------------------------------------------------------------------
2236
2294
  // Token Management
@@ -3269,7 +3327,7 @@ var StorageService = class extends ServiceModule {
3269
3327
  // --------------------------------------------------------------------------
3270
3328
  /** Get file metadata (no signed URL). */
3271
3329
  async getInfo(fileId, options) {
3272
- return this._get(`/files/${fileId}/info`, options);
3330
+ return this._get(`/files/${pathSegment(fileId, "fileId")}/info`, options);
3273
3331
  }
3274
3332
  /**
3275
3333
  * Get the calling app's storage + media settings — content policy,
@@ -3313,7 +3371,7 @@ var StorageService = class extends ServiceModule {
3313
3371
  * ```
3314
3372
  */
3315
3373
  async getFileStatus(fileId, options) {
3316
- return this._get(`/files/${fileId}/status`, options);
3374
+ return this._get(`/files/${pathSegment(fileId, "fileId")}/status`, options);
3317
3375
  }
3318
3376
  /**
3319
3377
  * Read the application's active media policy. Lightweight endpoint
@@ -3334,7 +3392,7 @@ var StorageService = class extends ServiceModule {
3334
3392
  * Returns CloudFront signed URL (fast, ~1us) or S3 presigned fallback.
3335
3393
  */
3336
3394
  async getViewUrl(fileId, options) {
3337
- return this.post(`/signed-url/view/${fileId}`, {}, options);
3395
+ return this.post(`/signed-url/view/${pathSegment(fileId, "fileId")}`, {}, options);
3338
3396
  }
3339
3397
  /**
3340
3398
  * Get signed view URLs for multiple files (batch, up to 100).
@@ -3349,11 +3407,11 @@ var StorageService = class extends ServiceModule {
3349
3407
  * Get a signed download URL (Content-Disposition: attachment).
3350
3408
  */
3351
3409
  async getDownloadUrl(fileId, options) {
3352
- return this.post(`/signed-url/download/${fileId}`, void 0, options);
3410
+ return this.post(`/signed-url/download/${pathSegment(fileId, "fileId")}`, void 0, options);
3353
3411
  }
3354
3412
  /** Delete a file (soft delete). */
3355
3413
  async delete(fileId, options) {
3356
- return this.del(`/files/${fileId}`, options);
3414
+ return this.del(`/files/${pathSegment(fileId, "fileId")}`, options);
3357
3415
  }
3358
3416
  /** List the current user's files (paginated). */
3359
3417
  async list(params, options) {
@@ -3361,7 +3419,7 @@ var StorageService = class extends ServiceModule {
3361
3419
  }
3362
3420
  /** Check file view/access status. */
3363
3421
  async getViewStatus(fileId, options) {
3364
- return this._get(`/files/${fileId}/view-status`, options);
3422
+ return this._get(`/files/${pathSegment(fileId, "fileId")}/view-status`, options);
3365
3423
  }
3366
3424
  /**
3367
3425
  * Update a file's visibility.
@@ -3382,7 +3440,7 @@ var StorageService = class extends ServiceModule {
3382
3440
  async updateVisibility(fileId, visibility, options) {
3383
3441
  const body = typeof visibility === "boolean" ? { is_public: visibility } : { visibility };
3384
3442
  return this.patch(
3385
- `/files/${fileId}/visibility`,
3443
+ `/files/${pathSegment(fileId, "fileId")}/visibility`,
3386
3444
  body,
3387
3445
  options
3388
3446
  );
@@ -4325,11 +4383,15 @@ var RealtimeService = class extends ServiceModule {
4325
4383
  }
4326
4384
  /** Broadcast to a specific channel. */
4327
4385
  async broadcastToChannel(channel, event, data, options) {
4328
- return this.post(`/broadcast/channel/${channel}`, { event, data }, options);
4386
+ return this.post(
4387
+ `/broadcast/channel/${pathSegment(channel, "channel")}`,
4388
+ { event, data },
4389
+ options
4390
+ );
4329
4391
  }
4330
4392
  /** Send to a specific user's connections. */
4331
4393
  async sendToUser(userId, event, data, options) {
4332
- return this.post(`/broadcast/user/${userId}`, { event, data }, options);
4394
+ return this.post(`/broadcast/user/${pathSegment(userId, "userId")}`, { event, data }, options);
4333
4395
  }
4334
4396
  // --------------------------------------------------------------------------
4335
4397
  // Connection Lifecycle
@@ -4742,7 +4804,7 @@ var VideoService = class extends ServiceModule {
4742
4804
  }
4743
4805
  }
4744
4806
  const completeResult = await this.post(
4745
- `/${video_id}/upload-complete`,
4807
+ `/${pathSegment(video_id, "video_id")}/upload-complete`,
4746
4808
  {
4747
4809
  upload_id,
4748
4810
  parts
@@ -4756,7 +4818,7 @@ var VideoService = class extends ServiceModule {
4756
4818
  // --------------------------------------------------------------------------
4757
4819
  /** Get video metadata and status. */
4758
4820
  async get(videoId, options) {
4759
- return super._get(`/${videoId}`, options);
4821
+ return super._get(`/${pathSegment(videoId, "videoId")}`, options);
4760
4822
  }
4761
4823
  /**
4762
4824
  * Register a video from a file already uploaded to scalemule-storage.
@@ -4861,7 +4923,7 @@ var VideoService = class extends ServiceModule {
4861
4923
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
4862
4924
  const result = await this.get(videoId, requestOptions);
4863
4925
  if (result.data?.status === "ready") {
4864
- return `${this.client.getBaseUrl()}${this.basePath}/${videoId}/playlist.m3u8`;
4926
+ return `${this.client.getBaseUrl()}${this.basePath}/${pathSegment(videoId, "videoId")}/playlist.m3u8`;
4865
4927
  }
4866
4928
  await new Promise((r) => setTimeout(r, intervalMs));
4867
4929
  }
@@ -4874,7 +4936,7 @@ var VideoService = class extends ServiceModule {
4874
4936
  async getStreamUrl(videoId) {
4875
4937
  const baseUrl = this.client.getBaseUrl();
4876
4938
  return {
4877
- data: { url: `${baseUrl}${this.basePath}/${videoId}/playlist.m3u8` },
4939
+ data: { url: `${baseUrl}${this.basePath}/${pathSegment(videoId, "videoId")}/playlist.m3u8` },
4878
4940
  error: null
4879
4941
  };
4880
4942
  }
@@ -4882,12 +4944,12 @@ var VideoService = class extends ServiceModule {
4882
4944
  * Track a playback event (view, play, pause, seek, complete, etc.).
4883
4945
  */
4884
4946
  async trackPlayback(videoId, event, options) {
4885
- return this.post(`/${videoId}/track`, event, options);
4947
+ return this.post(`/${pathSegment(videoId, "videoId")}/track`, event, options);
4886
4948
  }
4887
4949
  /** Get video analytics (views, watch time, etc.). */
4888
4950
  async getAnalytics(videoId, options) {
4889
4951
  return super._get(
4890
- `/${videoId}/analytics`,
4952
+ `/${pathSegment(videoId, "videoId")}/analytics`,
4891
4953
  options
4892
4954
  );
4893
4955
  }
@@ -4896,7 +4958,11 @@ var VideoService = class extends ServiceModule {
4896
4958
  * Public videos get 7-day signed URLs; private get 1-hour signed URLs.
4897
4959
  */
4898
4960
  async updateAccessMode(videoId, accessMode, options) {
4899
- return this.patch(`/${videoId}`, { access_mode: accessMode }, options);
4961
+ return this.patch(
4962
+ `/${pathSegment(videoId, "videoId")}`,
4963
+ { access_mode: accessMode },
4964
+ options
4965
+ );
4900
4966
  }
4901
4967
  // --------------------------------------------------------------------------
4902
4968
  // Legacy methods (backward compat)
@@ -4919,7 +4985,7 @@ var VideoService = class extends ServiceModule {
4919
4985
  async uploadPart(videoId, uploadId, partNumber, chunk, signal) {
4920
4986
  const formData = new FormData();
4921
4987
  formData.append("file", chunk);
4922
- const path = `${this.basePath}/${videoId}/upload-part?upload_id=${encodeURIComponent(uploadId)}&part_number=${partNumber}`;
4988
+ const path = `${this.basePath}/${pathSegment(videoId, "videoId")}/upload-part?upload_id=${encodeURIComponent(uploadId)}&part_number=${partNumber}`;
4923
4989
  const headers = {
4924
4990
  "x-api-key": this.client.getApiKey()
4925
4991
  };
@@ -4977,22 +5043,32 @@ var DataService = class extends ServiceModule {
4977
5043
  return this._get("/collections", options);
4978
5044
  }
4979
5045
  async deleteCollection(name, options) {
4980
- return this.del(`/collections/${name}`, options);
5046
+ return this.del(`/collections/${pathSegment(name, "name")}`, options);
4981
5047
  }
4982
5048
  // --------------------------------------------------------------------------
4983
5049
  // Documents — CRUD
4984
5050
  // --------------------------------------------------------------------------
4985
5051
  async create(collection, data, options) {
4986
- return this.post(`/${collection}/documents`, { data }, options);
5052
+ return this.post(`/${pathSegment(collection, "collection")}/documents`, { data }, options);
4987
5053
  }
4988
5054
  async get(collection, docId, options) {
4989
- return this._get(`/${collection}/documents/${docId}`, options);
5055
+ return this._get(
5056
+ `/${pathSegment(collection, "collection")}/documents/${pathSegment(docId, "docId")}`,
5057
+ options
5058
+ );
4990
5059
  }
4991
5060
  async update(collection, docId, data, options) {
4992
- return this.patch(`/${collection}/documents/${docId}`, { data }, options);
5061
+ return this.patch(
5062
+ `/${pathSegment(collection, "collection")}/documents/${pathSegment(docId, "docId")}`,
5063
+ { data },
5064
+ options
5065
+ );
4993
5066
  }
4994
5067
  async delete(collection, docId, options) {
4995
- return this.del(`/${collection}/documents/${docId}`, options);
5068
+ return this.del(
5069
+ `/${pathSegment(collection, "collection")}/documents/${pathSegment(docId, "docId")}`,
5070
+ options
5071
+ );
4996
5072
  }
4997
5073
  // --------------------------------------------------------------------------
4998
5074
  // Documents — Query & Aggregate
@@ -5010,7 +5086,11 @@ var DataService = class extends ServiceModule {
5010
5086
  page: options?.page ?? 1,
5011
5087
  per_page: options?.perPage ?? 20
5012
5088
  };
5013
- const response = await this.post(`/${collection}/query`, body, requestOptions);
5089
+ const response = await this.post(
5090
+ `/${pathSegment(collection, "collection")}/query`,
5091
+ body,
5092
+ requestOptions
5093
+ );
5014
5094
  if (response.error) {
5015
5095
  return {
5016
5096
  data: [],
@@ -5034,10 +5114,10 @@ var DataService = class extends ServiceModule {
5034
5114
  };
5035
5115
  }
5036
5116
  async aggregate(collection, options, requestOptions) {
5037
- return this.post(`/${collection}/aggregate`, options, requestOptions);
5117
+ return this.post(`/${pathSegment(collection, "collection")}/aggregate`, options, requestOptions);
5038
5118
  }
5039
5119
  async myDocuments(collection, options, requestOptions) {
5040
- return this._list(`/${collection}/my-documents`, options, requestOptions);
5120
+ return this._list(`/${pathSegment(collection, "collection")}/my-documents`, options, requestOptions);
5041
5121
  }
5042
5122
  // --------------------------------------------------------------------------
5043
5123
  // Legacy methods (backward compat)
@@ -5080,61 +5160,89 @@ var ChatService = class extends ServiceModule {
5080
5160
  return this._list("/conversations", params, requestOptions);
5081
5161
  }
5082
5162
  async getConversation(id, options) {
5083
- return this._get(`/conversations/${id}`, options);
5163
+ return this._get(`/conversations/${pathSegment(id, "id")}`, options);
5084
5164
  }
5085
5165
  async addParticipant(conversationId, userId, options) {
5086
- return this.post(`/conversations/${conversationId}/participants`, { user_id: userId }, options);
5166
+ return this.post(
5167
+ `/conversations/${pathSegment(conversationId, "conversationId")}/participants`,
5168
+ { user_id: userId },
5169
+ options
5170
+ );
5087
5171
  }
5088
5172
  async removeParticipant(conversationId, userId, options) {
5089
- return this.del(`/conversations/${conversationId}/participants/${userId}`, options);
5173
+ return this.del(
5174
+ `/conversations/${pathSegment(conversationId, "conversationId")}/participants/${pathSegment(userId, "userId")}`,
5175
+ options
5176
+ );
5090
5177
  }
5091
5178
  // --------------------------------------------------------------------------
5092
5179
  // Messages
5093
5180
  // --------------------------------------------------------------------------
5094
5181
  async sendMessage(conversationId, data, options) {
5095
- return this.post(`/conversations/${conversationId}/messages`, data, options);
5182
+ return this.post(
5183
+ `/conversations/${pathSegment(conversationId, "conversationId")}/messages`,
5184
+ data,
5185
+ options
5186
+ );
5096
5187
  }
5097
5188
  async getThreadReplies(messageId, params, requestOptions) {
5098
- return this._get(this.withQuery(`/messages/${messageId}/replies`, params), requestOptions);
5189
+ return this._get(
5190
+ this.withQuery(`/messages/${pathSegment(messageId, "messageId")}/replies`, params),
5191
+ requestOptions
5192
+ );
5099
5193
  }
5100
5194
  async getMessages(conversationId, options, requestOptions) {
5101
5195
  return this._get(
5102
- this.withQuery(`/conversations/${conversationId}/messages`, options),
5196
+ this.withQuery(`/conversations/${pathSegment(conversationId, "conversationId")}/messages`, options),
5103
5197
  requestOptions
5104
5198
  );
5105
5199
  }
5106
5200
  async editMessage(messageId, data, options) {
5107
- return this.patch(`/messages/${messageId}`, data, options);
5201
+ return this.patch(`/messages/${pathSegment(messageId, "messageId")}`, data, options);
5108
5202
  }
5109
5203
  async deleteMessage(messageId, options) {
5110
- return this.del(`/messages/${messageId}`, options);
5204
+ return this.del(`/messages/${pathSegment(messageId, "messageId")}`, options);
5111
5205
  }
5112
5206
  async addReaction(messageId, data, options) {
5113
- return this.post(`/messages/${messageId}/reactions`, data, options);
5207
+ return this.post(`/messages/${pathSegment(messageId, "messageId")}/reactions`, data, options);
5114
5208
  }
5115
5209
  // --------------------------------------------------------------------------
5116
5210
  // Pins
5117
5211
  // --------------------------------------------------------------------------
5118
5212
  async pinMessage(messageId, options) {
5119
- return this.post(`/messages/${messageId}/pin`, void 0, options);
5213
+ return this.post(`/messages/${pathSegment(messageId, "messageId")}/pin`, void 0, options);
5120
5214
  }
5121
5215
  async unpinMessage(messageId, options) {
5122
- return this.del(`/messages/${messageId}/pin`, options);
5216
+ return this.del(`/messages/${pathSegment(messageId, "messageId")}/pin`, options);
5123
5217
  }
5124
5218
  async getPinnedMessages(conversationId, options) {
5125
- return this._get(`/conversations/${conversationId}/pins`, options);
5219
+ return this._get(
5220
+ `/conversations/${pathSegment(conversationId, "conversationId")}/pins`,
5221
+ options
5222
+ );
5126
5223
  }
5127
5224
  // --------------------------------------------------------------------------
5128
5225
  // Typing & Read Receipts
5129
5226
  // --------------------------------------------------------------------------
5130
5227
  async sendTyping(conversationId, options) {
5131
- return this.post(`/conversations/${conversationId}/typing`, void 0, options);
5228
+ return this.post(
5229
+ `/conversations/${pathSegment(conversationId, "conversationId")}/typing`,
5230
+ void 0,
5231
+ options
5232
+ );
5132
5233
  }
5133
5234
  async markRead(conversationId, options) {
5134
- return this.post(`/conversations/${conversationId}/read`, void 0, options);
5235
+ return this.post(
5236
+ `/conversations/${pathSegment(conversationId, "conversationId")}/read`,
5237
+ void 0,
5238
+ options
5239
+ );
5135
5240
  }
5136
5241
  async getReadStatus(conversationId, options) {
5137
- return this._get(`/conversations/${conversationId}/read-status`, options);
5242
+ return this._get(
5243
+ `/conversations/${pathSegment(conversationId, "conversationId")}/read-status`,
5244
+ options
5245
+ );
5138
5246
  }
5139
5247
  // --------------------------------------------------------------------------
5140
5248
  // Legacy methods (backward compat)
@@ -5158,37 +5266,37 @@ var ConferenceService = class extends ServiceModule {
5158
5266
  return this.post("/calls", data, options);
5159
5267
  }
5160
5268
  async getCall(callId, options) {
5161
- return this._get(`/calls/${callId}`, options);
5269
+ return this._get(`/calls/${pathSegment(callId, "callId")}`, options);
5162
5270
  }
5163
5271
  async listCalls(params, options) {
5164
5272
  return this._get(this.withQuery("/calls", params), options);
5165
5273
  }
5166
5274
  async endCall(callId, options) {
5167
- return this.post(`/calls/${callId}/end`, void 0, options);
5275
+ return this.post(`/calls/${pathSegment(callId, "callId")}/end`, void 0, options);
5168
5276
  }
5169
5277
  // --------------------------------------------------------------------------
5170
5278
  // Participants
5171
5279
  // --------------------------------------------------------------------------
5172
5280
  async joinCall(callId, options) {
5173
- return this.post(`/calls/${callId}/join`, void 0, options);
5281
+ return this.post(`/calls/${pathSegment(callId, "callId")}/join`, void 0, options);
5174
5282
  }
5175
5283
  async leaveCall(callId, options) {
5176
- return this.post(`/calls/${callId}/leave`, void 0, options);
5284
+ return this.post(`/calls/${pathSegment(callId, "callId")}/leave`, void 0, options);
5177
5285
  }
5178
5286
  async listParticipants(callId, options) {
5179
- return this._get(`/calls/${callId}/participants`, options);
5287
+ return this._get(`/calls/${pathSegment(callId, "callId")}/participants`, options);
5180
5288
  }
5181
5289
  // --------------------------------------------------------------------------
5182
5290
  // Recording
5183
5291
  // --------------------------------------------------------------------------
5184
5292
  async startRecording(callId, options) {
5185
- return this.post(`/calls/${callId}/recording/start`, void 0, options);
5293
+ return this.post(`/calls/${pathSegment(callId, "callId")}/recording/start`, void 0, options);
5186
5294
  }
5187
5295
  async stopRecording(callId, options) {
5188
- return this.post(`/calls/${callId}/recording/stop`, void 0, options);
5296
+ return this.post(`/calls/${pathSegment(callId, "callId")}/recording/stop`, void 0, options);
5189
5297
  }
5190
5298
  async consentToRecording(callId, options) {
5191
- return this.post(`/calls/${callId}/recording/consent`, void 0, options);
5299
+ return this.post(`/calls/${pathSegment(callId, "callId")}/recording/consent`, void 0, options);
5192
5300
  }
5193
5301
  // --------------------------------------------------------------------------
5194
5302
  // Settings
@@ -5203,7 +5311,7 @@ var ConferenceService = class extends ServiceModule {
5203
5311
  // Stats
5204
5312
  // --------------------------------------------------------------------------
5205
5313
  async submitStats(callId, stats, options) {
5206
- return this.post(`/calls/${callId}/stats`, stats, options);
5314
+ return this.post(`/calls/${pathSegment(callId, "callId")}/stats`, stats, options);
5207
5315
  }
5208
5316
  };
5209
5317
 
@@ -5224,19 +5332,19 @@ var SocialService = class extends ServiceModule {
5224
5332
  // Follow / Unfollow
5225
5333
  // --------------------------------------------------------------------------
5226
5334
  async follow(userId, options) {
5227
- return this.post(`/users/${userId}/follow`, void 0, options);
5335
+ return this.post(`/users/${pathSegment(userId, "userId")}/follow`, void 0, options);
5228
5336
  }
5229
5337
  async unfollow(userId, options) {
5230
- return this.del(`/users/${userId}/follow`, options);
5338
+ return this.del(`/users/${pathSegment(userId, "userId")}/follow`, options);
5231
5339
  }
5232
5340
  async getFollowers(userId, params, requestOptions) {
5233
- return this._list(`/users/${userId}/followers`, params, requestOptions);
5341
+ return this._list(`/users/${pathSegment(userId, "userId")}/followers`, params, requestOptions);
5234
5342
  }
5235
5343
  async getFollowing(userId, params, requestOptions) {
5236
- return this._list(`/users/${userId}/following`, params, requestOptions);
5344
+ return this._list(`/users/${pathSegment(userId, "userId")}/following`, params, requestOptions);
5237
5345
  }
5238
5346
  async getFollowStatus(userId, options) {
5239
- return this._get(`/users/${userId}/follow-status`, options);
5347
+ return this._get(`/users/${pathSegment(userId, "userId")}/follow-status`, options);
5240
5348
  }
5241
5349
  // --------------------------------------------------------------------------
5242
5350
  // Posts
@@ -5245,13 +5353,13 @@ var SocialService = class extends ServiceModule {
5245
5353
  return this.post("/posts", data, options);
5246
5354
  }
5247
5355
  async getPost(postId, options) {
5248
- return this._get(`/posts/${postId}`, options);
5356
+ return this._get(`/posts/${pathSegment(postId, "postId")}`, options);
5249
5357
  }
5250
5358
  async deletePost(postId, options) {
5251
- return this.del(`/posts/${postId}`, options);
5359
+ return this.del(`/posts/${pathSegment(postId, "postId")}`, options);
5252
5360
  }
5253
5361
  async getUserPosts(userId, params, requestOptions) {
5254
- return this._list(`/users/${userId}/posts`, params, requestOptions);
5362
+ return this._list(`/users/${pathSegment(userId, "userId")}/posts`, params, requestOptions);
5255
5363
  }
5256
5364
  async getFeed(options, requestOptions) {
5257
5365
  return this._list("/feed", options, requestOptions);
@@ -5260,13 +5368,24 @@ var SocialService = class extends ServiceModule {
5260
5368
  // Likes
5261
5369
  // --------------------------------------------------------------------------
5262
5370
  async like(targetType, targetId, options) {
5263
- return this.post(`/${targetType}/${targetId}/like`, void 0, options);
5371
+ return this.post(
5372
+ `/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/like`,
5373
+ void 0,
5374
+ options
5375
+ );
5264
5376
  }
5265
5377
  async unlike(targetType, targetId, options) {
5266
- return this.del(`/${targetType}/${targetId}/like`, options);
5378
+ return this.del(
5379
+ `/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/like`,
5380
+ options
5381
+ );
5267
5382
  }
5268
5383
  async getLikes(targetType, targetId, params, requestOptions) {
5269
- return this._list(`/${targetType}/${targetId}/likes`, params, requestOptions);
5384
+ return this._list(
5385
+ `/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/likes`,
5386
+ params,
5387
+ requestOptions
5388
+ );
5270
5389
  }
5271
5390
  // --------------------------------------------------------------------------
5272
5391
  // Voting (bipolar — up/down with score)
@@ -5284,7 +5403,11 @@ var SocialService = class extends ServiceModule {
5284
5403
  * Requires an authenticated session; anonymous calls return 401.
5285
5404
  */
5286
5405
  async vote(targetType, targetId, value, options) {
5287
- return this.put(`/${targetType}/${targetId}/vote`, { value }, options);
5406
+ return this.put(
5407
+ `/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/vote`,
5408
+ { value },
5409
+ options
5410
+ );
5288
5411
  }
5289
5412
  /**
5290
5413
  * Read the caller's current vote on a target plus the aggregate counts.
@@ -5293,7 +5416,10 @@ var SocialService = class extends ServiceModule {
5293
5416
  * Requires an authenticated session.
5294
5417
  */
5295
5418
  async getVote(targetType, targetId, options) {
5296
- return this._get(`/${targetType}/${targetId}/vote`, options);
5419
+ return this._get(
5420
+ `/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/vote`,
5421
+ options
5422
+ );
5297
5423
  }
5298
5424
  // --------------------------------------------------------------------------
5299
5425
  // View counters
@@ -5310,22 +5436,29 @@ var SocialService = class extends ServiceModule {
5310
5436
  */
5311
5437
  async recordView(targetType, targetId, viewerFingerprint, options) {
5312
5438
  const body = viewerFingerprint ? { viewer_fingerprint: viewerFingerprint } : {};
5313
- return this.post(`/${targetType}/${targetId}/views`, body, options);
5439
+ return this.post(
5440
+ `/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/views`,
5441
+ body,
5442
+ options
5443
+ );
5314
5444
  }
5315
5445
  /**
5316
5446
  * Read view counters for a target.
5317
5447
  */
5318
5448
  async getViews(targetType, targetId, options) {
5319
- return this._get(`/${targetType}/${targetId}/views`, options);
5449
+ return this._get(
5450
+ `/${pathSegment(targetType, "targetType")}/${pathSegment(targetId, "targetId")}/views`,
5451
+ options
5452
+ );
5320
5453
  }
5321
5454
  // --------------------------------------------------------------------------
5322
5455
  // Comments
5323
5456
  // --------------------------------------------------------------------------
5324
5457
  async comment(postId, data, options) {
5325
- return this.post(`/posts/${postId}/comments`, data, options);
5458
+ return this.post(`/posts/${pathSegment(postId, "postId")}/comments`, data, options);
5326
5459
  }
5327
5460
  async getComments(postId, params, requestOptions) {
5328
- return this._list(`/posts/${postId}/comments`, params, requestOptions);
5461
+ return this._list(`/posts/${pathSegment(postId, "postId")}/comments`, params, requestOptions);
5329
5462
  }
5330
5463
  // --------------------------------------------------------------------------
5331
5464
  // Activity Feed
@@ -5334,7 +5467,7 @@ var SocialService = class extends ServiceModule {
5334
5467
  return this._list("/activity", params, requestOptions);
5335
5468
  }
5336
5469
  async markActivityRead(activityId, options) {
5337
- return this.patch(`/activity/${activityId}/read`, {}, options);
5470
+ return this.patch(`/activity/${pathSegment(activityId, "activityId")}/read`, {}, options);
5338
5471
  }
5339
5472
  async markAllRead(options) {
5340
5473
  return this.patch("/activity/read-all", {}, options);
@@ -5385,10 +5518,10 @@ var SocialPolicyService = class extends ServiceModule {
5385
5518
  return this.decideAction("connect_request", actor, target, options);
5386
5519
  }
5387
5520
  getSettings(identityId, options) {
5388
- return this._get(`/settings/${identityId}`, options);
5521
+ return this._get(`/settings/${pathSegment(identityId, "identityId")}`, options);
5389
5522
  }
5390
5523
  updateSettings(identityId, request, options) {
5391
- return this.patch(`/settings/${identityId}`, request, options);
5524
+ return this.patch(`/settings/${pathSegment(identityId, "identityId")}`, request, options);
5392
5525
  }
5393
5526
  createRelationship(request, options) {
5394
5527
  return this.post("/relationships", request, options);
@@ -5397,7 +5530,7 @@ var SocialPolicyService = class extends ServiceModule {
5397
5530
  return this._get(this.withQuery("/relationships", toQueryParams(params)), options);
5398
5531
  }
5399
5532
  deleteRelationship(relationshipId, options) {
5400
- return this.del(`/relationships/${relationshipId}`, options);
5533
+ return this.del(`/relationships/${pathSegment(relationshipId, "relationshipId")}`, options);
5401
5534
  }
5402
5535
  createContactRequest(request, options) {
5403
5536
  return this.post("/contact-requests", request, options);
@@ -5415,16 +5548,32 @@ var SocialPolicyService = class extends ServiceModule {
5415
5548
  );
5416
5549
  }
5417
5550
  acceptContactRequest(requestId, options) {
5418
- return this.post(`/contact-requests/${requestId}/accept`, void 0, options);
5551
+ return this.post(
5552
+ `/contact-requests/${pathSegment(requestId, "requestId")}/accept`,
5553
+ void 0,
5554
+ options
5555
+ );
5419
5556
  }
5420
5557
  ignoreContactRequest(requestId, options) {
5421
- return this.post(`/contact-requests/${requestId}/ignore`, void 0, options);
5558
+ return this.post(
5559
+ `/contact-requests/${pathSegment(requestId, "requestId")}/ignore`,
5560
+ void 0,
5561
+ options
5562
+ );
5422
5563
  }
5423
5564
  declineContactRequest(requestId, options) {
5424
- return this.post(`/contact-requests/${requestId}/decline`, void 0, options);
5565
+ return this.post(
5566
+ `/contact-requests/${pathSegment(requestId, "requestId")}/decline`,
5567
+ void 0,
5568
+ options
5569
+ );
5425
5570
  }
5426
5571
  reportContactRequest(requestId, options) {
5427
- return this.post(`/contact-requests/${requestId}/report`, void 0, options);
5572
+ return this.post(
5573
+ `/contact-requests/${pathSegment(requestId, "requestId")}/report`,
5574
+ void 0,
5575
+ options
5576
+ );
5428
5577
  }
5429
5578
  block(request, options) {
5430
5579
  return this.post("/block", request, options);
@@ -5568,7 +5717,7 @@ var BillingService = class extends ServiceModule {
5568
5717
  // openapi/scalemule-money-billing-v1.yaml.
5569
5718
  // --------------------------------------------------------------------------
5570
5719
  accountBase(accountId) {
5571
- return `/v1/billing/accounts/${encodeURIComponent(accountId)}`;
5720
+ return `/v1/billing/accounts/${pathSegment(accountId, "accountId")}`;
5572
5721
  }
5573
5722
  async getAccountCustomer(req, options) {
5574
5723
  const path = this.withQuery(`${this.accountBase(req.account_id)}/customer`, {
@@ -5590,14 +5739,14 @@ var BillingService = class extends ServiceModule {
5590
5739
  }
5591
5740
  async detachAccountPaymentMethod(req, paymentMethodId, options) {
5592
5741
  const path = this.withQuery(
5593
- `${this.accountBase(req.account_id)}/payment-methods/${encodeURIComponent(paymentMethodId)}`,
5742
+ `${this.accountBase(req.account_id)}/payment-methods/${pathSegment(paymentMethodId, "paymentMethodId")}`,
5594
5743
  { billing_mode: req.billing_mode }
5595
5744
  );
5596
5745
  return this.client.del(path, options);
5597
5746
  }
5598
5747
  async setDefaultAccountPaymentMethod(req, paymentMethodId, options) {
5599
5748
  const path = this.withQuery(
5600
- `${this.accountBase(req.account_id)}/payment-methods/${encodeURIComponent(paymentMethodId)}/default`,
5749
+ `${this.accountBase(req.account_id)}/payment-methods/${pathSegment(paymentMethodId, "paymentMethodId")}/default`,
5601
5750
  { billing_mode: req.billing_mode }
5602
5751
  );
5603
5752
  return this.client.put(path, void 0, options);
@@ -5611,7 +5760,7 @@ var BillingService = class extends ServiceModule {
5611
5760
  return this.client.get(path, options);
5612
5761
  }
5613
5762
  async getAccountInvoice(req, invoiceId, options) {
5614
- const path = this.withQuery(`${this.accountBase(req.account_id)}/invoices/${encodeURIComponent(invoiceId)}`, {
5763
+ const path = this.withQuery(`${this.accountBase(req.account_id)}/invoices/${pathSegment(invoiceId, "invoiceId")}`, {
5615
5764
  billing_mode: req.billing_mode
5616
5765
  });
5617
5766
  return this.client.get(path, options);
@@ -5667,13 +5816,13 @@ var BillingService = class extends ServiceModule {
5667
5816
  return this._list("/invoices", params, options);
5668
5817
  }
5669
5818
  async getInvoice(id, options) {
5670
- return this._get(`/invoices/${id}`, options);
5819
+ return this._get(`/invoices/${pathSegment(id, "id")}`, options);
5671
5820
  }
5672
5821
  async payInvoice(id, options) {
5673
- return this.post(`/invoices/${id}/pay`, void 0, options);
5822
+ return this.post(`/invoices/${pathSegment(id, "id")}/pay`, void 0, options);
5674
5823
  }
5675
5824
  async getInvoicePdf(id, options) {
5676
- return this._get(`/invoices/${id}/pdf`, options);
5825
+ return this._get(`/invoices/${pathSegment(id, "id")}/pdf`, options);
5677
5826
  }
5678
5827
  // --------------------------------------------------------------------------
5679
5828
  // Connected Accounts (Marketplace)
@@ -5682,20 +5831,24 @@ var BillingService = class extends ServiceModule {
5682
5831
  return this.post("/connected-accounts", data, options);
5683
5832
  }
5684
5833
  async getConnectedAccount(id, options) {
5685
- return this._get(`/connected-accounts/${id}`, options);
5834
+ return this._get(`/connected-accounts/${pathSegment(id, "id")}`, options);
5686
5835
  }
5687
5836
  async getMyConnectedAccount(options) {
5688
5837
  return this._get("/connected-accounts/me", options);
5689
5838
  }
5690
5839
  async createOnboardingLink(id, data, options) {
5691
- return this.post(`/connected-accounts/${id}/onboarding-link`, data, options);
5840
+ return this.post(`/connected-accounts/${pathSegment(id, "id")}/onboarding-link`, data, options);
5692
5841
  }
5693
5842
  async getAccountBalance(id, options) {
5694
5843
  void options;
5695
5844
  return this.retiredSurface(`/v1/money/billing/connected-accounts/${id}/balance`);
5696
5845
  }
5697
5846
  async createAccountSession(id, options) {
5698
- return this.post(`/connected-accounts/${id}/account-session`, void 0, options);
5847
+ return this.post(
5848
+ `/connected-accounts/${pathSegment(id, "id")}/account-session`,
5849
+ void 0,
5850
+ options
5851
+ );
5699
5852
  }
5700
5853
  // --------------------------------------------------------------------------
5701
5854
  // Config
@@ -5737,10 +5890,17 @@ var BillingService = class extends ServiceModule {
5737
5890
  return this.retiredSurface(`/v1/money/billing/connected-accounts/${accountId}/payouts`);
5738
5891
  }
5739
5892
  async getPayoutSchedule(accountId, options) {
5740
- return this._get(`/connected-accounts/${accountId}/payout-schedule`, options);
5893
+ return this._get(
5894
+ `/connected-accounts/${pathSegment(accountId, "accountId")}/payout-schedule`,
5895
+ options
5896
+ );
5741
5897
  }
5742
5898
  async setPayoutSchedule(accountId, data, options) {
5743
- return this.put(`/connected-accounts/${accountId}/payout-schedule`, data, options);
5899
+ return this.put(
5900
+ `/connected-accounts/${pathSegment(accountId, "accountId")}/payout-schedule`,
5901
+ data,
5902
+ options
5903
+ );
5744
5904
  }
5745
5905
  // --------------------------------------------------------------------------
5746
5906
  // Ledger
@@ -5951,7 +6111,7 @@ var AnalyticsService = class extends ServiceModule {
5951
6111
  return this._get("/funnels");
5952
6112
  }
5953
6113
  async getFunnelConversions(id) {
5954
- return this._get(`/funnels/${id}/conversions`);
6114
+ return this._get(`/funnels/${pathSegment(id, "id")}/conversions`);
5955
6115
  }
5956
6116
  // --------------------------------------------------------------------------
5957
6117
  // Custom Metrics
@@ -6014,47 +6174,47 @@ var FlagsService = class extends ServiceModule {
6014
6174
  );
6015
6175
  }
6016
6176
  async get(id, options) {
6017
- return this._get(`/${id}`, options);
6177
+ return this._get(`/${pathSegment(id, "id")}`, options);
6018
6178
  }
6019
6179
  async create(data, params, options) {
6020
6180
  const path = this.withQuery("", { application_id: params?.applicationId });
6021
6181
  return this.post(path, data, options);
6022
6182
  }
6023
6183
  async update(id, data, options) {
6024
- return this.patch(`/${id}`, data, options);
6184
+ return this.patch(`/${pathSegment(id, "id")}`, data, options);
6025
6185
  }
6026
6186
  async archive(id, options) {
6027
- return this.del(`/${id}`, options);
6187
+ return this.del(`/${pathSegment(id, "id")}`, options);
6028
6188
  }
6029
6189
  async activate(id, options) {
6030
- return this.post(`/${id}/activate`, void 0, options);
6190
+ return this.post(`/${pathSegment(id, "id")}/activate`, void 0, options);
6031
6191
  }
6032
6192
  async deactivate(id, options) {
6033
- return this.post(`/${id}/deactivate`, void 0, options);
6193
+ return this.post(`/${pathSegment(id, "id")}/deactivate`, void 0, options);
6034
6194
  }
6035
6195
  async listRules(id, options) {
6036
- return this._get(`/${id}/rules`, options);
6196
+ return this._get(`/${pathSegment(id, "id")}/rules`, options);
6037
6197
  }
6038
6198
  async createRule(id, data, options) {
6039
- return this.post(`/${id}/rules`, data, options);
6199
+ return this.post(`/${pathSegment(id, "id")}/rules`, data, options);
6040
6200
  }
6041
6201
  async updateRule(id, data, options) {
6042
- return this.patch(`/rules/${id}`, data, options);
6202
+ return this.patch(`/rules/${pathSegment(id, "id")}`, data, options);
6043
6203
  }
6044
6204
  async deleteRule(id, options) {
6045
- return this.del(`/rules/${id}`, options);
6205
+ return this.del(`/rules/${pathSegment(id, "id")}`, options);
6046
6206
  }
6047
6207
  async listVariants(id, options) {
6048
- return this._get(`/${id}/variants`, options);
6208
+ return this._get(`/${pathSegment(id, "id")}/variants`, options);
6049
6209
  }
6050
6210
  async createVariant(id, data, options) {
6051
- return this.post(`/${id}/variants`, data, options);
6211
+ return this.post(`/${pathSegment(id, "id")}/variants`, data, options);
6052
6212
  }
6053
6213
  async updateVariant(id, data, options) {
6054
- return this.patch(`/variants/${id}`, data, options);
6214
+ return this.patch(`/variants/${pathSegment(id, "id")}`, data, options);
6055
6215
  }
6056
6216
  async deleteVariant(id, options) {
6057
- return this.del(`/variants/${id}`, options);
6217
+ return this.del(`/variants/${pathSegment(id, "id")}`, options);
6058
6218
  }
6059
6219
  async listSegments(params, options) {
6060
6220
  return this._get(this.withQuery("/segments", { application_id: params?.applicationId }), options);
@@ -6067,19 +6227,23 @@ var FlagsService = class extends ServiceModule {
6067
6227
  );
6068
6228
  }
6069
6229
  async updateSegment(id, data, options) {
6070
- return this.patch(`/segments/${id}`, data, options);
6230
+ return this.patch(`/segments/${pathSegment(id, "id")}`, data, options);
6071
6231
  }
6072
6232
  async deleteSegment(id, options) {
6073
- return this.del(`/segments/${id}`, options);
6233
+ return this.del(`/segments/${pathSegment(id, "id")}`, options);
6074
6234
  }
6075
6235
  async listEnvironments(id, options) {
6076
- return this._get(`/${id}/environments`, options);
6236
+ return this._get(`/${pathSegment(id, "id")}/environments`, options);
6077
6237
  }
6078
6238
  async upsertEnvironment(id, environment, data, options) {
6079
- return this.put(`/${id}/environments/${encodeURIComponent(environment)}`, data, options);
6239
+ return this.put(
6240
+ `/${pathSegment(id, "id")}/environments/${pathSegment(environment, "environment")}`,
6241
+ data,
6242
+ options
6243
+ );
6080
6244
  }
6081
6245
  async listAudit(id, limit, options) {
6082
- return this._get(this.withQuery(`/${id}/audit`, { limit }), options);
6246
+ return this._get(this.withQuery(`/${pathSegment(id, "id")}/audit`, { limit }), options);
6083
6247
  }
6084
6248
  };
6085
6249
 
@@ -6096,7 +6260,7 @@ var CommunicationService = class extends ServiceModule {
6096
6260
  return this.post("/email/send", data, options);
6097
6261
  }
6098
6262
  async sendEmailTemplate(template, data, options) {
6099
- return this.post(`/email/templates/${template}/send`, data, options);
6263
+ return this.post(`/email/templates/${pathSegment(template, "template")}/send`, data, options);
6100
6264
  }
6101
6265
  // --------------------------------------------------------------------------
6102
6266
  // SMS
@@ -6105,7 +6269,7 @@ var CommunicationService = class extends ServiceModule {
6105
6269
  return this.post("/sms/send", data, options);
6106
6270
  }
6107
6271
  async sendSmsTemplate(template, data, options) {
6108
- return this.post(`/sms/templates/${template}/send`, data, options);
6272
+ return this.post(`/sms/templates/${pathSegment(template, "template")}/send`, data, options);
6109
6273
  }
6110
6274
  // --------------------------------------------------------------------------
6111
6275
  // Push Notifications — Send
@@ -6121,20 +6285,20 @@ var CommunicationService = class extends ServiceModule {
6121
6285
  }
6122
6286
  /** @deprecated Use unregisterPushTokenById() for web push tokens */
6123
6287
  async unregisterPushToken(token, options) {
6124
- return this.del(`/push/tokens/${token}`, options);
6288
+ return this.del(`/push/tokens/${pathSegment(token, "token")}`, options);
6125
6289
  }
6126
6290
  async unregisterPushTokenById(id, options) {
6127
- const result = await this.del(`/push/tokens/by-id/${id}`, options);
6291
+ const result = await this.del(`/push/tokens/by-id/${pathSegment(id, "id")}`, options);
6128
6292
  if (result.data && typeof result.data === "object" && !("id" in result.data)) {
6129
6293
  return { data: void 0, error: null };
6130
6294
  }
6131
6295
  return result;
6132
6296
  }
6133
6297
  async associatePushTokenUserById(id, options) {
6134
- return this.put(`/push/tokens/by-id/${id}/user`, {}, options);
6298
+ return this.put(`/push/tokens/by-id/${pathSegment(id, "id")}/user`, {}, options);
6135
6299
  }
6136
6300
  async disassociatePushTokenUser(id, options) {
6137
- const result = await this.del(`/push/tokens/by-id/${id}/user`, options);
6301
+ const result = await this.del(`/push/tokens/by-id/${pathSegment(id, "id")}/user`, options);
6138
6302
  if (result.data && typeof result.data === "object" && !("id" in result.data)) {
6139
6303
  return { data: void 0, error: null };
6140
6304
  }
@@ -6153,10 +6317,10 @@ var CommunicationService = class extends ServiceModule {
6153
6317
  return this._get("/push/topics", options);
6154
6318
  }
6155
6319
  async subscribeTopic(topicId, data, options) {
6156
- return this.post(`/push/topics/${topicId}/subscribe`, data || {}, options);
6320
+ return this.post(`/push/topics/${pathSegment(topicId, "topicId")}/subscribe`, data || {}, options);
6157
6321
  }
6158
6322
  async unsubscribeTopic(topicId, options) {
6159
- return this.del(`/push/topics/${topicId}/subscribe`, options);
6323
+ return this.del(`/push/topics/${pathSegment(topicId, "topicId")}/subscribe`, options);
6160
6324
  }
6161
6325
  async listSubscriptions(options) {
6162
6326
  return this._get("/push/subscriptions", options);
@@ -6174,7 +6338,7 @@ var CommunicationService = class extends ServiceModule {
6174
6338
  // Message Status
6175
6339
  // --------------------------------------------------------------------------
6176
6340
  async getMessageStatus(id, options) {
6177
- return this._get(`/messages/${id}`, options);
6341
+ return this._get(`/messages/${pathSegment(id, "id")}`, options);
6178
6342
  }
6179
6343
  // --------------------------------------------------------------------------
6180
6344
  // Legacy methods (backward compat)
@@ -6237,7 +6401,7 @@ var NotificationsService = class extends ServiceModule {
6237
6401
  * Mark a single notification as read.
6238
6402
  */
6239
6403
  async markRead(id, options) {
6240
- return this.patch(`/${id}/read`, void 0, options);
6404
+ return this.patch(`/${pathSegment(id, "id")}/read`, void 0, options);
6241
6405
  }
6242
6406
  /**
6243
6407
  * Mark all notifications as read.
@@ -6249,7 +6413,7 @@ var NotificationsService = class extends ServiceModule {
6249
6413
  * Dismiss a notification (soft delete).
6250
6414
  */
6251
6415
  async dismiss(id, options) {
6252
- return this.del(`/${id}`, options);
6416
+ return this.del(`/${pathSegment(id, "id")}`, options);
6253
6417
  }
6254
6418
  };
6255
6419
 
@@ -6559,34 +6723,34 @@ var SchedulerService = class extends ServiceModule {
6559
6723
  return this._list("/jobs", params, requestOptions);
6560
6724
  }
6561
6725
  async getJob(id, options) {
6562
- return this._get(`/jobs/${id}`, options);
6726
+ return this._get(`/jobs/${pathSegment(id, "id")}`, options);
6563
6727
  }
6564
6728
  async updateJob(id, data, options) {
6565
- return this.patch(`/jobs/${id}`, data, options);
6729
+ return this.patch(`/jobs/${pathSegment(id, "id")}`, data, options);
6566
6730
  }
6567
6731
  async deleteJob(id, options) {
6568
- return this.del(`/jobs/${id}`, options);
6732
+ return this.del(`/jobs/${pathSegment(id, "id")}`, options);
6569
6733
  }
6570
6734
  // --------------------------------------------------------------------------
6571
6735
  // Job Control
6572
6736
  // --------------------------------------------------------------------------
6573
6737
  async pauseJob(id, options) {
6574
- return this.post(`/jobs/${id}/pause`, void 0, options);
6738
+ return this.post(`/jobs/${pathSegment(id, "id")}/pause`, void 0, options);
6575
6739
  }
6576
6740
  async resumeJob(id, options) {
6577
- return this.post(`/jobs/${id}/resume`, void 0, options);
6741
+ return this.post(`/jobs/${pathSegment(id, "id")}/resume`, void 0, options);
6578
6742
  }
6579
6743
  async runNow(id, options) {
6580
- return this.post(`/jobs/${id}/run-now`, void 0, options);
6744
+ return this.post(`/jobs/${pathSegment(id, "id")}/run-now`, void 0, options);
6581
6745
  }
6582
6746
  // --------------------------------------------------------------------------
6583
6747
  // Execution History & Stats
6584
6748
  // --------------------------------------------------------------------------
6585
6749
  async getExecutions(jobId, params, requestOptions) {
6586
- return this._list(`/jobs/${jobId}/executions`, params, requestOptions);
6750
+ return this._list(`/jobs/${pathSegment(jobId, "jobId")}/executions`, params, requestOptions);
6587
6751
  }
6588
6752
  async getStats(jobId, options) {
6589
- return this._get(`/jobs/${jobId}/stats`, options);
6753
+ return this._get(`/jobs/${pathSegment(jobId, "jobId")}/stats`, options);
6590
6754
  }
6591
6755
  };
6592
6756
 
@@ -6609,7 +6773,7 @@ var DecisionsService = class extends ServiceModule {
6609
6773
  */
6610
6774
  async evaluate(decisionKey, inputs, options, requestOptions) {
6611
6775
  return this.post(
6612
- `/evaluate/${encodeURIComponent(decisionKey)}`,
6776
+ `/evaluate/${pathSegment(decisionKey, "decisionKey")}`,
6613
6777
  { inputs, options: options ?? {} },
6614
6778
  requestOptions
6615
6779
  );
@@ -6620,12 +6784,12 @@ var DecisionsService = class extends ServiceModule {
6620
6784
  }
6621
6785
  /** Fetch a stored receipt (end users only see their own). */
6622
6786
  async getReceipt(receiptId, requestOptions) {
6623
- return this._get(`/receipts/${encodeURIComponent(receiptId)}`, requestOptions);
6787
+ return this._get(`/receipts/${pathSegment(receiptId, "receiptId")}`, requestOptions);
6624
6788
  }
6625
6789
  /** Server-side verification of a stored receipt against the receipt ring. */
6626
6790
  async verifyReceipt(receiptId, requestOptions) {
6627
6791
  return this.post(
6628
- `/receipts/${encodeURIComponent(receiptId)}/verify`,
6792
+ `/receipts/${pathSegment(receiptId, "receiptId")}/verify`,
6629
6793
  void 0,
6630
6794
  requestOptions
6631
6795
  );
@@ -6654,6 +6818,13 @@ var AiService = class {
6654
6818
  get runs() {
6655
6819
  return this.ai.runs;
6656
6820
  }
6821
+ /**
6822
+ * Operation selection: `list`, `setPreference`, `clearPreference`,
6823
+ * `getSettings`, `updateSettings`. Option keys only; never agent or model ids.
6824
+ */
6825
+ get operations() {
6826
+ return this.ai.operations;
6827
+ }
6657
6828
  /** Summarize text and wait for the typed result. */
6658
6829
  summarize(input, options) {
6659
6830
  return this.ai.summarize(input, options);
@@ -6675,7 +6846,7 @@ var BookingsService = class extends ServiceModule {
6675
6846
  return this.post("/quotes", input, requestOptions);
6676
6847
  }
6677
6848
  async getQuote(quoteId, requestOptions) {
6678
- return this._get(`/quotes/${encodeURIComponent(quoteId)}`, requestOptions);
6849
+ return this._get(`/quotes/${pathSegment(quoteId, "quoteId")}`, requestOptions);
6679
6850
  }
6680
6851
  /**
6681
6852
  * Accept a quote with a verified deposit receipt. Bookings re-verifies the
@@ -6683,15 +6854,15 @@ var BookingsService = class extends ServiceModule {
6683
6854
  * and deposit on the quote.
6684
6855
  */
6685
6856
  async acceptQuote(quoteId, input, requestOptions) {
6686
- return this.post(`/quotes/${encodeURIComponent(quoteId)}/accept`, input, requestOptions);
6857
+ return this.post(`/quotes/${pathSegment(quoteId, "quoteId")}/accept`, input, requestOptions);
6687
6858
  }
6688
6859
  async getCustomerStats(customerRef, requestOptions) {
6689
- return this._get(`/customers/${encodeURIComponent(customerRef)}/stats`, requestOptions);
6860
+ return this._get(`/customers/${pathSegment(customerRef, "customerRef")}/stats`, requestOptions);
6690
6861
  }
6691
6862
  /** Host/admin: mark a booking completed (maintains the customer stats projection). */
6692
6863
  async completeBooking(bookingId, reason, requestOptions) {
6693
6864
  return this.post(
6694
- `/dashboard/bookings/${encodeURIComponent(bookingId)}/complete`,
6865
+ `/dashboard/bookings/${pathSegment(bookingId, "bookingId")}/complete`,
6695
6866
  { reason },
6696
6867
  requestOptions
6697
6868
  );
@@ -6699,7 +6870,7 @@ var BookingsService = class extends ServiceModule {
6699
6870
  /** Host/admin: mark a booking as a no-show (maintains the customer stats projection). */
6700
6871
  async markNoShow(bookingId, reason, requestOptions) {
6701
6872
  return this.post(
6702
- `/dashboard/bookings/${encodeURIComponent(bookingId)}/no-show`,
6873
+ `/dashboard/bookings/${pathSegment(bookingId, "bookingId")}/no-show`,
6703
6874
  { reason },
6704
6875
  requestOptions
6705
6876
  );
@@ -6733,10 +6904,14 @@ var PermissionsService = class extends ServiceModule {
6733
6904
  return this._get("/roles", options);
6734
6905
  }
6735
6906
  async assignPermissions(roleId, permissions, options) {
6736
- return this.post(`/roles/${roleId}/permissions`, { permissions }, options);
6907
+ return this.post(`/roles/${pathSegment(roleId, "roleId")}/permissions`, { permissions }, options);
6737
6908
  }
6738
6909
  async assignRole(userId, roleId, options) {
6739
- return this.post(`/users/${userId}/roles`, { role_id: roleId }, options);
6910
+ return this.post(
6911
+ `/users/${pathSegment(userId, "userId")}/roles`,
6912
+ { role_id: roleId },
6913
+ options
6914
+ );
6740
6915
  }
6741
6916
  // --------------------------------------------------------------------------
6742
6917
  // Permission Checks (unified — supports both member and user identity types)
@@ -6775,7 +6950,7 @@ var PermissionsService = class extends ServiceModule {
6775
6950
  return this._get(`/matrix?${params.toString()}`, options);
6776
6951
  }
6777
6952
  async getUserPermissions(userId, options) {
6778
- return this._get(`/users/${userId}/permissions`, options);
6953
+ return this._get(`/users/${pathSegment(userId, "userId")}/permissions`, options);
6779
6954
  }
6780
6955
  // --------------------------------------------------------------------------
6781
6956
  // Policies
@@ -6821,52 +6996,59 @@ var WorkspacesService = class extends ServiceModule {
6821
6996
  return this._list("/mine", params, options);
6822
6997
  }
6823
6998
  async get(id, options) {
6824
- return this._get(`/${id}`, options);
6999
+ return this._get(`/${pathSegment(id, "id")}`, options);
6825
7000
  }
6826
7001
  async update(id, data, options) {
6827
- return this.patch(`/${id}`, data, options);
7002
+ return this.patch(`/${pathSegment(id, "id")}`, data, options);
6828
7003
  }
6829
7004
  async delete(id, options) {
6830
- return this.del(`/${id}`, options);
7005
+ return this.del(`/${pathSegment(id, "id")}`, options);
6831
7006
  }
6832
7007
  // --------------------------------------------------------------------------
6833
7008
  // Members
6834
7009
  // --------------------------------------------------------------------------
6835
7010
  async listMembers(workspaceId, params, requestOptions) {
6836
- return this._list(`/${workspaceId}/members`, params, requestOptions);
7011
+ return this._list(`/${pathSegment(workspaceId, "workspaceId")}/members`, params, requestOptions);
6837
7012
  }
6838
7013
  async addMember(workspaceId, data, options) {
6839
- return this.post(`/${workspaceId}/members`, data, options);
7014
+ return this.post(`/${pathSegment(workspaceId, "workspaceId")}/members`, data, options);
6840
7015
  }
6841
7016
  async updateMember(workspaceId, userId, data, options) {
6842
- return this.patch(`/${workspaceId}/members/${userId}`, data, options);
7017
+ return this.patch(
7018
+ `/${pathSegment(workspaceId, "workspaceId")}/members/${pathSegment(userId, "userId")}`,
7019
+ data,
7020
+ options
7021
+ );
6843
7022
  }
6844
7023
  async removeMember(workspaceId, userId, options) {
6845
- return this.del(`/${workspaceId}/members/${userId}`, options);
7024
+ return this.del(
7025
+ `/${pathSegment(workspaceId, "workspaceId")}/members/${pathSegment(userId, "userId")}`,
7026
+ options
7027
+ );
6846
7028
  }
6847
7029
  // --------------------------------------------------------------------------
6848
7030
  // Invitations
6849
7031
  // --------------------------------------------------------------------------
6850
7032
  async invite(workspaceId, data, options) {
6851
- return this.post(`/${workspaceId}/invitations`, data, options);
7033
+ return this.post(`/${pathSegment(workspaceId, "workspaceId")}/invitations`, data, options);
6852
7034
  }
6853
7035
  async listInvitations(workspaceId, options) {
6854
- return this._get(`/${workspaceId}/invitations`, options);
7036
+ return this._get(`/${pathSegment(workspaceId, "workspaceId")}/invitations`, options);
6855
7037
  }
6856
7038
  async acceptInvitation(token, options) {
6857
- return this.post(`/invitations/${token}/accept`, void 0, options);
7039
+ return this.post(`/invitations/${pathSegment(token, "token")}/accept`, void 0, options);
6858
7040
  }
6859
7041
  async cancelInvitation(id, options) {
6860
- return this.del(`/invitations/${id}`, options);
7042
+ return this.del(`/invitations/${pathSegment(id, "id")}`, options);
6861
7043
  }
6862
7044
  // --------------------------------------------------------------------------
6863
7045
  // SSO (workspace-only)
6864
7046
  // --------------------------------------------------------------------------
6865
7047
  async configureSso(workspaceId, data, options) {
6866
- return this.post(`/${workspaceId}/sso/configure`, data, options);
7048
+ return this.post(`/${pathSegment(workspaceId, "workspaceId")}/sso/configure`, data, options);
6867
7049
  }
6868
7050
  async getSso(workspaceId, options) {
6869
- return this._get(`/${workspaceId}/sso`, options);
7051
+ return this._get(`/${pathSegment(workspaceId, "workspaceId")}/sso`, options);
6870
7052
  }
6871
7053
  };
6872
7054
 
@@ -6889,43 +7071,50 @@ var TeamsService = class extends ServiceModule {
6889
7071
  return this._list("/mine", params, options);
6890
7072
  }
6891
7073
  async get(id, options) {
6892
- return this._get(`/${id}`, options);
7074
+ return this._get(`/${pathSegment(id, "id")}`, options);
6893
7075
  }
6894
7076
  async update(id, data, options) {
6895
- return this.patch(`/${id}`, data, options);
7077
+ return this.patch(`/${pathSegment(id, "id")}`, data, options);
6896
7078
  }
6897
7079
  async delete(id, options) {
6898
- return this.del(`/${id}`, options);
7080
+ return this.del(`/${pathSegment(id, "id")}`, options);
6899
7081
  }
6900
7082
  // --------------------------------------------------------------------------
6901
7083
  // Members
6902
7084
  // --------------------------------------------------------------------------
6903
7085
  async listMembers(teamId, params, requestOptions) {
6904
- return this._list(`/${teamId}/members`, params, requestOptions);
7086
+ return this._list(`/${pathSegment(teamId, "teamId")}/members`, params, requestOptions);
6905
7087
  }
6906
7088
  async addMember(teamId, data, options) {
6907
- return this.post(`/${teamId}/members`, data, options);
7089
+ return this.post(`/${pathSegment(teamId, "teamId")}/members`, data, options);
6908
7090
  }
6909
7091
  async updateMember(teamId, userId, data, options) {
6910
- return this.patch(`/${teamId}/members/${userId}`, data, options);
7092
+ return this.patch(
7093
+ `/${pathSegment(teamId, "teamId")}/members/${pathSegment(userId, "userId")}`,
7094
+ data,
7095
+ options
7096
+ );
6911
7097
  }
6912
7098
  async removeMember(teamId, userId, options) {
6913
- return this.del(`/${teamId}/members/${userId}`, options);
7099
+ return this.del(
7100
+ `/${pathSegment(teamId, "teamId")}/members/${pathSegment(userId, "userId")}`,
7101
+ options
7102
+ );
6914
7103
  }
6915
7104
  // --------------------------------------------------------------------------
6916
7105
  // Invitations
6917
7106
  // --------------------------------------------------------------------------
6918
7107
  async invite(teamId, data, options) {
6919
- return this.post(`/${teamId}/invitations`, data, options);
7108
+ return this.post(`/${pathSegment(teamId, "teamId")}/invitations`, data, options);
6920
7109
  }
6921
7110
  async listInvitations(teamId, options) {
6922
- return this._get(`/${teamId}/invitations`, options);
7111
+ return this._get(`/${pathSegment(teamId, "teamId")}/invitations`, options);
6923
7112
  }
6924
7113
  async acceptInvitation(token, options) {
6925
- return this.post(`/invitations/${token}/accept`, void 0, options);
7114
+ return this.post(`/invitations/${pathSegment(token, "token")}/accept`, void 0, options);
6926
7115
  }
6927
7116
  async cancelInvitation(id, options) {
6928
- return this.del(`/invitations/${id}`, options);
7117
+ return this.del(`/invitations/${pathSegment(id, "id")}`, options);
6929
7118
  }
6930
7119
  };
6931
7120
 
@@ -6939,22 +7128,31 @@ var GraphService = class extends ServiceModule {
6939
7128
  return this.post("/nodes", data, requestOptions);
6940
7129
  }
6941
7130
  async updateNode(nodeId, data, requestOptions) {
6942
- return this.patch(`/nodes/${nodeId}`, data, requestOptions);
7131
+ return this.patch(`/nodes/${pathSegment(nodeId, "nodeId")}`, data, requestOptions);
6943
7132
  }
6944
7133
  async createEdge(data, requestOptions) {
6945
7134
  return this.post("/edges", data, requestOptions);
6946
7135
  }
6947
7136
  async getEdges(nodeId, options, requestOptions) {
6948
- return this._get(this.withQuery(`/nodes/${nodeId}/edges`, options), requestOptions);
7137
+ return this._get(
7138
+ this.withQuery(`/nodes/${pathSegment(nodeId, "nodeId")}/edges`, options),
7139
+ requestOptions
7140
+ );
6949
7141
  }
6950
7142
  async traverse(nodeId, options, requestOptions) {
6951
- return this._get(this.withQuery(`/nodes/${nodeId}/traverse`, options), requestOptions);
7143
+ return this._get(
7144
+ this.withQuery(`/nodes/${pathSegment(nodeId, "nodeId")}/traverse`, options),
7145
+ requestOptions
7146
+ );
6952
7147
  }
6953
7148
  async shortestPath(options, requestOptions) {
6954
7149
  return this.post("/shortest-path", options, requestOptions);
6955
7150
  }
6956
7151
  async neighbors(nodeId, options, requestOptions) {
6957
- return this._get(this.withQuery(`/nodes/${nodeId}/neighbors`, options), requestOptions);
7152
+ return this._get(
7153
+ this.withQuery(`/nodes/${pathSegment(nodeId, "nodeId")}/neighbors`, options),
7154
+ requestOptions
7155
+ );
6958
7156
  }
6959
7157
  async pageRank(options, requestOptions) {
6960
7158
  return this.post("/algorithms/pagerank", options, requestOptions);
@@ -6980,28 +7178,28 @@ var FunctionsService = class extends ServiceModule {
6980
7178
  return this._get("", options);
6981
7179
  }
6982
7180
  async get(name, options) {
6983
- return this._get(`/${name}`, options);
7181
+ return this._get(`/${pathSegment(name, "name")}`, options);
6984
7182
  }
6985
7183
  async update(name, data, options) {
6986
- return this.patch(`/${name}`, data, options);
7184
+ return this.patch(`/${pathSegment(name, "name")}`, data, options);
6987
7185
  }
6988
7186
  async delete(name, options) {
6989
- return this.del(`/${name}`, options);
7187
+ return this.del(`/${pathSegment(name, "name")}`, options);
6990
7188
  }
6991
7189
  async invoke(name, payload, options) {
6992
- return this.post(`/${name}/invoke`, payload, options);
7190
+ return this.post(`/${pathSegment(name, "name")}/invoke`, payload, options);
6993
7191
  }
6994
7192
  async invokeAsync(name, payload, options) {
6995
- return this.post(`/${name}/invoke-async`, payload, options);
7193
+ return this.post(`/${pathSegment(name, "name")}/invoke-async`, payload, options);
6996
7194
  }
6997
7195
  async getLogs(name, options) {
6998
- return this._get(`/${name}/logs`, options);
7196
+ return this._get(`/${pathSegment(name, "name")}/logs`, options);
6999
7197
  }
7000
7198
  async getExecutions(name, params, requestOptions) {
7001
- return this._list(`/${name}/executions`, params, requestOptions);
7199
+ return this._list(`/${pathSegment(name, "name")}/executions`, params, requestOptions);
7002
7200
  }
7003
7201
  async getMetrics(name, options) {
7004
- return this._get(`/${name}/metrics`, options);
7202
+ return this._get(`/${pathSegment(name, "name")}/metrics`, options);
7005
7203
  }
7006
7204
  /** @deprecated Use deploy() instead */
7007
7205
  async deployFunction(data) {
@@ -7023,13 +7221,13 @@ var ListingsService = class extends ServiceModule {
7023
7221
  return this.post("", data, options);
7024
7222
  }
7025
7223
  async get(id, options) {
7026
- return this._get(`/${id}`, options);
7224
+ return this._get(`/${pathSegment(id, "id")}`, options);
7027
7225
  }
7028
7226
  async update(id, data, options) {
7029
- return this.patch(`/${id}`, data, options);
7227
+ return this.patch(`/${pathSegment(id, "id")}`, data, options);
7030
7228
  }
7031
7229
  async delete(id, options) {
7032
- return this.del(`/${id}`, options);
7230
+ return this.del(`/${pathSegment(id, "id")}`, options);
7033
7231
  }
7034
7232
  async search(query, filters, options) {
7035
7233
  return this._get(this.withQuery("/search", { query, ...filters }), options);
@@ -7038,19 +7236,19 @@ var ListingsService = class extends ServiceModule {
7038
7236
  return this._get(this.withQuery("/nearby", nearbyOptions), options);
7039
7237
  }
7040
7238
  async getByCategory(category, params, requestOptions) {
7041
- return this._list(`/categories/${category}`, params, requestOptions);
7239
+ return this._list(`/categories/${pathSegment(category, "category")}`, params, requestOptions);
7042
7240
  }
7043
7241
  async favorite(listingId, options) {
7044
- return this.post(`/${listingId}/favorite`, void 0, options);
7242
+ return this.post(`/${pathSegment(listingId, "listingId")}/favorite`, void 0, options);
7045
7243
  }
7046
7244
  async unfavorite(listingId, options) {
7047
- return this.del(`/${listingId}/favorite`, options);
7245
+ return this.del(`/${pathSegment(listingId, "listingId")}/favorite`, options);
7048
7246
  }
7049
7247
  async getFavorites(params, requestOptions) {
7050
7248
  return this._list("/favorites", params, requestOptions);
7051
7249
  }
7052
7250
  async trackView(listingId, options) {
7053
- return this.post(`/${listingId}/view`, void 0, options);
7251
+ return this.post(`/${pathSegment(listingId, "listingId")}/view`, void 0, options);
7054
7252
  }
7055
7253
  /** @deprecated Use create() instead */
7056
7254
  async createListing(data) {
@@ -7067,7 +7265,7 @@ var ListingsService = class extends ServiceModule {
7067
7265
  };
7068
7266
 
7069
7267
  // src/services/community-maps.ts
7070
- var segment = (value) => encodeURIComponent(value);
7268
+ var segment = (value) => pathSegment(value);
7071
7269
  function devicePositionPayload(p) {
7072
7270
  return {
7073
7271
  latitude: p.latitude,
@@ -7101,7 +7299,7 @@ var CommunityMapsService = class extends ServiceModule {
7101
7299
  }
7102
7300
  listOwnSubmissions(slug, after, options) {
7103
7301
  return this._get(
7104
- "/collections/" + segment(slug) + "/submissions" + (after ? "?after=" + segment(after) : ""),
7302
+ "/collections/" + segment(slug) + "/submissions" + (after ? "?after=" + encodeURIComponent(after) : ""),
7105
7303
  options
7106
7304
  );
7107
7305
  }
@@ -7294,13 +7492,13 @@ var LocalIntelligenceService = class extends ServiceModule {
7294
7492
  this.basePath = "/v1/news";
7295
7493
  }
7296
7494
  scope(publication) {
7297
- return `/intelligence/publications/${encodeURIComponent(publication)}`;
7495
+ return `/intelligence/publications/${pathSegment(publication, "publication")}`;
7298
7496
  }
7299
7497
  records(publication, params = {}, options) {
7300
7498
  return this._get(this.withQuery(`${this.scope(publication)}/records`, params), options);
7301
7499
  }
7302
7500
  get(publication, record, options) {
7303
- return this._get(`${this.scope(publication)}/records/${encodeURIComponent(record)}`, options);
7501
+ return this._get(`${this.scope(publication)}/records/${pathSegment(record, "record")}`, options);
7304
7502
  }
7305
7503
  changes(publication, params = {}, options) {
7306
7504
  return this._get(this.withQuery(`${this.scope(publication)}/changes`, params), options);
@@ -7327,24 +7525,24 @@ var LocalIntelligenceService = class extends ServiceModule {
7327
7525
  }
7328
7526
  feedback(publication, record, recordRevision, outcome, options) {
7329
7527
  return this.post(
7330
- `${this.scope(publication)}/records/${encodeURIComponent(record)}/feedback`,
7528
+ `${this.scope(publication)}/records/${pathSegment(record, "record")}/feedback`,
7331
7529
  { record_revision: recordRevision, outcome },
7332
7530
  options
7333
7531
  );
7334
7532
  }
7335
7533
  deleteFeedback(publication, record, options) {
7336
- return this.del(`${this.scope(publication)}/records/${encodeURIComponent(record)}/feedback`, options);
7534
+ return this.del(`${this.scope(publication)}/records/${pathSegment(record, "record")}/feedback`, options);
7337
7535
  }
7338
7536
  /** Requires a human editor with publication publish authority. */
7339
7537
  release(publication, input, idempotencyKey, options) {
7340
- return this.post(`/publications/${encodeURIComponent(publication)}/intelligence`, input, {
7538
+ return this.post(`/publications/${pathSegment(publication, "publication")}/intelligence`, input, {
7341
7539
  ...options,
7342
7540
  headers: { ...options?.headers, "idempotency-key": idempotencyKey }
7343
7541
  });
7344
7542
  }
7345
7543
  withdraw(publication, record, expectedRevision, reason, options) {
7346
7544
  return this.post(
7347
- `/publications/${encodeURIComponent(publication)}/intelligence/${encodeURIComponent(record)}/withdraw`,
7545
+ `/publications/${pathSegment(publication, "publication")}/intelligence/${pathSegment(record, "record")}/withdraw`,
7348
7546
  { expected_revision: expectedRevision, reason },
7349
7547
  options
7350
7548
  );
@@ -7391,29 +7589,29 @@ var PollsService = class extends ServiceModule {
7391
7589
  return this._get(this.withQuery("/manage", params), options);
7392
7590
  }
7393
7591
  async get(id, options) {
7394
- return this._get(`/manage/${encodeURIComponent(id)}`, options);
7592
+ return this._get(`/manage/${pathSegment(id, "id")}`, options);
7395
7593
  }
7396
7594
  async update(id, data, options) {
7397
- return this.patch(`/manage/${encodeURIComponent(id)}`, data, options);
7595
+ return this.patch(`/manage/${pathSegment(id, "id")}`, data, options);
7398
7596
  }
7399
7597
  async publish(id, options) {
7400
- return this.post(`/manage/${encodeURIComponent(id)}/publish`, {}, options);
7598
+ return this.post(`/manage/${pathSegment(id, "id")}/publish`, {}, options);
7401
7599
  }
7402
7600
  async close(id, options) {
7403
- return this.post(`/manage/${encodeURIComponent(id)}/close`, {}, options);
7601
+ return this.post(`/manage/${pathSegment(id, "id")}/close`, {}, options);
7404
7602
  }
7405
7603
  async listPublic(params, options) {
7406
7604
  return this._get(this.withQuery("/public", params), options);
7407
7605
  }
7408
7606
  async getPublic(slug, params, options) {
7409
7607
  return this._get(
7410
- this.withQuery(`/public/${encodeURIComponent(slug)}`, params),
7608
+ this.withQuery(`/public/${pathSegment(slug, "slug")}`, params),
7411
7609
  options
7412
7610
  );
7413
7611
  }
7414
7612
  async vote(slug, choiceId, voterKey, options) {
7415
7613
  return this.post(
7416
- `/public/${encodeURIComponent(slug)}/votes`,
7614
+ `/public/${pathSegment(slug, "slug")}/votes`,
7417
7615
  {
7418
7616
  choice_id: choiceId,
7419
7617
  voter_key: voterKey
@@ -7454,28 +7652,28 @@ var EventsService = class extends ServiceModule {
7454
7652
  return this.post("", data, options);
7455
7653
  }
7456
7654
  async get(eventId, options) {
7457
- return this._get(`/${eventId}`, options);
7655
+ return this._get(`/${pathSegment(eventId, "eventId")}`, options);
7458
7656
  }
7459
7657
  async update(eventId, data, options) {
7460
- return this.patch(`/${eventId}`, data, options);
7658
+ return this.patch(`/${pathSegment(eventId, "eventId")}`, data, options);
7461
7659
  }
7462
7660
  async delete(eventId, options) {
7463
- return this.del(`/${eventId}`, options);
7661
+ return this.del(`/${pathSegment(eventId, "eventId")}`, options);
7464
7662
  }
7465
7663
  async list(filters, requestOptions) {
7466
7664
  return this._list("", filters, requestOptions);
7467
7665
  }
7468
7666
  async register(eventId, options) {
7469
- return this.post(`/${eventId}/register`, void 0, options);
7667
+ return this.post(`/${pathSegment(eventId, "eventId")}/register`, void 0, options);
7470
7668
  }
7471
7669
  async unregister(eventId, options) {
7472
- return this.del(`/${eventId}/register`, options);
7670
+ return this.del(`/${pathSegment(eventId, "eventId")}/register`, options);
7473
7671
  }
7474
7672
  async getAttendees(eventId, params, requestOptions) {
7475
- return this._list(`/${eventId}/attendees`, params, requestOptions);
7673
+ return this._list(`/${pathSegment(eventId, "eventId")}/attendees`, params, requestOptions);
7476
7674
  }
7477
7675
  async checkIn(eventId, options) {
7478
- return this.post(`/${eventId}/check-in`, void 0, options);
7676
+ return this.post(`/${pathSegment(eventId, "eventId")}/check-in`, void 0, options);
7479
7677
  }
7480
7678
  /** @deprecated Use create() instead */
7481
7679
  async createEvent(data) {
@@ -7497,22 +7695,38 @@ var LeaderboardService = class extends ServiceModule {
7497
7695
  return this.post("", data, options);
7498
7696
  }
7499
7697
  async submitScore(boardId, data, options) {
7500
- return this.post(`/${boardId}/scores`, data, options);
7698
+ return this.post(`/${pathSegment(boardId, "boardId")}/scores`, data, options);
7501
7699
  }
7502
7700
  async getRankings(boardId, rankingOptions, requestOptions) {
7503
- return this._get(this.withQuery(`/${boardId}/rankings`, rankingOptions), requestOptions);
7701
+ return this._get(
7702
+ this.withQuery(`/${pathSegment(boardId, "boardId")}/rankings`, rankingOptions),
7703
+ requestOptions
7704
+ );
7504
7705
  }
7505
7706
  async getUserRank(boardId, userId, options) {
7506
- return this._get(`/${boardId}/users/${userId}/rank`, options);
7707
+ return this._get(
7708
+ `/${pathSegment(boardId, "boardId")}/users/${pathSegment(userId, "userId")}/rank`,
7709
+ options
7710
+ );
7507
7711
  }
7508
7712
  async getUserHistory(boardId, userId, options) {
7509
- return this._get(`/${boardId}/users/${userId}/history`, options);
7713
+ return this._get(
7714
+ `/${pathSegment(boardId, "boardId")}/users/${pathSegment(userId, "userId")}/history`,
7715
+ options
7716
+ );
7510
7717
  }
7511
7718
  async updateScore(boardId, userId, data, options) {
7512
- return this.patch(`/${boardId}/users/${userId}/score`, data, options);
7719
+ return this.patch(
7720
+ `/${pathSegment(boardId, "boardId")}/users/${pathSegment(userId, "userId")}/score`,
7721
+ data,
7722
+ options
7723
+ );
7513
7724
  }
7514
7725
  async deleteScore(boardId, userId, options) {
7515
- return this.del(`/${boardId}/users/${userId}/score`, options);
7726
+ return this.del(
7727
+ `/${pathSegment(boardId, "boardId")}/users/${pathSegment(userId, "userId")}/score`,
7728
+ options
7729
+ );
7516
7730
  }
7517
7731
  };
7518
7732
 
@@ -7529,13 +7743,13 @@ var WebhooksService = class extends ServiceModule {
7529
7743
  return this._get("", options);
7530
7744
  }
7531
7745
  async get(id, options) {
7532
- return this._get(`/${id}`, options);
7746
+ return this._get(`/${pathSegment(id, "id")}`, options);
7533
7747
  }
7534
7748
  async update(id, data, options) {
7535
- return this.patch(`/${id}`, data, options);
7749
+ return this.patch(`/${pathSegment(id, "id")}`, data, options);
7536
7750
  }
7537
7751
  async delete(id, options) {
7538
- return this.del(`/${id}`, options);
7752
+ return this.del(`/${pathSegment(id, "id")}`, options);
7539
7753
  }
7540
7754
  async listEvents(options) {
7541
7755
  return this._get("/events", options);
@@ -7567,7 +7781,7 @@ var NewslettersService = class extends ServiceModule {
7567
7781
  /** Signs a reader up. Call from the reader's browser so their own evidence is recorded. */
7568
7782
  async subscribe(slug, input, options) {
7569
7783
  return this.post(
7570
- `/lists/${encodeURIComponent(slug)}/subscriptions`,
7784
+ `/lists/${pathSegment(slug, "slug")}/subscriptions`,
7571
7785
  { channel: "email", ...input },
7572
7786
  { skipRetry: true, ...options }
7573
7787
  );
@@ -7613,7 +7827,10 @@ var SearchService = class extends ServiceModule {
7613
7827
  return this.post("/documents", { index: indexName, ...document2 }, options);
7614
7828
  }
7615
7829
  async removeDocument(indexName, docId, options) {
7616
- return this.del(`/documents/${indexName}/${docId}`, options);
7830
+ return this.del(
7831
+ `/documents/${pathSegment(indexName, "indexName")}/${pathSegment(docId, "docId")}`,
7832
+ options
7833
+ );
7617
7834
  }
7618
7835
  /** @deprecated Use query() instead */
7619
7836
  async search(queryStr, options) {
@@ -7648,22 +7865,22 @@ var PhotoService = class extends ServiceModule {
7648
7865
  });
7649
7866
  }
7650
7867
  async transform(photoId, transformations, options) {
7651
- return this.post(`/${photoId}/transform`, transformations, options);
7868
+ return this.post(`/${pathSegment(photoId, "photoId")}/transform`, transformations, options);
7652
7869
  }
7653
7870
  async get(id, options) {
7654
- return this._get(`/${id}`, options);
7871
+ return this._get(`/${pathSegment(id, "id")}`, options);
7655
7872
  }
7656
7873
  async delete(id, options) {
7657
- return this.del(`/${id}`, options);
7874
+ return this.del(`/${pathSegment(id, "id")}`, options);
7658
7875
  }
7659
7876
  async getPresets(options) {
7660
7877
  return this._get("/presets", options);
7661
7878
  }
7662
7879
  async getManifest(id, params, options) {
7663
- return this._get(this.withQuery(`/${id}/manifest`, params), options);
7880
+ return this._get(this.withQuery(`/${pathSegment(id, "id")}/manifest`, params), options);
7664
7881
  }
7665
7882
  async getPublicManifest(id, params, options) {
7666
- return this._get(this.withQuery(`/public/${id}/manifest`, params), options);
7883
+ return this._get(this.withQuery(`/public/${pathSegment(id, "id")}/manifest`, params), options);
7667
7884
  }
7668
7885
  /**
7669
7886
  * Build an absolute URL for the on-demand transform endpoint.
@@ -7680,7 +7897,7 @@ var PhotoService = class extends ServiceModule {
7680
7897
  if (options?.format) params.set("format", options.format);
7681
7898
  if (options?.quality) params.set("quality", String(options.quality));
7682
7899
  const qs = params.toString();
7683
- return `${this.client.getBaseUrl()}${this.basePath}/${photoId}/transform${qs ? `?${qs}` : ""}`;
7900
+ return `${this.client.getBaseUrl()}${this.basePath}/${pathSegment(photoId, "photoId")}/transform${qs ? `?${qs}` : ""}`;
7684
7901
  }
7685
7902
  /**
7686
7903
  * Build an absolute URL for the **public** transform endpoint —
@@ -7715,7 +7932,7 @@ var PhotoService = class extends ServiceModule {
7715
7932
  if (options?.format) params.set("format", options.format);
7716
7933
  if (options?.quality) params.set("quality", String(options.quality));
7717
7934
  const qs = params.toString();
7718
- return `${this.client.getBaseUrl()}${this.basePath}/public/${photoId}/transform${qs ? `?${qs}` : ""}`;
7935
+ return `${this.client.getBaseUrl()}${this.basePath}/public/${pathSegment(photoId, "photoId")}/transform${qs ? `?${qs}` : ""}`;
7719
7936
  }
7720
7937
  /**
7721
7938
  * Get a transform URL optimized for the given display area.
@@ -8114,7 +8331,7 @@ var MediaService = class extends ServiceModule {
8114
8331
  }
8115
8332
  async releaseQuarantine(fileId, reason = "Released via @scalemule/sdk media.releaseQuarantine()", options) {
8116
8333
  const response = await this.client.post(
8117
- `/v1/storage/admin/files/${fileId}/scan-override`,
8334
+ `/v1/storage/admin/files/${pathSegment(fileId, "fileId")}/scan-override`,
8118
8335
  { scan_status: "clean", reason },
8119
8336
  options
8120
8337
  );
@@ -8592,7 +8809,7 @@ var TtsService = class extends ServiceModule {
8592
8809
  );
8593
8810
  }
8594
8811
  async getJob(id, options) {
8595
- return this._get(`/jobs/${id}`, options);
8812
+ return this._get(`/jobs/${pathSegment(id, "id")}`, options);
8596
8813
  }
8597
8814
  async listVoices(params, options) {
8598
8815
  return this._get(this.withQuery("/voices", { provider: params?.provider }), options);
@@ -8609,13 +8826,13 @@ var DeadLetterApi = class extends ServiceModule {
8609
8826
  return this._get("", options);
8610
8827
  }
8611
8828
  async get(id, options) {
8612
- return this._get(`/${id}`, options);
8829
+ return this._get(`/${pathSegment(id, "id")}`, options);
8613
8830
  }
8614
8831
  async retry(id, options) {
8615
- return this.post(`/${id}/retry`, void 0, options);
8832
+ return this.post(`/${pathSegment(id, "id")}/retry`, void 0, options);
8616
8833
  }
8617
8834
  async delete(id, options) {
8618
- return this.del(`/${id}`, options);
8835
+ return this.del(`/${pathSegment(id, "id")}`, options);
8619
8836
  }
8620
8837
  };
8621
8838
  var QueueService = class extends ServiceModule {
@@ -8628,7 +8845,7 @@ var QueueService = class extends ServiceModule {
8628
8845
  return this.post("/jobs", data, options);
8629
8846
  }
8630
8847
  async getJob(id, options) {
8631
- return this._get(`/jobs/${id}`, options);
8848
+ return this._get(`/jobs/${pathSegment(id, "id")}`, options);
8632
8849
  }
8633
8850
  };
8634
8851
 
@@ -8639,13 +8856,13 @@ var CacheService = class extends ServiceModule {
8639
8856
  this.basePath = "/v1/cache";
8640
8857
  }
8641
8858
  async get(key, options) {
8642
- return this._get(`/${key}`, options);
8859
+ return this._get(`/${pathSegment(key, "key")}`, options);
8643
8860
  }
8644
8861
  async set(key, value, ttl, options) {
8645
8862
  return this.post("", { key, value, ttl }, options);
8646
8863
  }
8647
8864
  async delete(key, options) {
8648
- return this.del(`/${key}`, options);
8865
+ return this.del(`/${pathSegment(key, "key")}`, options);
8649
8866
  }
8650
8867
  async flush(options) {
8651
8868
  return this.del("", options);
@@ -8697,10 +8914,10 @@ var ComplianceService = class extends ServiceModule {
8697
8914
  return this.post("/consent/v2", data, options);
8698
8915
  }
8699
8916
  async getUserConsents(userId, options) {
8700
- return this._get(`/consent/v2/${userId}`, options);
8917
+ return this._get(`/consent/v2/${pathSegment(userId, "userId")}`, options);
8701
8918
  }
8702
8919
  async withdrawConsent(consentId, data, options) {
8703
- return this.put(`/consent/v2/${consentId}/withdraw`, data || {}, options);
8920
+ return this.put(`/consent/v2/${pathSegment(consentId, "consentId")}/withdraw`, data || {}, options);
8704
8921
  }
8705
8922
  // --- Data Subject Requests ---
8706
8923
  async createDataSubjectRequest(data, options) {
@@ -8710,16 +8927,16 @@ var ComplianceService = class extends ServiceModule {
8710
8927
  return this._get(`/dsr${this.qs(params)}`, requestOptions);
8711
8928
  }
8712
8929
  async getDataSubjectRequest(id, options) {
8713
- return this._get(`/dsr/${id}`, options);
8930
+ return this._get(`/dsr/${pathSegment(id, "id")}`, options);
8714
8931
  }
8715
8932
  async updateDsrStatus(id, data, options) {
8716
- return this.put(`/dsr/${id}/status`, data, options);
8933
+ return this.put(`/dsr/${pathSegment(id, "id")}/status`, data, options);
8717
8934
  }
8718
8935
  async createDsrAction(dsrId, data, options) {
8719
- return this.post(`/dsr/${dsrId}/actions`, data, options);
8936
+ return this.post(`/dsr/${pathSegment(dsrId, "dsrId")}/actions`, data, options);
8720
8937
  }
8721
8938
  async listDsrActions(dsrId, options) {
8722
- return this._get(`/dsr/${dsrId}/actions`, options);
8939
+ return this._get(`/dsr/${pathSegment(dsrId, "dsrId")}/actions`, options);
8723
8940
  }
8724
8941
  // --- Data Breaches ---
8725
8942
  async reportBreach(data, options) {
@@ -8729,10 +8946,10 @@ var ComplianceService = class extends ServiceModule {
8729
8946
  return this._get(`/breaches${this.qs(params)}`, requestOptions);
8730
8947
  }
8731
8948
  async getBreach(id, options) {
8732
- return this._get(`/breaches/${id}`, options);
8949
+ return this._get(`/breaches/${pathSegment(id, "id")}`, options);
8733
8950
  }
8734
8951
  async updateBreach(id, data, options) {
8735
- return this.put(`/breaches/${id}`, data, options);
8952
+ return this.put(`/breaches/${pathSegment(id, "id")}`, data, options);
8736
8953
  }
8737
8954
  // --- Retention Policies ---
8738
8955
  async listRetentionPolicies(options) {
@@ -8749,10 +8966,10 @@ var ComplianceService = class extends ServiceModule {
8749
8966
  return this._get(`/processing-activities${this.qs(params)}`, requestOptions);
8750
8967
  }
8751
8968
  async getProcessingActivity(id, options) {
8752
- return this._get(`/processing-activities/${id}`, options);
8969
+ return this._get(`/processing-activities/${pathSegment(id, "id")}`, options);
8753
8970
  }
8754
8971
  async updateProcessingActivity(id, data, options) {
8755
- return this.put(`/processing-activities/${id}`, data, options);
8972
+ return this.put(`/processing-activities/${pathSegment(id, "id")}`, data, options);
8756
8973
  }
8757
8974
  };
8758
8975
 
@@ -8766,10 +8983,10 @@ var OrchestratorService = class extends ServiceModule {
8766
8983
  return this.post("/workflows", data, options);
8767
8984
  }
8768
8985
  async execute(workflowId, input, options) {
8769
- return this.post(`/workflows/${workflowId}/execute`, input, options);
8986
+ return this.post(`/workflows/${pathSegment(workflowId, "workflowId")}/execute`, input, options);
8770
8987
  }
8771
8988
  async getExecution(executionId, options) {
8772
- return this._get(`/executions/${executionId}`, options);
8989
+ return this._get(`/executions/${pathSegment(executionId, "executionId")}`, options);
8773
8990
  }
8774
8991
  /** @deprecated Use execute() instead */
8775
8992
  async executeWorkflow(workflowId, input) {
@@ -8810,7 +9027,7 @@ var IdentityService = class extends ServiceModule {
8810
9027
  return this._get("/api-keys", options);
8811
9028
  }
8812
9029
  async revokeApiKey(id, options) {
8813
- return this.del(`/api-keys/${id}`, options);
9030
+ return this.del(`/api-keys/${pathSegment(id, "id")}`, options);
8814
9031
  }
8815
9032
  /**
8816
9033
  * Explicitly link an anonymous_id to the current authenticated user.
@@ -8836,7 +9053,7 @@ var CatalogService = class extends ServiceModule {
8836
9053
  return this._get("/services", options);
8837
9054
  }
8838
9055
  async getServiceHealth(name, options) {
8839
- return this._get(`/services/${name}/health`, options);
9056
+ return this._get(`/services/${pathSegment(name, "name")}/health`, options);
8840
9057
  }
8841
9058
  };
8842
9059
 
@@ -8853,13 +9070,13 @@ var FlagContentService = class extends ServiceModule {
8853
9070
  return this._get(this.withQuery("/flags/check", params), requestOptions);
8854
9071
  }
8855
9072
  async getFlag(id, options) {
8856
- return this._get(`/flags/${id}`, options);
9073
+ return this._get(`/flags/${pathSegment(id, "id")}`, options);
8857
9074
  }
8858
9075
  async submitAppeal(data, options) {
8859
9076
  return this.post("/appeals", data, options);
8860
9077
  }
8861
9078
  async getAppeal(id, options) {
8862
- return this._get(`/appeals/${id}`, options);
9079
+ return this._get(`/appeals/${pathSegment(id, "id")}`, options);
8863
9080
  }
8864
9081
  };
8865
9082
 
@@ -8875,11 +9092,11 @@ var CreatorMakerService = class extends ServiceModule {
8875
9092
  }
8876
9093
  /** Get a generation job by ID. */
8877
9094
  async getJob(jobId, options) {
8878
- return this._get(`/jobs/${jobId}`, options);
9095
+ return this._get(`/jobs/${pathSegment(jobId, "jobId")}`, options);
8879
9096
  }
8880
9097
  /** Long-poll for job completion (server holds up to 30s). */
8881
9098
  async pollJob(jobId, options) {
8882
- return this._get(`/jobs/${jobId}/poll`, {
9099
+ return this._get(`/jobs/${pathSegment(jobId, "jobId")}/poll`, {
8883
9100
  ...options,
8884
9101
  timeout: 35e3
8885
9102
  });
@@ -8890,15 +9107,15 @@ var CreatorMakerService = class extends ServiceModule {
8890
9107
  }
8891
9108
  /** Cancel a pending or queued job. */
8892
9109
  async cancelJob(jobId, options) {
8893
- return this.post(`/jobs/${jobId}/cancel`, void 0, options);
9110
+ return this.post(`/jobs/${pathSegment(jobId, "jobId")}/cancel`, void 0, options);
8894
9111
  }
8895
9112
  /** Retry a failed job. */
8896
9113
  async retryJob(jobId, options) {
8897
- return this.post(`/jobs/${jobId}/retry`, void 0, options);
9114
+ return this.post(`/jobs/${pathSegment(jobId, "jobId")}/retry`, void 0, options);
8898
9115
  }
8899
9116
  /** Generate variations of a completed job. */
8900
9117
  async generateVariations(jobId, options) {
8901
- return this.post(`/jobs/${jobId}/variations`, void 0, options);
9118
+ return this.post(`/jobs/${pathSegment(jobId, "jobId")}/variations`, void 0, options);
8902
9119
  }
8903
9120
  /** List available style presets, optionally filtered by mode. */
8904
9121
  async listPresets(params, options) {
@@ -8906,7 +9123,7 @@ var CreatorMakerService = class extends ServiceModule {
8906
9123
  }
8907
9124
  /** Get a style preset by slug. */
8908
9125
  async getPreset(slug, options) {
8909
- return this._get(`/presets/${slug}`, options);
9126
+ return this._get(`/presets/${pathSegment(slug, "slug")}`, options);
8910
9127
  }
8911
9128
  /** Create a project. */
8912
9129
  async createProject(data, options) {
@@ -8922,11 +9139,11 @@ var CreatorMakerService = class extends ServiceModule {
8922
9139
  }
8923
9140
  /** Get a generation output by ID. */
8924
9141
  async getOutput(outputId, options) {
8925
- return this._get(`/outputs/${outputId}`, options);
9142
+ return this._get(`/outputs/${pathSegment(outputId, "outputId")}`, options);
8926
9143
  }
8927
9144
  /** Get a download URL for a generation output. */
8928
9145
  async getDownloadUrl(outputId, options) {
8929
- return this._get(`/outputs/${outputId}/download`, options);
9146
+ return this._get(`/outputs/${pathSegment(outputId, "outputId")}/download`, options);
8930
9147
  }
8931
9148
  };
8932
9149
 
@@ -8946,10 +9163,10 @@ var AgentAuthService = class extends ServiceModule {
8946
9163
  return this.post("/agent-tokens", data, options);
8947
9164
  }
8948
9165
  async revokeToken(id, options) {
8949
- return this.del(`/agent-tokens/${id}`, options);
9166
+ return this.del(`/agent-tokens/${pathSegment(id, "id")}`, options);
8950
9167
  }
8951
9168
  async rotateToken(id, options) {
8952
- return this.post(`/agent-tokens/${id}/rotate`, void 0, options);
9169
+ return this.post(`/agent-tokens/${pathSegment(id, "id")}/rotate`, void 0, options);
8953
9170
  }
8954
9171
  async exchangeToken(data, options) {
8955
9172
  return this.post("/agent-tokens/exchange", data, options);
@@ -8961,7 +9178,7 @@ var AgentAuthService = class extends ServiceModule {
8961
9178
  return this.post("/agent-signing-keys", data, options);
8962
9179
  }
8963
9180
  async revokeSigningKey(id, options) {
8964
- return this.del(`/agent-signing-keys/${id}`, options);
9181
+ return this.del(`/agent-signing-keys/${pathSegment(id, "id")}`, options);
8965
9182
  }
8966
9183
  async getProfile(options) {
8967
9184
  return this._get("/agent-profile", options);
@@ -8970,10 +9187,10 @@ var AgentAuthService = class extends ServiceModule {
8970
9187
  return this.patch("/agent-profile", data, options);
8971
9188
  }
8972
9189
  async getSecurityPolicy(appId, options) {
8973
- return this._get(`/applications/${appId}/agent-security`, options);
9190
+ return this._get(`/applications/${pathSegment(appId, "appId")}/agent-security`, options);
8974
9191
  }
8975
9192
  async updateSecurityPolicy(appId, data, options) {
8976
- return this.put(`/applications/${appId}/agent-security`, data, options);
9193
+ return this.put(`/applications/${pathSegment(appId, "appId")}/agent-security`, data, options);
8977
9194
  }
8978
9195
  };
8979
9196
 
@@ -8988,7 +9205,7 @@ var AgentsService = class extends ServiceModule {
8988
9205
  return this.post("/register-agent", data, options);
8989
9206
  }
8990
9207
  async deactivateAgent(id, options) {
8991
- return this.post(`/agents/${id}/deactivate`, void 0, options);
9208
+ return this.post(`/agents/${pathSegment(id, "id")}/deactivate`, void 0, options);
8992
9209
  }
8993
9210
  // Agent CRUD
8994
9211
  async create(data, options) {
@@ -8998,16 +9215,16 @@ var AgentsService = class extends ServiceModule {
8998
9215
  return this._list("/agents", params, options);
8999
9216
  }
9000
9217
  async get(id, options) {
9001
- return this._get(`/agents/${id}`, options);
9218
+ return this._get(`/agents/${pathSegment(id, "id")}`, options);
9002
9219
  }
9003
9220
  async update(id, data, options) {
9004
- return this.patch(`/agents/${id}`, data, options);
9221
+ return this.patch(`/agents/${pathSegment(id, "id")}`, data, options);
9005
9222
  }
9006
9223
  async remove(id, options) {
9007
- return this.del(`/agents/${id}`, options);
9224
+ return this.del(`/agents/${pathSegment(id, "id")}`, options);
9008
9225
  }
9009
9226
  async setDefaultWorkspace(id, data, options) {
9010
- return this.post(`/agents/${id}/set-default-workspace`, data, options);
9227
+ return this.post(`/agents/${pathSegment(id, "id")}/set-default-workspace`, data, options);
9011
9228
  }
9012
9229
  // Runtime Templates
9013
9230
  async createTemplate(data, options) {
@@ -9018,15 +9235,15 @@ var AgentsService = class extends ServiceModule {
9018
9235
  }
9019
9236
  async getTemplate(id, options) {
9020
9237
  return this._get(
9021
- `/runtime-templates/${id}`,
9238
+ `/runtime-templates/${pathSegment(id, "id")}`,
9022
9239
  options
9023
9240
  );
9024
9241
  }
9025
9242
  async createTemplateVersion(id, data, options) {
9026
- return this.post(`/runtime-templates/${id}/versions`, data, options);
9243
+ return this.post(`/runtime-templates/${pathSegment(id, "id")}/versions`, data, options);
9027
9244
  }
9028
9245
  async listTemplateVersions(id, options) {
9029
- return this._get(`/runtime-templates/${id}/versions`, options);
9246
+ return this._get(`/runtime-templates/${pathSegment(id, "id")}/versions`, options);
9030
9247
  }
9031
9248
  // Workspaces
9032
9249
  async createWorkspace(data, options) {
@@ -9036,13 +9253,13 @@ var AgentsService = class extends ServiceModule {
9036
9253
  return this._list("/workspaces", params, options);
9037
9254
  }
9038
9255
  async getWorkspace(id, options) {
9039
- return this._get(`/workspaces/${id}`, options);
9256
+ return this._get(`/workspaces/${pathSegment(id, "id")}`, options);
9040
9257
  }
9041
9258
  async updateWorkspace(id, data, options) {
9042
- return this.patch(`/workspaces/${id}`, data, options);
9259
+ return this.patch(`/workspaces/${pathSegment(id, "id")}`, data, options);
9043
9260
  }
9044
9261
  async addOsAccount(workspaceId, data, options) {
9045
- return this.post(`/workspaces/${workspaceId}/os-accounts`, data, options);
9262
+ return this.post(`/workspaces/${pathSegment(workspaceId, "workspaceId")}/os-accounts`, data, options);
9046
9263
  }
9047
9264
  };
9048
9265
 
@@ -9063,49 +9280,66 @@ var AgentProjectsService = class extends ServiceModule {
9063
9280
  return this._list("/projects", params, options);
9064
9281
  }
9065
9282
  async getProject(id, applicationId, options) {
9066
- return this._get(this.withAppId(`/projects/${id}`, applicationId), options);
9283
+ return this._get(this.withAppId(`/projects/${pathSegment(id, "id")}`, applicationId), options);
9067
9284
  }
9068
9285
  async updateProject(id, data, applicationId, options) {
9069
- return this.patch(this.withAppId(`/projects/${id}`, applicationId), data, options);
9286
+ return this.patch(this.withAppId(`/projects/${pathSegment(id, "id")}`, applicationId), data, options);
9070
9287
  }
9071
9288
  // Members (use auth user_id)
9072
9289
  async addMember(projectId, data, applicationId, options) {
9073
- return this.post(this.withAppId(`/projects/${projectId}/members`, applicationId), data, options);
9290
+ return this.post(
9291
+ this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/members`, applicationId),
9292
+ data,
9293
+ options
9294
+ );
9074
9295
  }
9075
9296
  async listMembers(projectId, params, options) {
9076
9297
  const qs = {};
9077
9298
  if (params?.application_id) qs.application_id = params.application_id;
9078
9299
  if (params?.hydrate) qs.hydrate = "true";
9079
- const path = Object.keys(qs).length ? this.withQuery(`/projects/${projectId}/members`, qs) : `/projects/${projectId}/members`;
9300
+ const path = Object.keys(qs).length ? this.withQuery(`/projects/${pathSegment(projectId, "projectId")}/members`, qs) : `/projects/${pathSegment(projectId, "projectId")}/members`;
9080
9301
  const result = await this._get(path, options);
9081
9302
  return { data: result.data?.members ?? [], error: result.error };
9082
9303
  }
9083
9304
  async updateMember(projectId, userId, data, applicationId, options) {
9084
9305
  return this.patch(
9085
- this.withAppId(`/projects/${projectId}/members/${userId}`, applicationId),
9306
+ this.withAppId(
9307
+ `/projects/${pathSegment(projectId, "projectId")}/members/${pathSegment(userId, "userId")}`,
9308
+ applicationId
9309
+ ),
9086
9310
  data,
9087
9311
  options
9088
9312
  );
9089
9313
  }
9090
9314
  async removeMember(projectId, userId, applicationId, options) {
9091
- return this.del(this.withAppId(`/projects/${projectId}/members/${userId}`, applicationId), options);
9315
+ return this.del(
9316
+ this.withAppId(
9317
+ `/projects/${pathSegment(projectId, "projectId")}/members/${pathSegment(userId, "userId")}`,
9318
+ applicationId
9319
+ ),
9320
+ options
9321
+ );
9092
9322
  }
9093
9323
  // Tasks
9094
9324
  async createTask(projectId, data, applicationId, options) {
9095
- return this.post(this.withAppId(`/projects/${projectId}/tasks`, applicationId), data, options);
9325
+ return this.post(
9326
+ this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/tasks`, applicationId),
9327
+ data,
9328
+ options
9329
+ );
9096
9330
  }
9097
9331
  async listTasks(projectId, params, options) {
9098
- return this._list(`/projects/${projectId}/tasks`, params, options);
9332
+ return this._list(`/projects/${pathSegment(projectId, "projectId")}/tasks`, params, options);
9099
9333
  }
9100
9334
  async getTask(id, applicationId, options) {
9101
- return this._get(this.withAppId(`/tasks/${id}`, applicationId), options);
9335
+ return this._get(this.withAppId(`/tasks/${pathSegment(id, "id")}`, applicationId), options);
9102
9336
  }
9103
9337
  async updateTask(id, data, applicationId, options) {
9104
- return this.patch(this.withAppId(`/tasks/${id}`, applicationId), data, options);
9338
+ return this.patch(this.withAppId(`/tasks/${pathSegment(id, "id")}`, applicationId), data, options);
9105
9339
  }
9106
9340
  async reorderTasks(projectId, taskIds, applicationId, options) {
9107
9341
  return this.post(
9108
- this.withAppId(`/projects/${projectId}/tasks/reorder`, applicationId),
9342
+ this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/tasks/reorder`, applicationId),
9109
9343
  { task_ids: taskIds },
9110
9344
  options
9111
9345
  );
@@ -9124,88 +9358,113 @@ var AgentProjectsService = class extends ServiceModule {
9124
9358
  }
9125
9359
  async claim(taskId, agentId, applicationId, options) {
9126
9360
  return this.post(
9127
- this.withAppId(`/tasks/${taskId}/claim`, applicationId),
9361
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/claim`, applicationId),
9128
9362
  { agent_id: agentId },
9129
9363
  options
9130
9364
  );
9131
9365
  }
9132
9366
  async heartbeat(taskId, agentId, applicationId, options) {
9133
9367
  return this.post(
9134
- this.withAppId(`/tasks/${taskId}/heartbeat`, applicationId),
9368
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/heartbeat`, applicationId),
9135
9369
  { agent_id: agentId },
9136
9370
  options
9137
9371
  );
9138
9372
  }
9139
9373
  async startTask(taskId, agentId, applicationId, options) {
9140
9374
  return this.post(
9141
- this.withAppId(`/tasks/${taskId}/start`, applicationId),
9375
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/start`, applicationId),
9142
9376
  { agent_id: agentId },
9143
9377
  options
9144
9378
  );
9145
9379
  }
9146
9380
  async submit(taskId, data, applicationId, options) {
9147
- return this.post(this.withAppId(`/tasks/${taskId}/submit`, applicationId), data, options);
9381
+ return this.post(
9382
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/submit`, applicationId),
9383
+ data,
9384
+ options
9385
+ );
9148
9386
  }
9149
9387
  async block(taskId, data, applicationId, options) {
9150
- return this.post(this.withAppId(`/tasks/${taskId}/block`, applicationId), data, options);
9388
+ return this.post(
9389
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/block`, applicationId),
9390
+ data,
9391
+ options
9392
+ );
9151
9393
  }
9152
9394
  // Assignment
9153
9395
  async assignAgent(taskId, data, applicationId, options) {
9154
- return this.post(this.withAppId(`/tasks/${taskId}/assign`, applicationId), data, options);
9396
+ return this.post(this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/assign`, applicationId), data, options);
9155
9397
  }
9156
9398
  async unassignAgent(taskId, agentId, applicationId, options) {
9157
- return this.del(this.withAppId(`/tasks/${taskId}/assign/${agentId}`, applicationId), options);
9399
+ return this.del(
9400
+ this.withAppId(
9401
+ `/tasks/${pathSegment(taskId, "taskId")}/assign/${pathSegment(agentId, "agentId")}`,
9402
+ applicationId
9403
+ ),
9404
+ options
9405
+ );
9158
9406
  }
9159
9407
  // History
9160
9408
  async listAttempts(taskId, applicationId, options) {
9161
9409
  const result = await this._get(
9162
- this.withAppId(`/tasks/${taskId}/attempts`, applicationId),
9410
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/attempts`, applicationId),
9163
9411
  options
9164
9412
  );
9165
9413
  return { data: result.data?.attempts ?? [], error: result.error };
9166
9414
  }
9167
9415
  async listTransitions(taskId, applicationId, options) {
9168
9416
  const result = await this._get(
9169
- this.withAppId(`/tasks/${taskId}/transitions`, applicationId),
9417
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/transitions`, applicationId),
9170
9418
  options
9171
9419
  );
9172
9420
  return { data: result.data?.transitions ?? [], error: result.error };
9173
9421
  }
9174
9422
  // Documents
9175
9423
  async createDocument(projectId, data, applicationId, options) {
9176
- return this.post(this.withAppId(`/projects/${projectId}/documents`, applicationId), data, options);
9424
+ return this.post(
9425
+ this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/documents`, applicationId),
9426
+ data,
9427
+ options
9428
+ );
9177
9429
  }
9178
9430
  async listDocuments(projectId, applicationId, options) {
9179
9431
  const result = await this._get(
9180
- this.withAppId(`/projects/${projectId}/documents`, applicationId),
9432
+ this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/documents`, applicationId),
9181
9433
  options
9182
9434
  );
9183
9435
  return { data: result.data?.documents ?? [], error: result.error };
9184
9436
  }
9185
9437
  async deleteDocument(documentId, applicationId, options) {
9186
- return this.del(this.withAppId(`/documents/${documentId}`, applicationId), options);
9438
+ return this.del(
9439
+ this.withAppId(`/documents/${pathSegment(documentId, "documentId")}`, applicationId),
9440
+ options
9441
+ );
9187
9442
  }
9188
9443
  // Pipelines
9189
9444
  async createPipeline(projectId, data, applicationId, options) {
9190
- return this.post(this.withAppId(`/projects/${projectId}/pipelines`, applicationId), data, options);
9445
+ return this.post(
9446
+ this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/pipelines`, applicationId),
9447
+ data,
9448
+ options
9449
+ );
9191
9450
  }
9192
9451
  async listPipelines(projectId, applicationId, options) {
9193
9452
  const result = await this._get(
9194
- this.withAppId(`/projects/${projectId}/pipelines`, applicationId),
9453
+ this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/pipelines`, applicationId),
9195
9454
  options
9196
9455
  );
9197
9456
  return { data: result.data?.pipelines ?? [], error: result.error };
9198
9457
  }
9199
9458
  async createPipelineVersion(pipelineId, data, applicationId, options) {
9200
9459
  return this.post(
9201
- this.withAppId(`/pipelines/${pipelineId}/versions`, applicationId),
9460
+ this.withAppId(`/pipelines/${pathSegment(pipelineId, "pipelineId")}/versions`, applicationId),
9202
9461
  data,
9203
9462
  options
9204
9463
  );
9205
9464
  }
9206
9465
  async listPipelineVersions(pipelineId, applicationId, options) {
9207
9466
  const result = await this._get(
9208
- this.withAppId(`/pipelines/${pipelineId}/versions`, applicationId),
9467
+ this.withAppId(`/pipelines/${pathSegment(pipelineId, "pipelineId")}/versions`, applicationId),
9209
9468
  options
9210
9469
  );
9211
9470
  return { data: result.data?.versions ?? [], error: result.error };
@@ -9224,20 +9483,20 @@ var AgentProjectsService = class extends ServiceModule {
9224
9483
  return { data: result.data?.grants ?? result.data ?? [], error: result.error };
9225
9484
  }
9226
9485
  async getGrant(id, options) {
9227
- return this._get(`/project-grants/${id}`, options);
9486
+ return this._get(`/project-grants/${pathSegment(id, "id")}`, options);
9228
9487
  }
9229
9488
  /** Public endpoint — no auth required. Returns masked email + project name. */
9230
9489
  async getGrantInfo(id, options) {
9231
- return this._get(`/project-grants/${id}/info`, { skipAuth: true, ...options });
9490
+ return this._get(`/project-grants/${pathSegment(id, "id")}/info`, { skipAuth: true, ...options });
9232
9491
  }
9233
9492
  async revokeGrant(id, options) {
9234
- return this.del(`/project-grants/${id}`, options);
9493
+ return this.del(`/project-grants/${pathSegment(id, "id")}`, options);
9235
9494
  }
9236
9495
  async resendGrantInvitation(id, data, options) {
9237
- return this.post(`/project-grants/${id}/resend`, data, options);
9496
+ return this.post(`/project-grants/${pathSegment(id, "id")}/resend`, data, options);
9238
9497
  }
9239
9498
  async redeemGrant(id, options) {
9240
- return this.post(`/project-grants/${id}/redeem`, void 0, options);
9499
+ return this.post(`/project-grants/${pathSegment(id, "id")}/redeem`, void 0, options);
9241
9500
  }
9242
9501
  };
9243
9502
 
@@ -9255,13 +9514,13 @@ var AgentToolsService = class extends ServiceModule {
9255
9514
  return this._list("/tools", params, options);
9256
9515
  }
9257
9516
  async getTool(id, options) {
9258
- return this._get(`/tools/${id}`, options);
9517
+ return this._get(`/tools/${pathSegment(id, "id")}`, options);
9259
9518
  }
9260
9519
  async createCapability(toolId, data, options) {
9261
- return this.post(`/tools/${toolId}/capabilities`, data, options);
9520
+ return this.post(`/tools/${pathSegment(toolId, "toolId")}/capabilities`, data, options);
9262
9521
  }
9263
9522
  async listCapabilities(toolId, options) {
9264
- return this._get(`/tools/${toolId}/capabilities`, options);
9523
+ return this._get(`/tools/${pathSegment(toolId, "toolId")}/capabilities`, options);
9265
9524
  }
9266
9525
  // Tool Integrations
9267
9526
  async createIntegration(data, options) {
@@ -9271,7 +9530,7 @@ var AgentToolsService = class extends ServiceModule {
9271
9530
  return this._list("/tool-integrations", params, options);
9272
9531
  }
9273
9532
  async updateIntegration(id, data, options) {
9274
- return this.patch(`/tool-integrations/${id}`, data, options);
9533
+ return this.patch(`/tool-integrations/${pathSegment(id, "id")}`, data, options);
9275
9534
  }
9276
9535
  // Credentials
9277
9536
  async createCredential(data, options) {
@@ -9281,13 +9540,17 @@ var AgentToolsService = class extends ServiceModule {
9281
9540
  return this._list("/credentials", params, options);
9282
9541
  }
9283
9542
  async updateCredential(id, data, options) {
9284
- return this.patch(`/credentials/${id}`, data, options);
9543
+ return this.patch(`/credentials/${pathSegment(id, "id")}`, data, options);
9285
9544
  }
9286
9545
  async createScope(credentialId, data, options) {
9287
- return this.post(`/credentials/${credentialId}/scopes`, data, options);
9546
+ return this.post(
9547
+ `/credentials/${pathSegment(credentialId, "credentialId")}/scopes`,
9548
+ data,
9549
+ options
9550
+ );
9288
9551
  }
9289
9552
  async listScopes(credentialId, options) {
9290
- return this._get(`/credentials/${credentialId}/scopes`, options);
9553
+ return this._get(`/credentials/${pathSegment(credentialId, "credentialId")}/scopes`, options);
9291
9554
  }
9292
9555
  // Entitlements
9293
9556
  async grantEntitlement(data, options) {
@@ -9297,7 +9560,7 @@ var AgentToolsService = class extends ServiceModule {
9297
9560
  return this._list("/agent-tool-entitlements", params, options);
9298
9561
  }
9299
9562
  async revokeEntitlement(id, options) {
9300
- return this.del(`/agent-tool-entitlements/${id}`, options);
9563
+ return this.del(`/agent-tool-entitlements/${pathSegment(id, "id")}`, options);
9301
9564
  }
9302
9565
  async authorizeAction(data, options) {
9303
9566
  return this.post("/authorize-action", data, options);
@@ -9339,13 +9602,13 @@ var AgentModelsService = class extends ServiceModule {
9339
9602
  return this._list("/models", params, options);
9340
9603
  }
9341
9604
  async getModel(id, options) {
9342
- return this._get(`/models/${id}`, options);
9605
+ return this._get(`/models/${pathSegment(id, "id")}`, options);
9343
9606
  }
9344
9607
  async createPricing(modelId, data, options) {
9345
- return this.post(`/models/${modelId}/pricing`, data, options);
9608
+ return this.post(`/models/${pathSegment(modelId, "modelId")}/pricing`, data, options);
9346
9609
  }
9347
9610
  async listPricing(modelId, options) {
9348
- return this._get(`/models/${modelId}/pricing`, options);
9611
+ return this._get(`/models/${pathSegment(modelId, "modelId")}/pricing`, options);
9349
9612
  }
9350
9613
  // Entitlements
9351
9614
  async createEntitlement(data, options) {
@@ -9355,7 +9618,7 @@ var AgentModelsService = class extends ServiceModule {
9355
9618
  return this._list("/model-entitlements", params, options);
9356
9619
  }
9357
9620
  async deleteEntitlement(id, options) {
9358
- return this.del(`/model-entitlements/${id}`, options);
9621
+ return this.del(`/model-entitlements/${pathSegment(id, "id")}`, options);
9359
9622
  }
9360
9623
  // Usage & Reporting
9361
9624
  async recordUsage(data, options) {
@@ -9386,27 +9649,27 @@ var AgentSessionsService = class extends ServiceModule {
9386
9649
  return this._list("/sessions", params, options);
9387
9650
  }
9388
9651
  async getSession(id, options) {
9389
- return this._get(`/sessions/${id}`, options);
9652
+ return this._get(`/sessions/${pathSegment(id, "id")}`, options);
9390
9653
  }
9391
9654
  async startSession(id, options) {
9392
- return this.post(`/sessions/${id}/start`, void 0, options);
9655
+ return this.post(`/sessions/${pathSegment(id, "id")}/start`, void 0, options);
9393
9656
  }
9394
9657
  async endSession(id, data, options) {
9395
- return this.post(`/sessions/${id}/end`, data, options);
9658
+ return this.post(`/sessions/${pathSegment(id, "id")}/end`, data, options);
9396
9659
  }
9397
9660
  // Logs
9398
9661
  async appendLog(sessionId, data, options) {
9399
- return this.post(`/sessions/${sessionId}/logs`, data, options);
9662
+ return this.post(`/sessions/${pathSegment(sessionId, "sessionId")}/logs`, data, options);
9400
9663
  }
9401
9664
  async listLogs(sessionId, options) {
9402
- return this._get(`/sessions/${sessionId}/logs`, options);
9665
+ return this._get(`/sessions/${pathSegment(sessionId, "sessionId")}/logs`, options);
9403
9666
  }
9404
9667
  // Artifacts
9405
9668
  async addArtifact(sessionId, data, options) {
9406
- return this.post(`/sessions/${sessionId}/artifacts`, data, options);
9669
+ return this.post(`/sessions/${pathSegment(sessionId, "sessionId")}/artifacts`, data, options);
9407
9670
  }
9408
9671
  async listArtifacts(sessionId, options) {
9409
- return this._get(`/sessions/${sessionId}/artifacts`, options);
9672
+ return this._get(`/sessions/${pathSegment(sessionId, "sessionId")}/artifacts`, options);
9410
9673
  }
9411
9674
  };
9412
9675
 
@@ -9759,6 +10022,7 @@ var index_default = ScaleMule;
9759
10022
  STORAGE_KEYS,
9760
10023
  ScaleMule,
9761
10024
  ScaleMuleClient,
10025
+ ScaleMulePathError,
9762
10026
  SchedulerService,
9763
10027
  SearchService,
9764
10028
  ServiceModule,
@@ -9791,6 +10055,7 @@ var index_default = ScaleMule;
9791
10055
  extractClientContext,
9792
10056
  findPhoneCountryByCode,
9793
10057
  findPhoneCountryByDialCode,
10058
+ findUnsafePathReason,
9794
10059
  generateAnonymousId,
9795
10060
  generateUploadSessionId,
9796
10061
  getMeasuredBandwidthMbps,
@@ -9802,6 +10067,7 @@ var index_default = ScaleMule;
9802
10067
  normalizeAndValidatePhone,
9803
10068
  normalizeExperiments,
9804
10069
  normalizePhoneNumber,
10070
+ pathSegment,
9805
10071
  pollSharePercent,
9806
10072
  pollVoterKey,
9807
10073
  prepareCommunityMapAttachment,