"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.scope = exports.getAuthUrl = exports.baseURLs = exports.APIRegionSchema = void 0;
const zod_1 = require("zod");
exports.APIRegionSchema = zod_1.z.enum(['US', 'EU', 'Canada']);
exports.baseURLs = {
    US: 'https://api.talkdeskapp.com/',
    EU: 'https://api.talkdeskapp.eu/',
    Canada: 'https://api.talkdeskappca.com/',
};
const getAuthUrl = (region, talkdeskAccountName) => {
    if (region === 'US')
        return `https://${talkdeskAccountName}.talkdeskid.com/oauth/token`;
    if (region === 'EU')
        return `https://${talkdeskAccountName}.talkdeskid.eu/oauth/token`;
    if (region === 'Canada')
        return `https://${talkdeskAccountName}.talkdeskidca.com/oauth/token`;
    throw new Error(`Cannot get Talkdesk auth URL for region ${String(region)}`);
};
exports.getAuthUrl = getAuthUrl;
var TalkdeskScope;
(function (TalkdeskScope) {
    TalkdeskScope["AccountRead"] = "account:read";
    TalkdeskScope["AppsRead"] = "apps:read";
    TalkdeskScope["AppsWrite"] = "apps:write";
    TalkdeskScope["AttributesRead"] = "attributes:read";
    TalkdeskScope["AttributesWrite"] = "attributes:write";
    TalkdeskScope["BulkImportsRead"] = "bulk-imports:read";
    TalkdeskScope["BulkImportsWrite"] = "bulk-imports:write";
    TalkdeskScope["CallbackWrite"] = "callback:write";
    TalkdeskScope["CampaignsRead"] = "campaigns:read";
    TalkdeskScope["CampaignsWrite"] = "campaigns:write";
    TalkdeskScope["CasesPublicWrite"] = "cases-public:write";
    TalkdeskScope["CaseFieldsPublicWrite"] = "case-fields-public:write";
    TalkdeskScope["CasesPublicRead"] = "cases-public:read";
    TalkdeskScope["ContactsRead"] = "contacts:read";
    TalkdeskScope["ContactsWrite"] = "contacts:write";
    TalkdeskScope["CfmPublicWrite"] = "cfm-public:write";
    TalkdeskScope["DoNotCallListsManage"] = "do-not-call-lists:manage";
    TalkdeskScope["DataReportsWrite"] = "data-reports:write";
    TalkdeskScope["DataReportsRead"] = "data-reports:read";
    TalkdeskScope["EventsWrite"] = "events:write";
    TalkdeskScope["ContinuitySettingsActivationWrite"] = "continuity-settings-activation:write";
    TalkdeskScope["ContinuitySettingsActivationRead"] = "continuity-settings-activation:read";
    TalkdeskScope["FlowsInteractionsStart"] = "flows-interactions:start";
    TalkdeskScope["GuardianCasesRead"] = "guardian-cases:read";
    TalkdeskScope["GuardianSessionRead"] = "guardian-session:read";
    TalkdeskScope["GuardianUsersRead"] = "guardian-users:read";
    TalkdeskScope["GuardianCallQualityRead"] = "guardian-call-quality:read";
    TalkdeskScope["IdentityActivityRead"] = "identity-activity:read";
    TalkdeskScope["LiveQueriesRead"] = "live-queries:read";
    TalkdeskScope["LiveSubscriptionsRead"] = "live-subscriptions:read";
    TalkdeskScope["LiveSubscriptionsWrite"] = "live-subscriptions:write";
    TalkdeskScope["PromptsWrite"] = "prompts:write";
    TalkdeskScope["PromptsDelete"] = "prompts:delete";
    TalkdeskScope["PromptsRead"] = "prompts:read";
    TalkdeskScope["IdentityPhoneValidationRead"] = "`identity-phone-validation:read";
    TalkdeskScope["RecordingsRead"] = "recordings:read";
    TalkdeskScope["RecordListsManage"] = "record-lists:manage";
    TalkdeskScope["ReportsWrite"] = "reports:write";
    TalkdeskScope["ReportsRead"] = "reports:read";
    TalkdeskScope["RingGroupsRead"] = "ring-groups:read";
    TalkdeskScope["UserRingGroupsRead"] = "user-ring-groups:read";
    TalkdeskScope["SimulatedEmailsWrite"] = "simulated-emails:write";
    TalkdeskScope["WfmAionPublicWrite"] = "wfm-aion-public:write";
    TalkdeskScope["UsersRead"] = "users:read";
    TalkdeskScope["AccountWalletsRead"] = "account-wallets:read";
    TalkdeskScope["BucketConfigurationsRead"] = "bucket-configurations:read";
    TalkdeskScope["VoiceBiometricsConsentWrite"] = "voicebiometrics-consent:write";
    TalkdeskScope["VoiceBiometricsConsentRead"] = "voicebiometrics-consent:read";
    TalkdeskScope["VoiceBiometricsEnrollWrite"] = "voicebiometrics-enroll:write";
    TalkdeskScope["WebhooksTriggerWrite"] = "webhooks-trigger:write";
    TalkdeskScope["WebhooksTriggerRead"] = "webhooks-trigger:read";
})(TalkdeskScope || (TalkdeskScope = {}));
/**
 * The scopes we need in order to be able
 * to execute all actions in this extension
 */
const scopesArray = [
    TalkdeskScope.FlowsInteractionsStart,
    TalkdeskScope.ContactsRead,
    TalkdeskScope.ContactsWrite,
];
exports.scope = scopesArray.join(' ');
//# sourceMappingURL=apiConfig.js.map