@posthog/core
Advanced tools
@@ -19,3 +19,11 @@ import { Survey } from '../types'; | ||
| export declare function canSurveyActivateRepeatedly(survey: SurveyForRepeatActivation): boolean; | ||
| type SurveyForIterationCheck = Pick<Survey, 'schedule' | 'current_iteration'>; | ||
| /** | ||
| * True when a survey is meant to come back around on its own: a recurring schedule, or an | ||
| * iteration already under way. Stored display state is keyed by iteration | ||
| * (see `getSurveyIterationKey`), so for these surveys it rolls over and stops being a | ||
| * dependable "already answered" record; other surveys keep one stable key for good. | ||
| */ | ||
| export declare function isSurveyIterationBased(survey: SurveyForIterationCheck): boolean; | ||
| export {}; | ||
| //# sourceMappingURL=activation.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"activation.d.ts","sourceRoot":"","sources":["../../src/surveys/activation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAkB,MAAM,UAAU,CAAA;AAIjD,KAAK,yBAAyB,GAAG,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG;IAC1D,UAAU,CAAC,EAAE;QACX,MAAM,CAAC,EAAE;YACP,kBAAkB,CAAC,EAAE,OAAO,CAAA;YAC5B,MAAM,CAAC,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAA;aAAE,EAAE,CAAA;SAC5B,GAAG,IAAI,CAAA;KACT,GAAG,IAAI,CAAA;CACT,CAAA;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAEpF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAKtF"} | ||
| {"version":3,"file":"activation.d.ts","sourceRoot":"","sources":["../../src/surveys/activation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAkB,MAAM,UAAU,CAAA;AAIjD,KAAK,yBAAyB,GAAG,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG;IAC1D,UAAU,CAAC,EAAE;QACX,MAAM,CAAC,EAAE;YACP,kBAAkB,CAAC,EAAE,OAAO,CAAA;YAC5B,MAAM,CAAC,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAA;aAAE,EAAE,CAAA;SAC5B,GAAG,IAAI,CAAA;KACT,GAAG,IAAI,CAAA;CACT,CAAA;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAEpF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAKtF;AAED,KAAK,uBAAuB,GAAG,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,mBAAmB,CAAC,CAAA;AAE7E;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAE/E"} |
@@ -28,2 +28,3 @@ "use strict"; | ||
| doesSurveyActivateByEvent: ()=>doesSurveyActivateByEvent, | ||
| isSurveyIterationBased: ()=>isSurveyIterationBased, | ||
| canSurveyActivateRepeatedly: ()=>canSurveyActivateRepeatedly | ||
@@ -38,7 +39,12 @@ }); | ||
| } | ||
| function isSurveyIterationBased(survey) { | ||
| return survey.schedule === external_types_js_namespaceObject.SurveySchedule.Recurring || (survey.current_iteration ?? 0) > 0; | ||
| } | ||
| exports.canSurveyActivateRepeatedly = __webpack_exports__.canSurveyActivateRepeatedly; | ||
| exports.doesSurveyActivateByEvent = __webpack_exports__.doesSurveyActivateByEvent; | ||
| exports.isSurveyIterationBased = __webpack_exports__.isSurveyIterationBased; | ||
| for(var __webpack_i__ in __webpack_exports__)if (-1 === [ | ||
| "canSurveyActivateRepeatedly", | ||
| "doesSurveyActivateByEvent" | ||
| "doesSurveyActivateByEvent", | ||
| "isSurveyIterationBased" | ||
| ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__]; | ||
@@ -45,0 +51,0 @@ Object.defineProperty(exports, '__esModule', { |
@@ -8,2 +8,5 @@ import { SurveySchedule } from "../types.mjs"; | ||
| } | ||
| export { canSurveyActivateRepeatedly, doesSurveyActivateByEvent }; | ||
| function isSurveyIterationBased(survey) { | ||
| return survey.schedule === SurveySchedule.Recurring || (survey.current_iteration ?? 0) > 0; | ||
| } | ||
| export { canSurveyActivateRepeatedly, doesSurveyActivateByEvent, isSurveyIterationBased }; |
| export { getValidationError, getLengthFromRules, getRequirementsHint } from './validation'; | ||
| export { buildSurveyResponseProperties, getSurveyInteractionProperty, getSurveyOldResponseKey, getSurveyResponseKey, getSurveyResponseValue, SURVEY_LANGUAGE_PROPERTY, surveyHasResponses, } from './events'; | ||
| export { applySurveyTranslation, detectSurveyLanguage, findBestTranslationMatch, getBaseLanguage, getLanguageFromStoredPersonProperties, normalizeLanguageCode, } from './translations'; | ||
| export { canSurveyActivateRepeatedly, doesSurveyActivateByEvent } from './activation'; | ||
| export { canSurveyActivateRepeatedly, doesSurveyActivateByEvent, isSurveyIterationBased } from './activation'; | ||
| export { getSurveyIterationKey, isSurveyKeyForSurvey, type SurveyWithIteration } from './keys'; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/surveys/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EACf,qCAAqC,EACrC,qBAAqB,GACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACrF,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,MAAM,QAAQ,CAAA"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/surveys/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EACf,qCAAqC,EACrC,qBAAqB,GACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAC7G,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,MAAM,QAAQ,CAAA"} |
@@ -31,2 +31,3 @@ "use strict"; | ||
| getSurveyResponseValue: ()=>external_events_js_namespaceObject.getSurveyResponseValue, | ||
| isSurveyIterationBased: ()=>external_activation_js_namespaceObject.isSurveyIterationBased, | ||
| SURVEY_LANGUAGE_PROPERTY: ()=>external_events_js_namespaceObject.SURVEY_LANGUAGE_PROPERTY, | ||
@@ -71,2 +72,3 @@ detectSurveyLanguage: ()=>external_translations_js_namespaceObject.detectSurveyLanguage, | ||
| exports.getValidationError = __webpack_exports__.getValidationError; | ||
| exports.isSurveyIterationBased = __webpack_exports__.isSurveyIterationBased; | ||
| exports.isSurveyKeyForSurvey = __webpack_exports__.isSurveyKeyForSurvey; | ||
@@ -93,2 +95,3 @@ exports.normalizeLanguageCode = __webpack_exports__.normalizeLanguageCode; | ||
| "getValidationError", | ||
| "isSurveyIterationBased", | ||
| "isSurveyKeyForSurvey", | ||
@@ -95,0 +98,0 @@ "normalizeLanguageCode", |
| import { getLengthFromRules, getRequirementsHint, getValidationError } from "./validation.mjs"; | ||
| import { SURVEY_LANGUAGE_PROPERTY, buildSurveyResponseProperties, getSurveyInteractionProperty, getSurveyOldResponseKey, getSurveyResponseKey, getSurveyResponseValue, surveyHasResponses } from "./events.mjs"; | ||
| import { applySurveyTranslation, detectSurveyLanguage, findBestTranslationMatch, getBaseLanguage, getLanguageFromStoredPersonProperties, normalizeLanguageCode } from "./translations.mjs"; | ||
| import { canSurveyActivateRepeatedly, doesSurveyActivateByEvent } from "./activation.mjs"; | ||
| import { canSurveyActivateRepeatedly, doesSurveyActivateByEvent, isSurveyIterationBased } from "./activation.mjs"; | ||
| import { getSurveyIterationKey, isSurveyKeyForSurvey } from "./keys.mjs"; | ||
| export { SURVEY_LANGUAGE_PROPERTY, applySurveyTranslation, buildSurveyResponseProperties, canSurveyActivateRepeatedly, detectSurveyLanguage, doesSurveyActivateByEvent, findBestTranslationMatch, getBaseLanguage, getLanguageFromStoredPersonProperties, getLengthFromRules, getRequirementsHint, getSurveyInteractionProperty, getSurveyIterationKey, getSurveyOldResponseKey, getSurveyResponseKey, getSurveyResponseValue, getValidationError, isSurveyKeyForSurvey, normalizeLanguageCode, surveyHasResponses }; | ||
| export { SURVEY_LANGUAGE_PROPERTY, applySurveyTranslation, buildSurveyResponseProperties, canSurveyActivateRepeatedly, detectSurveyLanguage, doesSurveyActivateByEvent, findBestTranslationMatch, getBaseLanguage, getLanguageFromStoredPersonProperties, getLengthFromRules, getRequirementsHint, getSurveyInteractionProperty, getSurveyIterationKey, getSurveyOldResponseKey, getSurveyResponseKey, getSurveyResponseValue, getValidationError, isSurveyIterationBased, isSurveyKeyForSurvey, normalizeLanguageCode, surveyHasResponses }; |
+1
-1
| { | ||
| "name": "@posthog/core", | ||
| "version": "1.45.1", | ||
| "version": "1.45.2", | ||
| "bugs": { | ||
@@ -5,0 +5,0 @@ "url": "https://github.com/PostHog/posthog-js/issues" |
@@ -29,1 +29,13 @@ import { Survey, SurveySchedule } from '../types' | ||
| } | ||
| type SurveyForIterationCheck = Pick<Survey, 'schedule' | 'current_iteration'> | ||
| /** | ||
| * True when a survey is meant to come back around on its own: a recurring schedule, or an | ||
| * iteration already under way. Stored display state is keyed by iteration | ||
| * (see `getSurveyIterationKey`), so for these surveys it rolls over and stops being a | ||
| * dependable "already answered" record; other surveys keep one stable key for good. | ||
| */ | ||
| export function isSurveyIterationBased(survey: SurveyForIterationCheck): boolean { | ||
| return survey.schedule === SurveySchedule.Recurring || (survey.current_iteration ?? 0) > 0 | ||
| } |
@@ -19,3 +19,3 @@ export { getValidationError, getLengthFromRules, getRequirementsHint } from './validation' | ||
| } from './translations' | ||
| export { canSurveyActivateRepeatedly, doesSurveyActivateByEvent } from './activation' | ||
| export { canSurveyActivateRepeatedly, doesSurveyActivateByEvent, isSurveyIterationBased } from './activation' | ||
| export { getSurveyIterationKey, isSurveyKeyForSurvey, type SurveyWithIteration } from './keys' |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1288149
0.16%29804
0.1%