@guidelytech/shared 0.9.0 → 0.10.0

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.cts CHANGED
@@ -4164,7 +4164,22 @@ declare function templateConfig(id: string): {
4164
4164
  };
4165
4165
  } | null;
4166
4166
 
4167
+ /**
4168
+ * The script-tag install snippet's stub. It defines `window.Guidely` before the SDK has loaded, so
4169
+ * the page can call `Guidely.init(…)` and `Guidely.get().identify(…)` straight away: calls are
4170
+ * queued and replayed by the SDK when it arrives (`packages/embed`). If the SDK can't load at all
4171
+ * (Guidely unreachable, blocked by an extension), the calls simply do nothing and the page carries on.
4172
+ *
4173
+ * Queued calls are `[onClient, method, args]` in `Guidely._q`; `Guidely.get()` returns `Guidely._c`,
4174
+ * which the SDK upgrades in place to forward to the real client. Flag reads return their fallback
4175
+ * until then. ES5 only: it runs on the customer's page before anything else.
4176
+ */
4177
+ declare const SCRIPT_STUB_METHODS: readonly ["identify", "track", "page", "reset", "setAccount", "updateTraits", "setConsent", "startGuide", "stopGuide", "dismissGuide", "openMessenger", "closeMessenger", "showNewMessage", "openResourceCenter", "closeResourceCenter", "openChecklist", "closeChecklist", "completeChecklistTask", "openComplaint", "captureException", "on"];
4178
+ declare const SCRIPT_STUB: string;
4179
+ /** The full script-tag install: stub, init (queued until the SDK loads), then the async SDK script. */
4180
+ declare function scriptSnippet(scriptUrl: string, initOptions: string): string;
4181
+
4167
4182
  declare const SDK_API_VERSION = "v1";
4168
- declare const SHARED_VERSION = "0.9.0";
4183
+ declare const SHARED_VERSION = "0.10.0";
4169
4184
 
4170
- export { ADVANCE_ON, ANNOTATION_COLORS, AUTOCAPTURE_EVENTS, type AnnotationColor, type ApiError, type AppSnapshot, type Appearance, AppearanceSchema, type AuthoringPick, AuthoringPickSchema, type AuthoringSessionInfo, type AutocaptureSettings, AutocaptureSettingsSchema, BUTTON_ACTIONS, ButtonSchema, type CaptureSessionInfo, type CaptureSettings, type CaptureStep, type CaptureStepInput, CaptureStepSchema, type CapturedElement, CapturedElementSchema, type ChecklistConfig, ChecklistConfigSchema, type ChecklistProgressRequest, ChecklistProgressRequestSchema, type ChecklistTask, ChecklistTaskSchema, type ConversationLookupResponse, ConversationLookupSchema, type ConversationMessagesResponse, ConversationRatingSchema, type ConversationStatus, DEFAULT_CAPTURE_SETTINGS, EVENT_NAMES, type ErrorTrackingSettings, ErrorTrackingSettingsSchema, type EventBatch, EventBatchSchema, type EventName, type FileComplaintRequest, type FileComplaintResponse, FileComplaintSchema, type FrequencyConfig, FrequencySchema, GUIDE_KINDS, GUIDE_LIFECYCLE_EVENTS, GUIDE_STATUSES, GUIDE_TEMPLATES, type GuideConfig, type GuideConfigInput, GuideConfigSchema, type GuideKind, GuideStateUpdateSchema, type GuideStatus, type GuideStep, type GuideStepInput, type GuideTemplate, HEATMAP_VIEWPORTS, HOWTO_ACTIONS, HOWTO_STEP_KINDS, type HeatmapPoint, type HeatmapProperties, type HeatmapViewport, type HowToAction, type HowToAnnotation, HowToAnnotationSchema, type HowToStepKind, type IdentifyRequest, IdentifyRequestSchema, type IdentifyResponse, MAX_ANNOTATIONS, MAX_MESSAGE_LENGTH, MESSAGE_AUTHORS, type MessageAuthor, type MessengerCitation, MessengerComplaint, MessengerComplaintOffer, MessengerComplaintsConfig, type MessengerConfig, type MessengerConversation, type MessengerHomeCards, type MessengerHowToCitation, type MessengerMessage, type MessengerPageContent, type MessengerPageRequest, MessengerPageRequestSchema, type MessengerPageSuggestion, type MessengerStatus, type MessengerSuggestedGuide, type MessengerTeammate, NormalizedPointSchema, type NormalizedRect, NormalizedRectSchema, PLACEMENTS, type Placement, PostMessageSchema, type ProjectTheme, ProjectThemeSchema, type PublishedGuide, PublishedGuideSchema, REPLAY_MAX_COMPRESSED_BYTES, REPLAY_MAX_RAW_BYTES, REPLY_TIMES, type ReplayChunk, ReplayChunkSchema, type ReplaySettings, ReplaySettingsSchema, type ReplyTime, type ResourceCenterArticle, type ResourceCenterCollection, type ResourceCenterConfig, Rule, RuleGroup, RuleGroupSchema, RuleSchema, SDK_API_VERSION, SELECTOR_KINDS, SHARED_VERSION, STATUS_LEVELS, STEP_TYPES, SURVEY_QUESTION_TYPES, type ScoutStreamEvent, type SdkArticleSummary, type SdkArticlesResponse, type SdkConfigResponse, type SdkEvent, SdkEventSchema, type SdkHowTo, type SdkHowToStep, type SdkHowToSummary, type SdkHowTosResponse, type SelectorStrategy, SelectorStrategySchema, type StartConversationRequest, type StartConversationResponse, StartConversationSchema, type StatusLevel, StepBranchSchema, type StepButton, StepSchema, type StepTarget, type StepType, type SurveyConfig, SurveyConfigSchema, type SurveyQuestion, SurveyQuestionSchema, type SurveyResponseRequest, SurveyResponseRequestSchema, TRIGGER_TYPES, TargetSchema, type TriggerConfig, TriggerSchema, type ValidationIssue, cleanLabel, defaultGuideConfig, defaultStep, describeCaptureStep, pageName, resolveCaptureSettings, templateConfig, validateGuideConfig, visibleButtons };
4185
+ export { ADVANCE_ON, ANNOTATION_COLORS, AUTOCAPTURE_EVENTS, type AnnotationColor, type ApiError, type AppSnapshot, type Appearance, AppearanceSchema, type AuthoringPick, AuthoringPickSchema, type AuthoringSessionInfo, type AutocaptureSettings, AutocaptureSettingsSchema, BUTTON_ACTIONS, ButtonSchema, type CaptureSessionInfo, type CaptureSettings, type CaptureStep, type CaptureStepInput, CaptureStepSchema, type CapturedElement, CapturedElementSchema, type ChecklistConfig, ChecklistConfigSchema, type ChecklistProgressRequest, ChecklistProgressRequestSchema, type ChecklistTask, ChecklistTaskSchema, type ConversationLookupResponse, ConversationLookupSchema, type ConversationMessagesResponse, ConversationRatingSchema, type ConversationStatus, DEFAULT_CAPTURE_SETTINGS, EVENT_NAMES, type ErrorTrackingSettings, ErrorTrackingSettingsSchema, type EventBatch, EventBatchSchema, type EventName, type FileComplaintRequest, type FileComplaintResponse, FileComplaintSchema, type FrequencyConfig, FrequencySchema, GUIDE_KINDS, GUIDE_LIFECYCLE_EVENTS, GUIDE_STATUSES, GUIDE_TEMPLATES, type GuideConfig, type GuideConfigInput, GuideConfigSchema, type GuideKind, GuideStateUpdateSchema, type GuideStatus, type GuideStep, type GuideStepInput, type GuideTemplate, HEATMAP_VIEWPORTS, HOWTO_ACTIONS, HOWTO_STEP_KINDS, type HeatmapPoint, type HeatmapProperties, type HeatmapViewport, type HowToAction, type HowToAnnotation, HowToAnnotationSchema, type HowToStepKind, type IdentifyRequest, IdentifyRequestSchema, type IdentifyResponse, MAX_ANNOTATIONS, MAX_MESSAGE_LENGTH, MESSAGE_AUTHORS, type MessageAuthor, type MessengerCitation, MessengerComplaint, MessengerComplaintOffer, MessengerComplaintsConfig, type MessengerConfig, type MessengerConversation, type MessengerHomeCards, type MessengerHowToCitation, type MessengerMessage, type MessengerPageContent, type MessengerPageRequest, MessengerPageRequestSchema, type MessengerPageSuggestion, type MessengerStatus, type MessengerSuggestedGuide, type MessengerTeammate, NormalizedPointSchema, type NormalizedRect, NormalizedRectSchema, PLACEMENTS, type Placement, PostMessageSchema, type ProjectTheme, ProjectThemeSchema, type PublishedGuide, PublishedGuideSchema, REPLAY_MAX_COMPRESSED_BYTES, REPLAY_MAX_RAW_BYTES, REPLY_TIMES, type ReplayChunk, ReplayChunkSchema, type ReplaySettings, ReplaySettingsSchema, type ReplyTime, type ResourceCenterArticle, type ResourceCenterCollection, type ResourceCenterConfig, Rule, RuleGroup, RuleGroupSchema, RuleSchema, SCRIPT_STUB, SCRIPT_STUB_METHODS, SDK_API_VERSION, SELECTOR_KINDS, SHARED_VERSION, STATUS_LEVELS, STEP_TYPES, SURVEY_QUESTION_TYPES, type ScoutStreamEvent, type SdkArticleSummary, type SdkArticlesResponse, type SdkConfigResponse, type SdkEvent, SdkEventSchema, type SdkHowTo, type SdkHowToStep, type SdkHowToSummary, type SdkHowTosResponse, type SelectorStrategy, SelectorStrategySchema, type StartConversationRequest, type StartConversationResponse, StartConversationSchema, type StatusLevel, StepBranchSchema, type StepButton, StepSchema, type StepTarget, type StepType, type SurveyConfig, SurveyConfigSchema, type SurveyQuestion, SurveyQuestionSchema, type SurveyResponseRequest, SurveyResponseRequestSchema, TRIGGER_TYPES, TargetSchema, type TriggerConfig, TriggerSchema, type ValidationIssue, cleanLabel, defaultGuideConfig, defaultStep, describeCaptureStep, pageName, resolveCaptureSettings, scriptSnippet, templateConfig, validateGuideConfig, visibleButtons };
package/dist/index.d.ts CHANGED
@@ -4164,7 +4164,22 @@ declare function templateConfig(id: string): {
4164
4164
  };
4165
4165
  } | null;
4166
4166
 
4167
+ /**
4168
+ * The script-tag install snippet's stub. It defines `window.Guidely` before the SDK has loaded, so
4169
+ * the page can call `Guidely.init(…)` and `Guidely.get().identify(…)` straight away: calls are
4170
+ * queued and replayed by the SDK when it arrives (`packages/embed`). If the SDK can't load at all
4171
+ * (Guidely unreachable, blocked by an extension), the calls simply do nothing and the page carries on.
4172
+ *
4173
+ * Queued calls are `[onClient, method, args]` in `Guidely._q`; `Guidely.get()` returns `Guidely._c`,
4174
+ * which the SDK upgrades in place to forward to the real client. Flag reads return their fallback
4175
+ * until then. ES5 only: it runs on the customer's page before anything else.
4176
+ */
4177
+ declare const SCRIPT_STUB_METHODS: readonly ["identify", "track", "page", "reset", "setAccount", "updateTraits", "setConsent", "startGuide", "stopGuide", "dismissGuide", "openMessenger", "closeMessenger", "showNewMessage", "openResourceCenter", "closeResourceCenter", "openChecklist", "closeChecklist", "completeChecklistTask", "openComplaint", "captureException", "on"];
4178
+ declare const SCRIPT_STUB: string;
4179
+ /** The full script-tag install: stub, init (queued until the SDK loads), then the async SDK script. */
4180
+ declare function scriptSnippet(scriptUrl: string, initOptions: string): string;
4181
+
4167
4182
  declare const SDK_API_VERSION = "v1";
4168
- declare const SHARED_VERSION = "0.9.0";
4183
+ declare const SHARED_VERSION = "0.10.0";
4169
4184
 
4170
- export { ADVANCE_ON, ANNOTATION_COLORS, AUTOCAPTURE_EVENTS, type AnnotationColor, type ApiError, type AppSnapshot, type Appearance, AppearanceSchema, type AuthoringPick, AuthoringPickSchema, type AuthoringSessionInfo, type AutocaptureSettings, AutocaptureSettingsSchema, BUTTON_ACTIONS, ButtonSchema, type CaptureSessionInfo, type CaptureSettings, type CaptureStep, type CaptureStepInput, CaptureStepSchema, type CapturedElement, CapturedElementSchema, type ChecklistConfig, ChecklistConfigSchema, type ChecklistProgressRequest, ChecklistProgressRequestSchema, type ChecklistTask, ChecklistTaskSchema, type ConversationLookupResponse, ConversationLookupSchema, type ConversationMessagesResponse, ConversationRatingSchema, type ConversationStatus, DEFAULT_CAPTURE_SETTINGS, EVENT_NAMES, type ErrorTrackingSettings, ErrorTrackingSettingsSchema, type EventBatch, EventBatchSchema, type EventName, type FileComplaintRequest, type FileComplaintResponse, FileComplaintSchema, type FrequencyConfig, FrequencySchema, GUIDE_KINDS, GUIDE_LIFECYCLE_EVENTS, GUIDE_STATUSES, GUIDE_TEMPLATES, type GuideConfig, type GuideConfigInput, GuideConfigSchema, type GuideKind, GuideStateUpdateSchema, type GuideStatus, type GuideStep, type GuideStepInput, type GuideTemplate, HEATMAP_VIEWPORTS, HOWTO_ACTIONS, HOWTO_STEP_KINDS, type HeatmapPoint, type HeatmapProperties, type HeatmapViewport, type HowToAction, type HowToAnnotation, HowToAnnotationSchema, type HowToStepKind, type IdentifyRequest, IdentifyRequestSchema, type IdentifyResponse, MAX_ANNOTATIONS, MAX_MESSAGE_LENGTH, MESSAGE_AUTHORS, type MessageAuthor, type MessengerCitation, MessengerComplaint, MessengerComplaintOffer, MessengerComplaintsConfig, type MessengerConfig, type MessengerConversation, type MessengerHomeCards, type MessengerHowToCitation, type MessengerMessage, type MessengerPageContent, type MessengerPageRequest, MessengerPageRequestSchema, type MessengerPageSuggestion, type MessengerStatus, type MessengerSuggestedGuide, type MessengerTeammate, NormalizedPointSchema, type NormalizedRect, NormalizedRectSchema, PLACEMENTS, type Placement, PostMessageSchema, type ProjectTheme, ProjectThemeSchema, type PublishedGuide, PublishedGuideSchema, REPLAY_MAX_COMPRESSED_BYTES, REPLAY_MAX_RAW_BYTES, REPLY_TIMES, type ReplayChunk, ReplayChunkSchema, type ReplaySettings, ReplaySettingsSchema, type ReplyTime, type ResourceCenterArticle, type ResourceCenterCollection, type ResourceCenterConfig, Rule, RuleGroup, RuleGroupSchema, RuleSchema, SDK_API_VERSION, SELECTOR_KINDS, SHARED_VERSION, STATUS_LEVELS, STEP_TYPES, SURVEY_QUESTION_TYPES, type ScoutStreamEvent, type SdkArticleSummary, type SdkArticlesResponse, type SdkConfigResponse, type SdkEvent, SdkEventSchema, type SdkHowTo, type SdkHowToStep, type SdkHowToSummary, type SdkHowTosResponse, type SelectorStrategy, SelectorStrategySchema, type StartConversationRequest, type StartConversationResponse, StartConversationSchema, type StatusLevel, StepBranchSchema, type StepButton, StepSchema, type StepTarget, type StepType, type SurveyConfig, SurveyConfigSchema, type SurveyQuestion, SurveyQuestionSchema, type SurveyResponseRequest, SurveyResponseRequestSchema, TRIGGER_TYPES, TargetSchema, type TriggerConfig, TriggerSchema, type ValidationIssue, cleanLabel, defaultGuideConfig, defaultStep, describeCaptureStep, pageName, resolveCaptureSettings, templateConfig, validateGuideConfig, visibleButtons };
4185
+ export { ADVANCE_ON, ANNOTATION_COLORS, AUTOCAPTURE_EVENTS, type AnnotationColor, type ApiError, type AppSnapshot, type Appearance, AppearanceSchema, type AuthoringPick, AuthoringPickSchema, type AuthoringSessionInfo, type AutocaptureSettings, AutocaptureSettingsSchema, BUTTON_ACTIONS, ButtonSchema, type CaptureSessionInfo, type CaptureSettings, type CaptureStep, type CaptureStepInput, CaptureStepSchema, type CapturedElement, CapturedElementSchema, type ChecklistConfig, ChecklistConfigSchema, type ChecklistProgressRequest, ChecklistProgressRequestSchema, type ChecklistTask, ChecklistTaskSchema, type ConversationLookupResponse, ConversationLookupSchema, type ConversationMessagesResponse, ConversationRatingSchema, type ConversationStatus, DEFAULT_CAPTURE_SETTINGS, EVENT_NAMES, type ErrorTrackingSettings, ErrorTrackingSettingsSchema, type EventBatch, EventBatchSchema, type EventName, type FileComplaintRequest, type FileComplaintResponse, FileComplaintSchema, type FrequencyConfig, FrequencySchema, GUIDE_KINDS, GUIDE_LIFECYCLE_EVENTS, GUIDE_STATUSES, GUIDE_TEMPLATES, type GuideConfig, type GuideConfigInput, GuideConfigSchema, type GuideKind, GuideStateUpdateSchema, type GuideStatus, type GuideStep, type GuideStepInput, type GuideTemplate, HEATMAP_VIEWPORTS, HOWTO_ACTIONS, HOWTO_STEP_KINDS, type HeatmapPoint, type HeatmapProperties, type HeatmapViewport, type HowToAction, type HowToAnnotation, HowToAnnotationSchema, type HowToStepKind, type IdentifyRequest, IdentifyRequestSchema, type IdentifyResponse, MAX_ANNOTATIONS, MAX_MESSAGE_LENGTH, MESSAGE_AUTHORS, type MessageAuthor, type MessengerCitation, MessengerComplaint, MessengerComplaintOffer, MessengerComplaintsConfig, type MessengerConfig, type MessengerConversation, type MessengerHomeCards, type MessengerHowToCitation, type MessengerMessage, type MessengerPageContent, type MessengerPageRequest, MessengerPageRequestSchema, type MessengerPageSuggestion, type MessengerStatus, type MessengerSuggestedGuide, type MessengerTeammate, NormalizedPointSchema, type NormalizedRect, NormalizedRectSchema, PLACEMENTS, type Placement, PostMessageSchema, type ProjectTheme, ProjectThemeSchema, type PublishedGuide, PublishedGuideSchema, REPLAY_MAX_COMPRESSED_BYTES, REPLAY_MAX_RAW_BYTES, REPLY_TIMES, type ReplayChunk, ReplayChunkSchema, type ReplaySettings, ReplaySettingsSchema, type ReplyTime, type ResourceCenterArticle, type ResourceCenterCollection, type ResourceCenterConfig, Rule, RuleGroup, RuleGroupSchema, RuleSchema, SCRIPT_STUB, SCRIPT_STUB_METHODS, SDK_API_VERSION, SELECTOR_KINDS, SHARED_VERSION, STATUS_LEVELS, STEP_TYPES, SURVEY_QUESTION_TYPES, type ScoutStreamEvent, type SdkArticleSummary, type SdkArticlesResponse, type SdkConfigResponse, type SdkEvent, SdkEventSchema, type SdkHowTo, type SdkHowToStep, type SdkHowToSummary, type SdkHowTosResponse, type SelectorStrategy, SelectorStrategySchema, type StartConversationRequest, type StartConversationResponse, StartConversationSchema, type StatusLevel, StepBranchSchema, type StepButton, StepSchema, type StepTarget, type StepType, type SurveyConfig, SurveyConfigSchema, type SurveyQuestion, SurveyQuestionSchema, type SurveyResponseRequest, SurveyResponseRequestSchema, TRIGGER_TYPES, TargetSchema, type TriggerConfig, TriggerSchema, type ValidationIssue, cleanLabel, defaultGuideConfig, defaultStep, describeCaptureStep, pageName, resolveCaptureSettings, scriptSnippet, templateConfig, validateGuideConfig, visibleButtons };
package/dist/index.js CHANGED
@@ -880,9 +880,42 @@ var HowToAnnotationSchema = z8.discriminatedUnion("type", [
880
880
  ]);
881
881
  var MAX_ANNOTATIONS = 30;
882
882
 
883
+ // src/snippet.ts
884
+ var SCRIPT_STUB_METHODS = [
885
+ "identify",
886
+ "track",
887
+ "page",
888
+ "reset",
889
+ "setAccount",
890
+ "updateTraits",
891
+ "setConsent",
892
+ "startGuide",
893
+ "stopGuide",
894
+ "dismissGuide",
895
+ "openMessenger",
896
+ "closeMessenger",
897
+ "showNewMessage",
898
+ "openResourceCenter",
899
+ "closeResourceCenter",
900
+ "openChecklist",
901
+ "closeChecklist",
902
+ "completeChecklistTask",
903
+ "openComplaint",
904
+ "captureException",
905
+ "on"
906
+ ];
907
+ var SCRIPT_STUB = `!function(w){if(w.Guidely)return;var g=w.Guidely={_q:[]},c=g._c={};function q(o,k){o[k]=function(){g._q.push([o===c?1:0,k,[].slice.call(arguments)])}}q(g,"init");"${SCRIPT_STUB_METHODS.join(" ")}".split(" ").forEach(function(k){q(c,k)});c.isFeatureEnabled=function(k,f){return!!f};c.getFeatureValue=function(k,f){return f};g.get=function(){return c}}(window);`;
908
+ function scriptSnippet(scriptUrl, initOptions) {
909
+ return `<script>
910
+ ${SCRIPT_STUB}
911
+ Guidely.init(${initOptions});
912
+ </script>
913
+ <script src="${scriptUrl}" async></script>`;
914
+ }
915
+
883
916
  // src/index.ts
884
917
  var SDK_API_VERSION = "v1";
885
- var SHARED_VERSION = "0.9.0";
918
+ var SHARED_VERSION = "0.10.0";
886
919
  export {
887
920
  ADVANCE_ON,
888
921
  ANNOTATION_COLORS,
@@ -968,6 +1001,8 @@ export {
968
1001
  ReplaySettingsSchema,
969
1002
  RuleGroupSchema,
970
1003
  RuleSchema,
1004
+ SCRIPT_STUB,
1005
+ SCRIPT_STUB_METHODS,
971
1006
  SDK_API_VERSION,
972
1007
  SELECTOR_KINDS,
973
1008
  SENSITIVE_HEADER_PATTERN,
@@ -1044,6 +1079,7 @@ export {
1044
1079
  safeRegExp,
1045
1080
  sanitizeProperties,
1046
1081
  screenPath,
1082
+ scriptSnippet,
1047
1083
  servedArticleAudiences,
1048
1084
  showMeHref,
1049
1085
  showMeKeyFromHref,