@lpextend/node-sdk 1.1.5 → 1.1.6

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
@@ -2396,6 +2396,26 @@ async function createSDK(config) {
2396
2396
  }
2397
2397
  }
2398
2398
  let accessToken = config.accessToken;
2399
+ if (config.mode === "local") {
2400
+ if (!accessToken) {
2401
+ throw new LPExtendSDKError(
2402
+ "Local mode requires accessToken to be provided directly. Use the LP Login Service API to obtain a bearer token.",
2403
+ ErrorCodes.INVALID_CONFIG
2404
+ );
2405
+ }
2406
+ if (debug) {
2407
+ console.log("[LP-Extend-SDK] Local mode \u2014 skipping shell verification");
2408
+ console.log("[LP-Extend-SDK] Granting scopes locally:", config.scopes || ["*"]);
2409
+ }
2410
+ const initResult = {
2411
+ appId: config.appId,
2412
+ accountId: config.accountId,
2413
+ grantedScopes: config.scopes || ["*"],
2414
+ appName: config.appId,
2415
+ version: "1.0.0"
2416
+ };
2417
+ return new LPExtendSDK({ ...config, accessToken }, initResult);
2418
+ }
2399
2419
  if (!accessToken && config.apiKey && config.extendToken) {
2400
2420
  const verifyUrl = `${shellBaseUrl}/api/v1/apps/verify`;
2401
2421
  if (debug) {
@@ -2634,6 +2654,20 @@ async function createSDK(config) {
2634
2654
  );
2635
2655
  }
2636
2656
  }
2657
+ if (config.skipRegistration) {
2658
+ if (debug) {
2659
+ console.log("[LP-Extend-SDK] skipRegistration=true \u2014 bypassing shell app verification");
2660
+ console.log("[LP-Extend-SDK] Granting scopes locally:", config.scopes || ["*"]);
2661
+ }
2662
+ const initResult = {
2663
+ appId: config.appId,
2664
+ accountId: config.accountId,
2665
+ grantedScopes: config.scopes || ["*"],
2666
+ appName: config.appId,
2667
+ version: "1.0.0"
2668
+ };
2669
+ return new LPExtendSDK({ ...config, accessToken }, initResult);
2670
+ }
2637
2671
  if (debug) {
2638
2672
  console.log("[LP-Extend-SDK] Verifying scopes with shell:", shellBaseUrl);
2639
2673
  }
@@ -2756,6 +2790,9 @@ async function createSDKFromEnv(extendToken) {
2756
2790
  debug
2757
2791
  });
2758
2792
  }
2793
+ async function createLocalSDK(config) {
2794
+ return createSDK({ ...config, mode: "local" });
2795
+ }
2759
2796
  var VERSION = "1.0.0";
2760
2797
  var Scopes = {
2761
2798
  // Account Configuration
@@ -2871,6 +2908,6 @@ async function getShellToken(config) {
2871
2908
  }
2872
2909
  }
2873
2910
 
2874
- export { AIStudioAPI, AIStudioUsersAPI, AgentActivityAPI, AgentGroupsAPI, AgentMetricsAPI, AutomaticMessagesAPI, BotAgentsAPI, BotGroupsAPI, BotsAPI, CampaignsAPI, CategoriesAPI, ConnectToMessagingAPI, ConversationBuilderAPI, ConversationsAPI, DialogsAPI, EngagementsAPI, ErrorCodes, EvaluatorsAPI, FlowsAPI, GeneratorsAPI, IntegrationsAPI, InteractionsAPI, KnowledgeBasesAPI, KnowledgebasesAPI, LOBsAPI, LPExtendSDK, LPExtendSDKError, LPPromptsAPI, MessagingAPI, MessagingHistoryAPI, MessagingOperationsAPI, NLUDomainsAPI, OutboundReportingAPI, PredefinedContentAPI, ProfilesAPI, PromptLibraryAPI, QueryAPI, Scopes, SentinelAPI, SimulationsAPI, SkillsAPI, SpecialOccasionsAPI, SummaryAPI, TranscriptAnalysisAPI, UsersAPI, VERSION, WorkingHoursAPI, createSDK, createSDKFromEnv, getShellToken, initializeSDK };
2911
+ export { AIStudioAPI, AIStudioUsersAPI, AgentActivityAPI, AgentGroupsAPI, AgentMetricsAPI, AutomaticMessagesAPI, BotAgentsAPI, BotGroupsAPI, BotsAPI, CampaignsAPI, CategoriesAPI, ConnectToMessagingAPI, ConversationBuilderAPI, ConversationsAPI, DialogsAPI, EngagementsAPI, ErrorCodes, EvaluatorsAPI, FlowsAPI, GeneratorsAPI, IntegrationsAPI, InteractionsAPI, KnowledgeBasesAPI, KnowledgebasesAPI, LOBsAPI, LPExtendSDK, LPExtendSDKError, LPPromptsAPI, MessagingAPI, MessagingHistoryAPI, MessagingOperationsAPI, NLUDomainsAPI, OutboundReportingAPI, PredefinedContentAPI, ProfilesAPI, PromptLibraryAPI, QueryAPI, Scopes, SentinelAPI, SimulationsAPI, SkillsAPI, SpecialOccasionsAPI, SummaryAPI, TranscriptAnalysisAPI, UsersAPI, VERSION, WorkingHoursAPI, createLocalSDK, createSDK, createSDKFromEnv, getShellToken, initializeSDK };
2875
2912
  //# sourceMappingURL=index.mjs.map
2876
2913
  //# sourceMappingURL=index.mjs.map