@livechat/developer-studio-api 3.4.6 → 3.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -6632,7 +6632,9 @@ interface LiveChatConfigurationApiError {
6632
6632
  }
6633
6633
 
6634
6634
  declare const getRegion: (token: string) => string | undefined;
6635
- type LiveChatClientAuthorization = GlobalAccountsClientAuthorization;
6635
+ type LiveChatClientAuthorization = GlobalAccountsClientAuthorization & {
6636
+ region?: string;
6637
+ };
6636
6638
  interface LiveChatClientOptions extends LiveChatClientAuthorization {
6637
6639
  ensureAuthorizationToken?: boolean;
6638
6640
  }
@@ -7240,41 +7242,41 @@ declare const api: {
7240
7242
  };
7241
7243
  configuration: {
7242
7244
  agents: {
7243
- getAgents(authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<AgentConfigurationDto[], any>>;
7245
+ getAgents(authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<AgentConfigurationDto[], any>>;
7244
7246
  };
7245
7247
  bots: {
7246
- createBotTemplate(bot: CreateLivechatBotTemplateDto, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<CreateLivechatBotTemplateResponse, any>>;
7247
- getBotTemplates(clientId: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatBotTemplate[], any>>;
7248
- updateBotTemplate(bot: UpdateLivechatBotTemplateDto, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<CreateLivechatBotTemplateResponse, any>>;
7249
- deleteBotTemplate(bot: DeleteLivechatBotTemplateDto, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<void, any>>;
7250
- resetBotTemplateSecret(bot: ResetLivechatBotTemplateSecretDto, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<{
7248
+ createBotTemplate(bot: CreateLivechatBotTemplateDto, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<CreateLivechatBotTemplateResponse, any>>;
7249
+ getBotTemplates(clientId: string, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatBotTemplate[], any>>;
7250
+ updateBotTemplate(bot: UpdateLivechatBotTemplateDto, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<CreateLivechatBotTemplateResponse, any>>;
7251
+ deleteBotTemplate(bot: DeleteLivechatBotTemplateDto, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<void, any>>;
7252
+ resetBotTemplateSecret(bot: ResetLivechatBotTemplateSecretDto, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<{
7251
7253
  secret: string;
7252
7254
  id: string;
7253
7255
  }, any>>;
7254
- deleteBotTemplates(clientId: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<void>;
7256
+ deleteBotTemplates(clientId: string, authorization?: LiveChatClientAuthorization | undefined): Promise<void>;
7255
7257
  };
7256
7258
  property: {
7257
- getProperties(clientId: string, isAgent?: boolean | undefined, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<PropertiesDto, any>>;
7258
- registerProperty(property: Property, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7259
- unregisterProperty(propertyId: string, clientId: string, properties?: PropertyDto[] | undefined, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7260
- publishProperty(propertyId: string, clientId: string, accessType: PropertyAccessItemDto, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7261
- publishProperties(properties: Property[], authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>[]>;
7262
- registerProperties(properties: Property[], authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>[]>;
7263
- unregisterProperties(clientId: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<void>;
7264
- getLicenseProperties(namespace?: string | undefined, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<LicenseProperty, any>>;
7265
- updateLicenseProperties(namespace: string, property: LicenseProperty, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7259
+ getProperties(clientId: string, isAgent?: boolean | undefined, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<PropertiesDto, any>>;
7260
+ registerProperty(property: Property, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7261
+ unregisterProperty(propertyId: string, clientId: string, properties?: PropertyDto[] | undefined, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7262
+ publishProperty(propertyId: string, clientId: string, accessType: PropertyAccessItemDto, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7263
+ publishProperties(properties: Property[], authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>[]>;
7264
+ registerProperties(properties: Property[], authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>[]>;
7265
+ unregisterProperties(clientId: string, authorization?: LiveChatClientAuthorization | undefined): Promise<void>;
7266
+ getLicenseProperties(namespace?: string | undefined, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<LicenseProperty, any>>;
7267
+ updateLicenseProperties(namespace: string, property: LicenseProperty, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7266
7268
  };
7267
7269
  webhook: {
7268
- getWebhooks(clientId?: string | undefined, isAgent?: boolean | undefined, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatWebhookDto[], any>>;
7269
- unregisterWebhook(clientId: string | undefined, webhookId: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7270
- unregisterWebhooks(clientId?: string | undefined, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<void>;
7271
- registerWebhook(webhook: LivechatWebhook, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<void>;
7272
- registerWebhooks(webhooks: LivechatWebhook[], authorization?: GlobalAccountsClientAuthorization | undefined): Promise<void>;
7273
- getLicenseWebhooksList(isAgent: boolean, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatWebhookDto[], any> | {
7270
+ getWebhooks(clientId?: string | undefined, isAgent?: boolean | undefined, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatWebhookDto[], any>>;
7271
+ unregisterWebhook(clientId: string | undefined, webhookId: string, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7272
+ unregisterWebhooks(clientId?: string | undefined, authorization?: LiveChatClientAuthorization | undefined): Promise<void>;
7273
+ registerWebhook(webhook: LivechatWebhook, authorization?: LiveChatClientAuthorization | undefined): Promise<void>;
7274
+ registerWebhooks(webhooks: LivechatWebhook[], authorization?: LiveChatClientAuthorization | undefined): Promise<void>;
7275
+ getLicenseWebhooksList(isAgent: boolean, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatWebhookDto[], any> | {
7274
7276
  data: LivechatWebhookDto[];
7275
7277
  }>;
7276
- deleteLicenseWebhook(id: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7277
- getWebhookNamesList(version: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<any, any>>;
7278
+ deleteLicenseWebhook(id: string, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7279
+ getWebhookNamesList(version: string, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<any, any>>;
7278
7280
  };
7279
7281
  };
7280
7282
  };
package/dist/index.d.ts CHANGED
@@ -6632,7 +6632,9 @@ interface LiveChatConfigurationApiError {
6632
6632
  }
6633
6633
 
6634
6634
  declare const getRegion: (token: string) => string | undefined;
6635
- type LiveChatClientAuthorization = GlobalAccountsClientAuthorization;
6635
+ type LiveChatClientAuthorization = GlobalAccountsClientAuthorization & {
6636
+ region?: string;
6637
+ };
6636
6638
  interface LiveChatClientOptions extends LiveChatClientAuthorization {
6637
6639
  ensureAuthorizationToken?: boolean;
6638
6640
  }
@@ -7240,41 +7242,41 @@ declare const api: {
7240
7242
  };
7241
7243
  configuration: {
7242
7244
  agents: {
7243
- getAgents(authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<AgentConfigurationDto[], any>>;
7245
+ getAgents(authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<AgentConfigurationDto[], any>>;
7244
7246
  };
7245
7247
  bots: {
7246
- createBotTemplate(bot: CreateLivechatBotTemplateDto, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<CreateLivechatBotTemplateResponse, any>>;
7247
- getBotTemplates(clientId: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatBotTemplate[], any>>;
7248
- updateBotTemplate(bot: UpdateLivechatBotTemplateDto, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<CreateLivechatBotTemplateResponse, any>>;
7249
- deleteBotTemplate(bot: DeleteLivechatBotTemplateDto, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<void, any>>;
7250
- resetBotTemplateSecret(bot: ResetLivechatBotTemplateSecretDto, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<{
7248
+ createBotTemplate(bot: CreateLivechatBotTemplateDto, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<CreateLivechatBotTemplateResponse, any>>;
7249
+ getBotTemplates(clientId: string, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatBotTemplate[], any>>;
7250
+ updateBotTemplate(bot: UpdateLivechatBotTemplateDto, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<CreateLivechatBotTemplateResponse, any>>;
7251
+ deleteBotTemplate(bot: DeleteLivechatBotTemplateDto, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<void, any>>;
7252
+ resetBotTemplateSecret(bot: ResetLivechatBotTemplateSecretDto, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<{
7251
7253
  secret: string;
7252
7254
  id: string;
7253
7255
  }, any>>;
7254
- deleteBotTemplates(clientId: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<void>;
7256
+ deleteBotTemplates(clientId: string, authorization?: LiveChatClientAuthorization | undefined): Promise<void>;
7255
7257
  };
7256
7258
  property: {
7257
- getProperties(clientId: string, isAgent?: boolean | undefined, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<PropertiesDto, any>>;
7258
- registerProperty(property: Property, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7259
- unregisterProperty(propertyId: string, clientId: string, properties?: PropertyDto[] | undefined, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7260
- publishProperty(propertyId: string, clientId: string, accessType: PropertyAccessItemDto, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7261
- publishProperties(properties: Property[], authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>[]>;
7262
- registerProperties(properties: Property[], authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>[]>;
7263
- unregisterProperties(clientId: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<void>;
7264
- getLicenseProperties(namespace?: string | undefined, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<LicenseProperty, any>>;
7265
- updateLicenseProperties(namespace: string, property: LicenseProperty, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7259
+ getProperties(clientId: string, isAgent?: boolean | undefined, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<PropertiesDto, any>>;
7260
+ registerProperty(property: Property, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7261
+ unregisterProperty(propertyId: string, clientId: string, properties?: PropertyDto[] | undefined, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7262
+ publishProperty(propertyId: string, clientId: string, accessType: PropertyAccessItemDto, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7263
+ publishProperties(properties: Property[], authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>[]>;
7264
+ registerProperties(properties: Property[], authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>[]>;
7265
+ unregisterProperties(clientId: string, authorization?: LiveChatClientAuthorization | undefined): Promise<void>;
7266
+ getLicenseProperties(namespace?: string | undefined, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<LicenseProperty, any>>;
7267
+ updateLicenseProperties(namespace: string, property: LicenseProperty, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7266
7268
  };
7267
7269
  webhook: {
7268
- getWebhooks(clientId?: string | undefined, isAgent?: boolean | undefined, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatWebhookDto[], any>>;
7269
- unregisterWebhook(clientId: string | undefined, webhookId: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7270
- unregisterWebhooks(clientId?: string | undefined, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<void>;
7271
- registerWebhook(webhook: LivechatWebhook, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<void>;
7272
- registerWebhooks(webhooks: LivechatWebhook[], authorization?: GlobalAccountsClientAuthorization | undefined): Promise<void>;
7273
- getLicenseWebhooksList(isAgent: boolean, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatWebhookDto[], any> | {
7270
+ getWebhooks(clientId?: string | undefined, isAgent?: boolean | undefined, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatWebhookDto[], any>>;
7271
+ unregisterWebhook(clientId: string | undefined, webhookId: string, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7272
+ unregisterWebhooks(clientId?: string | undefined, authorization?: LiveChatClientAuthorization | undefined): Promise<void>;
7273
+ registerWebhook(webhook: LivechatWebhook, authorization?: LiveChatClientAuthorization | undefined): Promise<void>;
7274
+ registerWebhooks(webhooks: LivechatWebhook[], authorization?: LiveChatClientAuthorization | undefined): Promise<void>;
7275
+ getLicenseWebhooksList(isAgent: boolean, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<LivechatWebhookDto[], any> | {
7274
7276
  data: LivechatWebhookDto[];
7275
7277
  }>;
7276
- deleteLicenseWebhook(id: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7277
- getWebhookNamesList(version: string, authorization?: GlobalAccountsClientAuthorization | undefined): Promise<axios.AxiosResponse<any, any>>;
7278
+ deleteLicenseWebhook(id: string, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<undefined, any>>;
7279
+ getWebhookNamesList(version: string, authorization?: LiveChatClientAuthorization | undefined): Promise<axios.AxiosResponse<any, any>>;
7278
7280
  };
7279
7281
  };
7280
7282
  };
package/dist/index.js CHANGED
@@ -3128,14 +3128,18 @@ livechatClientInstance.interceptors.response.use(
3128
3128
  }
3129
3129
  );
3130
3130
  function getLiveChatClientConfig(options = {}) {
3131
- var _a, _b;
3131
+ var _a, _b, _c;
3132
3132
  const currentHeaders = livechatClientInstance.defaults.headers;
3133
3133
  const defaultAuthorization = currentHeaders.Authorization;
3134
+ const defaultRegion = currentHeaders["X-Region"];
3134
3135
  const headers = {
3135
- authorization: (_b = options.token ? `${(_a = options.tokenType) != null ? _a : "Bearer"} ${options.token}` : void 0) != null ? _b : defaultAuthorization
3136
+ Authorization: (_b = options.token ? `${(_a = options.tokenType) != null ? _a : "Bearer"} ${options.token}` : void 0) != null ? _b : defaultAuthorization,
3137
+ "X-Region": (_c = options.region) != null ? _c : defaultRegion
3136
3138
  };
3137
3139
  return {
3138
- headers: __spreadValues({}, headers.authorization ? { Authorization: headers.authorization } : {})
3140
+ headers: __spreadValues(__spreadValues({}, headers.Authorization ? { Authorization: headers.Authorization } : {}), headers["X-Region"] ? {
3141
+ "X-Region": headers["X-Region"]
3142
+ } : {})
3139
3143
  };
3140
3144
  }
3141
3145
  function initLiveChatClient(baseUrl, token) {
package/dist/index.mjs CHANGED
@@ -2982,14 +2982,18 @@ livechatClientInstance.interceptors.response.use(
2982
2982
  }
2983
2983
  );
2984
2984
  function getLiveChatClientConfig(options = {}) {
2985
- var _a, _b;
2985
+ var _a, _b, _c;
2986
2986
  const currentHeaders = livechatClientInstance.defaults.headers;
2987
2987
  const defaultAuthorization = currentHeaders.Authorization;
2988
+ const defaultRegion = currentHeaders["X-Region"];
2988
2989
  const headers = {
2989
- authorization: (_b = options.token ? `${(_a = options.tokenType) != null ? _a : "Bearer"} ${options.token}` : void 0) != null ? _b : defaultAuthorization
2990
+ Authorization: (_b = options.token ? `${(_a = options.tokenType) != null ? _a : "Bearer"} ${options.token}` : void 0) != null ? _b : defaultAuthorization,
2991
+ "X-Region": (_c = options.region) != null ? _c : defaultRegion
2990
2992
  };
2991
2993
  return {
2992
- headers: __spreadValues({}, headers.authorization ? { Authorization: headers.authorization } : {})
2994
+ headers: __spreadValues(__spreadValues({}, headers.Authorization ? { Authorization: headers.Authorization } : {}), headers["X-Region"] ? {
2995
+ "X-Region": headers["X-Region"]
2996
+ } : {})
2993
2997
  };
2994
2998
  }
2995
2999
  function initLiveChatClient(baseUrl, token) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livechat/developer-studio-api",
3
- "version": "3.4.6",
3
+ "version": "3.4.8",
4
4
  "description": "This project is API for LiveChat Developer Studio.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -21,8 +21,8 @@
21
21
  "tsup": "^7.1.0",
22
22
  "typescript": "^5.1.6",
23
23
  "eslint-config-custom": "0.0.10",
24
- "tsconfig": "0.0.1",
25
- "utils": "0.0.4"
24
+ "utils": "0.0.4",
25
+ "tsconfig": "0.0.1"
26
26
  },
27
27
  "scripts": {
28
28
  "build": "tsup",