@scalemule/sdk 0.0.83 → 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
  );
@@ -6682,7 +6846,7 @@ var BookingsService = class extends ServiceModule {
6682
6846
  return this.post("/quotes", input, requestOptions);
6683
6847
  }
6684
6848
  async getQuote(quoteId, requestOptions) {
6685
- return this._get(`/quotes/${encodeURIComponent(quoteId)}`, requestOptions);
6849
+ return this._get(`/quotes/${pathSegment(quoteId, "quoteId")}`, requestOptions);
6686
6850
  }
6687
6851
  /**
6688
6852
  * Accept a quote with a verified deposit receipt. Bookings re-verifies the
@@ -6690,15 +6854,15 @@ var BookingsService = class extends ServiceModule {
6690
6854
  * and deposit on the quote.
6691
6855
  */
6692
6856
  async acceptQuote(quoteId, input, requestOptions) {
6693
- return this.post(`/quotes/${encodeURIComponent(quoteId)}/accept`, input, requestOptions);
6857
+ return this.post(`/quotes/${pathSegment(quoteId, "quoteId")}/accept`, input, requestOptions);
6694
6858
  }
6695
6859
  async getCustomerStats(customerRef, requestOptions) {
6696
- return this._get(`/customers/${encodeURIComponent(customerRef)}/stats`, requestOptions);
6860
+ return this._get(`/customers/${pathSegment(customerRef, "customerRef")}/stats`, requestOptions);
6697
6861
  }
6698
6862
  /** Host/admin: mark a booking completed (maintains the customer stats projection). */
6699
6863
  async completeBooking(bookingId, reason, requestOptions) {
6700
6864
  return this.post(
6701
- `/dashboard/bookings/${encodeURIComponent(bookingId)}/complete`,
6865
+ `/dashboard/bookings/${pathSegment(bookingId, "bookingId")}/complete`,
6702
6866
  { reason },
6703
6867
  requestOptions
6704
6868
  );
@@ -6706,7 +6870,7 @@ var BookingsService = class extends ServiceModule {
6706
6870
  /** Host/admin: mark a booking as a no-show (maintains the customer stats projection). */
6707
6871
  async markNoShow(bookingId, reason, requestOptions) {
6708
6872
  return this.post(
6709
- `/dashboard/bookings/${encodeURIComponent(bookingId)}/no-show`,
6873
+ `/dashboard/bookings/${pathSegment(bookingId, "bookingId")}/no-show`,
6710
6874
  { reason },
6711
6875
  requestOptions
6712
6876
  );
@@ -6740,10 +6904,14 @@ var PermissionsService = class extends ServiceModule {
6740
6904
  return this._get("/roles", options);
6741
6905
  }
6742
6906
  async assignPermissions(roleId, permissions, options) {
6743
- return this.post(`/roles/${roleId}/permissions`, { permissions }, options);
6907
+ return this.post(`/roles/${pathSegment(roleId, "roleId")}/permissions`, { permissions }, options);
6744
6908
  }
6745
6909
  async assignRole(userId, roleId, options) {
6746
- 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
+ );
6747
6915
  }
6748
6916
  // --------------------------------------------------------------------------
6749
6917
  // Permission Checks (unified — supports both member and user identity types)
@@ -6782,7 +6950,7 @@ var PermissionsService = class extends ServiceModule {
6782
6950
  return this._get(`/matrix?${params.toString()}`, options);
6783
6951
  }
6784
6952
  async getUserPermissions(userId, options) {
6785
- return this._get(`/users/${userId}/permissions`, options);
6953
+ return this._get(`/users/${pathSegment(userId, "userId")}/permissions`, options);
6786
6954
  }
6787
6955
  // --------------------------------------------------------------------------
6788
6956
  // Policies
@@ -6828,52 +6996,59 @@ var WorkspacesService = class extends ServiceModule {
6828
6996
  return this._list("/mine", params, options);
6829
6997
  }
6830
6998
  async get(id, options) {
6831
- return this._get(`/${id}`, options);
6999
+ return this._get(`/${pathSegment(id, "id")}`, options);
6832
7000
  }
6833
7001
  async update(id, data, options) {
6834
- return this.patch(`/${id}`, data, options);
7002
+ return this.patch(`/${pathSegment(id, "id")}`, data, options);
6835
7003
  }
6836
7004
  async delete(id, options) {
6837
- return this.del(`/${id}`, options);
7005
+ return this.del(`/${pathSegment(id, "id")}`, options);
6838
7006
  }
6839
7007
  // --------------------------------------------------------------------------
6840
7008
  // Members
6841
7009
  // --------------------------------------------------------------------------
6842
7010
  async listMembers(workspaceId, params, requestOptions) {
6843
- return this._list(`/${workspaceId}/members`, params, requestOptions);
7011
+ return this._list(`/${pathSegment(workspaceId, "workspaceId")}/members`, params, requestOptions);
6844
7012
  }
6845
7013
  async addMember(workspaceId, data, options) {
6846
- return this.post(`/${workspaceId}/members`, data, options);
7014
+ return this.post(`/${pathSegment(workspaceId, "workspaceId")}/members`, data, options);
6847
7015
  }
6848
7016
  async updateMember(workspaceId, userId, data, options) {
6849
- 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
+ );
6850
7022
  }
6851
7023
  async removeMember(workspaceId, userId, options) {
6852
- return this.del(`/${workspaceId}/members/${userId}`, options);
7024
+ return this.del(
7025
+ `/${pathSegment(workspaceId, "workspaceId")}/members/${pathSegment(userId, "userId")}`,
7026
+ options
7027
+ );
6853
7028
  }
6854
7029
  // --------------------------------------------------------------------------
6855
7030
  // Invitations
6856
7031
  // --------------------------------------------------------------------------
6857
7032
  async invite(workspaceId, data, options) {
6858
- return this.post(`/${workspaceId}/invitations`, data, options);
7033
+ return this.post(`/${pathSegment(workspaceId, "workspaceId")}/invitations`, data, options);
6859
7034
  }
6860
7035
  async listInvitations(workspaceId, options) {
6861
- return this._get(`/${workspaceId}/invitations`, options);
7036
+ return this._get(`/${pathSegment(workspaceId, "workspaceId")}/invitations`, options);
6862
7037
  }
6863
7038
  async acceptInvitation(token, options) {
6864
- return this.post(`/invitations/${token}/accept`, void 0, options);
7039
+ return this.post(`/invitations/${pathSegment(token, "token")}/accept`, void 0, options);
6865
7040
  }
6866
7041
  async cancelInvitation(id, options) {
6867
- return this.del(`/invitations/${id}`, options);
7042
+ return this.del(`/invitations/${pathSegment(id, "id")}`, options);
6868
7043
  }
6869
7044
  // --------------------------------------------------------------------------
6870
7045
  // SSO (workspace-only)
6871
7046
  // --------------------------------------------------------------------------
6872
7047
  async configureSso(workspaceId, data, options) {
6873
- return this.post(`/${workspaceId}/sso/configure`, data, options);
7048
+ return this.post(`/${pathSegment(workspaceId, "workspaceId")}/sso/configure`, data, options);
6874
7049
  }
6875
7050
  async getSso(workspaceId, options) {
6876
- return this._get(`/${workspaceId}/sso`, options);
7051
+ return this._get(`/${pathSegment(workspaceId, "workspaceId")}/sso`, options);
6877
7052
  }
6878
7053
  };
6879
7054
 
@@ -6896,43 +7071,50 @@ var TeamsService = class extends ServiceModule {
6896
7071
  return this._list("/mine", params, options);
6897
7072
  }
6898
7073
  async get(id, options) {
6899
- return this._get(`/${id}`, options);
7074
+ return this._get(`/${pathSegment(id, "id")}`, options);
6900
7075
  }
6901
7076
  async update(id, data, options) {
6902
- return this.patch(`/${id}`, data, options);
7077
+ return this.patch(`/${pathSegment(id, "id")}`, data, options);
6903
7078
  }
6904
7079
  async delete(id, options) {
6905
- return this.del(`/${id}`, options);
7080
+ return this.del(`/${pathSegment(id, "id")}`, options);
6906
7081
  }
6907
7082
  // --------------------------------------------------------------------------
6908
7083
  // Members
6909
7084
  // --------------------------------------------------------------------------
6910
7085
  async listMembers(teamId, params, requestOptions) {
6911
- return this._list(`/${teamId}/members`, params, requestOptions);
7086
+ return this._list(`/${pathSegment(teamId, "teamId")}/members`, params, requestOptions);
6912
7087
  }
6913
7088
  async addMember(teamId, data, options) {
6914
- return this.post(`/${teamId}/members`, data, options);
7089
+ return this.post(`/${pathSegment(teamId, "teamId")}/members`, data, options);
6915
7090
  }
6916
7091
  async updateMember(teamId, userId, data, options) {
6917
- 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
+ );
6918
7097
  }
6919
7098
  async removeMember(teamId, userId, options) {
6920
- return this.del(`/${teamId}/members/${userId}`, options);
7099
+ return this.del(
7100
+ `/${pathSegment(teamId, "teamId")}/members/${pathSegment(userId, "userId")}`,
7101
+ options
7102
+ );
6921
7103
  }
6922
7104
  // --------------------------------------------------------------------------
6923
7105
  // Invitations
6924
7106
  // --------------------------------------------------------------------------
6925
7107
  async invite(teamId, data, options) {
6926
- return this.post(`/${teamId}/invitations`, data, options);
7108
+ return this.post(`/${pathSegment(teamId, "teamId")}/invitations`, data, options);
6927
7109
  }
6928
7110
  async listInvitations(teamId, options) {
6929
- return this._get(`/${teamId}/invitations`, options);
7111
+ return this._get(`/${pathSegment(teamId, "teamId")}/invitations`, options);
6930
7112
  }
6931
7113
  async acceptInvitation(token, options) {
6932
- return this.post(`/invitations/${token}/accept`, void 0, options);
7114
+ return this.post(`/invitations/${pathSegment(token, "token")}/accept`, void 0, options);
6933
7115
  }
6934
7116
  async cancelInvitation(id, options) {
6935
- return this.del(`/invitations/${id}`, options);
7117
+ return this.del(`/invitations/${pathSegment(id, "id")}`, options);
6936
7118
  }
6937
7119
  };
6938
7120
 
@@ -6946,22 +7128,31 @@ var GraphService = class extends ServiceModule {
6946
7128
  return this.post("/nodes", data, requestOptions);
6947
7129
  }
6948
7130
  async updateNode(nodeId, data, requestOptions) {
6949
- return this.patch(`/nodes/${nodeId}`, data, requestOptions);
7131
+ return this.patch(`/nodes/${pathSegment(nodeId, "nodeId")}`, data, requestOptions);
6950
7132
  }
6951
7133
  async createEdge(data, requestOptions) {
6952
7134
  return this.post("/edges", data, requestOptions);
6953
7135
  }
6954
7136
  async getEdges(nodeId, options, requestOptions) {
6955
- 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
+ );
6956
7141
  }
6957
7142
  async traverse(nodeId, options, requestOptions) {
6958
- 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
+ );
6959
7147
  }
6960
7148
  async shortestPath(options, requestOptions) {
6961
7149
  return this.post("/shortest-path", options, requestOptions);
6962
7150
  }
6963
7151
  async neighbors(nodeId, options, requestOptions) {
6964
- 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
+ );
6965
7156
  }
6966
7157
  async pageRank(options, requestOptions) {
6967
7158
  return this.post("/algorithms/pagerank", options, requestOptions);
@@ -6987,28 +7178,28 @@ var FunctionsService = class extends ServiceModule {
6987
7178
  return this._get("", options);
6988
7179
  }
6989
7180
  async get(name, options) {
6990
- return this._get(`/${name}`, options);
7181
+ return this._get(`/${pathSegment(name, "name")}`, options);
6991
7182
  }
6992
7183
  async update(name, data, options) {
6993
- return this.patch(`/${name}`, data, options);
7184
+ return this.patch(`/${pathSegment(name, "name")}`, data, options);
6994
7185
  }
6995
7186
  async delete(name, options) {
6996
- return this.del(`/${name}`, options);
7187
+ return this.del(`/${pathSegment(name, "name")}`, options);
6997
7188
  }
6998
7189
  async invoke(name, payload, options) {
6999
- return this.post(`/${name}/invoke`, payload, options);
7190
+ return this.post(`/${pathSegment(name, "name")}/invoke`, payload, options);
7000
7191
  }
7001
7192
  async invokeAsync(name, payload, options) {
7002
- return this.post(`/${name}/invoke-async`, payload, options);
7193
+ return this.post(`/${pathSegment(name, "name")}/invoke-async`, payload, options);
7003
7194
  }
7004
7195
  async getLogs(name, options) {
7005
- return this._get(`/${name}/logs`, options);
7196
+ return this._get(`/${pathSegment(name, "name")}/logs`, options);
7006
7197
  }
7007
7198
  async getExecutions(name, params, requestOptions) {
7008
- return this._list(`/${name}/executions`, params, requestOptions);
7199
+ return this._list(`/${pathSegment(name, "name")}/executions`, params, requestOptions);
7009
7200
  }
7010
7201
  async getMetrics(name, options) {
7011
- return this._get(`/${name}/metrics`, options);
7202
+ return this._get(`/${pathSegment(name, "name")}/metrics`, options);
7012
7203
  }
7013
7204
  /** @deprecated Use deploy() instead */
7014
7205
  async deployFunction(data) {
@@ -7030,13 +7221,13 @@ var ListingsService = class extends ServiceModule {
7030
7221
  return this.post("", data, options);
7031
7222
  }
7032
7223
  async get(id, options) {
7033
- return this._get(`/${id}`, options);
7224
+ return this._get(`/${pathSegment(id, "id")}`, options);
7034
7225
  }
7035
7226
  async update(id, data, options) {
7036
- return this.patch(`/${id}`, data, options);
7227
+ return this.patch(`/${pathSegment(id, "id")}`, data, options);
7037
7228
  }
7038
7229
  async delete(id, options) {
7039
- return this.del(`/${id}`, options);
7230
+ return this.del(`/${pathSegment(id, "id")}`, options);
7040
7231
  }
7041
7232
  async search(query, filters, options) {
7042
7233
  return this._get(this.withQuery("/search", { query, ...filters }), options);
@@ -7045,19 +7236,19 @@ var ListingsService = class extends ServiceModule {
7045
7236
  return this._get(this.withQuery("/nearby", nearbyOptions), options);
7046
7237
  }
7047
7238
  async getByCategory(category, params, requestOptions) {
7048
- return this._list(`/categories/${category}`, params, requestOptions);
7239
+ return this._list(`/categories/${pathSegment(category, "category")}`, params, requestOptions);
7049
7240
  }
7050
7241
  async favorite(listingId, options) {
7051
- return this.post(`/${listingId}/favorite`, void 0, options);
7242
+ return this.post(`/${pathSegment(listingId, "listingId")}/favorite`, void 0, options);
7052
7243
  }
7053
7244
  async unfavorite(listingId, options) {
7054
- return this.del(`/${listingId}/favorite`, options);
7245
+ return this.del(`/${pathSegment(listingId, "listingId")}/favorite`, options);
7055
7246
  }
7056
7247
  async getFavorites(params, requestOptions) {
7057
7248
  return this._list("/favorites", params, requestOptions);
7058
7249
  }
7059
7250
  async trackView(listingId, options) {
7060
- return this.post(`/${listingId}/view`, void 0, options);
7251
+ return this.post(`/${pathSegment(listingId, "listingId")}/view`, void 0, options);
7061
7252
  }
7062
7253
  /** @deprecated Use create() instead */
7063
7254
  async createListing(data) {
@@ -7074,7 +7265,7 @@ var ListingsService = class extends ServiceModule {
7074
7265
  };
7075
7266
 
7076
7267
  // src/services/community-maps.ts
7077
- var segment = (value) => encodeURIComponent(value);
7268
+ var segment = (value) => pathSegment(value);
7078
7269
  function devicePositionPayload(p) {
7079
7270
  return {
7080
7271
  latitude: p.latitude,
@@ -7108,7 +7299,7 @@ var CommunityMapsService = class extends ServiceModule {
7108
7299
  }
7109
7300
  listOwnSubmissions(slug, after, options) {
7110
7301
  return this._get(
7111
- "/collections/" + segment(slug) + "/submissions" + (after ? "?after=" + segment(after) : ""),
7302
+ "/collections/" + segment(slug) + "/submissions" + (after ? "?after=" + encodeURIComponent(after) : ""),
7112
7303
  options
7113
7304
  );
7114
7305
  }
@@ -7301,13 +7492,13 @@ var LocalIntelligenceService = class extends ServiceModule {
7301
7492
  this.basePath = "/v1/news";
7302
7493
  }
7303
7494
  scope(publication) {
7304
- return `/intelligence/publications/${encodeURIComponent(publication)}`;
7495
+ return `/intelligence/publications/${pathSegment(publication, "publication")}`;
7305
7496
  }
7306
7497
  records(publication, params = {}, options) {
7307
7498
  return this._get(this.withQuery(`${this.scope(publication)}/records`, params), options);
7308
7499
  }
7309
7500
  get(publication, record, options) {
7310
- return this._get(`${this.scope(publication)}/records/${encodeURIComponent(record)}`, options);
7501
+ return this._get(`${this.scope(publication)}/records/${pathSegment(record, "record")}`, options);
7311
7502
  }
7312
7503
  changes(publication, params = {}, options) {
7313
7504
  return this._get(this.withQuery(`${this.scope(publication)}/changes`, params), options);
@@ -7334,24 +7525,24 @@ var LocalIntelligenceService = class extends ServiceModule {
7334
7525
  }
7335
7526
  feedback(publication, record, recordRevision, outcome, options) {
7336
7527
  return this.post(
7337
- `${this.scope(publication)}/records/${encodeURIComponent(record)}/feedback`,
7528
+ `${this.scope(publication)}/records/${pathSegment(record, "record")}/feedback`,
7338
7529
  { record_revision: recordRevision, outcome },
7339
7530
  options
7340
7531
  );
7341
7532
  }
7342
7533
  deleteFeedback(publication, record, options) {
7343
- return this.del(`${this.scope(publication)}/records/${encodeURIComponent(record)}/feedback`, options);
7534
+ return this.del(`${this.scope(publication)}/records/${pathSegment(record, "record")}/feedback`, options);
7344
7535
  }
7345
7536
  /** Requires a human editor with publication publish authority. */
7346
7537
  release(publication, input, idempotencyKey, options) {
7347
- return this.post(`/publications/${encodeURIComponent(publication)}/intelligence`, input, {
7538
+ return this.post(`/publications/${pathSegment(publication, "publication")}/intelligence`, input, {
7348
7539
  ...options,
7349
7540
  headers: { ...options?.headers, "idempotency-key": idempotencyKey }
7350
7541
  });
7351
7542
  }
7352
7543
  withdraw(publication, record, expectedRevision, reason, options) {
7353
7544
  return this.post(
7354
- `/publications/${encodeURIComponent(publication)}/intelligence/${encodeURIComponent(record)}/withdraw`,
7545
+ `/publications/${pathSegment(publication, "publication")}/intelligence/${pathSegment(record, "record")}/withdraw`,
7355
7546
  { expected_revision: expectedRevision, reason },
7356
7547
  options
7357
7548
  );
@@ -7398,29 +7589,29 @@ var PollsService = class extends ServiceModule {
7398
7589
  return this._get(this.withQuery("/manage", params), options);
7399
7590
  }
7400
7591
  async get(id, options) {
7401
- return this._get(`/manage/${encodeURIComponent(id)}`, options);
7592
+ return this._get(`/manage/${pathSegment(id, "id")}`, options);
7402
7593
  }
7403
7594
  async update(id, data, options) {
7404
- return this.patch(`/manage/${encodeURIComponent(id)}`, data, options);
7595
+ return this.patch(`/manage/${pathSegment(id, "id")}`, data, options);
7405
7596
  }
7406
7597
  async publish(id, options) {
7407
- return this.post(`/manage/${encodeURIComponent(id)}/publish`, {}, options);
7598
+ return this.post(`/manage/${pathSegment(id, "id")}/publish`, {}, options);
7408
7599
  }
7409
7600
  async close(id, options) {
7410
- return this.post(`/manage/${encodeURIComponent(id)}/close`, {}, options);
7601
+ return this.post(`/manage/${pathSegment(id, "id")}/close`, {}, options);
7411
7602
  }
7412
7603
  async listPublic(params, options) {
7413
7604
  return this._get(this.withQuery("/public", params), options);
7414
7605
  }
7415
7606
  async getPublic(slug, params, options) {
7416
7607
  return this._get(
7417
- this.withQuery(`/public/${encodeURIComponent(slug)}`, params),
7608
+ this.withQuery(`/public/${pathSegment(slug, "slug")}`, params),
7418
7609
  options
7419
7610
  );
7420
7611
  }
7421
7612
  async vote(slug, choiceId, voterKey, options) {
7422
7613
  return this.post(
7423
- `/public/${encodeURIComponent(slug)}/votes`,
7614
+ `/public/${pathSegment(slug, "slug")}/votes`,
7424
7615
  {
7425
7616
  choice_id: choiceId,
7426
7617
  voter_key: voterKey
@@ -7461,28 +7652,28 @@ var EventsService = class extends ServiceModule {
7461
7652
  return this.post("", data, options);
7462
7653
  }
7463
7654
  async get(eventId, options) {
7464
- return this._get(`/${eventId}`, options);
7655
+ return this._get(`/${pathSegment(eventId, "eventId")}`, options);
7465
7656
  }
7466
7657
  async update(eventId, data, options) {
7467
- return this.patch(`/${eventId}`, data, options);
7658
+ return this.patch(`/${pathSegment(eventId, "eventId")}`, data, options);
7468
7659
  }
7469
7660
  async delete(eventId, options) {
7470
- return this.del(`/${eventId}`, options);
7661
+ return this.del(`/${pathSegment(eventId, "eventId")}`, options);
7471
7662
  }
7472
7663
  async list(filters, requestOptions) {
7473
7664
  return this._list("", filters, requestOptions);
7474
7665
  }
7475
7666
  async register(eventId, options) {
7476
- return this.post(`/${eventId}/register`, void 0, options);
7667
+ return this.post(`/${pathSegment(eventId, "eventId")}/register`, void 0, options);
7477
7668
  }
7478
7669
  async unregister(eventId, options) {
7479
- return this.del(`/${eventId}/register`, options);
7670
+ return this.del(`/${pathSegment(eventId, "eventId")}/register`, options);
7480
7671
  }
7481
7672
  async getAttendees(eventId, params, requestOptions) {
7482
- return this._list(`/${eventId}/attendees`, params, requestOptions);
7673
+ return this._list(`/${pathSegment(eventId, "eventId")}/attendees`, params, requestOptions);
7483
7674
  }
7484
7675
  async checkIn(eventId, options) {
7485
- return this.post(`/${eventId}/check-in`, void 0, options);
7676
+ return this.post(`/${pathSegment(eventId, "eventId")}/check-in`, void 0, options);
7486
7677
  }
7487
7678
  /** @deprecated Use create() instead */
7488
7679
  async createEvent(data) {
@@ -7504,22 +7695,38 @@ var LeaderboardService = class extends ServiceModule {
7504
7695
  return this.post("", data, options);
7505
7696
  }
7506
7697
  async submitScore(boardId, data, options) {
7507
- return this.post(`/${boardId}/scores`, data, options);
7698
+ return this.post(`/${pathSegment(boardId, "boardId")}/scores`, data, options);
7508
7699
  }
7509
7700
  async getRankings(boardId, rankingOptions, requestOptions) {
7510
- return this._get(this.withQuery(`/${boardId}/rankings`, rankingOptions), requestOptions);
7701
+ return this._get(
7702
+ this.withQuery(`/${pathSegment(boardId, "boardId")}/rankings`, rankingOptions),
7703
+ requestOptions
7704
+ );
7511
7705
  }
7512
7706
  async getUserRank(boardId, userId, options) {
7513
- return this._get(`/${boardId}/users/${userId}/rank`, options);
7707
+ return this._get(
7708
+ `/${pathSegment(boardId, "boardId")}/users/${pathSegment(userId, "userId")}/rank`,
7709
+ options
7710
+ );
7514
7711
  }
7515
7712
  async getUserHistory(boardId, userId, options) {
7516
- return this._get(`/${boardId}/users/${userId}/history`, options);
7713
+ return this._get(
7714
+ `/${pathSegment(boardId, "boardId")}/users/${pathSegment(userId, "userId")}/history`,
7715
+ options
7716
+ );
7517
7717
  }
7518
7718
  async updateScore(boardId, userId, data, options) {
7519
- 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
+ );
7520
7724
  }
7521
7725
  async deleteScore(boardId, userId, options) {
7522
- return this.del(`/${boardId}/users/${userId}/score`, options);
7726
+ return this.del(
7727
+ `/${pathSegment(boardId, "boardId")}/users/${pathSegment(userId, "userId")}/score`,
7728
+ options
7729
+ );
7523
7730
  }
7524
7731
  };
7525
7732
 
@@ -7536,13 +7743,13 @@ var WebhooksService = class extends ServiceModule {
7536
7743
  return this._get("", options);
7537
7744
  }
7538
7745
  async get(id, options) {
7539
- return this._get(`/${id}`, options);
7746
+ return this._get(`/${pathSegment(id, "id")}`, options);
7540
7747
  }
7541
7748
  async update(id, data, options) {
7542
- return this.patch(`/${id}`, data, options);
7749
+ return this.patch(`/${pathSegment(id, "id")}`, data, options);
7543
7750
  }
7544
7751
  async delete(id, options) {
7545
- return this.del(`/${id}`, options);
7752
+ return this.del(`/${pathSegment(id, "id")}`, options);
7546
7753
  }
7547
7754
  async listEvents(options) {
7548
7755
  return this._get("/events", options);
@@ -7574,7 +7781,7 @@ var NewslettersService = class extends ServiceModule {
7574
7781
  /** Signs a reader up. Call from the reader's browser so their own evidence is recorded. */
7575
7782
  async subscribe(slug, input, options) {
7576
7783
  return this.post(
7577
- `/lists/${encodeURIComponent(slug)}/subscriptions`,
7784
+ `/lists/${pathSegment(slug, "slug")}/subscriptions`,
7578
7785
  { channel: "email", ...input },
7579
7786
  { skipRetry: true, ...options }
7580
7787
  );
@@ -7620,7 +7827,10 @@ var SearchService = class extends ServiceModule {
7620
7827
  return this.post("/documents", { index: indexName, ...document2 }, options);
7621
7828
  }
7622
7829
  async removeDocument(indexName, docId, options) {
7623
- return this.del(`/documents/${indexName}/${docId}`, options);
7830
+ return this.del(
7831
+ `/documents/${pathSegment(indexName, "indexName")}/${pathSegment(docId, "docId")}`,
7832
+ options
7833
+ );
7624
7834
  }
7625
7835
  /** @deprecated Use query() instead */
7626
7836
  async search(queryStr, options) {
@@ -7655,22 +7865,22 @@ var PhotoService = class extends ServiceModule {
7655
7865
  });
7656
7866
  }
7657
7867
  async transform(photoId, transformations, options) {
7658
- return this.post(`/${photoId}/transform`, transformations, options);
7868
+ return this.post(`/${pathSegment(photoId, "photoId")}/transform`, transformations, options);
7659
7869
  }
7660
7870
  async get(id, options) {
7661
- return this._get(`/${id}`, options);
7871
+ return this._get(`/${pathSegment(id, "id")}`, options);
7662
7872
  }
7663
7873
  async delete(id, options) {
7664
- return this.del(`/${id}`, options);
7874
+ return this.del(`/${pathSegment(id, "id")}`, options);
7665
7875
  }
7666
7876
  async getPresets(options) {
7667
7877
  return this._get("/presets", options);
7668
7878
  }
7669
7879
  async getManifest(id, params, options) {
7670
- return this._get(this.withQuery(`/${id}/manifest`, params), options);
7880
+ return this._get(this.withQuery(`/${pathSegment(id, "id")}/manifest`, params), options);
7671
7881
  }
7672
7882
  async getPublicManifest(id, params, options) {
7673
- return this._get(this.withQuery(`/public/${id}/manifest`, params), options);
7883
+ return this._get(this.withQuery(`/public/${pathSegment(id, "id")}/manifest`, params), options);
7674
7884
  }
7675
7885
  /**
7676
7886
  * Build an absolute URL for the on-demand transform endpoint.
@@ -7687,7 +7897,7 @@ var PhotoService = class extends ServiceModule {
7687
7897
  if (options?.format) params.set("format", options.format);
7688
7898
  if (options?.quality) params.set("quality", String(options.quality));
7689
7899
  const qs = params.toString();
7690
- return `${this.client.getBaseUrl()}${this.basePath}/${photoId}/transform${qs ? `?${qs}` : ""}`;
7900
+ return `${this.client.getBaseUrl()}${this.basePath}/${pathSegment(photoId, "photoId")}/transform${qs ? `?${qs}` : ""}`;
7691
7901
  }
7692
7902
  /**
7693
7903
  * Build an absolute URL for the **public** transform endpoint —
@@ -7722,7 +7932,7 @@ var PhotoService = class extends ServiceModule {
7722
7932
  if (options?.format) params.set("format", options.format);
7723
7933
  if (options?.quality) params.set("quality", String(options.quality));
7724
7934
  const qs = params.toString();
7725
- 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}` : ""}`;
7726
7936
  }
7727
7937
  /**
7728
7938
  * Get a transform URL optimized for the given display area.
@@ -8121,7 +8331,7 @@ var MediaService = class extends ServiceModule {
8121
8331
  }
8122
8332
  async releaseQuarantine(fileId, reason = "Released via @scalemule/sdk media.releaseQuarantine()", options) {
8123
8333
  const response = await this.client.post(
8124
- `/v1/storage/admin/files/${fileId}/scan-override`,
8334
+ `/v1/storage/admin/files/${pathSegment(fileId, "fileId")}/scan-override`,
8125
8335
  { scan_status: "clean", reason },
8126
8336
  options
8127
8337
  );
@@ -8599,7 +8809,7 @@ var TtsService = class extends ServiceModule {
8599
8809
  );
8600
8810
  }
8601
8811
  async getJob(id, options) {
8602
- return this._get(`/jobs/${id}`, options);
8812
+ return this._get(`/jobs/${pathSegment(id, "id")}`, options);
8603
8813
  }
8604
8814
  async listVoices(params, options) {
8605
8815
  return this._get(this.withQuery("/voices", { provider: params?.provider }), options);
@@ -8616,13 +8826,13 @@ var DeadLetterApi = class extends ServiceModule {
8616
8826
  return this._get("", options);
8617
8827
  }
8618
8828
  async get(id, options) {
8619
- return this._get(`/${id}`, options);
8829
+ return this._get(`/${pathSegment(id, "id")}`, options);
8620
8830
  }
8621
8831
  async retry(id, options) {
8622
- return this.post(`/${id}/retry`, void 0, options);
8832
+ return this.post(`/${pathSegment(id, "id")}/retry`, void 0, options);
8623
8833
  }
8624
8834
  async delete(id, options) {
8625
- return this.del(`/${id}`, options);
8835
+ return this.del(`/${pathSegment(id, "id")}`, options);
8626
8836
  }
8627
8837
  };
8628
8838
  var QueueService = class extends ServiceModule {
@@ -8635,7 +8845,7 @@ var QueueService = class extends ServiceModule {
8635
8845
  return this.post("/jobs", data, options);
8636
8846
  }
8637
8847
  async getJob(id, options) {
8638
- return this._get(`/jobs/${id}`, options);
8848
+ return this._get(`/jobs/${pathSegment(id, "id")}`, options);
8639
8849
  }
8640
8850
  };
8641
8851
 
@@ -8646,13 +8856,13 @@ var CacheService = class extends ServiceModule {
8646
8856
  this.basePath = "/v1/cache";
8647
8857
  }
8648
8858
  async get(key, options) {
8649
- return this._get(`/${key}`, options);
8859
+ return this._get(`/${pathSegment(key, "key")}`, options);
8650
8860
  }
8651
8861
  async set(key, value, ttl, options) {
8652
8862
  return this.post("", { key, value, ttl }, options);
8653
8863
  }
8654
8864
  async delete(key, options) {
8655
- return this.del(`/${key}`, options);
8865
+ return this.del(`/${pathSegment(key, "key")}`, options);
8656
8866
  }
8657
8867
  async flush(options) {
8658
8868
  return this.del("", options);
@@ -8704,10 +8914,10 @@ var ComplianceService = class extends ServiceModule {
8704
8914
  return this.post("/consent/v2", data, options);
8705
8915
  }
8706
8916
  async getUserConsents(userId, options) {
8707
- return this._get(`/consent/v2/${userId}`, options);
8917
+ return this._get(`/consent/v2/${pathSegment(userId, "userId")}`, options);
8708
8918
  }
8709
8919
  async withdrawConsent(consentId, data, options) {
8710
- return this.put(`/consent/v2/${consentId}/withdraw`, data || {}, options);
8920
+ return this.put(`/consent/v2/${pathSegment(consentId, "consentId")}/withdraw`, data || {}, options);
8711
8921
  }
8712
8922
  // --- Data Subject Requests ---
8713
8923
  async createDataSubjectRequest(data, options) {
@@ -8717,16 +8927,16 @@ var ComplianceService = class extends ServiceModule {
8717
8927
  return this._get(`/dsr${this.qs(params)}`, requestOptions);
8718
8928
  }
8719
8929
  async getDataSubjectRequest(id, options) {
8720
- return this._get(`/dsr/${id}`, options);
8930
+ return this._get(`/dsr/${pathSegment(id, "id")}`, options);
8721
8931
  }
8722
8932
  async updateDsrStatus(id, data, options) {
8723
- return this.put(`/dsr/${id}/status`, data, options);
8933
+ return this.put(`/dsr/${pathSegment(id, "id")}/status`, data, options);
8724
8934
  }
8725
8935
  async createDsrAction(dsrId, data, options) {
8726
- return this.post(`/dsr/${dsrId}/actions`, data, options);
8936
+ return this.post(`/dsr/${pathSegment(dsrId, "dsrId")}/actions`, data, options);
8727
8937
  }
8728
8938
  async listDsrActions(dsrId, options) {
8729
- return this._get(`/dsr/${dsrId}/actions`, options);
8939
+ return this._get(`/dsr/${pathSegment(dsrId, "dsrId")}/actions`, options);
8730
8940
  }
8731
8941
  // --- Data Breaches ---
8732
8942
  async reportBreach(data, options) {
@@ -8736,10 +8946,10 @@ var ComplianceService = class extends ServiceModule {
8736
8946
  return this._get(`/breaches${this.qs(params)}`, requestOptions);
8737
8947
  }
8738
8948
  async getBreach(id, options) {
8739
- return this._get(`/breaches/${id}`, options);
8949
+ return this._get(`/breaches/${pathSegment(id, "id")}`, options);
8740
8950
  }
8741
8951
  async updateBreach(id, data, options) {
8742
- return this.put(`/breaches/${id}`, data, options);
8952
+ return this.put(`/breaches/${pathSegment(id, "id")}`, data, options);
8743
8953
  }
8744
8954
  // --- Retention Policies ---
8745
8955
  async listRetentionPolicies(options) {
@@ -8756,10 +8966,10 @@ var ComplianceService = class extends ServiceModule {
8756
8966
  return this._get(`/processing-activities${this.qs(params)}`, requestOptions);
8757
8967
  }
8758
8968
  async getProcessingActivity(id, options) {
8759
- return this._get(`/processing-activities/${id}`, options);
8969
+ return this._get(`/processing-activities/${pathSegment(id, "id")}`, options);
8760
8970
  }
8761
8971
  async updateProcessingActivity(id, data, options) {
8762
- return this.put(`/processing-activities/${id}`, data, options);
8972
+ return this.put(`/processing-activities/${pathSegment(id, "id")}`, data, options);
8763
8973
  }
8764
8974
  };
8765
8975
 
@@ -8773,10 +8983,10 @@ var OrchestratorService = class extends ServiceModule {
8773
8983
  return this.post("/workflows", data, options);
8774
8984
  }
8775
8985
  async execute(workflowId, input, options) {
8776
- return this.post(`/workflows/${workflowId}/execute`, input, options);
8986
+ return this.post(`/workflows/${pathSegment(workflowId, "workflowId")}/execute`, input, options);
8777
8987
  }
8778
8988
  async getExecution(executionId, options) {
8779
- return this._get(`/executions/${executionId}`, options);
8989
+ return this._get(`/executions/${pathSegment(executionId, "executionId")}`, options);
8780
8990
  }
8781
8991
  /** @deprecated Use execute() instead */
8782
8992
  async executeWorkflow(workflowId, input) {
@@ -8817,7 +9027,7 @@ var IdentityService = class extends ServiceModule {
8817
9027
  return this._get("/api-keys", options);
8818
9028
  }
8819
9029
  async revokeApiKey(id, options) {
8820
- return this.del(`/api-keys/${id}`, options);
9030
+ return this.del(`/api-keys/${pathSegment(id, "id")}`, options);
8821
9031
  }
8822
9032
  /**
8823
9033
  * Explicitly link an anonymous_id to the current authenticated user.
@@ -8843,7 +9053,7 @@ var CatalogService = class extends ServiceModule {
8843
9053
  return this._get("/services", options);
8844
9054
  }
8845
9055
  async getServiceHealth(name, options) {
8846
- return this._get(`/services/${name}/health`, options);
9056
+ return this._get(`/services/${pathSegment(name, "name")}/health`, options);
8847
9057
  }
8848
9058
  };
8849
9059
 
@@ -8860,13 +9070,13 @@ var FlagContentService = class extends ServiceModule {
8860
9070
  return this._get(this.withQuery("/flags/check", params), requestOptions);
8861
9071
  }
8862
9072
  async getFlag(id, options) {
8863
- return this._get(`/flags/${id}`, options);
9073
+ return this._get(`/flags/${pathSegment(id, "id")}`, options);
8864
9074
  }
8865
9075
  async submitAppeal(data, options) {
8866
9076
  return this.post("/appeals", data, options);
8867
9077
  }
8868
9078
  async getAppeal(id, options) {
8869
- return this._get(`/appeals/${id}`, options);
9079
+ return this._get(`/appeals/${pathSegment(id, "id")}`, options);
8870
9080
  }
8871
9081
  };
8872
9082
 
@@ -8882,11 +9092,11 @@ var CreatorMakerService = class extends ServiceModule {
8882
9092
  }
8883
9093
  /** Get a generation job by ID. */
8884
9094
  async getJob(jobId, options) {
8885
- return this._get(`/jobs/${jobId}`, options);
9095
+ return this._get(`/jobs/${pathSegment(jobId, "jobId")}`, options);
8886
9096
  }
8887
9097
  /** Long-poll for job completion (server holds up to 30s). */
8888
9098
  async pollJob(jobId, options) {
8889
- return this._get(`/jobs/${jobId}/poll`, {
9099
+ return this._get(`/jobs/${pathSegment(jobId, "jobId")}/poll`, {
8890
9100
  ...options,
8891
9101
  timeout: 35e3
8892
9102
  });
@@ -8897,15 +9107,15 @@ var CreatorMakerService = class extends ServiceModule {
8897
9107
  }
8898
9108
  /** Cancel a pending or queued job. */
8899
9109
  async cancelJob(jobId, options) {
8900
- return this.post(`/jobs/${jobId}/cancel`, void 0, options);
9110
+ return this.post(`/jobs/${pathSegment(jobId, "jobId")}/cancel`, void 0, options);
8901
9111
  }
8902
9112
  /** Retry a failed job. */
8903
9113
  async retryJob(jobId, options) {
8904
- return this.post(`/jobs/${jobId}/retry`, void 0, options);
9114
+ return this.post(`/jobs/${pathSegment(jobId, "jobId")}/retry`, void 0, options);
8905
9115
  }
8906
9116
  /** Generate variations of a completed job. */
8907
9117
  async generateVariations(jobId, options) {
8908
- return this.post(`/jobs/${jobId}/variations`, void 0, options);
9118
+ return this.post(`/jobs/${pathSegment(jobId, "jobId")}/variations`, void 0, options);
8909
9119
  }
8910
9120
  /** List available style presets, optionally filtered by mode. */
8911
9121
  async listPresets(params, options) {
@@ -8913,7 +9123,7 @@ var CreatorMakerService = class extends ServiceModule {
8913
9123
  }
8914
9124
  /** Get a style preset by slug. */
8915
9125
  async getPreset(slug, options) {
8916
- return this._get(`/presets/${slug}`, options);
9126
+ return this._get(`/presets/${pathSegment(slug, "slug")}`, options);
8917
9127
  }
8918
9128
  /** Create a project. */
8919
9129
  async createProject(data, options) {
@@ -8929,11 +9139,11 @@ var CreatorMakerService = class extends ServiceModule {
8929
9139
  }
8930
9140
  /** Get a generation output by ID. */
8931
9141
  async getOutput(outputId, options) {
8932
- return this._get(`/outputs/${outputId}`, options);
9142
+ return this._get(`/outputs/${pathSegment(outputId, "outputId")}`, options);
8933
9143
  }
8934
9144
  /** Get a download URL for a generation output. */
8935
9145
  async getDownloadUrl(outputId, options) {
8936
- return this._get(`/outputs/${outputId}/download`, options);
9146
+ return this._get(`/outputs/${pathSegment(outputId, "outputId")}/download`, options);
8937
9147
  }
8938
9148
  };
8939
9149
 
@@ -8953,10 +9163,10 @@ var AgentAuthService = class extends ServiceModule {
8953
9163
  return this.post("/agent-tokens", data, options);
8954
9164
  }
8955
9165
  async revokeToken(id, options) {
8956
- return this.del(`/agent-tokens/${id}`, options);
9166
+ return this.del(`/agent-tokens/${pathSegment(id, "id")}`, options);
8957
9167
  }
8958
9168
  async rotateToken(id, options) {
8959
- return this.post(`/agent-tokens/${id}/rotate`, void 0, options);
9169
+ return this.post(`/agent-tokens/${pathSegment(id, "id")}/rotate`, void 0, options);
8960
9170
  }
8961
9171
  async exchangeToken(data, options) {
8962
9172
  return this.post("/agent-tokens/exchange", data, options);
@@ -8968,7 +9178,7 @@ var AgentAuthService = class extends ServiceModule {
8968
9178
  return this.post("/agent-signing-keys", data, options);
8969
9179
  }
8970
9180
  async revokeSigningKey(id, options) {
8971
- return this.del(`/agent-signing-keys/${id}`, options);
9181
+ return this.del(`/agent-signing-keys/${pathSegment(id, "id")}`, options);
8972
9182
  }
8973
9183
  async getProfile(options) {
8974
9184
  return this._get("/agent-profile", options);
@@ -8977,10 +9187,10 @@ var AgentAuthService = class extends ServiceModule {
8977
9187
  return this.patch("/agent-profile", data, options);
8978
9188
  }
8979
9189
  async getSecurityPolicy(appId, options) {
8980
- return this._get(`/applications/${appId}/agent-security`, options);
9190
+ return this._get(`/applications/${pathSegment(appId, "appId")}/agent-security`, options);
8981
9191
  }
8982
9192
  async updateSecurityPolicy(appId, data, options) {
8983
- return this.put(`/applications/${appId}/agent-security`, data, options);
9193
+ return this.put(`/applications/${pathSegment(appId, "appId")}/agent-security`, data, options);
8984
9194
  }
8985
9195
  };
8986
9196
 
@@ -8995,7 +9205,7 @@ var AgentsService = class extends ServiceModule {
8995
9205
  return this.post("/register-agent", data, options);
8996
9206
  }
8997
9207
  async deactivateAgent(id, options) {
8998
- return this.post(`/agents/${id}/deactivate`, void 0, options);
9208
+ return this.post(`/agents/${pathSegment(id, "id")}/deactivate`, void 0, options);
8999
9209
  }
9000
9210
  // Agent CRUD
9001
9211
  async create(data, options) {
@@ -9005,16 +9215,16 @@ var AgentsService = class extends ServiceModule {
9005
9215
  return this._list("/agents", params, options);
9006
9216
  }
9007
9217
  async get(id, options) {
9008
- return this._get(`/agents/${id}`, options);
9218
+ return this._get(`/agents/${pathSegment(id, "id")}`, options);
9009
9219
  }
9010
9220
  async update(id, data, options) {
9011
- return this.patch(`/agents/${id}`, data, options);
9221
+ return this.patch(`/agents/${pathSegment(id, "id")}`, data, options);
9012
9222
  }
9013
9223
  async remove(id, options) {
9014
- return this.del(`/agents/${id}`, options);
9224
+ return this.del(`/agents/${pathSegment(id, "id")}`, options);
9015
9225
  }
9016
9226
  async setDefaultWorkspace(id, data, options) {
9017
- return this.post(`/agents/${id}/set-default-workspace`, data, options);
9227
+ return this.post(`/agents/${pathSegment(id, "id")}/set-default-workspace`, data, options);
9018
9228
  }
9019
9229
  // Runtime Templates
9020
9230
  async createTemplate(data, options) {
@@ -9025,15 +9235,15 @@ var AgentsService = class extends ServiceModule {
9025
9235
  }
9026
9236
  async getTemplate(id, options) {
9027
9237
  return this._get(
9028
- `/runtime-templates/${id}`,
9238
+ `/runtime-templates/${pathSegment(id, "id")}`,
9029
9239
  options
9030
9240
  );
9031
9241
  }
9032
9242
  async createTemplateVersion(id, data, options) {
9033
- return this.post(`/runtime-templates/${id}/versions`, data, options);
9243
+ return this.post(`/runtime-templates/${pathSegment(id, "id")}/versions`, data, options);
9034
9244
  }
9035
9245
  async listTemplateVersions(id, options) {
9036
- return this._get(`/runtime-templates/${id}/versions`, options);
9246
+ return this._get(`/runtime-templates/${pathSegment(id, "id")}/versions`, options);
9037
9247
  }
9038
9248
  // Workspaces
9039
9249
  async createWorkspace(data, options) {
@@ -9043,13 +9253,13 @@ var AgentsService = class extends ServiceModule {
9043
9253
  return this._list("/workspaces", params, options);
9044
9254
  }
9045
9255
  async getWorkspace(id, options) {
9046
- return this._get(`/workspaces/${id}`, options);
9256
+ return this._get(`/workspaces/${pathSegment(id, "id")}`, options);
9047
9257
  }
9048
9258
  async updateWorkspace(id, data, options) {
9049
- return this.patch(`/workspaces/${id}`, data, options);
9259
+ return this.patch(`/workspaces/${pathSegment(id, "id")}`, data, options);
9050
9260
  }
9051
9261
  async addOsAccount(workspaceId, data, options) {
9052
- return this.post(`/workspaces/${workspaceId}/os-accounts`, data, options);
9262
+ return this.post(`/workspaces/${pathSegment(workspaceId, "workspaceId")}/os-accounts`, data, options);
9053
9263
  }
9054
9264
  };
9055
9265
 
@@ -9070,49 +9280,66 @@ var AgentProjectsService = class extends ServiceModule {
9070
9280
  return this._list("/projects", params, options);
9071
9281
  }
9072
9282
  async getProject(id, applicationId, options) {
9073
- return this._get(this.withAppId(`/projects/${id}`, applicationId), options);
9283
+ return this._get(this.withAppId(`/projects/${pathSegment(id, "id")}`, applicationId), options);
9074
9284
  }
9075
9285
  async updateProject(id, data, applicationId, options) {
9076
- return this.patch(this.withAppId(`/projects/${id}`, applicationId), data, options);
9286
+ return this.patch(this.withAppId(`/projects/${pathSegment(id, "id")}`, applicationId), data, options);
9077
9287
  }
9078
9288
  // Members (use auth user_id)
9079
9289
  async addMember(projectId, data, applicationId, options) {
9080
- 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
+ );
9081
9295
  }
9082
9296
  async listMembers(projectId, params, options) {
9083
9297
  const qs = {};
9084
9298
  if (params?.application_id) qs.application_id = params.application_id;
9085
9299
  if (params?.hydrate) qs.hydrate = "true";
9086
- 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`;
9087
9301
  const result = await this._get(path, options);
9088
9302
  return { data: result.data?.members ?? [], error: result.error };
9089
9303
  }
9090
9304
  async updateMember(projectId, userId, data, applicationId, options) {
9091
9305
  return this.patch(
9092
- this.withAppId(`/projects/${projectId}/members/${userId}`, applicationId),
9306
+ this.withAppId(
9307
+ `/projects/${pathSegment(projectId, "projectId")}/members/${pathSegment(userId, "userId")}`,
9308
+ applicationId
9309
+ ),
9093
9310
  data,
9094
9311
  options
9095
9312
  );
9096
9313
  }
9097
9314
  async removeMember(projectId, userId, applicationId, options) {
9098
- 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
+ );
9099
9322
  }
9100
9323
  // Tasks
9101
9324
  async createTask(projectId, data, applicationId, options) {
9102
- 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
+ );
9103
9330
  }
9104
9331
  async listTasks(projectId, params, options) {
9105
- return this._list(`/projects/${projectId}/tasks`, params, options);
9332
+ return this._list(`/projects/${pathSegment(projectId, "projectId")}/tasks`, params, options);
9106
9333
  }
9107
9334
  async getTask(id, applicationId, options) {
9108
- return this._get(this.withAppId(`/tasks/${id}`, applicationId), options);
9335
+ return this._get(this.withAppId(`/tasks/${pathSegment(id, "id")}`, applicationId), options);
9109
9336
  }
9110
9337
  async updateTask(id, data, applicationId, options) {
9111
- return this.patch(this.withAppId(`/tasks/${id}`, applicationId), data, options);
9338
+ return this.patch(this.withAppId(`/tasks/${pathSegment(id, "id")}`, applicationId), data, options);
9112
9339
  }
9113
9340
  async reorderTasks(projectId, taskIds, applicationId, options) {
9114
9341
  return this.post(
9115
- this.withAppId(`/projects/${projectId}/tasks/reorder`, applicationId),
9342
+ this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/tasks/reorder`, applicationId),
9116
9343
  { task_ids: taskIds },
9117
9344
  options
9118
9345
  );
@@ -9131,88 +9358,113 @@ var AgentProjectsService = class extends ServiceModule {
9131
9358
  }
9132
9359
  async claim(taskId, agentId, applicationId, options) {
9133
9360
  return this.post(
9134
- this.withAppId(`/tasks/${taskId}/claim`, applicationId),
9361
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/claim`, applicationId),
9135
9362
  { agent_id: agentId },
9136
9363
  options
9137
9364
  );
9138
9365
  }
9139
9366
  async heartbeat(taskId, agentId, applicationId, options) {
9140
9367
  return this.post(
9141
- this.withAppId(`/tasks/${taskId}/heartbeat`, applicationId),
9368
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/heartbeat`, applicationId),
9142
9369
  { agent_id: agentId },
9143
9370
  options
9144
9371
  );
9145
9372
  }
9146
9373
  async startTask(taskId, agentId, applicationId, options) {
9147
9374
  return this.post(
9148
- this.withAppId(`/tasks/${taskId}/start`, applicationId),
9375
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/start`, applicationId),
9149
9376
  { agent_id: agentId },
9150
9377
  options
9151
9378
  );
9152
9379
  }
9153
9380
  async submit(taskId, data, applicationId, options) {
9154
- 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
+ );
9155
9386
  }
9156
9387
  async block(taskId, data, applicationId, options) {
9157
- 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
+ );
9158
9393
  }
9159
9394
  // Assignment
9160
9395
  async assignAgent(taskId, data, applicationId, options) {
9161
- 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);
9162
9397
  }
9163
9398
  async unassignAgent(taskId, agentId, applicationId, options) {
9164
- 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
+ );
9165
9406
  }
9166
9407
  // History
9167
9408
  async listAttempts(taskId, applicationId, options) {
9168
9409
  const result = await this._get(
9169
- this.withAppId(`/tasks/${taskId}/attempts`, applicationId),
9410
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/attempts`, applicationId),
9170
9411
  options
9171
9412
  );
9172
9413
  return { data: result.data?.attempts ?? [], error: result.error };
9173
9414
  }
9174
9415
  async listTransitions(taskId, applicationId, options) {
9175
9416
  const result = await this._get(
9176
- this.withAppId(`/tasks/${taskId}/transitions`, applicationId),
9417
+ this.withAppId(`/tasks/${pathSegment(taskId, "taskId")}/transitions`, applicationId),
9177
9418
  options
9178
9419
  );
9179
9420
  return { data: result.data?.transitions ?? [], error: result.error };
9180
9421
  }
9181
9422
  // Documents
9182
9423
  async createDocument(projectId, data, applicationId, options) {
9183
- 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
+ );
9184
9429
  }
9185
9430
  async listDocuments(projectId, applicationId, options) {
9186
9431
  const result = await this._get(
9187
- this.withAppId(`/projects/${projectId}/documents`, applicationId),
9432
+ this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/documents`, applicationId),
9188
9433
  options
9189
9434
  );
9190
9435
  return { data: result.data?.documents ?? [], error: result.error };
9191
9436
  }
9192
9437
  async deleteDocument(documentId, applicationId, options) {
9193
- return this.del(this.withAppId(`/documents/${documentId}`, applicationId), options);
9438
+ return this.del(
9439
+ this.withAppId(`/documents/${pathSegment(documentId, "documentId")}`, applicationId),
9440
+ options
9441
+ );
9194
9442
  }
9195
9443
  // Pipelines
9196
9444
  async createPipeline(projectId, data, applicationId, options) {
9197
- 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
+ );
9198
9450
  }
9199
9451
  async listPipelines(projectId, applicationId, options) {
9200
9452
  const result = await this._get(
9201
- this.withAppId(`/projects/${projectId}/pipelines`, applicationId),
9453
+ this.withAppId(`/projects/${pathSegment(projectId, "projectId")}/pipelines`, applicationId),
9202
9454
  options
9203
9455
  );
9204
9456
  return { data: result.data?.pipelines ?? [], error: result.error };
9205
9457
  }
9206
9458
  async createPipelineVersion(pipelineId, data, applicationId, options) {
9207
9459
  return this.post(
9208
- this.withAppId(`/pipelines/${pipelineId}/versions`, applicationId),
9460
+ this.withAppId(`/pipelines/${pathSegment(pipelineId, "pipelineId")}/versions`, applicationId),
9209
9461
  data,
9210
9462
  options
9211
9463
  );
9212
9464
  }
9213
9465
  async listPipelineVersions(pipelineId, applicationId, options) {
9214
9466
  const result = await this._get(
9215
- this.withAppId(`/pipelines/${pipelineId}/versions`, applicationId),
9467
+ this.withAppId(`/pipelines/${pathSegment(pipelineId, "pipelineId")}/versions`, applicationId),
9216
9468
  options
9217
9469
  );
9218
9470
  return { data: result.data?.versions ?? [], error: result.error };
@@ -9231,20 +9483,20 @@ var AgentProjectsService = class extends ServiceModule {
9231
9483
  return { data: result.data?.grants ?? result.data ?? [], error: result.error };
9232
9484
  }
9233
9485
  async getGrant(id, options) {
9234
- return this._get(`/project-grants/${id}`, options);
9486
+ return this._get(`/project-grants/${pathSegment(id, "id")}`, options);
9235
9487
  }
9236
9488
  /** Public endpoint — no auth required. Returns masked email + project name. */
9237
9489
  async getGrantInfo(id, options) {
9238
- return this._get(`/project-grants/${id}/info`, { skipAuth: true, ...options });
9490
+ return this._get(`/project-grants/${pathSegment(id, "id")}/info`, { skipAuth: true, ...options });
9239
9491
  }
9240
9492
  async revokeGrant(id, options) {
9241
- return this.del(`/project-grants/${id}`, options);
9493
+ return this.del(`/project-grants/${pathSegment(id, "id")}`, options);
9242
9494
  }
9243
9495
  async resendGrantInvitation(id, data, options) {
9244
- return this.post(`/project-grants/${id}/resend`, data, options);
9496
+ return this.post(`/project-grants/${pathSegment(id, "id")}/resend`, data, options);
9245
9497
  }
9246
9498
  async redeemGrant(id, options) {
9247
- return this.post(`/project-grants/${id}/redeem`, void 0, options);
9499
+ return this.post(`/project-grants/${pathSegment(id, "id")}/redeem`, void 0, options);
9248
9500
  }
9249
9501
  };
9250
9502
 
@@ -9262,13 +9514,13 @@ var AgentToolsService = class extends ServiceModule {
9262
9514
  return this._list("/tools", params, options);
9263
9515
  }
9264
9516
  async getTool(id, options) {
9265
- return this._get(`/tools/${id}`, options);
9517
+ return this._get(`/tools/${pathSegment(id, "id")}`, options);
9266
9518
  }
9267
9519
  async createCapability(toolId, data, options) {
9268
- return this.post(`/tools/${toolId}/capabilities`, data, options);
9520
+ return this.post(`/tools/${pathSegment(toolId, "toolId")}/capabilities`, data, options);
9269
9521
  }
9270
9522
  async listCapabilities(toolId, options) {
9271
- return this._get(`/tools/${toolId}/capabilities`, options);
9523
+ return this._get(`/tools/${pathSegment(toolId, "toolId")}/capabilities`, options);
9272
9524
  }
9273
9525
  // Tool Integrations
9274
9526
  async createIntegration(data, options) {
@@ -9278,7 +9530,7 @@ var AgentToolsService = class extends ServiceModule {
9278
9530
  return this._list("/tool-integrations", params, options);
9279
9531
  }
9280
9532
  async updateIntegration(id, data, options) {
9281
- return this.patch(`/tool-integrations/${id}`, data, options);
9533
+ return this.patch(`/tool-integrations/${pathSegment(id, "id")}`, data, options);
9282
9534
  }
9283
9535
  // Credentials
9284
9536
  async createCredential(data, options) {
@@ -9288,13 +9540,17 @@ var AgentToolsService = class extends ServiceModule {
9288
9540
  return this._list("/credentials", params, options);
9289
9541
  }
9290
9542
  async updateCredential(id, data, options) {
9291
- return this.patch(`/credentials/${id}`, data, options);
9543
+ return this.patch(`/credentials/${pathSegment(id, "id")}`, data, options);
9292
9544
  }
9293
9545
  async createScope(credentialId, data, options) {
9294
- return this.post(`/credentials/${credentialId}/scopes`, data, options);
9546
+ return this.post(
9547
+ `/credentials/${pathSegment(credentialId, "credentialId")}/scopes`,
9548
+ data,
9549
+ options
9550
+ );
9295
9551
  }
9296
9552
  async listScopes(credentialId, options) {
9297
- return this._get(`/credentials/${credentialId}/scopes`, options);
9553
+ return this._get(`/credentials/${pathSegment(credentialId, "credentialId")}/scopes`, options);
9298
9554
  }
9299
9555
  // Entitlements
9300
9556
  async grantEntitlement(data, options) {
@@ -9304,7 +9560,7 @@ var AgentToolsService = class extends ServiceModule {
9304
9560
  return this._list("/agent-tool-entitlements", params, options);
9305
9561
  }
9306
9562
  async revokeEntitlement(id, options) {
9307
- return this.del(`/agent-tool-entitlements/${id}`, options);
9563
+ return this.del(`/agent-tool-entitlements/${pathSegment(id, "id")}`, options);
9308
9564
  }
9309
9565
  async authorizeAction(data, options) {
9310
9566
  return this.post("/authorize-action", data, options);
@@ -9346,13 +9602,13 @@ var AgentModelsService = class extends ServiceModule {
9346
9602
  return this._list("/models", params, options);
9347
9603
  }
9348
9604
  async getModel(id, options) {
9349
- return this._get(`/models/${id}`, options);
9605
+ return this._get(`/models/${pathSegment(id, "id")}`, options);
9350
9606
  }
9351
9607
  async createPricing(modelId, data, options) {
9352
- return this.post(`/models/${modelId}/pricing`, data, options);
9608
+ return this.post(`/models/${pathSegment(modelId, "modelId")}/pricing`, data, options);
9353
9609
  }
9354
9610
  async listPricing(modelId, options) {
9355
- return this._get(`/models/${modelId}/pricing`, options);
9611
+ return this._get(`/models/${pathSegment(modelId, "modelId")}/pricing`, options);
9356
9612
  }
9357
9613
  // Entitlements
9358
9614
  async createEntitlement(data, options) {
@@ -9362,7 +9618,7 @@ var AgentModelsService = class extends ServiceModule {
9362
9618
  return this._list("/model-entitlements", params, options);
9363
9619
  }
9364
9620
  async deleteEntitlement(id, options) {
9365
- return this.del(`/model-entitlements/${id}`, options);
9621
+ return this.del(`/model-entitlements/${pathSegment(id, "id")}`, options);
9366
9622
  }
9367
9623
  // Usage & Reporting
9368
9624
  async recordUsage(data, options) {
@@ -9393,27 +9649,27 @@ var AgentSessionsService = class extends ServiceModule {
9393
9649
  return this._list("/sessions", params, options);
9394
9650
  }
9395
9651
  async getSession(id, options) {
9396
- return this._get(`/sessions/${id}`, options);
9652
+ return this._get(`/sessions/${pathSegment(id, "id")}`, options);
9397
9653
  }
9398
9654
  async startSession(id, options) {
9399
- return this.post(`/sessions/${id}/start`, void 0, options);
9655
+ return this.post(`/sessions/${pathSegment(id, "id")}/start`, void 0, options);
9400
9656
  }
9401
9657
  async endSession(id, data, options) {
9402
- return this.post(`/sessions/${id}/end`, data, options);
9658
+ return this.post(`/sessions/${pathSegment(id, "id")}/end`, data, options);
9403
9659
  }
9404
9660
  // Logs
9405
9661
  async appendLog(sessionId, data, options) {
9406
- return this.post(`/sessions/${sessionId}/logs`, data, options);
9662
+ return this.post(`/sessions/${pathSegment(sessionId, "sessionId")}/logs`, data, options);
9407
9663
  }
9408
9664
  async listLogs(sessionId, options) {
9409
- return this._get(`/sessions/${sessionId}/logs`, options);
9665
+ return this._get(`/sessions/${pathSegment(sessionId, "sessionId")}/logs`, options);
9410
9666
  }
9411
9667
  // Artifacts
9412
9668
  async addArtifact(sessionId, data, options) {
9413
- return this.post(`/sessions/${sessionId}/artifacts`, data, options);
9669
+ return this.post(`/sessions/${pathSegment(sessionId, "sessionId")}/artifacts`, data, options);
9414
9670
  }
9415
9671
  async listArtifacts(sessionId, options) {
9416
- return this._get(`/sessions/${sessionId}/artifacts`, options);
9672
+ return this._get(`/sessions/${pathSegment(sessionId, "sessionId")}/artifacts`, options);
9417
9673
  }
9418
9674
  };
9419
9675
 
@@ -9766,6 +10022,7 @@ var index_default = ScaleMule;
9766
10022
  STORAGE_KEYS,
9767
10023
  ScaleMule,
9768
10024
  ScaleMuleClient,
10025
+ ScaleMulePathError,
9769
10026
  SchedulerService,
9770
10027
  SearchService,
9771
10028
  ServiceModule,
@@ -9798,6 +10055,7 @@ var index_default = ScaleMule;
9798
10055
  extractClientContext,
9799
10056
  findPhoneCountryByCode,
9800
10057
  findPhoneCountryByDialCode,
10058
+ findUnsafePathReason,
9801
10059
  generateAnonymousId,
9802
10060
  generateUploadSessionId,
9803
10061
  getMeasuredBandwidthMbps,
@@ -9809,6 +10067,7 @@ var index_default = ScaleMule;
9809
10067
  normalizeAndValidatePhone,
9810
10068
  normalizeExperiments,
9811
10069
  normalizePhoneNumber,
10070
+ pathSegment,
9812
10071
  pollSharePercent,
9813
10072
  pollVoterKey,
9814
10073
  prepareCommunityMapAttachment,