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