@slicemachine/manager 0.1.1-dev-plugins-validation.1 → 0.1.1-dev-plugins-m1-validation.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.
Files changed (59) hide show
  1. package/dist/constants/API_ENDPOINTS.cjs +6 -5
  2. package/dist/constants/API_ENDPOINTS.cjs.map +1 -1
  3. package/dist/constants/API_ENDPOINTS.js +6 -5
  4. package/dist/constants/API_ENDPOINTS.js.map +1 -1
  5. package/dist/lib/addTrailingSlash.cjs +7 -0
  6. package/dist/lib/addTrailingSlash.cjs.map +1 -0
  7. package/dist/lib/addTrailingSlash.d.ts +1 -0
  8. package/dist/lib/addTrailingSlash.js +7 -0
  9. package/dist/lib/addTrailingSlash.js.map +1 -0
  10. package/dist/lib/decodeSliceMachineConfig.cjs +0 -1
  11. package/dist/lib/decodeSliceMachineConfig.cjs.map +1 -1
  12. package/dist/lib/decodeSliceMachineConfig.js +0 -1
  13. package/dist/lib/decodeSliceMachineConfig.js.map +1 -1
  14. package/dist/lib/locateFileUpward.cjs.map +1 -1
  15. package/dist/lib/locateFileUpward.js.map +1 -1
  16. package/dist/managers/SliceMachineManager.cjs +7 -7
  17. package/dist/managers/SliceMachineManager.cjs.map +1 -1
  18. package/dist/managers/SliceMachineManager.d.ts +0 -4
  19. package/dist/managers/SliceMachineManager.js +7 -7
  20. package/dist/managers/SliceMachineManager.js.map +1 -1
  21. package/dist/managers/prismicRepository/PrismicRepositoryManager.cjs +18 -2
  22. package/dist/managers/prismicRepository/PrismicRepositoryManager.cjs.map +1 -1
  23. package/dist/managers/prismicRepository/PrismicRepositoryManager.js +18 -2
  24. package/dist/managers/prismicRepository/PrismicRepositoryManager.js.map +1 -1
  25. package/dist/managers/project/ProjectManager.cjs.map +1 -1
  26. package/dist/managers/project/ProjectManager.js.map +1 -1
  27. package/dist/managers/screenshots/ScreenshotsManager.cjs +7 -1
  28. package/dist/managers/screenshots/ScreenshotsManager.cjs.map +1 -1
  29. package/dist/managers/screenshots/ScreenshotsManager.js +7 -1
  30. package/dist/managers/screenshots/ScreenshotsManager.js.map +1 -1
  31. package/dist/managers/slices/SlicesManager.cjs +27 -19
  32. package/dist/managers/slices/SlicesManager.cjs.map +1 -1
  33. package/dist/managers/slices/SlicesManager.d.ts +5 -1
  34. package/dist/managers/slices/SlicesManager.js +27 -19
  35. package/dist/managers/slices/SlicesManager.js.map +1 -1
  36. package/dist/managers/telemetry/TelemetryManager.cjs +39 -12
  37. package/dist/managers/telemetry/TelemetryManager.cjs.map +1 -1
  38. package/dist/managers/telemetry/TelemetryManager.d.ts +14 -1
  39. package/dist/managers/telemetry/TelemetryManager.js +39 -12
  40. package/dist/managers/telemetry/TelemetryManager.js.map +1 -1
  41. package/dist/managers/telemetry/types.cjs +0 -4
  42. package/dist/managers/telemetry/types.cjs.map +1 -1
  43. package/dist/managers/telemetry/types.d.ts +5 -30
  44. package/dist/managers/telemetry/types.js +0 -4
  45. package/dist/managers/telemetry/types.js.map +1 -1
  46. package/dist/types.d.ts +0 -1
  47. package/package.json +5 -4
  48. package/src/constants/API_ENDPOINTS.ts +8 -5
  49. package/src/lib/addTrailingSlash.ts +5 -0
  50. package/src/lib/decodeSliceMachineConfig.ts +0 -1
  51. package/src/lib/locateFileUpward.ts +0 -1
  52. package/src/managers/SliceMachineManager.ts +9 -9
  53. package/src/managers/prismicRepository/PrismicRepositoryManager.ts +24 -2
  54. package/src/managers/project/ProjectManager.ts +0 -1
  55. package/src/managers/screenshots/ScreenshotsManager.ts +11 -1
  56. package/src/managers/slices/SlicesManager.ts +34 -29
  57. package/src/managers/telemetry/TelemetryManager.ts +77 -13
  58. package/src/managers/telemetry/types.ts +6 -32
  59. package/src/types.ts +0 -2
@@ -21,8 +21,6 @@ const SegmentEventType = {
21
21
  customType_sliceZoneUpdated: "custom-type:slice-zone-updated",
22
22
  customType_saved: "custom-type:saved",
23
23
  slice_created: "slice:created",
24
- identifyUser: "identify-user",
25
- groupLibraries: "group-libraries",
26
24
  screenshotTaken: "screenshot-taken",
27
25
  changes_pushed: "changes:pushed",
28
26
  changes_limitReach: "changes:limit-reach",
@@ -49,8 +47,6 @@ const HumanSegmentEventType = {
49
47
  [SegmentEventType.customType_sliceZoneUpdated]: "SliceMachine Slicezone Updated",
50
48
  [SegmentEventType.customType_saved]: "SliceMachine Custom Type Saved",
51
49
  [SegmentEventType.slice_created]: "SliceMachine Slice Created",
52
- [SegmentEventType.identifyUser]: "IdentifyUser",
53
- [SegmentEventType.groupLibraries]: "GroupLibraries",
54
50
  [SegmentEventType.screenshotTaken]: "SliceMachine Screenshot Taken",
55
51
  [SegmentEventType.changes_pushed]: "SliceMachine Changes Pushed",
56
52
  [SegmentEventType.changes_limitReach]: "SliceMachine Changes Limit Reach",
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import type { LimitType } from \"../prismicRepository/types\";\n\nexport const SegmentEventType = {\n\tcommand_init_start: \"command:init:start\",\n\tcommand_init_identify: \"command:init:identify\",\n\tcommand_init_end: \"command:init:end\",\n\treview: \"review\",\n\tonboarding_start: \"onboarding:start\",\n\tonboarding_skip: \"onboarding:skip\",\n\tonboarding_continue_screenIntro: \"onboarding:continue:screen-intro\",\n\tonboarding_continue_screen1: \"onboarding:continue:screen-1\",\n\tonboarding_continue_screen2: \"onboarding:continue:screen-2\",\n\tonboarding_continue_screen3: \"onboarding:continue:screen-3\",\n\tsliceSimulator_setup: \"slice-simulator:setup\",\n\tsliceSimulator_open: \"slice-simulator:open\",\n\tsliceSimulator_isNotRunning: \"slice-simulator:is-not-running\",\n\tpageView: \"page-view\",\n\topenVideoTutorials: \"open-video-tutorials\",\n\tcustomType_created: \"custom-type:created\",\n\tcustomType_fieldAdded: \"custom-type:field-added\",\n\tcustomType_sliceZoneUpdated: \"custom-type:slice-zone-updated\",\n\tcustomType_saved: \"custom-type:saved\",\n\tslice_created: \"slice:created\",\n\tidentifyUser: \"identify-user\",\n\tgroupLibraries: \"group-libraries\",\n\tscreenshotTaken: \"screenshot-taken\",\n\tchanges_pushed: \"changes:pushed\",\n\tchanges_limitReach: \"changes:limit-reach\",\n\teditor_widgetUsed: \"editor:widget-used\",\n} as const;\ntype SegmentEventTypes =\n\t(typeof SegmentEventType)[keyof typeof SegmentEventType];\n\nexport const HumanSegmentEventType = {\n\t[SegmentEventType.command_init_start]: \"SliceMachine Init Start\",\n\t[SegmentEventType.command_init_identify]: \"SliceMachine Init Identify\",\n\t[SegmentEventType.command_init_end]: \"SliceMachine Init End\",\n\t[SegmentEventType.review]: \"SliceMachine Review\",\n\t[SegmentEventType.onboarding_start]: \"SliceMachine Onboarding Start\",\n\t[SegmentEventType.onboarding_skip]: \"SliceMachine Onboarding Skip\",\n\t[SegmentEventType.onboarding_continue_screenIntro]:\n\t\t\"SliceMachine Onboarding Continue Screen Intro\",\n\t[SegmentEventType.onboarding_continue_screen1]:\n\t\t\"SliceMachine Onboarding Continue Screen 1\",\n\t[SegmentEventType.onboarding_continue_screen2]:\n\t\t\"SliceMachine Onboarding Continue Screen 2\",\n\t[SegmentEventType.onboarding_continue_screen3]:\n\t\t\"SliceMachine Onboarding Continue Screen 3\",\n\t[SegmentEventType.sliceSimulator_setup]: \"SliceMachine Slice Simulator Setup\",\n\t[SegmentEventType.sliceSimulator_open]: \"SliceMachine Slice Simulator Open\",\n\t[SegmentEventType.sliceSimulator_isNotRunning]:\n\t\t\"SliceMachine Slice Simulator is not running\",\n\t[SegmentEventType.pageView]: \"SliceMachine Page View\",\n\t[SegmentEventType.openVideoTutorials]: \"SliceMachine Open Video Tutorials\",\n\t[SegmentEventType.customType_created]: \"SliceMachine Custom Type Created\",\n\t[SegmentEventType.customType_fieldAdded]:\n\t\t\"SliceMachine Custom Type Field Added\",\n\t[SegmentEventType.customType_sliceZoneUpdated]:\n\t\t\"SliceMachine Slicezone Updated\",\n\t[SegmentEventType.customType_saved]: \"SliceMachine Custom Type Saved\",\n\t[SegmentEventType.slice_created]: \"SliceMachine Slice Created\",\n\t[SegmentEventType.identifyUser]: \"IdentifyUser\",\n\t[SegmentEventType.groupLibraries]: \"GroupLibraries\",\n\t[SegmentEventType.screenshotTaken]: \"SliceMachine Screenshot Taken\",\n\t[SegmentEventType.changes_pushed]: \"SliceMachine Changes Pushed\",\n\t[SegmentEventType.changes_limitReach]: \"SliceMachine Changes Limit Reach\",\n\t[SegmentEventType.editor_widgetUsed]: \"SliceMachine Editor Widget Used\",\n} as const;\nexport type HumanSegmentEventTypes =\n\t(typeof HumanSegmentEventType)[keyof typeof HumanSegmentEventType];\n\ntype SegmentEvent<\n\tTType extends SegmentEventTypes,\n\tTProperties extends Record<string, unknown> | void = void,\n> = TProperties extends void\n\t? {\n\t\t\tevent: TType;\n\t\t\trepository?: string;\n\t }\n\t: {\n\t\t\tevent: TType;\n\t\t\trepository?: string;\n\t } & TProperties;\n\ntype CommandInitStartSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_start\n>;\n\n// This event feels off, we have a dedicated `identify` method...\ntype CommandInitIdentifySegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_identify\n>;\n\ntype CommandInitEndSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_end,\n\t{ framework: string; success: boolean; error?: string }\n>;\n\ntype ReviewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.review,\n\t{ framework: string; rating: number; comment: string }\n>;\n\ntype OnboardingStartSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_start\n>;\n\ntype OnboardingSkipSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_skip,\n\t{ screenSkipped: number }\n>;\n\ntype OnboardingContinueScreenIntroSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screenIntro\n>;\n\ntype OnboardingContinueScreen1SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen1\n>;\n\ntype OnboardingContinueScreen2SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen2\n>;\n\ntype OnboardingContinueScreen3SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen3\n>;\n\ntype SliceSimulatorSetupSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_setup,\n\t{ framework: string; version: string }\n>;\n\ntype SliceSimulatorOpenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_open,\n\t{ framework: string; version: string }\n>;\n\ntype SliceSimulatorIsNotRunningSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_isNotRunning,\n\t{ framework: string }\n>;\n\ntype PageViewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.pageView,\n\t{\n\t\turl: string;\n\t\tpath: string;\n\t\tsearch: string;\n\t\ttitle: string;\n\t\treferrer: string;\n\t\tframework: string;\n\t\tslicemachineVersion: string;\n\t}\n>;\n\ntype OpenVideoTutorialsSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.openVideoTutorials,\n\t{ framework: string; slicemachineVersion: string; video: string }\n>;\n\ntype CustomTypeCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_created,\n\t{ id: string; name: string; type: \"repeatable\" | \"single\" }\n>;\n\ntype CustomTypeFieldAddedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_fieldAdded,\n\t{\n\t\tid: string; // field id\n\t\tname: string; // custom type id\n\t\tzone: \"static\" | \"repeatable\";\n\t\ttype: string;\n\t}\n>;\n\ntype CustomTypeSliceZoneUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_sliceZoneUpdated,\n\t{ customTypeId: string }\n>;\n\ntype CustomTypeSavedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_saved,\n\t{ id: string; name: string; type: \"repeatable\" | \"single\" }\n>;\n\ntype SliceCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.slice_created,\n\t{ id: string; name: string; library: string }\n>;\n\ntype IdentifyUserSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.identifyUser\n>;\n\ntype GroupLibrariesSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.groupLibraries,\n\t{\n\t\trepoName: string;\n\t\tmanualLibsCount: number;\n\t\tdownloadedLibsCount: number;\n\t\tnpmLibsCount: number;\n\t\tdownloadedLibs: Array<string>;\n\t\tslicemachineVersion: string;\n\t}\n>;\n\ntype ScreenshotTakenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.screenshotTaken,\n\t{\n\t\ttype: \"custom\" | \"automatic\";\n\t\tmethod: \"fromSimulator\" | \"upload\" | \"dragAndDrop\";\n\t}\n>;\n\ntype ChangesPushedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_pushed,\n\t{\n\t\tcustomTypesCreated: number;\n\t\tcustomTypesModified: number;\n\t\tcustomTypesDeleted: number;\n\t\tslicesCreated: number;\n\t\tslicesModified: number;\n\t\tslicesDeleted: number;\n\t\tmissingScreenshots: number;\n\t\ttotal: number;\n\t\tduration: number;\n\t\thasDeletedDocuments: boolean;\n\t}\n>;\n\ntype ChangesLimitReachSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_limitReach,\n\t{ limitType: LimitType }\n>;\n\ntype EditorWidgetUsedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.editor_widgetUsed,\n\t{ sliceId: string }\n>;\n\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| ReviewSegmentEvent\n\t| OnboardingStartSegmentEvent\n\t| OnboardingSkipSegmentEvent\n\t| OnboardingContinueScreenIntroSegmentEvent\n\t| OnboardingContinueScreen1SegmentEvent\n\t| OnboardingContinueScreen2SegmentEvent\n\t| OnboardingContinueScreen3SegmentEvent\n\t| SliceSimulatorSetupSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| CustomTypeCreatedSegmentEvent\n\t| CustomTypeFieldAddedSegmentEvent\n\t| CustomTypeSliceZoneUpdatedSegmentEvent\n\t| CustomTypeSavedSegmentEvent\n\t| SliceCreatedSegmentEvent\n\t| IdentifyUserSegmentEvent\n\t| GroupLibrariesSegmentEvent\n\t| ScreenshotTakenSegmentEvent\n\t| ChangesPushedSegmentEvent\n\t| ChangesLimitReachSegmentEvent\n\t| EditorWidgetUsedSegmentEvent;\n"],"names":[],"mappings":";;AAEO,MAAM,mBAAmB;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iCAAiC;AAAA,EACjC,6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,mBAAmB;;AAKb,MAAM,wBAAwB;AAAA,EACpC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,qBAAqB,GAAG;AAAA,EAC1C,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,MAAM,GAAG;AAAA,EAC3B,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,eAAe,GAAG;AAAA,EACpC,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,oBAAoB,GAAG;AAAA,EACzC,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,QAAQ,GAAG;AAAA,EAC7B,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,qBAAqB,GACtC;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,aAAa,GAAG;AAAA,EAClC,CAAC,iBAAiB,YAAY,GAAG;AAAA,EACjC,CAAC,iBAAiB,cAAc,GAAG;AAAA,EACnC,CAAC,iBAAiB,eAAe,GAAG;AAAA,EACpC,CAAC,iBAAiB,cAAc,GAAG;AAAA,EACnC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,iBAAiB,GAAG;;;;"}
1
+ {"version":3,"file":"types.cjs","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import type { LimitType } from \"../prismicRepository/types\";\n\nexport const SegmentEventType = {\n\tcommand_init_start: \"command:init:start\",\n\tcommand_init_identify: \"command:init:identify\",\n\tcommand_init_end: \"command:init:end\",\n\treview: \"review\",\n\tonboarding_start: \"onboarding:start\",\n\tonboarding_skip: \"onboarding:skip\",\n\tonboarding_continue_screenIntro: \"onboarding:continue:screen-intro\",\n\tonboarding_continue_screen1: \"onboarding:continue:screen-1\",\n\tonboarding_continue_screen2: \"onboarding:continue:screen-2\",\n\tonboarding_continue_screen3: \"onboarding:continue:screen-3\",\n\tsliceSimulator_setup: \"slice-simulator:setup\",\n\tsliceSimulator_open: \"slice-simulator:open\",\n\tsliceSimulator_isNotRunning: \"slice-simulator:is-not-running\",\n\tpageView: \"page-view\",\n\topenVideoTutorials: \"open-video-tutorials\",\n\tcustomType_created: \"custom-type:created\",\n\tcustomType_fieldAdded: \"custom-type:field-added\",\n\tcustomType_sliceZoneUpdated: \"custom-type:slice-zone-updated\",\n\tcustomType_saved: \"custom-type:saved\",\n\tslice_created: \"slice:created\",\n\tscreenshotTaken: \"screenshot-taken\",\n\tchanges_pushed: \"changes:pushed\",\n\tchanges_limitReach: \"changes:limit-reach\",\n\teditor_widgetUsed: \"editor:widget-used\",\n} as const;\ntype SegmentEventTypes =\n\t(typeof SegmentEventType)[keyof typeof SegmentEventType];\n\nexport const HumanSegmentEventType = {\n\t[SegmentEventType.command_init_start]: \"SliceMachine Init Start\",\n\t[SegmentEventType.command_init_identify]: \"SliceMachine Init Identify\",\n\t[SegmentEventType.command_init_end]: \"SliceMachine Init End\",\n\t[SegmentEventType.review]: \"SliceMachine Review\",\n\t[SegmentEventType.onboarding_start]: \"SliceMachine Onboarding Start\",\n\t[SegmentEventType.onboarding_skip]: \"SliceMachine Onboarding Skip\",\n\t[SegmentEventType.onboarding_continue_screenIntro]:\n\t\t\"SliceMachine Onboarding Continue Screen Intro\",\n\t[SegmentEventType.onboarding_continue_screen1]:\n\t\t\"SliceMachine Onboarding Continue Screen 1\",\n\t[SegmentEventType.onboarding_continue_screen2]:\n\t\t\"SliceMachine Onboarding Continue Screen 2\",\n\t[SegmentEventType.onboarding_continue_screen3]:\n\t\t\"SliceMachine Onboarding Continue Screen 3\",\n\t[SegmentEventType.sliceSimulator_setup]: \"SliceMachine Slice Simulator Setup\",\n\t[SegmentEventType.sliceSimulator_open]: \"SliceMachine Slice Simulator Open\",\n\t[SegmentEventType.sliceSimulator_isNotRunning]:\n\t\t\"SliceMachine Slice Simulator is not running\",\n\t[SegmentEventType.pageView]: \"SliceMachine Page View\",\n\t[SegmentEventType.openVideoTutorials]: \"SliceMachine Open Video Tutorials\",\n\t[SegmentEventType.customType_created]: \"SliceMachine Custom Type Created\",\n\t[SegmentEventType.customType_fieldAdded]:\n\t\t\"SliceMachine Custom Type Field Added\",\n\t[SegmentEventType.customType_sliceZoneUpdated]:\n\t\t\"SliceMachine Slicezone Updated\",\n\t[SegmentEventType.customType_saved]: \"SliceMachine Custom Type Saved\",\n\t[SegmentEventType.slice_created]: \"SliceMachine Slice Created\",\n\t[SegmentEventType.screenshotTaken]: \"SliceMachine Screenshot Taken\",\n\t[SegmentEventType.changes_pushed]: \"SliceMachine Changes Pushed\",\n\t[SegmentEventType.changes_limitReach]: \"SliceMachine Changes Limit Reach\",\n\t[SegmentEventType.editor_widgetUsed]: \"SliceMachine Editor Widget Used\",\n} as const;\nexport type HumanSegmentEventTypes =\n\t(typeof HumanSegmentEventType)[keyof typeof HumanSegmentEventType];\n\ntype SegmentEvent<\n\tTType extends SegmentEventTypes,\n\tTProperties extends Record<string, unknown> | void = void,\n> = TProperties extends void\n\t? {\n\t\t\tevent: TType;\n\t\t\trepository?: string;\n\t }\n\t: {\n\t\t\tevent: TType;\n\t\t\trepository?: string;\n\t } & TProperties;\n\ntype CommandInitStartSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_start\n>;\n\n// This event feels off, we have a dedicated `identify` method...\ntype CommandInitIdentifySegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_identify\n>;\n\ntype CommandInitEndSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_end,\n\t{ framework: string; success: boolean; error?: string }\n>;\n\ntype ReviewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.review,\n\t{ rating: number; comment: string }\n>;\n\ntype OnboardingStartSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_start\n>;\n\ntype OnboardingSkipSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_skip,\n\t{ screenSkipped: number }\n>;\n\ntype OnboardingContinueScreenIntroSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screenIntro\n>;\n\ntype OnboardingContinueScreen1SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen1\n>;\n\ntype OnboardingContinueScreen2SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen2\n>;\n\ntype OnboardingContinueScreen3SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen3\n>;\n\ntype SliceSimulatorSetupSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_setup\n>;\n\ntype SliceSimulatorOpenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_open\n>;\n\ntype SliceSimulatorIsNotRunningSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_isNotRunning\n>;\n\ntype PageViewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.pageView,\n\t{\n\t\turl: string;\n\t\tpath: string;\n\t\tsearch: string;\n\t\ttitle: string;\n\t\treferrer: string;\n\t\tadapter: string;\n\t}\n>;\n\ntype OpenVideoTutorialsSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.openVideoTutorials,\n\t{ video: string }\n>;\n\ntype CustomTypeCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_created,\n\t{ id: string; name: string; type: \"repeatable\" | \"single\" }\n>;\n\ntype CustomTypeFieldAddedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_fieldAdded,\n\t{\n\t\tid: string; // field id\n\t\tname: string; // custom type id\n\t\tzone: \"static\" | \"repeatable\";\n\t\ttype: string;\n\t}\n>;\n\ntype CustomTypeSliceZoneUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_sliceZoneUpdated,\n\t{ customTypeId: string }\n>;\n\ntype CustomTypeSavedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_saved,\n\t{ id: string; name: string; type: \"repeatable\" | \"single\" }\n>;\n\ntype SliceCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.slice_created,\n\t{ id: string; name: string; library: string }\n>;\n\ntype ScreenshotTakenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.screenshotTaken,\n\t{\n\t\ttype: \"custom\" | \"automatic\";\n\t\tmethod: \"fromSimulator\" | \"upload\" | \"dragAndDrop\";\n\t}\n>;\n\ntype ChangesPushedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_pushed,\n\t{\n\t\tcustomTypesCreated: number;\n\t\tcustomTypesModified: number;\n\t\tcustomTypesDeleted: number;\n\t\tslicesCreated: number;\n\t\tslicesModified: number;\n\t\tslicesDeleted: number;\n\t\tmissingScreenshots: number;\n\t\ttotal: number;\n\t\tduration: number;\n\t\thasDeletedDocuments: boolean;\n\t}\n>;\n\ntype ChangesLimitReachSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_limitReach,\n\t{ limitType: LimitType }\n>;\n\ntype EditorWidgetUsedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.editor_widgetUsed,\n\t{ sliceId: string }\n>;\n\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| ReviewSegmentEvent\n\t| OnboardingStartSegmentEvent\n\t| OnboardingSkipSegmentEvent\n\t| OnboardingContinueScreenIntroSegmentEvent\n\t| OnboardingContinueScreen1SegmentEvent\n\t| OnboardingContinueScreen2SegmentEvent\n\t| OnboardingContinueScreen3SegmentEvent\n\t| SliceSimulatorSetupSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| CustomTypeCreatedSegmentEvent\n\t| CustomTypeFieldAddedSegmentEvent\n\t| CustomTypeSliceZoneUpdatedSegmentEvent\n\t| CustomTypeSavedSegmentEvent\n\t| SliceCreatedSegmentEvent\n\t| ScreenshotTakenSegmentEvent\n\t| ChangesPushedSegmentEvent\n\t| ChangesLimitReachSegmentEvent\n\t| EditorWidgetUsedSegmentEvent;\n"],"names":[],"mappings":";;AAEO,MAAM,mBAAmB;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iCAAiC;AAAA,EACjC,6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,mBAAmB;;AAKb,MAAM,wBAAwB;AAAA,EACpC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,qBAAqB,GAAG;AAAA,EAC1C,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,MAAM,GAAG;AAAA,EAC3B,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,eAAe,GAAG;AAAA,EACpC,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,oBAAoB,GAAG;AAAA,EACzC,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,QAAQ,GAAG;AAAA,EAC7B,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,qBAAqB,GACtC;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,aAAa,GAAG;AAAA,EAClC,CAAC,iBAAiB,eAAe,GAAG;AAAA,EACpC,CAAC,iBAAiB,cAAc,GAAG;AAAA,EACnC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,iBAAiB,GAAG;;;;"}
@@ -20,8 +20,6 @@ export declare const SegmentEventType: {
20
20
  readonly customType_sliceZoneUpdated: "custom-type:slice-zone-updated";
21
21
  readonly customType_saved: "custom-type:saved";
22
22
  readonly slice_created: "slice:created";
23
- readonly identifyUser: "identify-user";
24
- readonly groupLibraries: "group-libraries";
25
23
  readonly screenshotTaken: "screenshot-taken";
26
24
  readonly changes_pushed: "changes:pushed";
27
25
  readonly changes_limitReach: "changes:limit-reach";
@@ -49,8 +47,6 @@ export declare const HumanSegmentEventType: {
49
47
  readonly "custom-type:slice-zone-updated": "SliceMachine Slicezone Updated";
50
48
  readonly "custom-type:saved": "SliceMachine Custom Type Saved";
51
49
  readonly "slice:created": "SliceMachine Slice Created";
52
- readonly "identify-user": "IdentifyUser";
53
- readonly "group-libraries": "GroupLibraries";
54
50
  readonly "screenshot-taken": "SliceMachine Screenshot Taken";
55
51
  readonly "changes:pushed": "SliceMachine Changes Pushed";
56
52
  readonly "changes:limit-reach": "SliceMachine Changes Limit Reach";
@@ -72,7 +68,6 @@ type CommandInitEndSegmentEvent = SegmentEvent<typeof SegmentEventType.command_i
72
68
  error?: string;
73
69
  }>;
74
70
  type ReviewSegmentEvent = SegmentEvent<typeof SegmentEventType.review, {
75
- framework: string;
76
71
  rating: number;
77
72
  comment: string;
78
73
  }>;
@@ -84,29 +79,18 @@ type OnboardingContinueScreenIntroSegmentEvent = SegmentEvent<typeof SegmentEven
84
79
  type OnboardingContinueScreen1SegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_continue_screen1>;
85
80
  type OnboardingContinueScreen2SegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_continue_screen2>;
86
81
  type OnboardingContinueScreen3SegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_continue_screen3>;
87
- type SliceSimulatorSetupSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_setup, {
88
- framework: string;
89
- version: string;
90
- }>;
91
- type SliceSimulatorOpenSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_open, {
92
- framework: string;
93
- version: string;
94
- }>;
95
- type SliceSimulatorIsNotRunningSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_isNotRunning, {
96
- framework: string;
97
- }>;
82
+ type SliceSimulatorSetupSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_setup>;
83
+ type SliceSimulatorOpenSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_open>;
84
+ type SliceSimulatorIsNotRunningSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_isNotRunning>;
98
85
  type PageViewSegmentEvent = SegmentEvent<typeof SegmentEventType.pageView, {
99
86
  url: string;
100
87
  path: string;
101
88
  search: string;
102
89
  title: string;
103
90
  referrer: string;
104
- framework: string;
105
- slicemachineVersion: string;
91
+ adapter: string;
106
92
  }>;
107
93
  type OpenVideoTutorialsSegmentEvent = SegmentEvent<typeof SegmentEventType.openVideoTutorials, {
108
- framework: string;
109
- slicemachineVersion: string;
110
94
  video: string;
111
95
  }>;
112
96
  type CustomTypeCreatedSegmentEvent = SegmentEvent<typeof SegmentEventType.customType_created, {
@@ -133,15 +117,6 @@ type SliceCreatedSegmentEvent = SegmentEvent<typeof SegmentEventType.slice_creat
133
117
  name: string;
134
118
  library: string;
135
119
  }>;
136
- type IdentifyUserSegmentEvent = SegmentEvent<typeof SegmentEventType.identifyUser>;
137
- type GroupLibrariesSegmentEvent = SegmentEvent<typeof SegmentEventType.groupLibraries, {
138
- repoName: string;
139
- manualLibsCount: number;
140
- downloadedLibsCount: number;
141
- npmLibsCount: number;
142
- downloadedLibs: Array<string>;
143
- slicemachineVersion: string;
144
- }>;
145
120
  type ScreenshotTakenSegmentEvent = SegmentEvent<typeof SegmentEventType.screenshotTaken, {
146
121
  type: "custom" | "automatic";
147
122
  method: "fromSimulator" | "upload" | "dragAndDrop";
@@ -164,5 +139,5 @@ type ChangesLimitReachSegmentEvent = SegmentEvent<typeof SegmentEventType.change
164
139
  type EditorWidgetUsedSegmentEvent = SegmentEvent<typeof SegmentEventType.editor_widgetUsed, {
165
140
  sliceId: string;
166
141
  }>;
167
- export type SegmentEvents = CommandInitStartSegmentEvent | CommandInitIdentifySegmentEvent | CommandInitEndSegmentEvent | ReviewSegmentEvent | OnboardingStartSegmentEvent | OnboardingSkipSegmentEvent | OnboardingContinueScreenIntroSegmentEvent | OnboardingContinueScreen1SegmentEvent | OnboardingContinueScreen2SegmentEvent | OnboardingContinueScreen3SegmentEvent | SliceSimulatorSetupSegmentEvent | SliceSimulatorOpenSegmentEvent | SliceSimulatorIsNotRunningSegmentEvent | PageViewSegmentEvent | OpenVideoTutorialsSegmentEvent | CustomTypeCreatedSegmentEvent | CustomTypeFieldAddedSegmentEvent | CustomTypeSliceZoneUpdatedSegmentEvent | CustomTypeSavedSegmentEvent | SliceCreatedSegmentEvent | IdentifyUserSegmentEvent | GroupLibrariesSegmentEvent | ScreenshotTakenSegmentEvent | ChangesPushedSegmentEvent | ChangesLimitReachSegmentEvent | EditorWidgetUsedSegmentEvent;
142
+ export type SegmentEvents = CommandInitStartSegmentEvent | CommandInitIdentifySegmentEvent | CommandInitEndSegmentEvent | ReviewSegmentEvent | OnboardingStartSegmentEvent | OnboardingSkipSegmentEvent | OnboardingContinueScreenIntroSegmentEvent | OnboardingContinueScreen1SegmentEvent | OnboardingContinueScreen2SegmentEvent | OnboardingContinueScreen3SegmentEvent | SliceSimulatorSetupSegmentEvent | SliceSimulatorOpenSegmentEvent | SliceSimulatorIsNotRunningSegmentEvent | PageViewSegmentEvent | OpenVideoTutorialsSegmentEvent | CustomTypeCreatedSegmentEvent | CustomTypeFieldAddedSegmentEvent | CustomTypeSliceZoneUpdatedSegmentEvent | CustomTypeSavedSegmentEvent | SliceCreatedSegmentEvent | ScreenshotTakenSegmentEvent | ChangesPushedSegmentEvent | ChangesLimitReachSegmentEvent | EditorWidgetUsedSegmentEvent;
168
143
  export {};
@@ -19,8 +19,6 @@ const SegmentEventType = {
19
19
  customType_sliceZoneUpdated: "custom-type:slice-zone-updated",
20
20
  customType_saved: "custom-type:saved",
21
21
  slice_created: "slice:created",
22
- identifyUser: "identify-user",
23
- groupLibraries: "group-libraries",
24
22
  screenshotTaken: "screenshot-taken",
25
23
  changes_pushed: "changes:pushed",
26
24
  changes_limitReach: "changes:limit-reach",
@@ -47,8 +45,6 @@ const HumanSegmentEventType = {
47
45
  [SegmentEventType.customType_sliceZoneUpdated]: "SliceMachine Slicezone Updated",
48
46
  [SegmentEventType.customType_saved]: "SliceMachine Custom Type Saved",
49
47
  [SegmentEventType.slice_created]: "SliceMachine Slice Created",
50
- [SegmentEventType.identifyUser]: "IdentifyUser",
51
- [SegmentEventType.groupLibraries]: "GroupLibraries",
52
48
  [SegmentEventType.screenshotTaken]: "SliceMachine Screenshot Taken",
53
49
  [SegmentEventType.changes_pushed]: "SliceMachine Changes Pushed",
54
50
  [SegmentEventType.changes_limitReach]: "SliceMachine Changes Limit Reach",
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import type { LimitType } from \"../prismicRepository/types\";\n\nexport const SegmentEventType = {\n\tcommand_init_start: \"command:init:start\",\n\tcommand_init_identify: \"command:init:identify\",\n\tcommand_init_end: \"command:init:end\",\n\treview: \"review\",\n\tonboarding_start: \"onboarding:start\",\n\tonboarding_skip: \"onboarding:skip\",\n\tonboarding_continue_screenIntro: \"onboarding:continue:screen-intro\",\n\tonboarding_continue_screen1: \"onboarding:continue:screen-1\",\n\tonboarding_continue_screen2: \"onboarding:continue:screen-2\",\n\tonboarding_continue_screen3: \"onboarding:continue:screen-3\",\n\tsliceSimulator_setup: \"slice-simulator:setup\",\n\tsliceSimulator_open: \"slice-simulator:open\",\n\tsliceSimulator_isNotRunning: \"slice-simulator:is-not-running\",\n\tpageView: \"page-view\",\n\topenVideoTutorials: \"open-video-tutorials\",\n\tcustomType_created: \"custom-type:created\",\n\tcustomType_fieldAdded: \"custom-type:field-added\",\n\tcustomType_sliceZoneUpdated: \"custom-type:slice-zone-updated\",\n\tcustomType_saved: \"custom-type:saved\",\n\tslice_created: \"slice:created\",\n\tidentifyUser: \"identify-user\",\n\tgroupLibraries: \"group-libraries\",\n\tscreenshotTaken: \"screenshot-taken\",\n\tchanges_pushed: \"changes:pushed\",\n\tchanges_limitReach: \"changes:limit-reach\",\n\teditor_widgetUsed: \"editor:widget-used\",\n} as const;\ntype SegmentEventTypes =\n\t(typeof SegmentEventType)[keyof typeof SegmentEventType];\n\nexport const HumanSegmentEventType = {\n\t[SegmentEventType.command_init_start]: \"SliceMachine Init Start\",\n\t[SegmentEventType.command_init_identify]: \"SliceMachine Init Identify\",\n\t[SegmentEventType.command_init_end]: \"SliceMachine Init End\",\n\t[SegmentEventType.review]: \"SliceMachine Review\",\n\t[SegmentEventType.onboarding_start]: \"SliceMachine Onboarding Start\",\n\t[SegmentEventType.onboarding_skip]: \"SliceMachine Onboarding Skip\",\n\t[SegmentEventType.onboarding_continue_screenIntro]:\n\t\t\"SliceMachine Onboarding Continue Screen Intro\",\n\t[SegmentEventType.onboarding_continue_screen1]:\n\t\t\"SliceMachine Onboarding Continue Screen 1\",\n\t[SegmentEventType.onboarding_continue_screen2]:\n\t\t\"SliceMachine Onboarding Continue Screen 2\",\n\t[SegmentEventType.onboarding_continue_screen3]:\n\t\t\"SliceMachine Onboarding Continue Screen 3\",\n\t[SegmentEventType.sliceSimulator_setup]: \"SliceMachine Slice Simulator Setup\",\n\t[SegmentEventType.sliceSimulator_open]: \"SliceMachine Slice Simulator Open\",\n\t[SegmentEventType.sliceSimulator_isNotRunning]:\n\t\t\"SliceMachine Slice Simulator is not running\",\n\t[SegmentEventType.pageView]: \"SliceMachine Page View\",\n\t[SegmentEventType.openVideoTutorials]: \"SliceMachine Open Video Tutorials\",\n\t[SegmentEventType.customType_created]: \"SliceMachine Custom Type Created\",\n\t[SegmentEventType.customType_fieldAdded]:\n\t\t\"SliceMachine Custom Type Field Added\",\n\t[SegmentEventType.customType_sliceZoneUpdated]:\n\t\t\"SliceMachine Slicezone Updated\",\n\t[SegmentEventType.customType_saved]: \"SliceMachine Custom Type Saved\",\n\t[SegmentEventType.slice_created]: \"SliceMachine Slice Created\",\n\t[SegmentEventType.identifyUser]: \"IdentifyUser\",\n\t[SegmentEventType.groupLibraries]: \"GroupLibraries\",\n\t[SegmentEventType.screenshotTaken]: \"SliceMachine Screenshot Taken\",\n\t[SegmentEventType.changes_pushed]: \"SliceMachine Changes Pushed\",\n\t[SegmentEventType.changes_limitReach]: \"SliceMachine Changes Limit Reach\",\n\t[SegmentEventType.editor_widgetUsed]: \"SliceMachine Editor Widget Used\",\n} as const;\nexport type HumanSegmentEventTypes =\n\t(typeof HumanSegmentEventType)[keyof typeof HumanSegmentEventType];\n\ntype SegmentEvent<\n\tTType extends SegmentEventTypes,\n\tTProperties extends Record<string, unknown> | void = void,\n> = TProperties extends void\n\t? {\n\t\t\tevent: TType;\n\t\t\trepository?: string;\n\t }\n\t: {\n\t\t\tevent: TType;\n\t\t\trepository?: string;\n\t } & TProperties;\n\ntype CommandInitStartSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_start\n>;\n\n// This event feels off, we have a dedicated `identify` method...\ntype CommandInitIdentifySegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_identify\n>;\n\ntype CommandInitEndSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_end,\n\t{ framework: string; success: boolean; error?: string }\n>;\n\ntype ReviewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.review,\n\t{ framework: string; rating: number; comment: string }\n>;\n\ntype OnboardingStartSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_start\n>;\n\ntype OnboardingSkipSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_skip,\n\t{ screenSkipped: number }\n>;\n\ntype OnboardingContinueScreenIntroSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screenIntro\n>;\n\ntype OnboardingContinueScreen1SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen1\n>;\n\ntype OnboardingContinueScreen2SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen2\n>;\n\ntype OnboardingContinueScreen3SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen3\n>;\n\ntype SliceSimulatorSetupSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_setup,\n\t{ framework: string; version: string }\n>;\n\ntype SliceSimulatorOpenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_open,\n\t{ framework: string; version: string }\n>;\n\ntype SliceSimulatorIsNotRunningSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_isNotRunning,\n\t{ framework: string }\n>;\n\ntype PageViewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.pageView,\n\t{\n\t\turl: string;\n\t\tpath: string;\n\t\tsearch: string;\n\t\ttitle: string;\n\t\treferrer: string;\n\t\tframework: string;\n\t\tslicemachineVersion: string;\n\t}\n>;\n\ntype OpenVideoTutorialsSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.openVideoTutorials,\n\t{ framework: string; slicemachineVersion: string; video: string }\n>;\n\ntype CustomTypeCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_created,\n\t{ id: string; name: string; type: \"repeatable\" | \"single\" }\n>;\n\ntype CustomTypeFieldAddedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_fieldAdded,\n\t{\n\t\tid: string; // field id\n\t\tname: string; // custom type id\n\t\tzone: \"static\" | \"repeatable\";\n\t\ttype: string;\n\t}\n>;\n\ntype CustomTypeSliceZoneUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_sliceZoneUpdated,\n\t{ customTypeId: string }\n>;\n\ntype CustomTypeSavedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_saved,\n\t{ id: string; name: string; type: \"repeatable\" | \"single\" }\n>;\n\ntype SliceCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.slice_created,\n\t{ id: string; name: string; library: string }\n>;\n\ntype IdentifyUserSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.identifyUser\n>;\n\ntype GroupLibrariesSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.groupLibraries,\n\t{\n\t\trepoName: string;\n\t\tmanualLibsCount: number;\n\t\tdownloadedLibsCount: number;\n\t\tnpmLibsCount: number;\n\t\tdownloadedLibs: Array<string>;\n\t\tslicemachineVersion: string;\n\t}\n>;\n\ntype ScreenshotTakenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.screenshotTaken,\n\t{\n\t\ttype: \"custom\" | \"automatic\";\n\t\tmethod: \"fromSimulator\" | \"upload\" | \"dragAndDrop\";\n\t}\n>;\n\ntype ChangesPushedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_pushed,\n\t{\n\t\tcustomTypesCreated: number;\n\t\tcustomTypesModified: number;\n\t\tcustomTypesDeleted: number;\n\t\tslicesCreated: number;\n\t\tslicesModified: number;\n\t\tslicesDeleted: number;\n\t\tmissingScreenshots: number;\n\t\ttotal: number;\n\t\tduration: number;\n\t\thasDeletedDocuments: boolean;\n\t}\n>;\n\ntype ChangesLimitReachSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_limitReach,\n\t{ limitType: LimitType }\n>;\n\ntype EditorWidgetUsedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.editor_widgetUsed,\n\t{ sliceId: string }\n>;\n\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| ReviewSegmentEvent\n\t| OnboardingStartSegmentEvent\n\t| OnboardingSkipSegmentEvent\n\t| OnboardingContinueScreenIntroSegmentEvent\n\t| OnboardingContinueScreen1SegmentEvent\n\t| OnboardingContinueScreen2SegmentEvent\n\t| OnboardingContinueScreen3SegmentEvent\n\t| SliceSimulatorSetupSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| CustomTypeCreatedSegmentEvent\n\t| CustomTypeFieldAddedSegmentEvent\n\t| CustomTypeSliceZoneUpdatedSegmentEvent\n\t| CustomTypeSavedSegmentEvent\n\t| SliceCreatedSegmentEvent\n\t| IdentifyUserSegmentEvent\n\t| GroupLibrariesSegmentEvent\n\t| ScreenshotTakenSegmentEvent\n\t| ChangesPushedSegmentEvent\n\t| ChangesLimitReachSegmentEvent\n\t| EditorWidgetUsedSegmentEvent;\n"],"names":[],"mappings":"AAEO,MAAM,mBAAmB;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iCAAiC;AAAA,EACjC,6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,mBAAmB;;AAKb,MAAM,wBAAwB;AAAA,EACpC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,qBAAqB,GAAG;AAAA,EAC1C,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,MAAM,GAAG;AAAA,EAC3B,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,eAAe,GAAG;AAAA,EACpC,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,oBAAoB,GAAG;AAAA,EACzC,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,QAAQ,GAAG;AAAA,EAC7B,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,qBAAqB,GACtC;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,aAAa,GAAG;AAAA,EAClC,CAAC,iBAAiB,YAAY,GAAG;AAAA,EACjC,CAAC,iBAAiB,cAAc,GAAG;AAAA,EACnC,CAAC,iBAAiB,eAAe,GAAG;AAAA,EACpC,CAAC,iBAAiB,cAAc,GAAG;AAAA,EACnC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,iBAAiB,GAAG;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import type { LimitType } from \"../prismicRepository/types\";\n\nexport const SegmentEventType = {\n\tcommand_init_start: \"command:init:start\",\n\tcommand_init_identify: \"command:init:identify\",\n\tcommand_init_end: \"command:init:end\",\n\treview: \"review\",\n\tonboarding_start: \"onboarding:start\",\n\tonboarding_skip: \"onboarding:skip\",\n\tonboarding_continue_screenIntro: \"onboarding:continue:screen-intro\",\n\tonboarding_continue_screen1: \"onboarding:continue:screen-1\",\n\tonboarding_continue_screen2: \"onboarding:continue:screen-2\",\n\tonboarding_continue_screen3: \"onboarding:continue:screen-3\",\n\tsliceSimulator_setup: \"slice-simulator:setup\",\n\tsliceSimulator_open: \"slice-simulator:open\",\n\tsliceSimulator_isNotRunning: \"slice-simulator:is-not-running\",\n\tpageView: \"page-view\",\n\topenVideoTutorials: \"open-video-tutorials\",\n\tcustomType_created: \"custom-type:created\",\n\tcustomType_fieldAdded: \"custom-type:field-added\",\n\tcustomType_sliceZoneUpdated: \"custom-type:slice-zone-updated\",\n\tcustomType_saved: \"custom-type:saved\",\n\tslice_created: \"slice:created\",\n\tscreenshotTaken: \"screenshot-taken\",\n\tchanges_pushed: \"changes:pushed\",\n\tchanges_limitReach: \"changes:limit-reach\",\n\teditor_widgetUsed: \"editor:widget-used\",\n} as const;\ntype SegmentEventTypes =\n\t(typeof SegmentEventType)[keyof typeof SegmentEventType];\n\nexport const HumanSegmentEventType = {\n\t[SegmentEventType.command_init_start]: \"SliceMachine Init Start\",\n\t[SegmentEventType.command_init_identify]: \"SliceMachine Init Identify\",\n\t[SegmentEventType.command_init_end]: \"SliceMachine Init End\",\n\t[SegmentEventType.review]: \"SliceMachine Review\",\n\t[SegmentEventType.onboarding_start]: \"SliceMachine Onboarding Start\",\n\t[SegmentEventType.onboarding_skip]: \"SliceMachine Onboarding Skip\",\n\t[SegmentEventType.onboarding_continue_screenIntro]:\n\t\t\"SliceMachine Onboarding Continue Screen Intro\",\n\t[SegmentEventType.onboarding_continue_screen1]:\n\t\t\"SliceMachine Onboarding Continue Screen 1\",\n\t[SegmentEventType.onboarding_continue_screen2]:\n\t\t\"SliceMachine Onboarding Continue Screen 2\",\n\t[SegmentEventType.onboarding_continue_screen3]:\n\t\t\"SliceMachine Onboarding Continue Screen 3\",\n\t[SegmentEventType.sliceSimulator_setup]: \"SliceMachine Slice Simulator Setup\",\n\t[SegmentEventType.sliceSimulator_open]: \"SliceMachine Slice Simulator Open\",\n\t[SegmentEventType.sliceSimulator_isNotRunning]:\n\t\t\"SliceMachine Slice Simulator is not running\",\n\t[SegmentEventType.pageView]: \"SliceMachine Page View\",\n\t[SegmentEventType.openVideoTutorials]: \"SliceMachine Open Video Tutorials\",\n\t[SegmentEventType.customType_created]: \"SliceMachine Custom Type Created\",\n\t[SegmentEventType.customType_fieldAdded]:\n\t\t\"SliceMachine Custom Type Field Added\",\n\t[SegmentEventType.customType_sliceZoneUpdated]:\n\t\t\"SliceMachine Slicezone Updated\",\n\t[SegmentEventType.customType_saved]: \"SliceMachine Custom Type Saved\",\n\t[SegmentEventType.slice_created]: \"SliceMachine Slice Created\",\n\t[SegmentEventType.screenshotTaken]: \"SliceMachine Screenshot Taken\",\n\t[SegmentEventType.changes_pushed]: \"SliceMachine Changes Pushed\",\n\t[SegmentEventType.changes_limitReach]: \"SliceMachine Changes Limit Reach\",\n\t[SegmentEventType.editor_widgetUsed]: \"SliceMachine Editor Widget Used\",\n} as const;\nexport type HumanSegmentEventTypes =\n\t(typeof HumanSegmentEventType)[keyof typeof HumanSegmentEventType];\n\ntype SegmentEvent<\n\tTType extends SegmentEventTypes,\n\tTProperties extends Record<string, unknown> | void = void,\n> = TProperties extends void\n\t? {\n\t\t\tevent: TType;\n\t\t\trepository?: string;\n\t }\n\t: {\n\t\t\tevent: TType;\n\t\t\trepository?: string;\n\t } & TProperties;\n\ntype CommandInitStartSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_start\n>;\n\n// This event feels off, we have a dedicated `identify` method...\ntype CommandInitIdentifySegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_identify\n>;\n\ntype CommandInitEndSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.command_init_end,\n\t{ framework: string; success: boolean; error?: string }\n>;\n\ntype ReviewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.review,\n\t{ rating: number; comment: string }\n>;\n\ntype OnboardingStartSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_start\n>;\n\ntype OnboardingSkipSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_skip,\n\t{ screenSkipped: number }\n>;\n\ntype OnboardingContinueScreenIntroSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screenIntro\n>;\n\ntype OnboardingContinueScreen1SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen1\n>;\n\ntype OnboardingContinueScreen2SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen2\n>;\n\ntype OnboardingContinueScreen3SegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_continue_screen3\n>;\n\ntype SliceSimulatorSetupSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_setup\n>;\n\ntype SliceSimulatorOpenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_open\n>;\n\ntype SliceSimulatorIsNotRunningSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.sliceSimulator_isNotRunning\n>;\n\ntype PageViewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.pageView,\n\t{\n\t\turl: string;\n\t\tpath: string;\n\t\tsearch: string;\n\t\ttitle: string;\n\t\treferrer: string;\n\t\tadapter: string;\n\t}\n>;\n\ntype OpenVideoTutorialsSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.openVideoTutorials,\n\t{ video: string }\n>;\n\ntype CustomTypeCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_created,\n\t{ id: string; name: string; type: \"repeatable\" | \"single\" }\n>;\n\ntype CustomTypeFieldAddedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_fieldAdded,\n\t{\n\t\tid: string; // field id\n\t\tname: string; // custom type id\n\t\tzone: \"static\" | \"repeatable\";\n\t\ttype: string;\n\t}\n>;\n\ntype CustomTypeSliceZoneUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_sliceZoneUpdated,\n\t{ customTypeId: string }\n>;\n\ntype CustomTypeSavedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_saved,\n\t{ id: string; name: string; type: \"repeatable\" | \"single\" }\n>;\n\ntype SliceCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.slice_created,\n\t{ id: string; name: string; library: string }\n>;\n\ntype ScreenshotTakenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.screenshotTaken,\n\t{\n\t\ttype: \"custom\" | \"automatic\";\n\t\tmethod: \"fromSimulator\" | \"upload\" | \"dragAndDrop\";\n\t}\n>;\n\ntype ChangesPushedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_pushed,\n\t{\n\t\tcustomTypesCreated: number;\n\t\tcustomTypesModified: number;\n\t\tcustomTypesDeleted: number;\n\t\tslicesCreated: number;\n\t\tslicesModified: number;\n\t\tslicesDeleted: number;\n\t\tmissingScreenshots: number;\n\t\ttotal: number;\n\t\tduration: number;\n\t\thasDeletedDocuments: boolean;\n\t}\n>;\n\ntype ChangesLimitReachSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_limitReach,\n\t{ limitType: LimitType }\n>;\n\ntype EditorWidgetUsedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.editor_widgetUsed,\n\t{ sliceId: string }\n>;\n\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| ReviewSegmentEvent\n\t| OnboardingStartSegmentEvent\n\t| OnboardingSkipSegmentEvent\n\t| OnboardingContinueScreenIntroSegmentEvent\n\t| OnboardingContinueScreen1SegmentEvent\n\t| OnboardingContinueScreen2SegmentEvent\n\t| OnboardingContinueScreen3SegmentEvent\n\t| SliceSimulatorSetupSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| CustomTypeCreatedSegmentEvent\n\t| CustomTypeFieldAddedSegmentEvent\n\t| CustomTypeSliceZoneUpdatedSegmentEvent\n\t| CustomTypeSavedSegmentEvent\n\t| SliceCreatedSegmentEvent\n\t| ScreenshotTakenSegmentEvent\n\t| ChangesPushedSegmentEvent\n\t| ChangesLimitReachSegmentEvent\n\t| EditorWidgetUsedSegmentEvent;\n"],"names":[],"mappings":"AAEO,MAAM,mBAAmB;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iCAAiC;AAAA,EACjC,6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,6BAA6B;AAAA,EAC7B,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,mBAAmB;;AAKb,MAAM,wBAAwB;AAAA,EACpC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,qBAAqB,GAAG;AAAA,EAC1C,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,MAAM,GAAG;AAAA,EAC3B,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,eAAe,GAAG;AAAA,EACpC,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,oBAAoB,GAAG;AAAA,EACzC,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,QAAQ,GAAG;AAAA,EAC7B,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,qBAAqB,GACtC;AAAA,EACD,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,aAAa,GAAG;AAAA,EAClC,CAAC,iBAAiB,eAAe,GAAG;AAAA,EACpC,CAAC,iBAAiB,cAAc,GAAG;AAAA,EACnC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,iBAAiB,GAAG;;"}
package/dist/types.d.ts CHANGED
@@ -26,7 +26,6 @@ export type SliceMachineConfigPluginRegistration<TSliceMachinePluginOptions exte
26
26
  * Slice Machine configuration from `slicemachine.config.js`.
27
27
  */
28
28
  export type SliceMachineConfig = {
29
- _latest: string;
30
29
  apiEndpoint?: string;
31
30
  repositoryName: string;
32
31
  localSliceSimulatorURL?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slicemachine/manager",
3
- "version": "0.1.1-dev-plugins-validation.1",
3
+ "version": "0.1.1-dev-plugins-m1-validation.0",
4
4
  "description": "Manage all aspects of a Slice Machine project.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,7 +50,7 @@
50
50
  "dev": "vite build --watch",
51
51
  "format": "prettier --write .",
52
52
  "lint": "eslint --ext .js,.ts .",
53
- "//prepare": "npm run build",
53
+ "prepublishOnly": "npm run build",
54
54
  "size": "size-limit",
55
55
  "test": "npm run lint && npm run types && npm run unit && npm run build && npm run size",
56
56
  "types": "tsc --noEmit",
@@ -63,7 +63,7 @@
63
63
  "@antfu/ni": "^0.20.0",
64
64
  "@prismicio/custom-types-client": "^1.0.2",
65
65
  "@prismicio/types-internal": "^1.5.3",
66
- "@slicemachine/plugin-kit": "0.1.8-dev-plugins-validation.1",
66
+ "@slicemachine/plugin-kit": "0.1.8-dev-plugins-m1-validation.0",
67
67
  "@wooorm/starry-night": "^1.6.0",
68
68
  "analytics-node": "^6.2.0",
69
69
  "cookie": "^0.5.0",
@@ -100,6 +100,7 @@
100
100
  "@typescript-eslint/parser": "^5.55.0",
101
101
  "@vitest/coverage-c8": "^0.27.3",
102
102
  "better-npm-audit": "^3.7.3",
103
+ "depcheck": "^1.4.3",
103
104
  "eslint": "^8.36.0",
104
105
  "eslint-config-prettier": "^8.7.0",
105
106
  "eslint-plugin-prettier": "^4.2.1",
@@ -135,5 +136,5 @@
135
136
  "publishConfig": {
136
137
  "access": "public"
137
138
  },
138
- "gitHead": "be509347c1cfaed23c9b9f714051a38436d4d9de"
139
+ "gitHead": "415983afa162095df70bf6da138658f206da8f2b"
139
140
  }
@@ -1,3 +1,4 @@
1
+ import { addTrailingSlash } from "../lib/addTrailingSlash";
1
2
  import { APPLICATION_MODE } from "./APPLICATION_MODE";
2
3
 
3
4
  export type APIEndpoints = {
@@ -12,11 +13,13 @@ export const API_ENDPOINTS: APIEndpoints = (() => {
12
13
  switch (process.env.SM_ENV) {
13
14
  case APPLICATION_MODE.Development: {
14
15
  const apiEndpoints = {
15
- PrismicWroom: process.env.wroom_endpoint,
16
- PrismicAuthentication: process.env.authentication_server_endpoint,
17
- PrismicModels: process.env.customtypesapi_endpoint,
18
- PrismicUser: process.env.user_service_endpoint,
19
- AwsAclProvider: process.env.acl_provider_endpoint,
16
+ PrismicWroom: addTrailingSlash(process.env.wroom_endpoint),
17
+ PrismicAuthentication: addTrailingSlash(
18
+ process.env.authentication_server_endpoint,
19
+ ),
20
+ PrismicModels: addTrailingSlash(process.env.customtypesapi_endpoint),
21
+ PrismicUser: addTrailingSlash(process.env.user_service_endpoint),
22
+ AwsAclProvider: addTrailingSlash(process.env.acl_provider_endpoint),
20
23
  };
21
24
 
22
25
  const missingAPIEndpoints = Object.keys(apiEndpoints).filter((key) => {
@@ -0,0 +1,5 @@
1
+ export const addTrailingSlash = (
2
+ url: string | undefined,
3
+ ): string | undefined => {
4
+ return url?.replace(/\/?$/, "/");
5
+ };
@@ -18,7 +18,6 @@ const SliceMachineConfigPluginRegistrationCodec = t.union([
18
18
 
19
19
  const SliceMachineConfigCodec = t.intersection([
20
20
  t.type({
21
- _latest: t.string,
22
21
  repositoryName: t.string,
23
22
  adapter: SliceMachineConfigPluginRegistrationCodec,
24
23
  }),
@@ -26,7 +26,6 @@ export const locateFileUpward = async (
26
26
 
27
27
  for (const filePath of filePaths) {
28
28
  const resolvedFilePath = path.resolve(startDir, filePath);
29
-
30
29
  try {
31
30
  await fs.access(resolvedFilePath);
32
31
 
@@ -44,8 +44,6 @@ type SliceMachineManagerGetStateReturnType = {
44
44
  repo: string;
45
45
  changelog?: PackageChangelog;
46
46
  packageManager: PackageManager;
47
- mockConfig: unknown; // TODO: Remove
48
- framework: unknown; // TODO: Remove
49
47
  };
50
48
  libraries: {
51
49
  name: string;
@@ -61,13 +59,11 @@ type SliceMachineManagerGetStateReturnType = {
61
59
  screenshots: Record<
62
60
  string,
63
61
  {
64
- path: string;
65
62
  hash: string;
66
63
  data: Buffer;
67
64
  }
68
65
  >;
69
66
  mock?: SharedSliceContent[];
70
- mockConfig: unknown; // TODO: Remove
71
67
  }[];
72
68
  meta: {
73
69
  name?: string;
@@ -216,7 +212,6 @@ export class SliceMachineManager {
216
212
 
217
213
  return {
218
214
  env: {
219
- framework: "",
220
215
  manifest: {
221
216
  apiEndpoint:
222
217
  sliceMachineConfig.apiEndpoint ||
@@ -225,7 +220,6 @@ export class SliceMachineManager {
225
220
  ),
226
221
  localSliceSimulatorURL: sliceMachineConfig.localSliceSimulatorURL,
227
222
  },
228
- mockConfig: {},
229
223
  packageManager,
230
224
  repo: sliceMachineConfig.repositoryName,
231
225
  intercomHash: profile?.intercomHash,
@@ -288,7 +282,6 @@ export class SliceMachineManager {
288
282
 
289
283
  if (screenshot.data) {
290
284
  screenshots[variation.id] = {
291
- path: "__stub__",
292
285
  hash: createContentDigest(screenshot.data),
293
286
  data: screenshot.data,
294
287
  };
@@ -305,7 +298,6 @@ export class SliceMachineManager {
305
298
  model,
306
299
  screenshots,
307
300
  mock: mocks,
308
- mockConfig: {}, // TODO: This property can probably be removed.
309
301
  });
310
302
  }
311
303
  }),
@@ -328,7 +320,15 @@ export class SliceMachineManager {
328
320
  );
329
321
  }
330
322
 
331
- return libraries;
323
+ // Preserve library order from config file
324
+ return libraries.sort((library1, library2) => {
325
+ const libraryIndex1 =
326
+ sliceMachineConfig.libraries?.indexOf(library1.name) || 0;
327
+ const libraryIndex2 =
328
+ sliceMachineConfig.libraries?.indexOf(library2.name) || 0;
329
+
330
+ return Math.sign(libraryIndex1 - libraryIndex2);
331
+ });
332
332
  }
333
333
 
334
334
  private async _getCustomTypes(): Promise<
@@ -273,10 +273,21 @@ export class PrismicRepositoryManager extends BaseManager {
273
273
  throw Error(`Could not find model ${change.id}`);
274
274
  }
275
275
 
276
+ const modelWithScreenshots =
277
+ await this.slices.updateSliceModelScreenshotsInPlace({
278
+ libraryID: change.libraryID,
279
+ model,
280
+ });
281
+
282
+ await this.slices.updateSlice({
283
+ libraryID: change.libraryID,
284
+ model: modelWithScreenshots,
285
+ });
286
+
276
287
  return {
277
288
  type: ChangeTypes.SLICE_INSERT,
278
289
  id: change.id,
279
- payload: model,
290
+ payload: modelWithScreenshots,
280
291
  };
281
292
  }
282
293
  case "MODIFIED": {
@@ -289,10 +300,21 @@ export class PrismicRepositoryManager extends BaseManager {
289
300
  throw Error(`Could not find model ${change.id}`);
290
301
  }
291
302
 
303
+ const modelWithScreenshots =
304
+ await this.slices.updateSliceModelScreenshotsInPlace({
305
+ libraryID: change.libraryID,
306
+ model,
307
+ });
308
+
309
+ await this.slices.updateSlice({
310
+ libraryID: change.libraryID,
311
+ model: modelWithScreenshots,
312
+ });
313
+
292
314
  return {
293
315
  type: ChangeTypes.SLICE_UPDATE,
294
316
  id: change.id,
295
- payload: model,
317
+ payload: modelWithScreenshots,
296
318
  };
297
319
  }
298
320
  case "DELETED":
@@ -147,7 +147,6 @@ export class ProjectManager extends BaseManager {
147
147
  async loadSliceMachineConfig(): Promise<SliceMachineConfig> {
148
148
  // TODO: Reload plugins with a fresh plugin runner. Plugins may
149
149
  // have been added or removed.
150
-
151
150
  const configFilePath = await this.getSliceMachineConfigPath();
152
151
 
153
152
  let rawConfig: unknown | undefined;
@@ -123,7 +123,17 @@ export class ScreenshotsManager extends BaseManager {
123
123
  Repository: sliceMachineConfig.repositoryName,
124
124
  },
125
125
  });
126
- const awsACLJSON = await awsACLRes.json();
126
+
127
+ const awsACLText = await awsACLRes.text();
128
+ let awsACLJSON: unknown;
129
+ try {
130
+ awsACLJSON = JSON.parse(awsACLText);
131
+ } catch (error) {
132
+ // Response is not JSON
133
+ throw new Error(
134
+ `Invalid AWS ACL response from ${awsACLURL}: ${awsACLText}`,
135
+ );
136
+ }
127
137
 
128
138
  const { value: awsACL, error } = decode(
129
139
  t.intersection([
@@ -30,6 +30,7 @@ import { API_ENDPOINTS } from "../../constants/API_ENDPOINTS";
30
30
  import { UnauthenticatedError, UnauthorizedError } from "../../errors";
31
31
 
32
32
  import { BaseManager } from "../BaseManager";
33
+ import { createContentDigest } from "../../lib/createContentDigest";
33
34
 
34
35
  type SlicesManagerReadSliceLibraryReturnType = {
35
36
  sliceIDs: string[];
@@ -348,7 +349,7 @@ export class SlicesManager extends BaseManager {
348
349
 
349
350
  if (model) {
350
351
  const modelWithScreenshots =
351
- await this._updateSliceModelScreenshotsInPlace({
352
+ await this.updateSliceModelScreenshotsInPlace({
352
353
  libraryID: args.libraryID,
353
354
  model,
354
355
  });
@@ -568,48 +569,52 @@ export class SlicesManager extends BaseManager {
568
569
  return await client.getAllSharedSlices();
569
570
  }
570
571
 
571
- private async _updateSliceModelScreenshotsInPlace(
572
+ async updateSliceModelScreenshotsInPlace(
572
573
  args: SlicesManagerUpsertHostedSliceScrenshotsArgs,
573
574
  ): Promise<CustomTypes.Widgets.Slices.SharedSlice> {
574
575
  const sliceMachineConfig = await this.project.getSliceMachineConfig();
575
576
 
576
577
  const variations = await Promise.all(
577
578
  args.model.variations.map(async (variation) => {
578
- const updatedVariation: CustomTypes.Widgets.Slices.Variation = {
579
- ...variation,
580
- imageUrl: DEFAULT_SLICE_SCREENSHOT_URL,
581
- };
582
-
583
579
  const screenshot = await this.readSliceScreenshot({
584
580
  libraryID: args.libraryID,
585
581
  sliceID: args.model.id,
586
582
  variationID: variation.id,
587
583
  });
588
584
 
589
- if (screenshot.data) {
590
- const keyPrefix = [
591
- sliceMachineConfig.repositoryName,
592
- "shared-slices",
593
- args.model.id,
594
- variation.id,
595
- ].join("/");
596
-
597
- // TODO: If the existing imageUrl
598
- // property (not the prefilled efault
599
- // URL) is identical to the new image
600
- // (we'll need to get the image's full
601
- // URL before we upload it), then don't
602
- // upload anything.
603
-
604
- const uploadedScreenshot = await this.screenshots.uploadScreenshot({
605
- data: screenshot.data,
606
- keyPrefix,
607
- });
608
-
609
- updatedVariation.imageUrl = uploadedScreenshot.url;
585
+ // If there's no screenshot, delete it by replacing it with the default screenshot
586
+ if (!screenshot.data) {
587
+ return {
588
+ ...variation,
589
+ imageUrl: DEFAULT_SLICE_SCREENSHOT_URL,
590
+ };
591
+ }
592
+
593
+ const hasScreenshotChanged = !variation.imageUrl?.includes(
594
+ createContentDigest(screenshot.data),
595
+ );
596
+
597
+ // If screenshot hasn't changed, do nothing
598
+ if (!hasScreenshotChanged) {
599
+ return variation;
610
600
  }
611
601
 
612
- return updatedVariation;
602
+ const keyPrefix = [
603
+ sliceMachineConfig.repositoryName,
604
+ "shared-slices",
605
+ args.model.id,
606
+ variation.id,
607
+ ].join("/");
608
+
609
+ const uploadedScreenshot = await this.screenshots.uploadScreenshot({
610
+ data: screenshot.data,
611
+ keyPrefix,
612
+ });
613
+
614
+ return {
615
+ ...variation,
616
+ imageUrl: uploadedScreenshot.url,
617
+ };
613
618
  }),
614
619
  );
615
620