@slicemachine/manager 0.2.0 → 0.2.2-dev-page-types.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 (87) hide show
  1. package/dist/_node_modules/common-tags/es/stripIndent/stripIndent.cjs +2 -1
  2. package/dist/_node_modules/common-tags/es/stripIndent/stripIndent.cjs.map +1 -1
  3. package/dist/_node_modules/common-tags/es/stripIndent/stripIndent.js +2 -1
  4. package/dist/_node_modules/common-tags/es/stripIndent/stripIndent.js.map +1 -1
  5. package/dist/auth/PrismicAuthManager.cjs +5 -4
  6. package/dist/auth/PrismicAuthManager.cjs.map +1 -1
  7. package/dist/auth/PrismicAuthManager.d.ts +58 -58
  8. package/dist/auth/PrismicAuthManager.js +5 -4
  9. package/dist/auth/PrismicAuthManager.js.map +1 -1
  10. package/dist/auth/createPrismicAuthManager.d.ts +4 -4
  11. package/dist/auth/createPrismicAuthManagerMiddleware.d.ts +14 -14
  12. package/dist/client/index.d.ts +6 -6
  13. package/dist/constants/API_ENDPOINTS.d.ts +8 -8
  14. package/dist/constants/API_TOKENS.d.ts +5 -5
  15. package/dist/constants/APPLICATION_MODE.d.ts +5 -5
  16. package/dist/constants/DEFAULT_SLICE_SCREENSHOT_URL.d.ts +5 -5
  17. package/dist/constants/SLICE_MACHINE_CONFIG_FILENAME.d.ts +1 -1
  18. package/dist/constants/SLICE_MACHINE_GITHUB_PACKAGE_NAME.d.ts +1 -1
  19. package/dist/constants/SLICE_MACHINE_GITHUB_REPOSITORY_NAME.d.ts +1 -1
  20. package/dist/constants/SLICE_MACHINE_GITHUB_REPOSITORY_ORGANIZATION.d.ts +1 -1
  21. package/dist/constants/SLICE_MACHINE_NPM_PACKAGE_NAME.d.ts +1 -1
  22. package/dist/constants/SLICE_MACHINE_USER_AGENT.d.ts +1 -1
  23. package/dist/constants/TS_CONFIG_FILENAME.d.ts +1 -1
  24. package/dist/constants/VERSION_KIND.d.ts +6 -6
  25. package/dist/errors.d.ts +34 -34
  26. package/dist/index.d.ts +11 -11
  27. package/dist/lib/DecodeError.d.ts +12 -12
  28. package/dist/lib/addTrailingSlash.d.ts +1 -1
  29. package/dist/lib/assertPluginsInitialized.d.ts +2 -2
  30. package/dist/lib/bufferCodec.d.ts +4 -4
  31. package/dist/lib/buildPrismicRepositoryAPIEndpoint.d.ts +4 -4
  32. package/dist/lib/castArray.d.ts +1 -1
  33. package/dist/lib/checkIsURLAccessible.d.ts +1 -1
  34. package/dist/lib/createContentDigest.d.ts +9 -9
  35. package/dist/lib/decode.d.ts +10 -10
  36. package/dist/lib/decodeHookResult.d.ts +10 -10
  37. package/dist/lib/decodePackageJSON.d.ts +12 -12
  38. package/dist/lib/decodeSliceMachineConfig.d.ts +3 -3
  39. package/dist/lib/fetchGitHubReleaseBodyForRelease.d.ts +21 -21
  40. package/dist/lib/fetchNPMPackageVersions.d.ts +5 -5
  41. package/dist/lib/format.d.ts +12 -12
  42. package/dist/lib/functionCodec.d.ts +2 -2
  43. package/dist/lib/installDependencies.d.ts +13 -13
  44. package/dist/lib/locateFileUpward.d.ts +10 -10
  45. package/dist/lib/markdownToHTML.d.ts +1 -1
  46. package/dist/lib/mockSlice.d.ts +9 -9
  47. package/dist/lib/prismicrc.d.ts +10 -10
  48. package/dist/lib/serializeCookies.d.ts +6 -6
  49. package/dist/managers/BaseManager.d.ts +33 -33
  50. package/dist/managers/SliceMachineManager.d.ts +95 -95
  51. package/dist/managers/createSliceMachineManager.d.ts +5 -5
  52. package/dist/managers/createSliceMachineManagerClient.d.ts +8 -8
  53. package/dist/managers/createSliceMachineManagerMiddleware.d.ts +15 -15
  54. package/dist/managers/customTypes/CustomTypesManager.d.ts +56 -56
  55. package/dist/managers/plugins/PluginsManager.d.ts +13 -13
  56. package/dist/managers/prismicRepository/PrismicRepositoryManager.cjs +5 -12
  57. package/dist/managers/prismicRepository/PrismicRepositoryManager.cjs.map +1 -1
  58. package/dist/managers/prismicRepository/PrismicRepositoryManager.d.ts +30 -30
  59. package/dist/managers/prismicRepository/PrismicRepositoryManager.js +5 -12
  60. package/dist/managers/prismicRepository/PrismicRepositoryManager.js.map +1 -1
  61. package/dist/managers/prismicRepository/types.d.ts +123 -123
  62. package/dist/managers/project/ProjectManager.d.ts +49 -49
  63. package/dist/managers/screenshots/ScreenshotsManager.cjs +6 -5
  64. package/dist/managers/screenshots/ScreenshotsManager.cjs.map +1 -1
  65. package/dist/managers/screenshots/ScreenshotsManager.d.ts +34 -34
  66. package/dist/managers/screenshots/ScreenshotsManager.js +6 -5
  67. package/dist/managers/screenshots/ScreenshotsManager.js.map +1 -1
  68. package/dist/managers/simulator/SimulatorManager.d.ts +38 -38
  69. package/dist/managers/slices/SlicesManager.cjs +1 -5
  70. package/dist/managers/slices/SlicesManager.cjs.map +1 -1
  71. package/dist/managers/slices/SlicesManager.d.ts +128 -128
  72. package/dist/managers/slices/SlicesManager.js +1 -5
  73. package/dist/managers/slices/SlicesManager.js.map +1 -1
  74. package/dist/managers/snippets/SnippetsManager.d.ts +11 -11
  75. package/dist/managers/telemetry/TelemetryManager.d.ts +30 -30
  76. package/dist/managers/telemetry/types.d.ts +143 -143
  77. package/dist/managers/user/UserManager.d.ts +40 -40
  78. package/dist/managers/versions/VersionsManager.d.ts +19 -19
  79. package/dist/managers/versions/types.d.ts +5 -5
  80. package/dist/test/createSliceMachineManagerMSWHandler.d.ts +7 -7
  81. package/dist/test/index.d.ts +2 -2
  82. package/dist/types.d.ts +45 -45
  83. package/package.json +3 -3
  84. package/src/auth/PrismicAuthManager.ts +5 -9
  85. package/src/managers/prismicRepository/PrismicRepositoryManager.ts +5 -12
  86. package/src/managers/screenshots/ScreenshotsManager.ts +12 -5
  87. package/src/managers/slices/SlicesManager.ts +1 -6
@@ -1,143 +1,143 @@
1
- import type { LimitType } from "../prismicRepository/types";
2
- export declare const SegmentEventType: {
3
- readonly command_init_start: "command:init:start";
4
- readonly command_init_identify: "command:init:identify";
5
- readonly command_init_end: "command:init:end";
6
- readonly review: "review";
7
- readonly onboarding_start: "onboarding:start";
8
- readonly onboarding_skip: "onboarding:skip";
9
- readonly onboarding_continue_screenIntro: "onboarding:continue:screen-intro";
10
- readonly onboarding_continue_screen1: "onboarding:continue:screen-1";
11
- readonly onboarding_continue_screen2: "onboarding:continue:screen-2";
12
- readonly onboarding_continue_screen3: "onboarding:continue:screen-3";
13
- readonly sliceSimulator_setup: "slice-simulator:setup";
14
- readonly sliceSimulator_open: "slice-simulator:open";
15
- readonly sliceSimulator_isNotRunning: "slice-simulator:is-not-running";
16
- readonly pageView: "page-view";
17
- readonly openVideoTutorials: "open-video-tutorials";
18
- readonly customType_created: "custom-type:created";
19
- readonly customType_fieldAdded: "custom-type:field-added";
20
- readonly customType_sliceZoneUpdated: "custom-type:slice-zone-updated";
21
- readonly customType_saved: "custom-type:saved";
22
- readonly slice_created: "slice:created";
23
- readonly screenshotTaken: "screenshot-taken";
24
- readonly changes_pushed: "changes:pushed";
25
- readonly changes_limitReach: "changes:limit-reach";
26
- readonly editor_widgetUsed: "editor:widget-used";
27
- };
28
- type SegmentEventTypes = (typeof SegmentEventType)[keyof typeof SegmentEventType];
29
- export declare const HumanSegmentEventType: {
30
- readonly "command:init:start": "SliceMachine Init Start";
31
- readonly "command:init:identify": "SliceMachine Init Identify";
32
- readonly "command:init:end": "SliceMachine Init End";
33
- readonly review: "SliceMachine Review";
34
- readonly "onboarding:start": "SliceMachine Onboarding Start";
35
- readonly "onboarding:skip": "SliceMachine Onboarding Skip";
36
- readonly "onboarding:continue:screen-intro": "SliceMachine Onboarding Continue Screen Intro";
37
- readonly "onboarding:continue:screen-1": "SliceMachine Onboarding Continue Screen 1";
38
- readonly "onboarding:continue:screen-2": "SliceMachine Onboarding Continue Screen 2";
39
- readonly "onboarding:continue:screen-3": "SliceMachine Onboarding Continue Screen 3";
40
- readonly "slice-simulator:setup": "SliceMachine Slice Simulator Setup";
41
- readonly "slice-simulator:open": "SliceMachine Slice Simulator Open";
42
- readonly "slice-simulator:is-not-running": "SliceMachine Slice Simulator is not running";
43
- readonly "page-view": "SliceMachine Page View";
44
- readonly "open-video-tutorials": "SliceMachine Open Video Tutorials";
45
- readonly "custom-type:created": "SliceMachine Custom Type Created";
46
- readonly "custom-type:field-added": "SliceMachine Custom Type Field Added";
47
- readonly "custom-type:slice-zone-updated": "SliceMachine Slicezone Updated";
48
- readonly "custom-type:saved": "SliceMachine Custom Type Saved";
49
- readonly "slice:created": "SliceMachine Slice Created";
50
- readonly "screenshot-taken": "SliceMachine Screenshot Taken";
51
- readonly "changes:pushed": "SliceMachine Changes Pushed";
52
- readonly "changes:limit-reach": "SliceMachine Changes Limit Reach";
53
- readonly "editor:widget-used": "SliceMachine Editor Widget Used";
54
- };
55
- export type HumanSegmentEventTypes = (typeof HumanSegmentEventType)[keyof typeof HumanSegmentEventType];
56
- type SegmentEvent<TType extends SegmentEventTypes, TProperties extends Record<string, unknown> | void = void> = TProperties extends void ? {
57
- event: TType;
58
- repository?: string;
59
- } : {
60
- event: TType;
61
- repository?: string;
62
- } & TProperties;
63
- type CommandInitStartSegmentEvent = SegmentEvent<typeof SegmentEventType.command_init_start>;
64
- type CommandInitIdentifySegmentEvent = SegmentEvent<typeof SegmentEventType.command_init_identify>;
65
- type CommandInitEndSegmentEvent = SegmentEvent<typeof SegmentEventType.command_init_end, {
66
- framework: string;
67
- success: boolean;
68
- error?: string;
69
- }>;
70
- type ReviewSegmentEvent = SegmentEvent<typeof SegmentEventType.review, {
71
- rating: number;
72
- comment: string;
73
- }>;
74
- type OnboardingStartSegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_start>;
75
- type OnboardingSkipSegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_skip, {
76
- screenSkipped: number;
77
- }>;
78
- type OnboardingContinueScreenIntroSegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_continue_screenIntro>;
79
- type OnboardingContinueScreen1SegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_continue_screen1>;
80
- type OnboardingContinueScreen2SegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_continue_screen2>;
81
- type OnboardingContinueScreen3SegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_continue_screen3>;
82
- type SliceSimulatorSetupSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_setup>;
83
- type SliceSimulatorOpenSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_open>;
84
- type SliceSimulatorIsNotRunningSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_isNotRunning>;
85
- type PageViewSegmentEvent = SegmentEvent<typeof SegmentEventType.pageView, {
86
- url: string;
87
- path: string;
88
- search: string;
89
- title: string;
90
- referrer: string;
91
- adapter: string;
92
- }>;
93
- type OpenVideoTutorialsSegmentEvent = SegmentEvent<typeof SegmentEventType.openVideoTutorials, {
94
- video: string;
95
- }>;
96
- type CustomTypeCreatedSegmentEvent = SegmentEvent<typeof SegmentEventType.customType_created, {
97
- id: string;
98
- name: string;
99
- type: "repeatable" | "single";
100
- }>;
101
- type CustomTypeFieldAddedSegmentEvent = SegmentEvent<typeof SegmentEventType.customType_fieldAdded, {
102
- id: string;
103
- name: string;
104
- zone: "static" | "repeatable";
105
- type: string;
106
- }>;
107
- type CustomTypeSliceZoneUpdatedSegmentEvent = SegmentEvent<typeof SegmentEventType.customType_sliceZoneUpdated, {
108
- customTypeId: string;
109
- }>;
110
- type CustomTypeSavedSegmentEvent = SegmentEvent<typeof SegmentEventType.customType_saved, {
111
- id: string;
112
- name: string;
113
- type: "repeatable" | "single";
114
- }>;
115
- type SliceCreatedSegmentEvent = SegmentEvent<typeof SegmentEventType.slice_created, {
116
- id: string;
117
- name: string;
118
- library: string;
119
- }>;
120
- type ScreenshotTakenSegmentEvent = SegmentEvent<typeof SegmentEventType.screenshotTaken, {
121
- type: "custom" | "automatic";
122
- method: "fromSimulator" | "upload" | "dragAndDrop";
123
- }>;
124
- type ChangesPushedSegmentEvent = SegmentEvent<typeof SegmentEventType.changes_pushed, {
125
- customTypesCreated: number;
126
- customTypesModified: number;
127
- customTypesDeleted: number;
128
- slicesCreated: number;
129
- slicesModified: number;
130
- slicesDeleted: number;
131
- missingScreenshots: number;
132
- total: number;
133
- duration: number;
134
- hasDeletedDocuments: boolean;
135
- }>;
136
- type ChangesLimitReachSegmentEvent = SegmentEvent<typeof SegmentEventType.changes_limitReach, {
137
- limitType: LimitType;
138
- }>;
139
- type EditorWidgetUsedSegmentEvent = SegmentEvent<typeof SegmentEventType.editor_widgetUsed, {
140
- sliceId: string;
141
- }>;
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;
143
- export {};
1
+ import type { LimitType } from "../prismicRepository/types";
2
+ export declare const SegmentEventType: {
3
+ readonly command_init_start: "command:init:start";
4
+ readonly command_init_identify: "command:init:identify";
5
+ readonly command_init_end: "command:init:end";
6
+ readonly review: "review";
7
+ readonly onboarding_start: "onboarding:start";
8
+ readonly onboarding_skip: "onboarding:skip";
9
+ readonly onboarding_continue_screenIntro: "onboarding:continue:screen-intro";
10
+ readonly onboarding_continue_screen1: "onboarding:continue:screen-1";
11
+ readonly onboarding_continue_screen2: "onboarding:continue:screen-2";
12
+ readonly onboarding_continue_screen3: "onboarding:continue:screen-3";
13
+ readonly sliceSimulator_setup: "slice-simulator:setup";
14
+ readonly sliceSimulator_open: "slice-simulator:open";
15
+ readonly sliceSimulator_isNotRunning: "slice-simulator:is-not-running";
16
+ readonly pageView: "page-view";
17
+ readonly openVideoTutorials: "open-video-tutorials";
18
+ readonly customType_created: "custom-type:created";
19
+ readonly customType_fieldAdded: "custom-type:field-added";
20
+ readonly customType_sliceZoneUpdated: "custom-type:slice-zone-updated";
21
+ readonly customType_saved: "custom-type:saved";
22
+ readonly slice_created: "slice:created";
23
+ readonly screenshotTaken: "screenshot-taken";
24
+ readonly changes_pushed: "changes:pushed";
25
+ readonly changes_limitReach: "changes:limit-reach";
26
+ readonly editor_widgetUsed: "editor:widget-used";
27
+ };
28
+ type SegmentEventTypes = (typeof SegmentEventType)[keyof typeof SegmentEventType];
29
+ export declare const HumanSegmentEventType: {
30
+ readonly "command:init:start": "SliceMachine Init Start";
31
+ readonly "command:init:identify": "SliceMachine Init Identify";
32
+ readonly "command:init:end": "SliceMachine Init End";
33
+ readonly review: "SliceMachine Review";
34
+ readonly "onboarding:start": "SliceMachine Onboarding Start";
35
+ readonly "onboarding:skip": "SliceMachine Onboarding Skip";
36
+ readonly "onboarding:continue:screen-intro": "SliceMachine Onboarding Continue Screen Intro";
37
+ readonly "onboarding:continue:screen-1": "SliceMachine Onboarding Continue Screen 1";
38
+ readonly "onboarding:continue:screen-2": "SliceMachine Onboarding Continue Screen 2";
39
+ readonly "onboarding:continue:screen-3": "SliceMachine Onboarding Continue Screen 3";
40
+ readonly "slice-simulator:setup": "SliceMachine Slice Simulator Setup";
41
+ readonly "slice-simulator:open": "SliceMachine Slice Simulator Open";
42
+ readonly "slice-simulator:is-not-running": "SliceMachine Slice Simulator is not running";
43
+ readonly "page-view": "SliceMachine Page View";
44
+ readonly "open-video-tutorials": "SliceMachine Open Video Tutorials";
45
+ readonly "custom-type:created": "SliceMachine Custom Type Created";
46
+ readonly "custom-type:field-added": "SliceMachine Custom Type Field Added";
47
+ readonly "custom-type:slice-zone-updated": "SliceMachine Slicezone Updated";
48
+ readonly "custom-type:saved": "SliceMachine Custom Type Saved";
49
+ readonly "slice:created": "SliceMachine Slice Created";
50
+ readonly "screenshot-taken": "SliceMachine Screenshot Taken";
51
+ readonly "changes:pushed": "SliceMachine Changes Pushed";
52
+ readonly "changes:limit-reach": "SliceMachine Changes Limit Reach";
53
+ readonly "editor:widget-used": "SliceMachine Editor Widget Used";
54
+ };
55
+ export type HumanSegmentEventTypes = (typeof HumanSegmentEventType)[keyof typeof HumanSegmentEventType];
56
+ type SegmentEvent<TType extends SegmentEventTypes, TProperties extends Record<string, unknown> | void = void> = TProperties extends void ? {
57
+ event: TType;
58
+ repository?: string;
59
+ } : {
60
+ event: TType;
61
+ repository?: string;
62
+ } & TProperties;
63
+ type CommandInitStartSegmentEvent = SegmentEvent<typeof SegmentEventType.command_init_start>;
64
+ type CommandInitIdentifySegmentEvent = SegmentEvent<typeof SegmentEventType.command_init_identify>;
65
+ type CommandInitEndSegmentEvent = SegmentEvent<typeof SegmentEventType.command_init_end, {
66
+ framework: string;
67
+ success: boolean;
68
+ error?: string;
69
+ }>;
70
+ type ReviewSegmentEvent = SegmentEvent<typeof SegmentEventType.review, {
71
+ rating: number;
72
+ comment: string;
73
+ }>;
74
+ type OnboardingStartSegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_start>;
75
+ type OnboardingSkipSegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_skip, {
76
+ screenSkipped: number;
77
+ }>;
78
+ type OnboardingContinueScreenIntroSegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_continue_screenIntro>;
79
+ type OnboardingContinueScreen1SegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_continue_screen1>;
80
+ type OnboardingContinueScreen2SegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_continue_screen2>;
81
+ type OnboardingContinueScreen3SegmentEvent = SegmentEvent<typeof SegmentEventType.onboarding_continue_screen3>;
82
+ type SliceSimulatorSetupSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_setup>;
83
+ type SliceSimulatorOpenSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_open>;
84
+ type SliceSimulatorIsNotRunningSegmentEvent = SegmentEvent<typeof SegmentEventType.sliceSimulator_isNotRunning>;
85
+ type PageViewSegmentEvent = SegmentEvent<typeof SegmentEventType.pageView, {
86
+ url: string;
87
+ path: string;
88
+ search: string;
89
+ title: string;
90
+ referrer: string;
91
+ adapter: string;
92
+ }>;
93
+ type OpenVideoTutorialsSegmentEvent = SegmentEvent<typeof SegmentEventType.openVideoTutorials, {
94
+ video: string;
95
+ }>;
96
+ type CustomTypeCreatedSegmentEvent = SegmentEvent<typeof SegmentEventType.customType_created, {
97
+ id: string;
98
+ name: string;
99
+ type: "repeatable" | "single";
100
+ }>;
101
+ type CustomTypeFieldAddedSegmentEvent = SegmentEvent<typeof SegmentEventType.customType_fieldAdded, {
102
+ id: string;
103
+ name: string;
104
+ zone: "static" | "repeatable";
105
+ type: string;
106
+ }>;
107
+ type CustomTypeSliceZoneUpdatedSegmentEvent = SegmentEvent<typeof SegmentEventType.customType_sliceZoneUpdated, {
108
+ customTypeId: string;
109
+ }>;
110
+ type CustomTypeSavedSegmentEvent = SegmentEvent<typeof SegmentEventType.customType_saved, {
111
+ id: string;
112
+ name: string;
113
+ type: "repeatable" | "single";
114
+ }>;
115
+ type SliceCreatedSegmentEvent = SegmentEvent<typeof SegmentEventType.slice_created, {
116
+ id: string;
117
+ name: string;
118
+ library: string;
119
+ }>;
120
+ type ScreenshotTakenSegmentEvent = SegmentEvent<typeof SegmentEventType.screenshotTaken, {
121
+ type: "custom" | "automatic";
122
+ method: "fromSimulator" | "upload" | "dragAndDrop";
123
+ }>;
124
+ type ChangesPushedSegmentEvent = SegmentEvent<typeof SegmentEventType.changes_pushed, {
125
+ customTypesCreated: number;
126
+ customTypesModified: number;
127
+ customTypesDeleted: number;
128
+ slicesCreated: number;
129
+ slicesModified: number;
130
+ slicesDeleted: number;
131
+ missingScreenshots: number;
132
+ total: number;
133
+ duration: number;
134
+ hasDeletedDocuments: boolean;
135
+ }>;
136
+ type ChangesLimitReachSegmentEvent = SegmentEvent<typeof SegmentEventType.changes_limitReach, {
137
+ limitType: LimitType;
138
+ }>;
139
+ type EditorWidgetUsedSegmentEvent = SegmentEvent<typeof SegmentEventType.editor_widgetUsed, {
140
+ sliceId: string;
141
+ }>;
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;
143
+ export {};
@@ -1,40 +1,40 @@
1
- import { BaseManager } from "../BaseManager";
2
- import { SliceMachineManager } from "../SliceMachineManager";
3
- export declare class UserManager extends BaseManager {
4
- constructor(sliceMachineManager: SliceMachineManager);
5
- login: (args: {
6
- email: string;
7
- cookies: string[];
8
- }) => Promise<void>;
9
- getLoginSessionInfo: () => Promise<{
10
- port: number;
11
- url: string;
12
- }>;
13
- nodeLoginSession: (args: {
14
- port: number;
15
- onListenCallback?: (() => void) | undefined;
16
- }) => Promise<void>;
17
- logout: () => Promise<void>;
18
- checkIsLoggedIn: () => Promise<boolean>;
19
- refreshAuthenticationToken: () => Promise<void>;
20
- getAuthenticationToken: () => Promise<string>;
21
- getAuthenticationCookies: () => Promise<{
22
- "prismic-auth"?: string | undefined;
23
- SESSION?: string | undefined;
24
- } & {
25
- [x: string]: string;
26
- } & Required<Pick<{
27
- "prismic-auth"?: string | undefined;
28
- SESSION?: string | undefined;
29
- } & {
30
- [x: string]: string;
31
- }, "prismic-auth" | "SESSION">>>;
32
- getProfile: () => Promise<{
33
- userId: string;
34
- shortId: string;
35
- intercomHash: string;
36
- email: string;
37
- firstName: string;
38
- lastName: string;
39
- }>;
40
- }
1
+ import { BaseManager } from "../BaseManager";
2
+ import { SliceMachineManager } from "../SliceMachineManager";
3
+ export declare class UserManager extends BaseManager {
4
+ constructor(sliceMachineManager: SliceMachineManager);
5
+ login: (args: {
6
+ email: string;
7
+ cookies: string[];
8
+ }) => Promise<void>;
9
+ getLoginSessionInfo: () => Promise<{
10
+ port: number;
11
+ url: string;
12
+ }>;
13
+ nodeLoginSession: (args: {
14
+ port: number;
15
+ onListenCallback?: (() => void) | undefined;
16
+ }) => Promise<void>;
17
+ logout: () => Promise<void>;
18
+ checkIsLoggedIn: () => Promise<boolean>;
19
+ refreshAuthenticationToken: () => Promise<void>;
20
+ getAuthenticationToken: () => Promise<string>;
21
+ getAuthenticationCookies: () => Promise<{
22
+ "prismic-auth"?: string | undefined;
23
+ SESSION?: string | undefined;
24
+ } & {
25
+ [x: string]: string;
26
+ } & Required<Pick<{
27
+ "prismic-auth"?: string | undefined;
28
+ SESSION?: string | undefined;
29
+ } & {
30
+ [x: string]: string;
31
+ }, "prismic-auth" | "SESSION">>>;
32
+ getProfile: () => Promise<{
33
+ userId: string;
34
+ shortId: string;
35
+ intercomHash: string;
36
+ email: string;
37
+ firstName: string;
38
+ lastName: string;
39
+ }>;
40
+ }
@@ -1,19 +1,19 @@
1
- import { GitHubReleaseMetadata } from "../../lib/fetchGitHubReleaseBodyForRelease";
2
- import { BaseManager } from "../BaseManager";
3
- import { Version } from "./types";
4
- type SliceMachineManagerGetReleaseNotesForVersionArgs = {
5
- version: string;
6
- };
7
- export declare class VersionsManager extends BaseManager {
8
- /**
9
- * Record of version numbers mapped to their GitHub release metadata.
10
- */
11
- gitHubSliceMachineReleaseMetadataCache: Record<string, GitHubReleaseMetadata | undefined>;
12
- getRunningSliceMachineVersion(): Promise<string>;
13
- getAllStableSliceMachineVersions(): Promise<string[]>;
14
- getAllStableSliceMachineVersionsWithKind(): Promise<Version[]>;
15
- getLatestNonBreakingSliceMachineVersion(): Promise<string | undefined>;
16
- checkIsUpdateAvailable(): Promise<boolean>;
17
- getSliceMachineReleaseNotesForVersion(args: SliceMachineManagerGetReleaseNotesForVersionArgs): Promise<string | undefined>;
18
- }
19
- export {};
1
+ import { GitHubReleaseMetadata } from "../../lib/fetchGitHubReleaseBodyForRelease";
2
+ import { BaseManager } from "../BaseManager";
3
+ import { Version } from "./types";
4
+ type SliceMachineManagerGetReleaseNotesForVersionArgs = {
5
+ version: string;
6
+ };
7
+ export declare class VersionsManager extends BaseManager {
8
+ /**
9
+ * Record of version numbers mapped to their GitHub release metadata.
10
+ */
11
+ gitHubSliceMachineReleaseMetadataCache: Record<string, GitHubReleaseMetadata | undefined>;
12
+ getRunningSliceMachineVersion(): Promise<string>;
13
+ getAllStableSliceMachineVersions(): Promise<string[]>;
14
+ getAllStableSliceMachineVersionsWithKind(): Promise<Version[]>;
15
+ getLatestNonBreakingSliceMachineVersion(): Promise<string | undefined>;
16
+ checkIsUpdateAvailable(): Promise<boolean>;
17
+ getSliceMachineReleaseNotesForVersion(args: SliceMachineManagerGetReleaseNotesForVersionArgs): Promise<string | undefined>;
18
+ }
19
+ export {};
@@ -1,5 +1,5 @@
1
- import { VERSION_KIND } from "../../constants/VERSION_KIND";
2
- export type Version = {
3
- version: string;
4
- kind: (typeof VERSION_KIND)[keyof typeof VERSION_KIND] | undefined;
5
- };
1
+ import { VERSION_KIND } from "../../constants/VERSION_KIND";
2
+ export type Version = {
3
+ version: string;
4
+ kind: (typeof VERSION_KIND)[keyof typeof VERSION_KIND] | undefined;
5
+ };
@@ -1,7 +1,7 @@
1
- import { DefaultBodyType, MockedRequest, RestHandler } from "msw";
2
- import { SliceMachineManager } from "../managers/SliceMachineManager";
3
- export type CreateSliceMachineManagerMSWHandlerArgs = {
4
- sliceMachineManager: SliceMachineManager;
5
- url: string;
6
- };
7
- export declare const createSliceMachineManagerMSWHandler: (args: CreateSliceMachineManagerMSWHandlerArgs) => RestHandler<MockedRequest<DefaultBodyType>>;
1
+ import { DefaultBodyType, MockedRequest, RestHandler } from "msw";
2
+ import { SliceMachineManager } from "../managers/SliceMachineManager";
3
+ export type CreateSliceMachineManagerMSWHandlerArgs = {
4
+ sliceMachineManager: SliceMachineManager;
5
+ url: string;
6
+ };
7
+ export declare const createSliceMachineManagerMSWHandler: (args: CreateSliceMachineManagerMSWHandlerArgs) => RestHandler<MockedRequest<DefaultBodyType>>;
@@ -1,2 +1,2 @@
1
- export { createSliceMachineManagerMSWHandler } from "./createSliceMachineManagerMSWHandler";
2
- export type { CreateSliceMachineManagerMSWHandlerArgs } from "./createSliceMachineManagerMSWHandler";
1
+ export { createSliceMachineManagerMSWHandler } from "./createSliceMachineManagerMSWHandler";
2
+ export type { CreateSliceMachineManagerMSWHandlerArgs } from "./createSliceMachineManagerMSWHandler";
package/dist/types.d.ts CHANGED
@@ -1,45 +1,45 @@
1
- import { HookError, SliceMachinePluginOptions } from "@slicemachine/plugin-kit";
2
- import { detect as niDetect } from "@antfu/ni";
3
- import { VERSION_KIND } from "./constants/VERSION_KIND";
4
- export type PackageManager = NonNullable<Awaited<ReturnType<typeof niDetect>>>;
5
- export type PackageChangelog = {
6
- currentVersion: string;
7
- updateAvailable: boolean;
8
- latestNonBreakingVersion: string | null;
9
- versions: PackageVersion[];
10
- };
11
- export type PackageVersion = {
12
- versionNumber: string;
13
- releaseNote: string | null;
14
- kind: (typeof VERSION_KIND)[keyof typeof VERSION_KIND] | undefined;
15
- };
16
- /**
17
- * A string, object, or instance representing a registered plugin.
18
- *
19
- * @typeParam TSliceMachinePluginOptions - User-provided options for the plugin.
20
- */
21
- export type SliceMachineConfigPluginRegistration<TSliceMachinePluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions> = string | {
22
- resolve: string;
23
- options?: TSliceMachinePluginOptions;
24
- };
25
- /**
26
- * Slice Machine configuration from `slicemachine.config.js`.
27
- */
28
- export type SliceMachineConfig = {
29
- apiEndpoint?: string;
30
- repositoryName: string;
31
- localSliceSimulatorURL?: string;
32
- libraries?: string[];
33
- adapter: SliceMachineConfigPluginRegistration;
34
- plugins?: SliceMachineConfigPluginRegistration[];
35
- };
36
- export type OnlyHookErrors<THookResult extends {
37
- errors: HookError[];
38
- } | Promise<{
39
- errors: HookError[];
40
- }>> = Pick<Awaited<THookResult>, "errors">;
41
- export type S3ACL = {
42
- uploadEndpoint: string;
43
- requiredFormDataFields: Record<string, string>;
44
- imgixEndpoint: string;
45
- };
1
+ import { HookError, SliceMachinePluginOptions } from "@slicemachine/plugin-kit";
2
+ import { detect as niDetect } from "@antfu/ni";
3
+ import { VERSION_KIND } from "./constants/VERSION_KIND";
4
+ export type PackageManager = NonNullable<Awaited<ReturnType<typeof niDetect>>>;
5
+ export type PackageChangelog = {
6
+ currentVersion: string;
7
+ updateAvailable: boolean;
8
+ latestNonBreakingVersion: string | null;
9
+ versions: PackageVersion[];
10
+ };
11
+ export type PackageVersion = {
12
+ versionNumber: string;
13
+ releaseNote: string | null;
14
+ kind: (typeof VERSION_KIND)[keyof typeof VERSION_KIND] | undefined;
15
+ };
16
+ /**
17
+ * A string, object, or instance representing a registered plugin.
18
+ *
19
+ * @typeParam TSliceMachinePluginOptions - User-provided options for the plugin.
20
+ */
21
+ export type SliceMachineConfigPluginRegistration<TSliceMachinePluginOptions extends SliceMachinePluginOptions = SliceMachinePluginOptions> = string | {
22
+ resolve: string;
23
+ options?: TSliceMachinePluginOptions;
24
+ };
25
+ /**
26
+ * Slice Machine configuration from `slicemachine.config.js`.
27
+ */
28
+ export type SliceMachineConfig = {
29
+ apiEndpoint?: string;
30
+ repositoryName: string;
31
+ localSliceSimulatorURL?: string;
32
+ libraries?: string[];
33
+ adapter: SliceMachineConfigPluginRegistration;
34
+ plugins?: SliceMachineConfigPluginRegistration[];
35
+ };
36
+ export type OnlyHookErrors<THookResult extends {
37
+ errors: HookError[];
38
+ } | Promise<{
39
+ errors: HookError[];
40
+ }>> = Pick<Awaited<THookResult>, "errors">;
41
+ export type S3ACL = {
42
+ uploadEndpoint: string;
43
+ requiredFormDataFields: Record<string, string>;
44
+ imgixEndpoint: string;
45
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slicemachine/manager",
3
- "version": "0.2.0",
3
+ "version": "0.2.2-dev-page-types.0",
4
4
  "description": "Manage all aspects of a Slice Machine project.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -65,7 +65,7 @@
65
65
  "@prismicio/custom-types-client": "^1.1.0",
66
66
  "@prismicio/mocks": "2.0.0-alpha.2",
67
67
  "@prismicio/types-internal": "2.0.0-alpha.9",
68
- "@slicemachine/plugin-kit": "0.2.0",
68
+ "@slicemachine/plugin-kit": "0.2.1-dev-page-types.0",
69
69
  "@wooorm/starry-night": "^1.6.0",
70
70
  "analytics-node": "^6.2.0",
71
71
  "cookie": "^0.5.0",
@@ -138,5 +138,5 @@
138
138
  "publishConfig": {
139
139
  "access": "public"
140
140
  },
141
- "gitHead": "94819b03033580880acc7a3475a3dc9b4d466a0c"
141
+ "gitHead": "0d651d6e309c69211c2f0bcca1d74372eb2d275a"
142
142
  }
@@ -343,30 +343,26 @@ export class PrismicAuthManager {
343
343
  const authStateFilePath = this._getPersistedAuthStateFilePath();
344
344
 
345
345
  let authStateFileContents: string = JSON.stringify({});
346
+ let rawAuthState: Record<string, unknown> = {};
346
347
 
347
348
  try {
348
349
  authStateFileContents = await fs.readFile(authStateFilePath, "utf8");
350
+ rawAuthState = JSON.parse(authStateFileContents);
349
351
  } catch {
350
352
  // Write a default persisted state if it doesn't already exist.
351
353
 
352
- const defaultStateFileContents = {
354
+ rawAuthState = {
353
355
  ...DEFAULT_PERSISTED_AUTH_STATE,
354
356
  cookies: serializeCookies(DEFAULT_PERSISTED_AUTH_STATE.cookies),
355
357
  };
356
- authStateFileContents = JSON.stringify(
357
- defaultStateFileContents,
358
- null,
359
- "\t",
360
- );
358
+ authStateFileContents = JSON.stringify(rawAuthState, null, "\t");
361
359
 
362
360
  await fs.mkdir(path.dirname(authStateFilePath), { recursive: true });
363
361
  await fs.writeFile(authStateFilePath, authStateFileContents);
364
362
  }
365
363
 
366
- const rawAuthState = JSON.parse(authStateFileContents);
367
-
368
364
  // Decode cookies into a record for convenience.
369
- if ("cookies" in rawAuthState) {
365
+ if (typeof rawAuthState.cookies === "string") {
370
366
  rawAuthState.cookies = parseCookies(rawAuthState.cookies);
371
367
  }
372
368
 
@@ -259,6 +259,9 @@ export class PrismicRepositoryManager extends BaseManager {
259
259
  }
260
260
 
261
261
  try {
262
+ // Update the AWS ACL before uploading screenshots as it might have expired
263
+ await this.screenshots.initS3ACL();
264
+
262
265
  const allChanges: AllChangeTypes[] = await Promise.all(
263
266
  args.changes.map(async (change) => {
264
267
  if (change.type === "Slice") {
@@ -279,15 +282,10 @@ export class PrismicRepositoryManager extends BaseManager {
279
282
  model,
280
283
  });
281
284
 
282
- await this.slices.updateSlice({
283
- libraryID: change.libraryID,
284
- model: modelWithScreenshots,
285
- });
286
-
287
285
  return {
288
- type: ChangeTypes.SLICE_INSERT,
289
286
  id: change.id,
290
287
  payload: modelWithScreenshots,
288
+ type: ChangeTypes.SLICE_INSERT,
291
289
  };
292
290
  }
293
291
  case "MODIFIED": {
@@ -306,15 +304,10 @@ export class PrismicRepositoryManager extends BaseManager {
306
304
  model,
307
305
  });
308
306
 
309
- await this.slices.updateSlice({
310
- libraryID: change.libraryID,
311
- model: modelWithScreenshots,
312
- });
313
-
314
307
  return {
315
- type: ChangeTypes.SLICE_UPDATE,
316
308
  id: change.id,
317
309
  payload: modelWithScreenshots,
310
+ type: ChangeTypes.SLICE_UPDATE,
318
311
  };
319
312
  }
320
313
  case "DELETED":