@livechat/developer-studio-api 5.4.2-beta.generator.28 → 5.5.0-beta.generator.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -115,6 +115,7 @@ __export(src_exports, {
115
115
  SortOrder: () => SortOrder,
116
116
  TRIGGER_REFERENCE_NAME: () => TRIGGER_REFERENCE_NAME,
117
117
  TextApiError: () => TextApiError,
118
+ TextBillingApiError: () => TextBillingApiError,
118
119
  TextCustomerEventNames: () => TextCustomerEventNames,
119
120
  TextHelpDeskEventNames: () => TextHelpDeskEventNames,
120
121
  TextLivechatEventNames: () => TextLivechatEventNames,
@@ -123,6 +124,7 @@ __export(src_exports, {
123
124
  TicketStatus: () => TicketStatus,
124
125
  UnauthorizeAccountsApiError: () => UnauthorizeAccountsApiError,
125
126
  UnauthorizeApiError: () => UnauthorizeApiError,
127
+ UnauthorizeTextBillingApiError: () => UnauthorizeTextBillingApiError,
126
128
  WorkflowAgentTriggerSubType: () => WorkflowAgentTriggerSubType,
127
129
  WorkflowConditionTaskFieldType: () => WorkflowConditionTaskFieldType,
128
130
  WorkflowConditionTaskLogic: () => WorkflowConditionTaskLogic,
@@ -217,6 +219,7 @@ __export(src_exports, {
217
219
  initPlatformAccountsClient: () => initPlatformAccountsClient,
218
220
  initShopifyClient: () => initShopifyClient,
219
221
  initSlackClient: () => initSlackClient,
222
+ initTextBillingClient: () => initTextBillingClient,
220
223
  initTextClient: () => initTextClient,
221
224
  initVercelClient: () => initVercelClient,
222
225
  initWorkflowsClient: () => initWorkflowsClient,
@@ -243,6 +246,7 @@ __export(src_exports, {
243
246
  shopifyEventsZods: () => shopifyEventsZods,
244
247
  slackClientInstance: () => slackClientInstance,
245
248
  slackEventsZods: () => slackEventsZods,
249
+ textBillingClientInstance: () => textBillingClientInstance,
246
250
  textClientInstance: () => textClientInstance,
247
251
  textCustomerEventsZods: () => textCustomerEventsZods,
248
252
  textEventsZods: () => textEventsZods,
@@ -3992,8 +3996,117 @@ var textAiAgentApi = {
3992
3996
  }
3993
3997
  };
3994
3998
 
3995
- // src/apis/integrations/text/external-account-manager/api.ts
3999
+ // src/apis/integrations/text/billing/instance.ts
4000
+ var TextBillingApiError = class extends ApiErrorBase {
4001
+ constructor() {
4002
+ super(...arguments);
4003
+ this.name = "text";
4004
+ }
4005
+ };
4006
+ var UnauthorizeTextBillingApiError = class extends UnauthorizeApiError {
4007
+ constructor(message) {
4008
+ super("text", message);
4009
+ }
4010
+ };
4011
+ var TextBillingApiClient = class extends ApiClient {
4012
+ constructor() {
4013
+ super(...arguments);
4014
+ this.UnauthorizedError = UnauthorizeTextBillingApiError;
4015
+ this.Error = TextBillingApiError;
4016
+ this.options = {
4017
+ headers: {
4018
+ Accept: "application/json",
4019
+ "Content-Type": "application/json"
4020
+ }
4021
+ };
4022
+ }
4023
+ };
4024
+ var textBillingClientInstance = new TextBillingApiClient({
4025
+ baseURL: "https://billing.labs.text.com"
4026
+ });
4027
+ function initTextBillingClient(baseUrl, token) {
4028
+ if (baseUrl) {
4029
+ textBillingClientInstance.updateConfig({
4030
+ baseURL: baseUrl
4031
+ });
4032
+ }
4033
+ textBillingClientInstance.updateAuthorization({
4034
+ token
4035
+ });
4036
+ }
4037
+
4038
+ // src/apis/integrations/text/billing/api.ts
3996
4039
  var urls = {
4040
+ getFeature: (featureName) => `/v4/organizations/my/features/${encodeURIComponent(featureName)}`,
4041
+ getSubscriptions: () => "/v4/subscriptions",
4042
+ getPlans: (billingProfileId) => `/v4/billing_profiles/${encodeURIComponent(billingProfileId)}/plans`,
4043
+ getBillingProfile: (billingProfileId) => `/v4/billing_profiles/${encodeURIComponent(billingProfileId)}`,
4044
+ deletePendingChange: (subscriptionId) => `/v4/subscriptions/${encodeURIComponent(subscriptionId)}:delete_pending_change`
4045
+ };
4046
+ var textBillingApi = {
4047
+ meta: {
4048
+ urls
4049
+ },
4050
+ getFeature(featureName, authorization) {
4051
+ return __async(this, null, function* () {
4052
+ return textBillingClientInstance.get(
4053
+ urls.getFeature(featureName),
4054
+ {
4055
+ authorization,
4056
+ customErrorMessage: "Feature couldn't be fetched."
4057
+ }
4058
+ );
4059
+ });
4060
+ },
4061
+ getSubscriptions(authorization) {
4062
+ return __async(this, null, function* () {
4063
+ return textBillingClientInstance.get(
4064
+ urls.getSubscriptions(),
4065
+ {
4066
+ authorization,
4067
+ customErrorMessage: "Subscriptions couldn't be fetched."
4068
+ }
4069
+ );
4070
+ });
4071
+ },
4072
+ getPlans(billingProfileId, authorization) {
4073
+ return __async(this, null, function* () {
4074
+ return textBillingClientInstance.get(
4075
+ urls.getPlans(billingProfileId),
4076
+ {
4077
+ authorization,
4078
+ customErrorMessage: "Plans couldn't be fetched."
4079
+ }
4080
+ );
4081
+ });
4082
+ },
4083
+ getBillingProfile(billingProfileId, authorization) {
4084
+ return __async(this, null, function* () {
4085
+ return textBillingClientInstance.get(
4086
+ urls.getBillingProfile(billingProfileId),
4087
+ {
4088
+ authorization,
4089
+ customErrorMessage: "Billing profile couldn't be fetched."
4090
+ }
4091
+ );
4092
+ });
4093
+ },
4094
+ deletePendingChange(subscriptionId, authorization) {
4095
+ return __async(this, null, function* () {
4096
+ return textBillingClientInstance.delete(
4097
+ urls.deletePendingChange(subscriptionId),
4098
+ void 0,
4099
+ {
4100
+ authorization,
4101
+ customErrorMessage: "Pending change couldn't be deleted."
4102
+ }
4103
+ );
4104
+ });
4105
+ }
4106
+ };
4107
+
4108
+ // src/apis/integrations/text/external-account-manager/api.ts
4109
+ var urls2 = {
3997
4110
  getOAuthState: () => "/external-account-manager/v1/oauth/state",
3998
4111
  getAccounts: () => "/external-account-manager/v1/accounts"
3999
4112
  };
@@ -4006,7 +4119,7 @@ var textExternalAccountManagerApi = {
4006
4119
  getOAuthState(accessToken) {
4007
4120
  return __async(this, null, function* () {
4008
4121
  return textClientInstance.get(
4009
- urls.getOAuthState(),
4122
+ urls2.getOAuthState(),
4010
4123
  getTextClientConfig({
4011
4124
  token: accessToken,
4012
4125
  ensureAuthorizationToken: true
@@ -4026,7 +4139,7 @@ var textExternalAccountManagerApi = {
4026
4139
  getAccounts(authorization) {
4027
4140
  return __async(this, null, function* () {
4028
4141
  return textClientInstance.get(
4029
- urls.getAccounts(),
4142
+ urls2.getAccounts(),
4030
4143
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4031
4144
  ensureAuthorizationToken: true
4032
4145
  }))
@@ -4126,7 +4239,7 @@ var getUrl = (segments = [], version) => buildUrlFromSegments(
4126
4239
  segments,
4127
4240
  `/workflow_platform/${version ? `${version}/` : ""}credentials`
4128
4241
  );
4129
- var urls2 = {
4242
+ var urls3 = {
4130
4243
  get: (id) => getUrl([id], "v1.0" /* V1 */),
4131
4244
  getList: (queryParams) => enrichUrlWithQueryParams(getUrl([], "v1.0" /* V1 */), queryParams),
4132
4245
  create: () => getUrl([], "v1.0" /* V1 */),
@@ -4138,12 +4251,12 @@ var urls2 = {
4138
4251
  };
4139
4252
  var textPlatformWorkflowsCredentialsApi = {
4140
4253
  meta: {
4141
- urls: urls2
4254
+ urls: urls3
4142
4255
  },
4143
4256
  get(id, authorization) {
4144
4257
  return __async(this, null, function* () {
4145
4258
  return textClientInstance.get(
4146
- urls2.get(id),
4259
+ urls3.get(id),
4147
4260
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4148
4261
  ensureAuthorizationToken: true
4149
4262
  }))
@@ -4160,7 +4273,7 @@ var textPlatformWorkflowsCredentialsApi = {
4160
4273
  getList(queryParams, authorization) {
4161
4274
  return __async(this, null, function* () {
4162
4275
  return textClientInstance.get(
4163
- urls2.getList(queryParams),
4276
+ urls3.getList(queryParams),
4164
4277
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4165
4278
  ensureAuthorizationToken: true
4166
4279
  }))
@@ -4177,7 +4290,7 @@ var textPlatformWorkflowsCredentialsApi = {
4177
4290
  create(payload, authorization) {
4178
4291
  return __async(this, null, function* () {
4179
4292
  return textClientInstance.post(
4180
- urls2.create(),
4293
+ urls3.create(),
4181
4294
  payload,
4182
4295
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4183
4296
  ensureAuthorizationToken: true
@@ -4195,7 +4308,7 @@ var textPlatformWorkflowsCredentialsApi = {
4195
4308
  update(id, payload, authorization) {
4196
4309
  return __async(this, null, function* () {
4197
4310
  return textClientInstance.put(
4198
- urls2.update(id),
4311
+ urls3.update(id),
4199
4312
  payload,
4200
4313
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4201
4314
  ensureAuthorizationToken: true
@@ -4213,7 +4326,7 @@ var textPlatformWorkflowsCredentialsApi = {
4213
4326
  delete(id, authorization) {
4214
4327
  return __async(this, null, function* () {
4215
4328
  return textClientInstance.delete(
4216
- urls2.delete(id),
4329
+ urls3.delete(id),
4217
4330
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4218
4331
  ensureAuthorizationToken: true
4219
4332
  }))
@@ -4230,7 +4343,7 @@ var textPlatformWorkflowsCredentialsApi = {
4230
4343
  connect(id, code, codeVerifier, authorization) {
4231
4344
  return __async(this, null, function* () {
4232
4345
  return textClientInstance.put(
4233
- urls2.connect(id),
4346
+ urls3.connect(id),
4234
4347
  {
4235
4348
  code,
4236
4349
  code_verifier: codeVerifier
@@ -4251,7 +4364,7 @@ var textPlatformWorkflowsCredentialsApi = {
4251
4364
  disconnect(id, authorization) {
4252
4365
  return __async(this, null, function* () {
4253
4366
  return textClientInstance.put(
4254
- urls2.disconnect(id),
4367
+ urls3.disconnect(id),
4255
4368
  {},
4256
4369
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4257
4370
  ensureAuthorizationToken: true
@@ -4269,7 +4382,7 @@ var textPlatformWorkflowsCredentialsApi = {
4269
4382
  importCredential(externalAccountId, authorization) {
4270
4383
  return __async(this, null, function* () {
4271
4384
  return textClientInstance.post(
4272
- urls2.import(),
4385
+ urls3.import(),
4273
4386
  {
4274
4387
  source: "external_account_manager",
4275
4388
  data: {
@@ -4295,17 +4408,17 @@ var textPlatformWorkflowsCredentialsApi = {
4295
4408
 
4296
4409
  // src/apis/integrations/text/platform/workflow/functions/api.ts
4297
4410
  var getUrl2 = (segments = []) => buildUrlFromSegments(segments, "/workflow_platform/functions");
4298
- var urls3 = {
4411
+ var urls4 = {
4299
4412
  get: () => getUrl2()
4300
4413
  };
4301
4414
  var textPlatformWorkflowsFunctionsApi = {
4302
4415
  meta: {
4303
- urls: urls3
4416
+ urls: urls4
4304
4417
  },
4305
4418
  get(authorization) {
4306
4419
  return __async(this, null, function* () {
4307
4420
  return textClientInstance.get(
4308
- urls3.get(),
4421
+ urls4.get(),
4309
4422
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4310
4423
  ensureAuthorizationToken: true
4311
4424
  }))
@@ -5896,18 +6009,18 @@ var getUrl3 = (segments = [], version) => buildUrlFromSegments(
5896
6009
  segments,
5897
6010
  `/workflow_platform/${version ? `${version}/` : ""}workflows/templates`
5898
6011
  );
5899
- var urls4 = {
6012
+ var urls5 = {
5900
6013
  getList: (queryParams) => enrichUrlWithQueryParams(getUrl3([], "v1.0" /* V1 */), queryParams),
5901
6014
  get: (templateId) => getUrl3([templateId], "v1.0" /* V1 */)
5902
6015
  };
5903
6016
  var textPlatformWorkflowsTemplatesApi = {
5904
6017
  meta: {
5905
- urls: urls4
6018
+ urls: urls5
5906
6019
  },
5907
6020
  getList(queryParams, authorization) {
5908
6021
  return __async(this, null, function* () {
5909
6022
  return textClientInstance.get(
5910
- urls4.getList(queryParams),
6023
+ urls5.getList(queryParams),
5911
6024
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5912
6025
  ensureAuthorizationToken: true
5913
6026
  }))
@@ -5924,7 +6037,7 @@ var textPlatformWorkflowsTemplatesApi = {
5924
6037
  get(templateId, authorization) {
5925
6038
  return __async(this, null, function* () {
5926
6039
  return textClientInstance.get(
5927
- urls4.get(templateId),
6040
+ urls5.get(templateId),
5928
6041
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5929
6042
  ensureAuthorizationToken: true
5930
6043
  }))
@@ -5942,7 +6055,7 @@ var textPlatformWorkflowsTemplatesApi = {
5942
6055
 
5943
6056
  // src/apis/integrations/text/platform/workflow/workflows/internal/crm/api.ts
5944
6057
  var getUrl4 = (segments = []) => buildUrlFromSegments(segments, "/internal/crm");
5945
- var urls5 = {
6058
+ var urls6 = {
5946
6059
  getOrganizations: (queryParams) => enrichUrlWithQueryParams(getUrl4(["stats"]), queryParams),
5947
6060
  getOrganization: (organizationId) => getUrl4(["stats", organizationId]),
5948
6061
  getWorkflows: (queryParams) => enrichUrlWithQueryParams(getUrl4(["workflows"]), queryParams),
@@ -5956,12 +6069,12 @@ var urls5 = {
5956
6069
  };
5957
6070
  var textPlatformWorkflowsInternalCrmApi = {
5958
6071
  meta: {
5959
- urls: urls5
6072
+ urls: urls6
5960
6073
  },
5961
6074
  getOrganizations(queryParams, authorization) {
5962
6075
  return __async(this, null, function* () {
5963
6076
  const { data: organizations } = yield textClientInstance.get(
5964
- urls5.getOrganizations(queryParams),
6077
+ urls6.getOrganizations(queryParams),
5965
6078
  getWorkflowApiCrmConfig(authorization)
5966
6079
  );
5967
6080
  return organizations;
@@ -5970,7 +6083,7 @@ var textPlatformWorkflowsInternalCrmApi = {
5970
6083
  getOrganization(organizationId, authorization) {
5971
6084
  return __async(this, null, function* () {
5972
6085
  const { data: organization } = yield textClientInstance.get(
5973
- urls5.getOrganization(organizationId),
6086
+ urls6.getOrganization(organizationId),
5974
6087
  getWorkflowApiCrmConfig(authorization)
5975
6088
  );
5976
6089
  return organization;
@@ -5978,7 +6091,7 @@ var textPlatformWorkflowsInternalCrmApi = {
5978
6091
  },
5979
6092
  getWorkflows(queryParams, authorization) {
5980
6093
  return __async(this, null, function* () {
5981
- const { data: workflows } = yield textClientInstance.get(urls5.getWorkflows(queryParams), getWorkflowApiCrmConfig(authorization));
6094
+ const { data: workflows } = yield textClientInstance.get(urls6.getWorkflows(queryParams), getWorkflowApiCrmConfig(authorization));
5982
6095
  workflows.data = workflows.data.map(enrichWorkflowTrigger);
5983
6096
  return workflows;
5984
6097
  });
@@ -5988,7 +6101,7 @@ var textPlatformWorkflowsInternalCrmApi = {
5988
6101
  const searchParams = new URLSearchParams();
5989
6102
  const query = searchParams.toString();
5990
6103
  const { data: workflow } = yield textClientInstance.get(
5991
- `${urls5.getWorkflow(workflowId)}${query ? `?${query}` : ""}`,
6104
+ `${urls6.getWorkflow(workflowId)}${query ? `?${query}` : ""}`,
5992
6105
  getWorkflowApiCrmConfig(authorization)
5993
6106
  );
5994
6107
  return enrichWorkflowTrigger(workflow);
@@ -5997,7 +6110,7 @@ var textPlatformWorkflowsInternalCrmApi = {
5997
6110
  getWorkflowExecutions(workflowId, queryParams, authorization) {
5998
6111
  return __async(this, null, function* () {
5999
6112
  const { data: executions } = yield textClientInstance.get(
6000
- urls5.getWorkflowExecutions(workflowId, queryParams),
6113
+ urls6.getWorkflowExecutions(workflowId, queryParams),
6001
6114
  getWorkflowApiCrmConfig(authorization)
6002
6115
  );
6003
6116
  return executions;
@@ -6006,7 +6119,7 @@ var textPlatformWorkflowsInternalCrmApi = {
6006
6119
  getWorkflowExecution(workflowId, executionId, authorization) {
6007
6120
  return __async(this, null, function* () {
6008
6121
  const { data: execution } = yield textClientInstance.get(
6009
- urls5.getWorkflowExecution(workflowId, executionId),
6122
+ urls6.getWorkflowExecution(workflowId, executionId),
6010
6123
  getWorkflowApiCrmConfig(authorization)
6011
6124
  );
6012
6125
  return execution;
@@ -6020,7 +6133,7 @@ var textPlatformWorkflowsInternalCrmApi = {
6020
6133
  }
6021
6134
  const query = searchParams.toString();
6022
6135
  const { data: introspection } = yield textClientInstance.get(
6023
- `${urls5.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
6136
+ `${urls6.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
6024
6137
  getWorkflowApiCrmConfig(authorization)
6025
6138
  );
6026
6139
  return {
@@ -6064,7 +6177,7 @@ var getUrl5 = (segments = [], version) => buildUrlFromSegments(
6064
6177
  segments,
6065
6178
  `/workflow_platform/${version ? `${version}/` : ""}workflows`
6066
6179
  );
6067
- var urls6 = {
6180
+ var urls7 = {
6068
6181
  getWorkflows: (queryParams) => enrichUrlWithQueryParams(getUrl5([], "v1.0" /* V1 */), queryParams),
6069
6182
  createWorkflow: () => getUrl5(),
6070
6183
  getWorkflow: (id) => getUrl5([id], "v1.0" /* V1 */),
@@ -6085,12 +6198,12 @@ var urls6 = {
6085
6198
  var textPlatformWorkflowsApi = {
6086
6199
  internal: textPlatformWorkflowsInternalApi,
6087
6200
  meta: {
6088
- urls: urls6
6201
+ urls: urls7
6089
6202
  },
6090
6203
  getWorkflows(queryParams, authorization) {
6091
6204
  return __async(this, null, function* () {
6092
6205
  const { data: workflows } = yield textClientInstance.get(
6093
- urls6.getWorkflows(queryParams),
6206
+ urls7.getWorkflows(queryParams),
6094
6207
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6095
6208
  ensureAuthorizationToken: true
6096
6209
  }))
@@ -6107,7 +6220,7 @@ var textPlatformWorkflowsApi = {
6107
6220
  }
6108
6221
  const query = searchParams.toString();
6109
6222
  const { data: workflow } = yield textClientInstance.get(
6110
- `${urls6.getWorkflow(workflowId)}${query ? `?${query}` : ""}`,
6223
+ `${urls7.getWorkflow(workflowId)}${query ? `?${query}` : ""}`,
6111
6224
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6112
6225
  ensureAuthorizationToken: true
6113
6226
  }))
@@ -6118,7 +6231,7 @@ var textPlatformWorkflowsApi = {
6118
6231
  createWorkflow(payload, authorization) {
6119
6232
  return __async(this, null, function* () {
6120
6233
  return textClientInstance.post(
6121
- urls6.createWorkflow(),
6234
+ urls7.createWorkflow(),
6122
6235
  __spreadProps(__spreadValues({}, payload), {
6123
6236
  trigger: payload.trigger || {}
6124
6237
  }),
@@ -6131,7 +6244,7 @@ var textPlatformWorkflowsApi = {
6131
6244
  updateWorkflow(workflowId, payload, authorization) {
6132
6245
  return __async(this, null, function* () {
6133
6246
  return textClientInstance.put(
6134
- urls6.updateWorkflow(workflowId),
6247
+ urls7.updateWorkflow(workflowId),
6135
6248
  __spreadProps(__spreadValues({}, payload), {
6136
6249
  trigger: payload.trigger || {}
6137
6250
  }),
@@ -6143,7 +6256,7 @@ var textPlatformWorkflowsApi = {
6143
6256
  },
6144
6257
  deleteWorkflow(workflowId, authorization) {
6145
6258
  return __async(this, null, function* () {
6146
- return textClientInstance.delete(urls6.deleteWorkflow(workflowId), __spreadValues({}, getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6259
+ return textClientInstance.delete(urls7.deleteWorkflow(workflowId), __spreadValues({}, getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6147
6260
  ensureAuthorizationToken: true
6148
6261
  }))));
6149
6262
  });
@@ -6151,7 +6264,7 @@ var textPlatformWorkflowsApi = {
6151
6264
  createWorkflowDraft(workflowId, payload, authorization) {
6152
6265
  return __async(this, null, function* () {
6153
6266
  return textClientInstance.post(
6154
- urls6.createWorkflowDraft(workflowId),
6267
+ urls7.createWorkflowDraft(workflowId),
6155
6268
  __spreadProps(__spreadValues({}, payload), {
6156
6269
  trigger: payload.trigger || {}
6157
6270
  }),
@@ -6164,7 +6277,7 @@ var textPlatformWorkflowsApi = {
6164
6277
  publishWorkflowDraft(workflowId, authorization) {
6165
6278
  return __async(this, null, function* () {
6166
6279
  return textClientInstance.post(
6167
- urls6.publishWorkflowDraft(workflowId),
6280
+ urls7.publishWorkflowDraft(workflowId),
6168
6281
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6169
6282
  ensureAuthorizationToken: true
6170
6283
  }))
@@ -6174,7 +6287,7 @@ var textPlatformWorkflowsApi = {
6174
6287
  toggleWorkflowActivation(workflowId, isActive, authorization) {
6175
6288
  return __async(this, null, function* () {
6176
6289
  return textClientInstance.put(
6177
- urls6.toggleWorkflowActivation(workflowId),
6290
+ urls7.toggleWorkflowActivation(workflowId),
6178
6291
  {
6179
6292
  active: isActive
6180
6293
  },
@@ -6187,7 +6300,7 @@ var textPlatformWorkflowsApi = {
6187
6300
  executeWorkflow(workflowId, input, authorization) {
6188
6301
  return __async(this, null, function* () {
6189
6302
  const { data: execution } = yield textClientInstance.post(
6190
- urls6.executeWorkflow(workflowId),
6303
+ urls7.executeWorkflow(workflowId),
6191
6304
  {
6192
6305
  input
6193
6306
  },
@@ -6201,7 +6314,7 @@ var textPlatformWorkflowsApi = {
6201
6314
  getWorkflowExecutions(workflowId, queryParams, authorization) {
6202
6315
  return __async(this, null, function* () {
6203
6316
  const { data: executions } = yield textClientInstance.get(
6204
- urls6.getWorkflowExecutions(workflowId, queryParams),
6317
+ urls7.getWorkflowExecutions(workflowId, queryParams),
6205
6318
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6206
6319
  ensureAuthorizationToken: true
6207
6320
  }))
@@ -6212,7 +6325,7 @@ var textPlatformWorkflowsApi = {
6212
6325
  getWorkflowExecution(workflowId, executionId, authorization) {
6213
6326
  return __async(this, null, function* () {
6214
6327
  const { data: execution } = yield textClientInstance.get(
6215
- urls6.getWorkflowExecution(workflowId, executionId),
6328
+ urls7.getWorkflowExecution(workflowId, executionId),
6216
6329
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6217
6330
  ensureAuthorizationToken: true
6218
6331
  }))
@@ -6228,7 +6341,7 @@ var textPlatformWorkflowsApi = {
6228
6341
  }
6229
6342
  const query = searchParams.toString();
6230
6343
  const { data: introspection } = yield textClientInstance.get(
6231
- `${urls6.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
6344
+ `${urls7.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
6232
6345
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6233
6346
  ensureAuthorizationToken: true
6234
6347
  }))
@@ -6241,7 +6354,7 @@ var textPlatformWorkflowsApi = {
6241
6354
  introspectWorkflowTask(workflowId, payload, authorization) {
6242
6355
  return __async(this, null, function* () {
6243
6356
  const response = yield textClientInstance.post(
6244
- urls6.introspectWorkflowTask(workflowId),
6357
+ urls7.introspectWorkflowTask(workflowId),
6245
6358
  {
6246
6359
  task_reference_name: payload.taskReferenceName,
6247
6360
  input_parameters: payload.inputParameters
@@ -6280,7 +6393,7 @@ var buildResourcePath = ({ provider, domain, name }) => {
6280
6393
  }
6281
6394
  return [targetProvider, domain, name].filter(notEmpty).join("/");
6282
6395
  };
6283
- var urls7 = {
6396
+ var urls8 = {
6284
6397
  listSchema: () => "/workflow_resources/schema",
6285
6398
  getSchema: (provider) => `/workflow_resources/schema/${provider}`,
6286
6399
  getResource: (resource) => `/workflow_resources/resources/${buildResourcePath(resource)}`
@@ -6291,7 +6404,7 @@ var textResourcerApi = {
6291
6404
  const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6292
6405
  ensureAuthorizationToken: true
6293
6406
  }));
6294
- return textClientInstance.get(urls7.getResource(resource), __spreadProps(__spreadValues({}, config), {
6407
+ return textClientInstance.get(urls8.getResource(resource), __spreadProps(__spreadValues({}, config), {
6295
6408
  headers: __spreadProps(__spreadValues({}, config.headers), {
6296
6409
  "X-Credential-ID": credentialId
6297
6410
  })
@@ -6310,7 +6423,7 @@ var textResourcerApi = {
6310
6423
  const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6311
6424
  ensureAuthorizationToken: true
6312
6425
  }));
6313
- return textClientInstance.get(urls7.listSchema(), __spreadProps(__spreadValues({}, config), {
6426
+ return textClientInstance.get(urls8.listSchema(), __spreadProps(__spreadValues({}, config), {
6314
6427
  headers: __spreadProps(__spreadValues({}, config.headers), {
6315
6428
  "X-Credential-ID": credentialId
6316
6429
  })
@@ -6329,7 +6442,7 @@ var textResourcerApi = {
6329
6442
  const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6330
6443
  ensureAuthorizationToken: true
6331
6444
  }));
6332
- return textClientInstance.get(urls7.getSchema(provider), __spreadProps(__spreadValues({}, config), {
6445
+ return textClientInstance.get(urls8.getSchema(provider), __spreadProps(__spreadValues({}, config), {
6333
6446
  headers: __spreadProps(__spreadValues({}, config.headers), {
6334
6447
  "X-Credential-ID": credentialId
6335
6448
  })
@@ -6349,6 +6462,7 @@ var textResourcerApi = {
6349
6462
  var textApi = {
6350
6463
  platform: textPlatformApi,
6351
6464
  ai: textAiAgentApi,
6465
+ billing: textBillingApi,
6352
6466
  externalAccountManager: textExternalAccountManagerApi,
6353
6467
  resourcer: textResourcerApi
6354
6468
  };
@@ -6652,7 +6766,7 @@ var integrationsApi = {
6652
6766
  };
6653
6767
 
6654
6768
  // src/apis/platform/accounts/accounts/api.ts
6655
- var urls8 = (withBaseUrl = false) => {
6769
+ var urls9 = (withBaseUrl = false) => {
6656
6770
  const getUrl7 = (segments = []) => buildUrlFromSegments(
6657
6771
  segments,
6658
6772
  "/v2/accounts",
@@ -6668,7 +6782,7 @@ var api2 = {
6668
6782
  getAccounts(authorization) {
6669
6783
  return __async(this, null, function* () {
6670
6784
  return platformAccountsClientInstance.get(
6671
- urls8().getAccounts(),
6785
+ urls9().getAccounts(),
6672
6786
  {
6673
6787
  authorization,
6674
6788
  customErrorMessage: "Accounts couldn't be fetched."
@@ -6679,7 +6793,7 @@ var api2 = {
6679
6793
  getAccount(accountId, authorization) {
6680
6794
  return __async(this, null, function* () {
6681
6795
  return platformAccountsClientInstance.get(
6682
- urls8().getAccount(accountId),
6796
+ urls9().getAccount(accountId),
6683
6797
  {
6684
6798
  authorization,
6685
6799
  customErrorMessage: "Account couldn't be fetched."
@@ -6701,7 +6815,7 @@ var api2 = {
6701
6815
  };
6702
6816
  var platformAccountsAccountApi = __spreadProps(__spreadValues({}, api2), {
6703
6817
  meta: {
6704
- urls: urls8
6818
+ urls: urls9
6705
6819
  }
6706
6820
  });
6707
6821
 
@@ -6867,18 +6981,18 @@ var platformAccountsPersonalAccessTokenApi = {
6867
6981
 
6868
6982
  // src/apis/platform/accounts/products/api.ts
6869
6983
  var getUrl6 = (segments = []) => buildUrlFromSegments(segments, "/v2/organizations");
6870
- var urls9 = {
6984
+ var urls10 = {
6871
6985
  getOrganizationProducts: () => getUrl6(["my", "products"]),
6872
6986
  updateOrganizationProducts: () => getUrl6(["my", "products"])
6873
6987
  };
6874
6988
  var platformAccountsProductsApi = {
6875
6989
  meta: {
6876
- urls: urls9
6990
+ urls: urls10
6877
6991
  },
6878
6992
  getOrganizationProducts(authorization) {
6879
6993
  return __async(this, null, function* () {
6880
6994
  return platformAccountsClientInstance.get(
6881
- urls9.getOrganizationProducts(),
6995
+ urls10.getOrganizationProducts(),
6882
6996
  { authorization, customErrorMessage: "Products couldn't be fetched." }
6883
6997
  );
6884
6998
  });
@@ -6886,7 +7000,7 @@ var platformAccountsProductsApi = {
6886
7000
  updateOrganizationProducts(payload, authorization) {
6887
7001
  return __async(this, null, function* () {
6888
7002
  return platformAccountsClientInstance.post(
6889
- urls9.updateOrganizationProducts(),
7003
+ urls10.updateOrganizationProducts(),
6890
7004
  payload,
6891
7005
  { authorization, customErrorMessage: "Products couldn't be updated." }
6892
7006
  );
@@ -9849,7 +9963,7 @@ var api = {
9849
9963
  isInitialized: false
9850
9964
  };
9851
9965
  function initApi(config, tokens) {
9852
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
9966
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
9853
9967
  initPlatformAccountsClient(
9854
9968
  (_a = config.urls.platform) == null ? void 0 : _a.accounts,
9855
9969
  (_b = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _b.token
@@ -9869,14 +9983,18 @@ function initApi(config, tokens) {
9869
9983
  initLiveChatClient((_h = config.urls.products) == null ? void 0 : _h.livechat, (_i = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _i.token);
9870
9984
  initHelpDeskClient((_j = config.urls.products) == null ? void 0 : _j.helpdesk, (_k = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _k.token);
9871
9985
  initTextClient((_l = config.urls.integrations) == null ? void 0 : _l.text, (_m = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _m.token);
9986
+ initTextBillingClient(
9987
+ (_n = config.urls.integrations) == null ? void 0 : _n.textBilling,
9988
+ (_o = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _o.token
9989
+ );
9872
9990
  initWorkflowsClient(
9873
- (_o = (_n = config.urls.textIntelligence) == null ? void 0 : _n.workflows) == null ? void 0 : _o.workflows,
9991
+ (_q = (_p = config.urls.textIntelligence) == null ? void 0 : _p.workflows) == null ? void 0 : _q.workflows,
9874
9992
  tokens ? {
9875
9993
  platform: tokens.platform
9876
9994
  } : void 0
9877
9995
  );
9878
9996
  initAdapterClient(
9879
- (_q = (_p = config.urls.textIntelligence) == null ? void 0 : _p.workflows) == null ? void 0 : _q.adapter,
9997
+ (_s = (_r = config.urls.textIntelligence) == null ? void 0 : _r.workflows) == null ? void 0 : _s.adapter,
9880
9998
  tokens ? {
9881
9999
  platform: tokens.platform,
9882
10000
  github: tokens.github,
@@ -9889,16 +10007,16 @@ function initApi(config, tokens) {
9889
10007
  slack: tokens.slack
9890
10008
  } : void 0
9891
10009
  );
9892
- initGithubClient((_r = tokens == null ? void 0 : tokens.github) == null ? void 0 : _r.appToken);
9893
- initNetlifyClient((_s = tokens == null ? void 0 : tokens.netlify) == null ? void 0 : _s.token);
9894
- initVercelClient((_t = tokens == null ? void 0 : tokens.vercel) == null ? void 0 : _t.token);
9895
- initNeonClient((_u = tokens == null ? void 0 : tokens.neon) == null ? void 0 : _u.token);
9896
- initPlanetScaleClient((_v = tokens == null ? void 0 : tokens.planetscale) == null ? void 0 : _v.token);
9897
- initMailchimpClient((_w = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _w.token, (_x = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _x.server);
9898
- initShopifyClient((_y = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _y.token, (_z = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _z.shop);
9899
- initBigCommerceClient((_A = tokens == null ? void 0 : tokens.bigcommerce) == null ? void 0 : _A.token, (_B = tokens == null ? void 0 : tokens.bigcommerce) == null ? void 0 : _B.shop);
9900
- initHubspotClient((_C = tokens == null ? void 0 : tokens.hubspot) == null ? void 0 : _C.token);
9901
- initSlackClient((_D = tokens == null ? void 0 : tokens.slack) == null ? void 0 : _D.token);
10010
+ initGithubClient((_t = tokens == null ? void 0 : tokens.github) == null ? void 0 : _t.appToken);
10011
+ initNetlifyClient((_u = tokens == null ? void 0 : tokens.netlify) == null ? void 0 : _u.token);
10012
+ initVercelClient((_v = tokens == null ? void 0 : tokens.vercel) == null ? void 0 : _v.token);
10013
+ initNeonClient((_w = tokens == null ? void 0 : tokens.neon) == null ? void 0 : _w.token);
10014
+ initPlanetScaleClient((_x = tokens == null ? void 0 : tokens.planetscale) == null ? void 0 : _x.token);
10015
+ initMailchimpClient((_y = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _y.token, (_z = tokens == null ? void 0 : tokens.mailchimp) == null ? void 0 : _z.server);
10016
+ initShopifyClient((_A = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _A.token, (_B = tokens == null ? void 0 : tokens.shopify) == null ? void 0 : _B.shop);
10017
+ initBigCommerceClient((_C = tokens == null ? void 0 : tokens.bigcommerce) == null ? void 0 : _C.token, (_D = tokens == null ? void 0 : tokens.bigcommerce) == null ? void 0 : _D.shop);
10018
+ initHubspotClient((_E = tokens == null ? void 0 : tokens.hubspot) == null ? void 0 : _E.token);
10019
+ initSlackClient((_F = tokens == null ? void 0 : tokens.slack) == null ? void 0 : _F.token);
9902
10020
  api.isInitialized = true;
9903
10021
  }
9904
10022
  // Annotate the CommonJS export names for ESM import in node:
@@ -9951,6 +10069,7 @@ function initApi(config, tokens) {
9951
10069
  SortOrder,
9952
10070
  TRIGGER_REFERENCE_NAME,
9953
10071
  TextApiError,
10072
+ TextBillingApiError,
9954
10073
  TextCustomerEventNames,
9955
10074
  TextHelpDeskEventNames,
9956
10075
  TextLivechatEventNames,
@@ -9959,6 +10078,7 @@ function initApi(config, tokens) {
9959
10078
  TicketStatus,
9960
10079
  UnauthorizeAccountsApiError,
9961
10080
  UnauthorizeApiError,
10081
+ UnauthorizeTextBillingApiError,
9962
10082
  WorkflowAgentTriggerSubType,
9963
10083
  WorkflowConditionTaskFieldType,
9964
10084
  WorkflowConditionTaskLogic,
@@ -10053,6 +10173,7 @@ function initApi(config, tokens) {
10053
10173
  initPlatformAccountsClient,
10054
10174
  initShopifyClient,
10055
10175
  initSlackClient,
10176
+ initTextBillingClient,
10056
10177
  initTextClient,
10057
10178
  initVercelClient,
10058
10179
  initWorkflowsClient,
@@ -10079,6 +10200,7 @@ function initApi(config, tokens) {
10079
10200
  shopifyEventsZods,
10080
10201
  slackClientInstance,
10081
10202
  slackEventsZods,
10203
+ textBillingClientInstance,
10082
10204
  textClientInstance,
10083
10205
  textCustomerEventsZods,
10084
10206
  textEventsZods,