@slicemachine/manager 0.25.2-beta.9 → 0.25.3-alpha.dani-mcp.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.cjs +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.js +1 -1
- package/dist/_node_modules/cross-spawn/index.cjs +1 -1
- package/dist/_node_modules/cross-spawn/index.js +1 -1
- package/dist/_node_modules/execa/index.cjs +8 -70
- package/dist/_node_modules/execa/index.cjs.map +1 -1
- package/dist/_node_modules/execa/index.js +2 -64
- package/dist/_node_modules/execa/index.js.map +1 -1
- package/dist/_node_modules/execa/lib/stream.cjs +0 -15
- package/dist/_node_modules/execa/lib/stream.cjs.map +1 -1
- package/dist/_node_modules/execa/lib/stream.js +1 -16
- package/dist/_node_modules/execa/lib/stream.js.map +1 -1
- package/dist/_virtual/index2.cjs +4 -3
- package/dist/_virtual/index2.cjs.map +1 -1
- package/dist/_virtual/index2.js +4 -2
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/_virtual/index3.cjs +3 -4
- package/dist/_virtual/index3.cjs.map +1 -1
- package/dist/_virtual/index3.js +2 -4
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/client/index.d.ts +0 -1
- package/dist/client.cjs +0 -2
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +0 -2
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/managers/SliceMachineManager.cjs +0 -3
- package/dist/managers/SliceMachineManager.cjs.map +1 -1
- package/dist/managers/SliceMachineManager.d.ts +0 -2
- package/dist/managers/SliceMachineManager.js +0 -3
- package/dist/managers/SliceMachineManager.js.map +1 -1
- package/dist/managers/prismicRepository/PrismicRepositoryManager.cjs +2 -0
- package/dist/managers/prismicRepository/PrismicRepositoryManager.cjs.map +1 -1
- package/dist/managers/prismicRepository/PrismicRepositoryManager.js +2 -0
- package/dist/managers/prismicRepository/PrismicRepositoryManager.js.map +1 -1
- package/dist/managers/prismicRepository/types.cjs.map +1 -1
- package/dist/managers/prismicRepository/types.d.ts +7 -0
- package/dist/managers/prismicRepository/types.js.map +1 -1
- package/dist/managers/project/ProjectManager.cjs +6 -3
- package/dist/managers/project/ProjectManager.cjs.map +1 -1
- package/dist/managers/project/ProjectManager.d.ts +5 -0
- package/dist/managers/project/ProjectManager.js +6 -3
- package/dist/managers/project/ProjectManager.js.map +1 -1
- package/dist/managers/slices/SlicesManager.cjs +11 -3
- package/dist/managers/slices/SlicesManager.cjs.map +1 -1
- package/dist/managers/slices/SlicesManager.d.ts +9 -2
- package/dist/managers/slices/SlicesManager.js +11 -3
- package/dist/managers/slices/SlicesManager.js.map +1 -1
- package/dist/managers/telemetry/TelemetryManager.cjs +6 -2
- package/dist/managers/telemetry/TelemetryManager.cjs.map +1 -1
- package/dist/managers/telemetry/TelemetryManager.js +6 -2
- package/dist/managers/telemetry/TelemetryManager.js.map +1 -1
- package/dist/managers/telemetry/types.cjs +4 -2
- package/dist/managers/telemetry/types.cjs.map +1 -1
- package/dist/managers/telemetry/types.d.ts +7 -2
- package/dist/managers/telemetry/types.js +4 -2
- package/dist/managers/telemetry/types.js.map +1 -1
- package/package.json +3 -3
- package/src/client/index.ts +0 -2
- package/src/index.ts +0 -2
- package/src/managers/SliceMachineManager.ts +0 -4
- package/src/managers/prismicRepository/PrismicRepositoryManager.ts +2 -0
- package/src/managers/prismicRepository/types.ts +7 -0
- package/src/managers/project/ProjectManager.ts +9 -6
- package/src/managers/slices/SlicesManager.ts +22 -6
- package/src/managers/telemetry/TelemetryManager.ts +7 -2
- package/src/managers/telemetry/types.ts +12 -2
- package/dist/constants/GIT_PROVIDER.cjs +0 -7
- package/dist/constants/GIT_PROVIDER.cjs.map +0 -1
- package/dist/constants/GIT_PROVIDER.d.ts +0 -4
- package/dist/constants/GIT_PROVIDER.js +0 -7
- package/dist/constants/GIT_PROVIDER.js.map +0 -1
- package/dist/constants/GIT_PROVIDER_APP_SLUGS.cjs +0 -26
- package/dist/constants/GIT_PROVIDER_APP_SLUGS.cjs.map +0 -1
- package/dist/constants/GIT_PROVIDER_APP_SLUGS.d.ts +0 -3
- package/dist/constants/GIT_PROVIDER_APP_SLUGS.js +0 -26
- package/dist/constants/GIT_PROVIDER_APP_SLUGS.js.map +0 -1
- package/dist/managers/git/GitManager.cjs +0 -334
- package/dist/managers/git/GitManager.cjs.map +0 -1
- package/dist/managers/git/GitManager.d.ts +0 -89
- package/dist/managers/git/GitManager.js +0 -316
- package/dist/managers/git/GitManager.js.map +0 -1
- package/dist/managers/git/buildGitRepoSpecifier.cjs +0 -7
- package/dist/managers/git/buildGitRepoSpecifier.cjs.map +0 -1
- package/dist/managers/git/buildGitRepoSpecifier.d.ts +0 -19
- package/dist/managers/git/buildGitRepoSpecifier.js +0 -7
- package/dist/managers/git/buildGitRepoSpecifier.js.map +0 -1
- package/dist/managers/git/types.d.ts +0 -20
- package/src/constants/GIT_PROVIDER.ts +0 -5
- package/src/constants/GIT_PROVIDER_APP_SLUGS.ts +0 -28
- package/src/managers/git/GitManager.ts +0 -502
- package/src/managers/git/buildGitRepoSpecifier.ts +0 -24
- package/src/managers/git/types.ts +0 -26
|
@@ -62,8 +62,12 @@ class TelemetryManager extends BaseManager {
|
|
|
62
62
|
if (_includeEnvironmentKind) {
|
|
63
63
|
if (this.project.checkSupportsEnvironments()) {
|
|
64
64
|
try {
|
|
65
|
-
const
|
|
66
|
-
|
|
65
|
+
const activeEnvironmentResult = await this.project.fetchActiveEnvironment();
|
|
66
|
+
if (activeEnvironmentResult.type === "ok") {
|
|
67
|
+
environmentKind = activeEnvironmentResult.activeEnvironment.kind;
|
|
68
|
+
} else {
|
|
69
|
+
throw activeEnvironmentResult.error;
|
|
70
|
+
}
|
|
67
71
|
} catch {
|
|
68
72
|
environmentKind = "_unknown";
|
|
69
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TelemetryManager.js","sources":["../../../../src/managers/telemetry/TelemetryManager.ts"],"sourcesContent":["import {\n\tExperiment,\n\tRemoteEvaluationClient,\n\tVariant,\n} from \"@amplitude/experiment-node-server\";\nimport { randomUUID } from \"node:crypto\";\nimport { Analytics, GroupParams, TrackParams } from \"@segment/analytics-node\";\n\nimport { readPrismicrc } from \"../../lib/prismicrc\";\n\nimport { API_TOKENS } from \"../../constants/API_TOKENS\";\n\nimport { BaseManager } from \"../BaseManager\";\n\nimport {\n\tHumanSegmentEventType,\n\tHumanSegmentEventTypes,\n\tSegmentEvents,\n} from \"./types\";\nimport { Environment } from \"../prismicRepository/types\";\n\ntype TelemetryManagerInitTelemetryArgs = {\n\tappName: string;\n\tappVersion: string;\n};\n\ntype TelemetryManagerTrackArgs = SegmentEvents & {\n\t_includeEnvironmentKind?: boolean;\n};\n\ntype TelemetryManagerIdentifyArgs = {\n\tuserID: string;\n\tintercomHash: string;\n};\n\ntype TelemetryManagerGroupArgs = {\n\tmanualLibsCount: number;\n\tdownloadedLibsCount: number;\n\tnpmLibsCount: number;\n\tdownloadedLibs: string[];\n};\n\ntype TelemetryManagerContext = {\n\tapp: {\n\t\tname: string;\n\t\tversion: string;\n\t};\n};\n\nfunction assertTelemetryInitialized(\n\tsegmentClient: (() => Analytics) | undefined,\n): asserts segmentClient is NonNullable<typeof segmentClient> {\n\tif (segmentClient === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Telemetry has not been initialized. Run `SliceMachineManager.telemetry.prototype.initTelemetry()` before re-calling this method.\",\n\t\t);\n\t}\n}\n\nexport class TelemetryManager extends BaseManager {\n\tprivate _segmentClient: (() => Analytics) | undefined = undefined;\n\tprivate _anonymousID: string | undefined = undefined;\n\tprivate _userID: string | undefined = undefined;\n\tprivate _context: TelemetryManagerContext | undefined = undefined;\n\tprivate _experiment: RemoteEvaluationClient | undefined = undefined;\n\n\tasync initTelemetry(args: TelemetryManagerInitTelemetryArgs): Promise<void> {\n\t\tconst isTelemetryEnabled = await this.checkIsTelemetryEnabled();\n\n\t\tthis._segmentClient = () => {\n\t\t\tconst analytics = new Analytics({\n\t\t\t\twriteKey: API_TOKENS.SegmentKey,\n\t\t\t\t// Since it's a local app, we do not benefit from event batching the way a server would normally do, all tracking event will be awaited.\n\t\t\t\tmaxEventsInBatch: 1,\n\t\t\t\t// TODO: Verify that this actually does not send data to Segment when false.\n\t\t\t\tdisable: !isTelemetryEnabled,\n\t\t\t});\n\n\t\t\tanalytics.on(\"error\", (error) => {\n\t\t\t\t// noop - We don't care if the tracking event\n\t\t\t\t// failed. Some users or networks intentionally\n\t\t\t\t// block Segment, so we can't block the app if\n\t\t\t\t// a tracking event is unsuccessful.\n\t\t\t\tif (import.meta.env.DEV) {\n\t\t\t\t\tconsole.error(`An error occurred with Segment`, error);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn analytics;\n\t\t};\n\n\t\tif (isTelemetryEnabled) {\n\t\t\tthis.initExperiment();\n\t\t}\n\n\t\tthis._anonymousID = randomUUID();\n\t\tthis._context = { app: { name: args.appName, version: args.appVersion } };\n\t}\n\n\t// TODO: Should `userId` be automatically populated by the logged in\n\t// user? We already have their info via UserRepository.\n\tasync track(args: TelemetryManagerTrackArgs): Promise<void> {\n\t\tconst { event, repository, _includeEnvironmentKind, ...properties } = args;\n\t\tlet repositoryName = repository;\n\n\t\tif (repositoryName === undefined) {\n\t\t\ttry {\n\t\t\t\trepositoryName = await this.project.getRepositoryName();\n\t\t\t} catch (error) {\n\t\t\t\t// noop, happen only when the user is not in a project\n\t\t\t}\n\t\t}\n\n\t\tlet environmentKind: Environment[\"kind\"] | \"_unknown\" | undefined =\n\t\t\tundefined;\n\t\tif (_includeEnvironmentKind) {\n\t\t\tif (this.project.checkSupportsEnvironments()) {\n\t\t\t\ttry {\n\t\t\t\t\tconst { activeEnvironment } =\n\t\t\t\t\t\tawait this.project.fetchActiveEnvironment();\n\t\t\t\t\tenvironmentKind = activeEnvironment.kind;\n\t\t\t\t} catch {\n\t\t\t\t\tenvironmentKind = \"_unknown\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Assume only the production environment can be\n\t\t\t\t// used if the project's adapter does not\n\t\t\t\t// support environments.\n\t\t\t\tenvironmentKind = \"prod\";\n\t\t\t}\n\t\t}\n\n\t\tconst payload: {\n\t\t\tevent: HumanSegmentEventTypes;\n\t\t\tuserId?: string;\n\t\t\tanonymousId?: string;\n\t\t\tproperties?: Record<string, unknown>;\n\t\t\tcontext?: Partial<TelemetryManagerContext> & {\n\t\t\t\tgroupId?: {\n\t\t\t\t\tRepository?: string;\n\t\t\t\t};\n\t\t\t};\n\t\t} = {\n\t\t\tevent: HumanSegmentEventType[event],\n\t\t\tproperties: {\n\t\t\t\tnodeVersion: process.versions.node,\n\t\t\t\tenvironmentKind,\n\t\t\t\t...properties,\n\t\t\t},\n\t\t\tcontext: { ...this._context },\n\t\t};\n\n\t\tif (this._userID) {\n\t\t\tpayload.userId = this._userID;\n\t\t} else {\n\t\t\tpayload.anonymousId = this._anonymousID;\n\t\t}\n\n\t\tif (repositoryName) {\n\t\t\tpayload.context ||= {};\n\t\t\tpayload.context.groupId ||= {};\n\t\t\tpayload.context.groupId.Repository = repositoryName;\n\t\t}\n\n\t\treturn new Promise((resolve) => {\n\t\t\tassertTelemetryInitialized(this._segmentClient);\n\n\t\t\t// TODO: Make sure client fails gracefully when no internet connection\n\t\t\tthis._segmentClient().track(\n\t\t\t\tpayload as TrackParams,\n\t\t\t\t(maybeError?: unknown) => {\n\t\t\t\t\tif (maybeError && import.meta.env.DEV) {\n\t\t\t\t\t\t// TODO: Not sure how we want to deal with that\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`An error occurred during Segment tracking`,\n\t\t\t\t\t\t\tmaybeError,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve();\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}\n\n\t// TODO: Should `userID` and `intercomHash` be automatically populated\n\t// by the logged in user? We already have their info via\n\t// UserRepository.\n\tidentify(args: TelemetryManagerIdentifyArgs): Promise<void> {\n\t\tconst payload = {\n\t\t\tuserId: args.userID,\n\t\t\tanonymousId: this._anonymousID,\n\t\t\tintegrations: {\n\t\t\t\tIntercom: {\n\t\t\t\t\tuser_hash: args.intercomHash,\n\t\t\t\t},\n\t\t\t},\n\t\t\tcontext: { ...this._context },\n\t\t};\n\n\t\tthis._userID = args.userID;\n\n\t\treturn new Promise((resolve) => {\n\t\t\tassertTelemetryInitialized(this._segmentClient);\n\n\t\t\t// TODO: Make sure client fails gracefully when no internet connection\n\t\t\tthis._segmentClient().identify(payload, (maybeError?: unknown) => {\n\t\t\t\tif (maybeError && import.meta.env.DEV) {\n\t\t\t\t\t// TODO: Not sure how we want to deal with that\n\t\t\t\t\tconsole.warn(`An error occurred during Segment identify`, maybeError);\n\t\t\t\t}\n\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t}\n\n\tasync group(args: TelemetryManagerGroupArgs): Promise<void> {\n\t\tlet repositoryName;\n\n\t\ttry {\n\t\t\trepositoryName = await this.project.getRepositoryName();\n\t\t} catch (error) {\n\t\t\t// noop, happen only when the user is not in a project\n\t\t}\n\n\t\tconst payload: {\n\t\t\tgroupId?: string;\n\t\t\tuserId?: string;\n\t\t\tanonymousId?: string;\n\t\t\ttraits?: Record<string, unknown>;\n\t\t\tcontext?: Partial<TelemetryManagerContext> & {\n\t\t\t\tgroupId?: {\n\t\t\t\t\tRepository?: string;\n\t\t\t\t};\n\t\t\t};\n\t\t} = {\n\t\t\ttraits: args,\n\t\t\tcontext: { ...this._context },\n\t\t};\n\n\t\tif (this._userID) {\n\t\t\tpayload.userId = this._userID;\n\t\t} else {\n\t\t\tpayload.anonymousId = this._anonymousID;\n\t\t}\n\n\t\tif (repositoryName) {\n\t\t\tpayload.groupId = repositoryName;\n\t\t\tpayload.context ||= {};\n\t\t\tpayload.context.groupId ||= {};\n\t\t\tpayload.context.groupId.Repository = repositoryName;\n\t\t}\n\n\t\treturn new Promise((resolve) => {\n\t\t\tassertTelemetryInitialized(this._segmentClient);\n\n\t\t\tthis._segmentClient().group(\n\t\t\t\tpayload as GroupParams,\n\t\t\t\t(maybeError?: unknown) => {\n\t\t\t\t\tif (maybeError && import.meta.env.DEV) {\n\t\t\t\t\t\t// TODO: Not sure how we want to deal with that\n\t\t\t\t\t\tconsole.warn(`An error occurred during Segment group`, maybeError);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve();\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}\n\n\tasync checkIsTelemetryEnabled(): Promise<boolean> {\n\t\tlet root: string;\n\t\ttry {\n\t\t\troot = await this.project\n\t\t\t\t.getRoot()\n\t\t\t\t.catch(() => this.project.suggestRoot());\n\n\t\t\treturn readPrismicrc(root).telemetry !== false;\n\t\t} catch {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tprivate initExperiment(): void {\n\t\ttry {\n\t\t\tthis._experiment = Experiment.initializeRemote(API_TOKENS.AmplitudeKey);\n\t\t} catch (error) {\n\t\t\tif (import.meta.env.DEV) {\n\t\t\t\tconsole.error(\"Error initializing experiment\", error);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync getExperimentVariant(variantKey: string): Promise<Variant | undefined> {\n\t\tif (this._experiment) {\n\t\t\ttry {\n\t\t\t\tconst repositoryName = await this.project.getRepositoryName();\n\t\t\t\tconst variants = await this._experiment.fetchV2({\n\t\t\t\t\tuser_id: this._userID,\n\t\t\t\t\tuser_properties: {\n\t\t\t\t\t\tRepository: repositoryName,\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\tconst variantValue = variants[variantKey].value;\n\t\t\t\tif (variantValue) {\n\t\t\t\t\tawait this.track({\n\t\t\t\t\t\tevent: \"experiment:exposure\",\n\t\t\t\t\t\tflag_key: variantKey,\n\t\t\t\t\t\tvariant: variantValue,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn variants[variantKey];\n\t\t\t} catch (error) {\n\t\t\t\tif (import.meta.env.DEV) {\n\t\t\t\t\tconsole.error(\"Error fetching experiment variant\", error);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n"],"names":["Experiment"],"mappings":";;;;;;;;;;;;;;AAiDA,SAAS,2BACR,eAA4C;AAE5C,MAAI,kBAAkB,QAAW;AAC1B,UAAA,IAAI,MACT,kIAAkI;AAAA,EAEpI;AACD;AAEM,MAAO,yBAAyB,YAAW;AAAA,EAA3C;AAAA;AACG;AACA;AACA;AACA;AACA;AAAA;AAAA,EAER,MAAM,cAAc,MAAuC;AACpD,UAAA,qBAAqB,MAAM,KAAK;AAEtC,SAAK,iBAAiB,MAAK;AACpB,YAAA,YAAY,IAAI,UAAU;AAAA,QAC/B,UAAU,WAAW;AAAA;AAAA,QAErB,kBAAkB;AAAA;AAAA,QAElB,SAAS,CAAC;AAAA,MAAA,CACV;AAES,gBAAA,GAAG,SAAS,CAAC,UAAS;AAAA,MAO/B,CACA;AAEM,aAAA;AAAA,IAAA;AAGR,QAAI,oBAAoB;AACvB,WAAK,eAAc;AAAA,IACpB;AAEA,SAAK,eAAe;AACf,SAAA,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,SAAS,KAAK;EAC5D;AAAA;AAAA;AAAA,EAIA,MAAM,MAAM,MAA+B;;AAC1C,UAAM,EAAE,OAAO,YAAY,yBAAyB,GAAG,WAAe,IAAA;AACtE,QAAI,iBAAiB;AAErB,QAAI,mBAAmB,QAAW;AAC7B,UAAA;AACc,yBAAA,MAAM,KAAK,QAAQ;eAC5B,OAAO;AAAA,MAEhB;AAAA,IACD;AAEA,QAAI,kBACH;AACD,QAAI,yBAAyB;AACxB,UAAA,KAAK,QAAQ,6BAA6B;AACzC,YAAA;AACH,gBAAM,EAAE,kBAAiB,IACxB,MAAM,KAAK,QAAQ,uBAAsB;AAC1C,4BAAkB,kBAAkB;AAAA,QAAA,QAC7B;AACW,4BAAA;AAAA,QACnB;AAAA,MAAA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A,CACD;AAEK,cAAA,eAAe,SAAS,UAAU,EAAE;AAC1C,YAAI,cAAc;AACjB,gBAAM,KAAK,MAAM;AAAA,YAChB,OAAO;AAAA,YACP,UAAU;AAAA,YACV,SAAS;AAAA,UAAA,CACT;AAAA,QACF;AAEA,eAAO,SAAS,UAAU;AAAA,eAClB,OAAO;AAAA,MAIhB;AAAA,IACD;AAEO,WAAA;AAAA,EACR;AACA;"}
|
|
1
|
+
{"version":3,"file":"TelemetryManager.js","sources":["../../../../src/managers/telemetry/TelemetryManager.ts"],"sourcesContent":["import {\n\tExperiment,\n\tRemoteEvaluationClient,\n\tVariant,\n} from \"@amplitude/experiment-node-server\";\nimport { randomUUID } from \"node:crypto\";\nimport { Analytics, GroupParams, TrackParams } from \"@segment/analytics-node\";\n\nimport { readPrismicrc } from \"../../lib/prismicrc\";\n\nimport { API_TOKENS } from \"../../constants/API_TOKENS\";\n\nimport { BaseManager } from \"../BaseManager\";\n\nimport {\n\tHumanSegmentEventType,\n\tHumanSegmentEventTypes,\n\tSegmentEvents,\n} from \"./types\";\nimport { Environment } from \"../prismicRepository/types\";\n\ntype TelemetryManagerInitTelemetryArgs = {\n\tappName: string;\n\tappVersion: string;\n};\n\ntype TelemetryManagerTrackArgs = SegmentEvents & {\n\t_includeEnvironmentKind?: boolean;\n};\n\ntype TelemetryManagerIdentifyArgs = {\n\tuserID: string;\n\tintercomHash: string;\n};\n\ntype TelemetryManagerGroupArgs = {\n\tmanualLibsCount: number;\n\tdownloadedLibsCount: number;\n\tnpmLibsCount: number;\n\tdownloadedLibs: string[];\n};\n\ntype TelemetryManagerContext = {\n\tapp: {\n\t\tname: string;\n\t\tversion: string;\n\t};\n};\n\nfunction assertTelemetryInitialized(\n\tsegmentClient: (() => Analytics) | undefined,\n): asserts segmentClient is NonNullable<typeof segmentClient> {\n\tif (segmentClient === undefined) {\n\t\tthrow new Error(\n\t\t\t\"Telemetry has not been initialized. Run `SliceMachineManager.telemetry.prototype.initTelemetry()` before re-calling this method.\",\n\t\t);\n\t}\n}\n\nexport class TelemetryManager extends BaseManager {\n\tprivate _segmentClient: (() => Analytics) | undefined = undefined;\n\tprivate _anonymousID: string | undefined = undefined;\n\tprivate _userID: string | undefined = undefined;\n\tprivate _context: TelemetryManagerContext | undefined = undefined;\n\tprivate _experiment: RemoteEvaluationClient | undefined = undefined;\n\n\tasync initTelemetry(args: TelemetryManagerInitTelemetryArgs): Promise<void> {\n\t\tconst isTelemetryEnabled = await this.checkIsTelemetryEnabled();\n\n\t\tthis._segmentClient = () => {\n\t\t\tconst analytics = new Analytics({\n\t\t\t\twriteKey: API_TOKENS.SegmentKey,\n\t\t\t\t// Since it's a local app, we do not benefit from event batching the way a server would normally do, all tracking event will be awaited.\n\t\t\t\tmaxEventsInBatch: 1,\n\t\t\t\t// TODO: Verify that this actually does not send data to Segment when false.\n\t\t\t\tdisable: !isTelemetryEnabled,\n\t\t\t});\n\n\t\t\tanalytics.on(\"error\", (error) => {\n\t\t\t\t// noop - We don't care if the tracking event\n\t\t\t\t// failed. Some users or networks intentionally\n\t\t\t\t// block Segment, so we can't block the app if\n\t\t\t\t// a tracking event is unsuccessful.\n\t\t\t\tif (import.meta.env.DEV) {\n\t\t\t\t\tconsole.error(`An error occurred with Segment`, error);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn analytics;\n\t\t};\n\n\t\tif (isTelemetryEnabled) {\n\t\t\tthis.initExperiment();\n\t\t}\n\n\t\tthis._anonymousID = randomUUID();\n\t\tthis._context = { app: { name: args.appName, version: args.appVersion } };\n\t}\n\n\t// TODO: Should `userId` be automatically populated by the logged in\n\t// user? We already have their info via UserRepository.\n\tasync track(args: TelemetryManagerTrackArgs): Promise<void> {\n\t\tconst { event, repository, _includeEnvironmentKind, ...properties } = args;\n\t\tlet repositoryName = repository;\n\n\t\tif (repositoryName === undefined) {\n\t\t\ttry {\n\t\t\t\trepositoryName = await this.project.getRepositoryName();\n\t\t\t} catch (error) {\n\t\t\t\t// noop, happen only when the user is not in a project\n\t\t\t}\n\t\t}\n\n\t\tlet environmentKind: Environment[\"kind\"] | \"_unknown\" | undefined =\n\t\t\tundefined;\n\t\tif (_includeEnvironmentKind) {\n\t\t\tif (this.project.checkSupportsEnvironments()) {\n\t\t\t\ttry {\n\t\t\t\t\tconst activeEnvironmentResult =\n\t\t\t\t\t\tawait this.project.fetchActiveEnvironment();\n\n\t\t\t\t\tif (activeEnvironmentResult.type === \"ok\") {\n\t\t\t\t\t\tenvironmentKind = activeEnvironmentResult.activeEnvironment.kind;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow activeEnvironmentResult.error;\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\tenvironmentKind = \"_unknown\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Assume only the production environment can be\n\t\t\t\t// used if the project's adapter does not\n\t\t\t\t// support environments.\n\t\t\t\tenvironmentKind = \"prod\";\n\t\t\t}\n\t\t}\n\n\t\tconst payload: {\n\t\t\tevent: HumanSegmentEventTypes;\n\t\t\tuserId?: string;\n\t\t\tanonymousId?: string;\n\t\t\tproperties?: Record<string, unknown>;\n\t\t\tcontext?: Partial<TelemetryManagerContext> & {\n\t\t\t\tgroupId?: {\n\t\t\t\t\tRepository?: string;\n\t\t\t\t};\n\t\t\t};\n\t\t} = {\n\t\t\tevent: HumanSegmentEventType[event],\n\t\t\tproperties: {\n\t\t\t\tnodeVersion: process.versions.node,\n\t\t\t\tenvironmentKind,\n\t\t\t\t...properties,\n\t\t\t},\n\t\t\tcontext: { ...this._context },\n\t\t};\n\n\t\tif (this._userID) {\n\t\t\tpayload.userId = this._userID;\n\t\t} else {\n\t\t\tpayload.anonymousId = this._anonymousID;\n\t\t}\n\n\t\tif (repositoryName) {\n\t\t\tpayload.context ||= {};\n\t\t\tpayload.context.groupId ||= {};\n\t\t\tpayload.context.groupId.Repository = repositoryName;\n\t\t}\n\n\t\treturn new Promise((resolve) => {\n\t\t\tassertTelemetryInitialized(this._segmentClient);\n\n\t\t\t// TODO: Make sure client fails gracefully when no internet connection\n\t\t\tthis._segmentClient().track(\n\t\t\t\tpayload as TrackParams,\n\t\t\t\t(maybeError?: unknown) => {\n\t\t\t\t\tif (maybeError && import.meta.env.DEV) {\n\t\t\t\t\t\t// TODO: Not sure how we want to deal with that\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`An error occurred during Segment tracking`,\n\t\t\t\t\t\t\tmaybeError,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve();\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}\n\n\t// TODO: Should `userID` and `intercomHash` be automatically populated\n\t// by the logged in user? We already have their info via\n\t// UserRepository.\n\tidentify(args: TelemetryManagerIdentifyArgs): Promise<void> {\n\t\tconst payload = {\n\t\t\tuserId: args.userID,\n\t\t\tanonymousId: this._anonymousID,\n\t\t\tintegrations: {\n\t\t\t\tIntercom: {\n\t\t\t\t\tuser_hash: args.intercomHash,\n\t\t\t\t},\n\t\t\t},\n\t\t\tcontext: { ...this._context },\n\t\t};\n\n\t\tthis._userID = args.userID;\n\n\t\treturn new Promise((resolve) => {\n\t\t\tassertTelemetryInitialized(this._segmentClient);\n\n\t\t\t// TODO: Make sure client fails gracefully when no internet connection\n\t\t\tthis._segmentClient().identify(payload, (maybeError?: unknown) => {\n\t\t\t\tif (maybeError && import.meta.env.DEV) {\n\t\t\t\t\t// TODO: Not sure how we want to deal with that\n\t\t\t\t\tconsole.warn(`An error occurred during Segment identify`, maybeError);\n\t\t\t\t}\n\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t}\n\n\tasync group(args: TelemetryManagerGroupArgs): Promise<void> {\n\t\tlet repositoryName;\n\n\t\ttry {\n\t\t\trepositoryName = await this.project.getRepositoryName();\n\t\t} catch (error) {\n\t\t\t// noop, happen only when the user is not in a project\n\t\t}\n\n\t\tconst payload: {\n\t\t\tgroupId?: string;\n\t\t\tuserId?: string;\n\t\t\tanonymousId?: string;\n\t\t\ttraits?: Record<string, unknown>;\n\t\t\tcontext?: Partial<TelemetryManagerContext> & {\n\t\t\t\tgroupId?: {\n\t\t\t\t\tRepository?: string;\n\t\t\t\t};\n\t\t\t};\n\t\t} = {\n\t\t\ttraits: args,\n\t\t\tcontext: { ...this._context },\n\t\t};\n\n\t\tif (this._userID) {\n\t\t\tpayload.userId = this._userID;\n\t\t} else {\n\t\t\tpayload.anonymousId = this._anonymousID;\n\t\t}\n\n\t\tif (repositoryName) {\n\t\t\tpayload.groupId = repositoryName;\n\t\t\tpayload.context ||= {};\n\t\t\tpayload.context.groupId ||= {};\n\t\t\tpayload.context.groupId.Repository = repositoryName;\n\t\t}\n\n\t\treturn new Promise((resolve) => {\n\t\t\tassertTelemetryInitialized(this._segmentClient);\n\n\t\t\tthis._segmentClient().group(\n\t\t\t\tpayload as GroupParams,\n\t\t\t\t(maybeError?: unknown) => {\n\t\t\t\t\tif (maybeError && import.meta.env.DEV) {\n\t\t\t\t\t\t// TODO: Not sure how we want to deal with that\n\t\t\t\t\t\tconsole.warn(`An error occurred during Segment group`, maybeError);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve();\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t}\n\n\tasync checkIsTelemetryEnabled(): Promise<boolean> {\n\t\tlet root: string;\n\t\ttry {\n\t\t\troot = await this.project\n\t\t\t\t.getRoot()\n\t\t\t\t.catch(() => this.project.suggestRoot());\n\n\t\t\treturn readPrismicrc(root).telemetry !== false;\n\t\t} catch {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tprivate initExperiment(): void {\n\t\ttry {\n\t\t\tthis._experiment = Experiment.initializeRemote(API_TOKENS.AmplitudeKey);\n\t\t} catch (error) {\n\t\t\tif (import.meta.env.DEV) {\n\t\t\t\tconsole.error(\"Error initializing experiment\", error);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync getExperimentVariant(variantKey: string): Promise<Variant | undefined> {\n\t\tif (this._experiment) {\n\t\t\ttry {\n\t\t\t\tconst repositoryName = await this.project.getRepositoryName();\n\t\t\t\tconst variants = await this._experiment.fetchV2({\n\t\t\t\t\tuser_id: this._userID,\n\t\t\t\t\tuser_properties: {\n\t\t\t\t\t\tRepository: repositoryName,\n\t\t\t\t\t},\n\t\t\t\t});\n\n\t\t\t\tconst variantValue = variants[variantKey].value;\n\t\t\t\tif (variantValue) {\n\t\t\t\t\tawait this.track({\n\t\t\t\t\t\tevent: \"experiment:exposure\",\n\t\t\t\t\t\tflag_key: variantKey,\n\t\t\t\t\t\tvariant: variantValue,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn variants[variantKey];\n\t\t\t} catch (error) {\n\t\t\t\tif (import.meta.env.DEV) {\n\t\t\t\t\tconsole.error(\"Error fetching experiment variant\", error);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n"],"names":["Experiment"],"mappings":";;;;;;;;;;;;;;AAiDA,SAAS,2BACR,eAA4C;AAE5C,MAAI,kBAAkB,QAAW;AAC1B,UAAA,IAAI,MACT,kIAAkI;AAAA,EAEpI;AACD;AAEM,MAAO,yBAAyB,YAAW;AAAA,EAA3C;AAAA;AACG;AACA;AACA;AACA;AACA;AAAA;AAAA,EAER,MAAM,cAAc,MAAuC;AACpD,UAAA,qBAAqB,MAAM,KAAK;AAEtC,SAAK,iBAAiB,MAAK;AACpB,YAAA,YAAY,IAAI,UAAU;AAAA,QAC/B,UAAU,WAAW;AAAA;AAAA,QAErB,kBAAkB;AAAA;AAAA,QAElB,SAAS,CAAC;AAAA,MAAA,CACV;AAES,gBAAA,GAAG,SAAS,CAAC,UAAS;AAAA,MAO/B,CACA;AAEM,aAAA;AAAA,IAAA;AAGR,QAAI,oBAAoB;AACvB,WAAK,eAAc;AAAA,IACpB;AAEA,SAAK,eAAe;AACf,SAAA,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,SAAS,KAAK;EAC5D;AAAA;AAAA;AAAA,EAIA,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S,EACT,MAAM,MAAM,KAAK,QAAQ,YAAA,CAAa;AAEjC,aAAA,cAAc,IAAI,EAAE,cAAc;AAAA,IAAA,QAClC;AACA,aAAA;AAAA,IACR;AAAA,EACD;AAAA,EAEQ,iBAAc;AACjB,QAAA;AACH,WAAK,cAAcA,IAAA,WAAW,iBAAiB,WAAW,YAAY;AAAA,aAC9D,OAAO;AAAA,IAIhB;AAAA,EACD;AAAA,EAEA,MAAM,qBAAqB,YAAkB;AAC5C,QAAI,KAAK,aAAa;AACjB,UAAA;AACH,cAAM,iBAAiB,MAAM,KAAK,QAAQ,kBAAiB;AAC3D,cAAM,WAAW,MAAM,KAAK,YAAY,QAAQ;AAAA,UAC/C,SAAS,KAAK;AAAA,UACd,iBAAiB;AAAA,YAChB,YAAY;AAAA,UACZ;AAAA,QAAA,CACD;AAEK,cAAA,eAAe,SAAS,UAAU,EAAE;AAC1C,YAAI,cAAc;AACjB,gBAAM,KAAK,MAAM;AAAA,YAChB,OAAO;AAAA,YACP,UAAU;AAAA,YACV,SAAS;AAAA,UAAA,CACT;AAAA,QACF;AAEA,eAAO,SAAS,UAAU;AAAA,eAClB,OAAO;AAAA,MAIhB;AAAA,IACD;AAEO,WAAA;AAAA,EACR;AACA;"}
|
|
@@ -37,7 +37,8 @@ const SegmentEventType = {
|
|
|
37
37
|
sharedOnboarding_completed: "shared-onboarding:completed",
|
|
38
38
|
sharedOnboarding_tutorial: "shared-onboarding:follow-tutorial",
|
|
39
39
|
sliceGenerationFeedback: "slice-generation-feedback",
|
|
40
|
-
navigation_documentationLinkClicked: "navigation:documentation-link-clicked"
|
|
40
|
+
navigation_documentationLinkClicked: "navigation:documentation-link-clicked",
|
|
41
|
+
sidebar_link_clicked: "sidebar:link-clicked"
|
|
41
42
|
};
|
|
42
43
|
const HumanSegmentEventType = {
|
|
43
44
|
[SegmentEventType.command_init_start]: "SliceMachine Init Start",
|
|
@@ -76,7 +77,8 @@ const HumanSegmentEventType = {
|
|
|
76
77
|
[SegmentEventType.sharedOnboarding_completed]: "Prismic Onboarding Guide Completed",
|
|
77
78
|
[SegmentEventType.sharedOnboarding_tutorial]: "Prismic Onboarding Guide Follow Tutorial",
|
|
78
79
|
[SegmentEventType.sliceGenerationFeedback]: "Slice Generation Feedback",
|
|
79
|
-
[SegmentEventType.navigation_documentationLinkClicked]: "SliceMachine Documentation Link Clicked"
|
|
80
|
+
[SegmentEventType.navigation_documentationLinkClicked]: "SliceMachine Documentation Link Clicked",
|
|
81
|
+
[SegmentEventType.sidebar_link_clicked]: "Sidebar Link Clicked"
|
|
80
82
|
};
|
|
81
83
|
exports.HumanSegmentEventType = HumanSegmentEventType;
|
|
82
84
|
exports.SegmentEventType = SegmentEventType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import {\n\tFieldType,\n\tLinkConfig,\n} from \"@prismicio/types-internal/lib/customtypes/widgets\";\n\nimport { CustomTypeFormat } from \"../customTypes/types\";\nimport type { PushChangesLimitType } from \"../prismicRepository/types\";\n\nexport type { Variant } from \"@amplitude/experiment-node-server\";\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\tsliceSimulator_open: \"slice-simulator:open\",\n\tsliceSimulator_isNotRunning: \"slice-simulator:is-not-running\",\n\tpageView: \"page-view\",\n\topenVideoTutorials: \"open-video-tutorials\",\n\tfield_added: \"field:added\",\n\tfield_updated: \"field:updated\",\n\tfield_settingsOpened: \"field:settings-opened\",\n\tcustomType_created: \"custom-type:created\",\n\tcustomType_sliceZoneUpdated: \"custom-type:slice-zone-updated\",\n\tcustomType_openAddFromTemplates: \"custom-type:open-add-from-templates\",\n\tcustomType_saved: \"custom-type:saved\",\n\tslice_created: \"slice:created\",\n\tlegacySlice_converted: \"legacy-slice:converted\",\n\tscreenshotTaken: \"screenshot-taken\",\n\tchanges_pushed: \"changes:pushed\",\n\tchanges_groupPushed: \"changes:group-pushed\",\n\tchanges_limitReach: \"changes:limit-reach\",\n\teditor_widgetUsed: \"editor:widget-used\",\n\topen_page_snippet: \"page-type:open-snippet\",\n\tcopy_page_snippet: \"page-type:copy-snippet\",\n\tswitch_environment: \"environment:switch\",\n\tdevCollab_joinBetaClicked: \"dev-collab:join-beta-clicked\",\n\tdevCollab_setUpWorkflowOpened: \"dev-collab:set-up-workflow-opened\",\n\tdevCollab_workflowStubDisplayed: \"dev-collab:workflow-stub-displayed\",\n\tsliceMachine_start: \"slice-machine:start\",\n\tpostPush_emptyStateCtaClicked: \"post-push:empty-state-cta-clicked\",\n\tpostPush_toastCtaClicked: \"post-push:toast-cta-clicked\",\n\texperiment_exposure: \"experiment:exposure\",\n\tsharedOnboarding_step_opened: \"shared-onboarding:step-opened\",\n\tsharedOnboarding_step_completed: \"shared-onboarding:step-completed\",\n\tsharedOnboarding_completed: \"shared-onboarding:completed\",\n\tsharedOnboarding_tutorial: \"shared-onboarding:follow-tutorial\",\n\tsliceGenerationFeedback: \"slice-generation-feedback\",\n\tnavigation_documentationLinkClicked: \"navigation:documentation-link-clicked\",\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.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.field_added]: \"SliceMachine Field Added\",\n\t[SegmentEventType.field_updated]: \"SliceMachine Field Updated\",\n\t[SegmentEventType.field_settingsOpened]: \"SliceMachine Field Settings Opened\",\n\t[SegmentEventType.customType_created]: \"SliceMachine Custom Type Created\",\n\t[SegmentEventType.customType_sliceZoneUpdated]:\n\t\t\"SliceMachine Slicezone Updated\",\n\t[SegmentEventType.customType_openAddFromTemplates]:\n\t\t\"SliceMachine Open Add from templates\",\n\t[SegmentEventType.customType_saved]: \"SliceMachine Custom Type Saved\",\n\t[SegmentEventType.slice_created]: \"SliceMachine Slice Created\",\n\t[SegmentEventType.legacySlice_converted]:\n\t\t\"SliceMachine Legacy Slice Converted\",\n\t[SegmentEventType.screenshotTaken]: \"SliceMachine Screenshot Taken\",\n\t[SegmentEventType.changes_pushed]: \"SliceMachine Changes Pushed\",\n\t[SegmentEventType.changes_groupPushed]: \"SliceMachine Group Field Pushed\",\n\t[SegmentEventType.changes_limitReach]: \"SliceMachine Changes Limit Reach\",\n\t[SegmentEventType.editor_widgetUsed]: \"SliceMachine Editor Widget Used\",\n\t[SegmentEventType.open_page_snippet]:\n\t\t\"SliceMachine Opens Page Type Snippet Dialog\",\n\t[SegmentEventType.copy_page_snippet]:\n\t\t\"Slice Machine page code snippet copied\",\n\t[SegmentEventType.switch_environment]: \"SliceMachine environment switch\",\n\t[SegmentEventType.devCollab_joinBetaClicked]:\n\t\t\"SliceMachine Dev Collab Join Beta Clicked\",\n\t[SegmentEventType.devCollab_setUpWorkflowOpened]:\n\t\t\"SliceMachine Dev Collab Set Up Workflow Opened\",\n\t[SegmentEventType.devCollab_workflowStubDisplayed]:\n\t\t\"SliceMachine Dev Collab Workflow Stub Displayed\",\n\t[SegmentEventType.sliceMachine_start]: \"SliceMachine Start\",\n\t[SegmentEventType.postPush_emptyStateCtaClicked]:\n\t\t\"SliceMachine Post Push Empty State CTA Clicked\",\n\t[SegmentEventType.postPush_toastCtaClicked]:\n\t\t\"SliceMachine Post Push Toast CTA Clicked\",\n\t[SegmentEventType.experiment_exposure]: \"$exposure\",\n\t[SegmentEventType.sharedOnboarding_step_completed]:\n\t\t\"Prismic Onboarding Guide Step Completed\",\n\t[SegmentEventType.sharedOnboarding_step_opened]:\n\t\t\"Prismic Onboarding Guide Step Open\",\n\t[SegmentEventType.sharedOnboarding_completed]:\n\t\t\"Prismic Onboarding Guide Completed\",\n\t[SegmentEventType.sharedOnboarding_tutorial]:\n\t\t\"Prismic Onboarding Guide Follow Tutorial\",\n\t[SegmentEventType.sliceGenerationFeedback]: \"Slice Generation Feedback\",\n\t[SegmentEventType.navigation_documentationLinkClicked]:\n\t\t\"SliceMachine Documentation Link Clicked\",\n} as const;\n\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 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\t/*\n\t\t * We are tracking outer sizes instead of inner sizes as with the latter, we\n\t\t * can't differentiate between users with a high-density screen and those\n\t\t * zooming in/out with ⌘ + / ⌘ -. Indeed, when users zoom in/out, some\n\t\t * browsers (like Google Chrome) will update `window.devicePixelRatio` while\n\t\t * others (like Safari) will keep it unchanged so that it always reflects\n\t\t * the ratio of physical pixels to CSS pixels.\n\t\t */\n\t\touterWidth: number;\n\t\touterHeight: number;\n\t\tscreenWidth: number;\n\t\tscreenHeight: number;\n\t}\n>;\n\ntype OpenPageSnippetSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.open_page_snippet,\n\t{ framework: string }\n>;\n\ntype CopyPageSnippetSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.copy_page_snippet,\n\t{ framework: string }\n>;\n\ntype SwitchEnvironmentSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.switch_environment,\n\t{ domain: string }\n>;\n\ntype OpenVideoTutorialsSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.openVideoTutorials,\n\t{ video: string }\n>;\n\ntype FieldAddedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_added,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t\tallowText?: boolean;\n\t\trepeat?: boolean;\n\t\tvariants?: string[];\n\t\tlinkSelect?: LinkConfig[\"select\"];\n\t\tlinkPickedFields?: number;\n\t\tlinkNestedPickedFields?: number;\n\t}\n>;\n\ntype FieldUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_updated,\n\t{\n\t\tpreviousId: string;\n\t\tid: string;\n\t\tidUpdated: boolean;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t\tallowText?: boolean;\n\t\trepeat?: boolean;\n\t\tvariants?: string[];\n\t\tlinkSelect?: LinkConfig[\"select\"];\n\t\tlinkPickedFields?: number;\n\t\tlinkNestedPickedFields?: number;\n\t}\n>;\n\ntype FieldSettingsOpenedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_settingsOpened,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t}\n>;\n\ntype CustomTypeCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_created,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tformat: CustomTypeFormat;\n\t\ttype: \"repeatable\" | \"single\";\n\t\torigin: \"onboarding\" | \"table\";\n\t}\n>;\n\ntype CustomTypeSliceZoneUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_sliceZoneUpdated,\n\t{ customTypeId: string }\n>;\n\ntype CustomTypeOpenAddFromTemplatesEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_openAddFromTemplates,\n\t{ customTypeId: string; customTypeFormat: CustomTypeFormat }\n>;\n\ntype CustomTypeSavedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_saved,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tformat: CustomTypeFormat;\n\t\ttype: \"repeatable\" | \"single\";\n\t}\n>;\n\ntype SliceCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.slice_created,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tlibrary: string;\n\t\tlocation: \"custom_type\" | \"page_type\" | \"slices\";\n\t} & (\n\t\t| { mode: \"ai\"; langSmithUrl?: string }\n\t\t| { mode: \"manual\" }\n\t\t| { mode: \"template\"; sliceTemplate: string }\n\t)\n>;\n\ntype LegacySliceConvertedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.legacySlice_converted,\n\t{\n\t\tid: string;\n\t\tvariation: string;\n\t\tlibrary: string;\n\t\tconversionType:\n\t\t\t| \"as_new_slice\"\n\t\t\t| \"as_new_variation\"\n\t\t\t| \"merge_with_identical\";\n\t}\n>;\n\ntype ScreenshotTakenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.screenshotTaken,\n\t{\n\t\ttype: \"custom\";\n\t\tmethod: \"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 ChangesGroupPushedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_groupPushed,\n\t{\n\t\tisInStaticZone: boolean;\n\t\tisInSlice: boolean;\n\t} & {\n\t\t[key in FieldType]?: number;\n\t}\n>;\n\ntype ChangesLimitReachSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_limitReach,\n\t{ limitType: PushChangesLimitType }\n>;\n\ntype EditorWidgetUsedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.editor_widgetUsed,\n\t{ sliceId: string }\n>;\n\ntype DevCollabJoinBetaClicked = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_joinBetaClicked\n>;\n\ntype DevCollabSetUpWorkflowOpened = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_setUpWorkflowOpened\n>;\n\ntype DevCollabWorkflowStubDisplayed = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_workflowStubDisplayed\n>;\n\ntype SliceMachineStart = SegmentEvent<\n\ttypeof SegmentEventType.sliceMachine_start,\n\t{\n\t\tadapter?: string;\n\t\tadapterVersion?: string;\n\t\tgitProvider?: string;\n\t\tisAdapterUpdateAvailable?: boolean;\n\t\tisLoggedIn?: boolean;\n\t\tisSliceMachineUpdateAvailable?: boolean;\n\t\tisTypeScriptProject?: boolean;\n\t\tnodeVersion?: string;\n\t\tnumberOfCustomTypes?: number;\n\t\tnumberOfSlices?: number;\n\t\tosPlatform?: string;\n\t\tpackageManager?: string;\n\t\tprojectPort?: string;\n\t\tsliceMachineVersion?: string;\n\t\tversionControlSystem?: string;\n\t}\n>;\n\ntype OnboardingCommonPayload = { stepId: string; stepTitle: string };\ntype SharedOnboardingProperties<T = Record<string, string>> = T & {\n\tsource: \"SliceMachine\";\n};\n\ntype SliceMachineSharedOnboardingStepOpened = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_step_opened,\n\tSharedOnboardingProperties<OnboardingCommonPayload>\n>;\ntype SliceMachineSharedOnboardingStepCompleted = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_step_completed,\n\tSharedOnboardingProperties<OnboardingCommonPayload>\n>;\ntype SliceMachineSharedOnboardingCompleted = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_completed,\n\tSharedOnboardingProperties\n>;\ntype SliceMachineSharedOnboardingTutorial = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_tutorial,\n\tSharedOnboardingProperties\n>;\ntype SliceMachinePostPushEmptyStateCtaClicked = SegmentEvent<\n\ttypeof SegmentEventType.postPush_emptyStateCtaClicked\n>;\n\ntype SliceMachinePostPushToastCtaClicked = SegmentEvent<\n\ttypeof SegmentEventType.postPush_toastCtaClicked\n>;\n\ntype SliceMachineExperimentExposure = SegmentEvent<\n\ttypeof SegmentEventType.experiment_exposure,\n\t{\n\t\tflag_key: string;\n\t\tvariant: string;\n\t}\n>;\n\ntype SliceGenerationFeedback = SegmentEvent<\n\ttypeof SegmentEventType.sliceGenerationFeedback,\n\t{\n\t\ttype: \"model\";\n\t\tsliceId: string;\n\t\tvariationId: string;\n\t\tfeedback: \"up\" | \"down\";\n\t\tlangSmithUrl?: string;\n\t}\n>;\n\ntype NavigationDocumentationLinkClicked = SegmentEvent<\n\ttypeof SegmentEventType.navigation_documentationLinkClicked,\n\t{\n\t\tframework: string;\n\t}\n>;\n\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| FieldAddedSegmentEvent\n\t| FieldUpdatedSegmentEvent\n\t| FieldSettingsOpenedSegmentEvent\n\t| CustomTypeCreatedSegmentEvent\n\t| CustomTypeSliceZoneUpdatedSegmentEvent\n\t| CustomTypeOpenAddFromTemplatesEvent\n\t| CustomTypeSavedSegmentEvent\n\t| SliceCreatedSegmentEvent\n\t| LegacySliceConvertedSegmentEvent\n\t| ScreenshotTakenSegmentEvent\n\t| ChangesPushedSegmentEvent\n\t| ChangesGroupPushedSegmentEvent\n\t| ChangesLimitReachSegmentEvent\n\t| EditorWidgetUsedSegmentEvent\n\t| OpenPageSnippetSegmentEvent\n\t| CopyPageSnippetSegmentEvent\n\t| SwitchEnvironmentSegmentEvent\n\t| DevCollabJoinBetaClicked\n\t| DevCollabSetUpWorkflowOpened\n\t| DevCollabWorkflowStubDisplayed\n\t| SliceMachineStart\n\t| SliceMachineSharedOnboardingStepOpened\n\t| SliceMachineSharedOnboardingStepCompleted\n\t| SliceMachineSharedOnboardingCompleted\n\t| SliceMachineSharedOnboardingTutorial\n\t| SliceMachinePostPushEmptyStateCtaClicked\n\t| SliceMachinePostPushToastCtaClicked\n\t| SliceMachineExperimentExposure\n\t| SliceGenerationFeedback\n\t| NavigationDocumentationLinkClicked;\n"],"names":[],"mappings":";;AAUO,MAAM,mBAAmB;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EA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C,iBAAiB,cAAc,GAAG;AAAA,EACnC,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,iBAAiB,GAAG;AAAA,EACtC,CAAC,iBAAiB,iBAAiB,GAClC;AAAA,EACD,CAAC,iBAAiB,iBAAiB,GAClC;AAAA,EACD,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,yBAAyB,GAC1C;AAAA,EACD,CAAC,iBAAiB,6BAA6B,GAC9C;AAAA,EACD,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,6BAA6B,GAC9C;AAAA,EACD,CAAC,iBAAiB,wBAAwB,GACzC;AAAA,EACD,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,4BAA4B,GAC7C;AAAA,EACD,CAAC,iBAAiB,0BAA0B,GAC3C;AAAA,EACD,CAAC,iBAAiB,yBAAyB,GAC1C;AAAA,EACD,CAAC,iBAAiB,uBAAuB,GAAG;AAAA,EAC5C,CAAC,iBAAiB,mCAAmC,GACpD;;;;"}
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import {\n\tFieldType,\n\tLinkConfig,\n} from \"@prismicio/types-internal/lib/customtypes/widgets\";\n\nimport { CustomTypeFormat } from \"../customTypes/types\";\nimport type { PushChangesLimitType } from \"../prismicRepository/types\";\n\nexport type { Variant } from \"@amplitude/experiment-node-server\";\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\tsliceSimulator_open: \"slice-simulator:open\",\n\tsliceSimulator_isNotRunning: \"slice-simulator:is-not-running\",\n\tpageView: \"page-view\",\n\topenVideoTutorials: \"open-video-tutorials\",\n\tfield_added: \"field:added\",\n\tfield_updated: \"field:updated\",\n\tfield_settingsOpened: \"field:settings-opened\",\n\tcustomType_created: \"custom-type:created\",\n\tcustomType_sliceZoneUpdated: \"custom-type:slice-zone-updated\",\n\tcustomType_openAddFromTemplates: \"custom-type:open-add-from-templates\",\n\tcustomType_saved: \"custom-type:saved\",\n\tslice_created: \"slice:created\",\n\tlegacySlice_converted: \"legacy-slice:converted\",\n\tscreenshotTaken: \"screenshot-taken\",\n\tchanges_pushed: \"changes:pushed\",\n\tchanges_groupPushed: \"changes:group-pushed\",\n\tchanges_limitReach: \"changes:limit-reach\",\n\teditor_widgetUsed: \"editor:widget-used\",\n\topen_page_snippet: \"page-type:open-snippet\",\n\tcopy_page_snippet: \"page-type:copy-snippet\",\n\tswitch_environment: \"environment:switch\",\n\tdevCollab_joinBetaClicked: \"dev-collab:join-beta-clicked\",\n\tdevCollab_setUpWorkflowOpened: \"dev-collab:set-up-workflow-opened\",\n\tdevCollab_workflowStubDisplayed: \"dev-collab:workflow-stub-displayed\",\n\tsliceMachine_start: \"slice-machine:start\",\n\tpostPush_emptyStateCtaClicked: \"post-push:empty-state-cta-clicked\",\n\tpostPush_toastCtaClicked: \"post-push:toast-cta-clicked\",\n\texperiment_exposure: \"experiment:exposure\",\n\tsharedOnboarding_step_opened: \"shared-onboarding:step-opened\",\n\tsharedOnboarding_step_completed: \"shared-onboarding:step-completed\",\n\tsharedOnboarding_completed: \"shared-onboarding:completed\",\n\tsharedOnboarding_tutorial: \"shared-onboarding:follow-tutorial\",\n\tsliceGenerationFeedback: \"slice-generation-feedback\",\n\tnavigation_documentationLinkClicked: \"navigation:documentation-link-clicked\",\n\tsidebar_link_clicked: \"sidebar:link-clicked\",\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.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.field_added]: \"SliceMachine Field Added\",\n\t[SegmentEventType.field_updated]: \"SliceMachine Field Updated\",\n\t[SegmentEventType.field_settingsOpened]: \"SliceMachine Field Settings Opened\",\n\t[SegmentEventType.customType_created]: \"SliceMachine Custom Type Created\",\n\t[SegmentEventType.customType_sliceZoneUpdated]:\n\t\t\"SliceMachine Slicezone Updated\",\n\t[SegmentEventType.customType_openAddFromTemplates]:\n\t\t\"SliceMachine Open Add from templates\",\n\t[SegmentEventType.customType_saved]: \"SliceMachine Custom Type Saved\",\n\t[SegmentEventType.slice_created]: \"SliceMachine Slice Created\",\n\t[SegmentEventType.legacySlice_converted]:\n\t\t\"SliceMachine Legacy Slice Converted\",\n\t[SegmentEventType.screenshotTaken]: \"SliceMachine Screenshot Taken\",\n\t[SegmentEventType.changes_pushed]: \"SliceMachine Changes Pushed\",\n\t[SegmentEventType.changes_groupPushed]: \"SliceMachine Group Field Pushed\",\n\t[SegmentEventType.changes_limitReach]: \"SliceMachine Changes Limit Reach\",\n\t[SegmentEventType.editor_widgetUsed]: \"SliceMachine Editor Widget Used\",\n\t[SegmentEventType.open_page_snippet]:\n\t\t\"SliceMachine Opens Page Type Snippet Dialog\",\n\t[SegmentEventType.copy_page_snippet]:\n\t\t\"Slice Machine page code snippet copied\",\n\t[SegmentEventType.switch_environment]: \"SliceMachine environment switch\",\n\t[SegmentEventType.devCollab_joinBetaClicked]:\n\t\t\"SliceMachine Dev Collab Join Beta Clicked\",\n\t[SegmentEventType.devCollab_setUpWorkflowOpened]:\n\t\t\"SliceMachine Dev Collab Set Up Workflow Opened\",\n\t[SegmentEventType.devCollab_workflowStubDisplayed]:\n\t\t\"SliceMachine Dev Collab Workflow Stub Displayed\",\n\t[SegmentEventType.sliceMachine_start]: \"SliceMachine Start\",\n\t[SegmentEventType.postPush_emptyStateCtaClicked]:\n\t\t\"SliceMachine Post Push Empty State CTA Clicked\",\n\t[SegmentEventType.postPush_toastCtaClicked]:\n\t\t\"SliceMachine Post Push Toast CTA Clicked\",\n\t[SegmentEventType.experiment_exposure]: \"$exposure\",\n\t[SegmentEventType.sharedOnboarding_step_completed]:\n\t\t\"Prismic Onboarding Guide Step Completed\",\n\t[SegmentEventType.sharedOnboarding_step_opened]:\n\t\t\"Prismic Onboarding Guide Step Open\",\n\t[SegmentEventType.sharedOnboarding_completed]:\n\t\t\"Prismic Onboarding Guide Completed\",\n\t[SegmentEventType.sharedOnboarding_tutorial]:\n\t\t\"Prismic Onboarding Guide Follow Tutorial\",\n\t[SegmentEventType.sliceGenerationFeedback]: \"Slice Generation Feedback\",\n\t[SegmentEventType.navigation_documentationLinkClicked]:\n\t\t\"SliceMachine Documentation Link Clicked\",\n\t[SegmentEventType.sidebar_link_clicked]: \"Sidebar Link Clicked\",\n} as const;\n\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 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\t/*\n\t\t * We are tracking outer sizes instead of inner sizes as with the latter, we\n\t\t * can't differentiate between users with a high-density screen and those\n\t\t * zooming in/out with ⌘ + / ⌘ -. Indeed, when users zoom in/out, some\n\t\t * browsers (like Google Chrome) will update `window.devicePixelRatio` while\n\t\t * others (like Safari) will keep it unchanged so that it always reflects\n\t\t * the ratio of physical pixels to CSS pixels.\n\t\t */\n\t\touterWidth: number;\n\t\touterHeight: number;\n\t\tscreenWidth: number;\n\t\tscreenHeight: number;\n\t}\n>;\n\ntype OpenPageSnippetSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.open_page_snippet,\n\t{ framework: string }\n>;\n\ntype CopyPageSnippetSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.copy_page_snippet,\n\t{ framework: string }\n>;\n\ntype SwitchEnvironmentSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.switch_environment,\n\t{ domain: string }\n>;\n\ntype OpenVideoTutorialsSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.openVideoTutorials,\n\t{ video: string }\n>;\n\ntype FieldAddedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_added,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t\tallowText?: boolean;\n\t\trepeat?: boolean;\n\t\tvariants?: string[];\n\t\tlinkSelect?: LinkConfig[\"select\"];\n\t\tlinkPickedFields?: number;\n\t\tlinkNestedPickedFields?: number;\n\t}\n>;\n\ntype FieldUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_updated,\n\t{\n\t\tpreviousId: string;\n\t\tid: string;\n\t\tidUpdated: boolean;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t\tallowText?: boolean;\n\t\trepeat?: boolean;\n\t\tvariants?: string[];\n\t\tlinkSelect?: LinkConfig[\"select\"];\n\t\tlinkPickedFields?: number;\n\t\tlinkNestedPickedFields?: number;\n\t}\n>;\n\ntype FieldSettingsOpenedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_settingsOpened,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t}\n>;\n\ntype CustomTypeCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_created,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tformat: CustomTypeFormat;\n\t\ttype: \"repeatable\" | \"single\";\n\t\torigin: \"onboarding\" | \"table\";\n\t}\n>;\n\ntype CustomTypeSliceZoneUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_sliceZoneUpdated,\n\t{ customTypeId: string }\n>;\n\ntype CustomTypeOpenAddFromTemplatesEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_openAddFromTemplates,\n\t{ customTypeId: string; customTypeFormat: CustomTypeFormat }\n>;\n\ntype CustomTypeSavedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_saved,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tformat: CustomTypeFormat;\n\t\ttype: \"repeatable\" | \"single\";\n\t}\n>;\n\ntype SliceCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.slice_created,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tlibrary: string;\n\t\tlocation: \"custom_type\" | \"page_type\" | \"slices\";\n\t} & (\n\t\t| { mode: \"ai\"; langSmithUrl?: string }\n\t\t| { mode: \"manual\" }\n\t\t| { mode: \"template\"; sliceTemplate: string }\n\t)\n>;\n\ntype LegacySliceConvertedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.legacySlice_converted,\n\t{\n\t\tid: string;\n\t\tvariation: string;\n\t\tlibrary: string;\n\t\tconversionType:\n\t\t\t| \"as_new_slice\"\n\t\t\t| \"as_new_variation\"\n\t\t\t| \"merge_with_identical\";\n\t}\n>;\n\ntype ScreenshotTakenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.screenshotTaken,\n\t{\n\t\ttype: \"custom\";\n\t\tmethod: \"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 ChangesGroupPushedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_groupPushed,\n\t{\n\t\tisInStaticZone: boolean;\n\t\tisInSlice: boolean;\n\t} & {\n\t\t[key in FieldType]?: number;\n\t}\n>;\n\ntype ChangesLimitReachSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_limitReach,\n\t{ limitType: PushChangesLimitType }\n>;\n\ntype EditorWidgetUsedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.editor_widgetUsed,\n\t{ sliceId: string }\n>;\n\ntype DevCollabJoinBetaClicked = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_joinBetaClicked\n>;\n\ntype DevCollabSetUpWorkflowOpened = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_setUpWorkflowOpened\n>;\n\ntype DevCollabWorkflowStubDisplayed = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_workflowStubDisplayed\n>;\n\ntype SliceMachineStart = SegmentEvent<\n\ttypeof SegmentEventType.sliceMachine_start,\n\t{\n\t\tadapter?: string;\n\t\tadapterVersion?: string;\n\t\tisAdapterUpdateAvailable?: boolean;\n\t\tisLoggedIn?: boolean;\n\t\tisSliceMachineUpdateAvailable?: boolean;\n\t\tisTypeScriptProject?: boolean;\n\t\tnodeVersion?: string;\n\t\tnumberOfCustomTypes?: number;\n\t\tnumberOfSlices?: number;\n\t\tosPlatform?: string;\n\t\tpackageManager?: string;\n\t\tprojectPort?: string;\n\t\tsliceMachineVersion?: string;\n\t\tversionControlSystem?: string;\n\t}\n>;\n\ntype OnboardingCommonPayload = { stepId: string; stepTitle: string };\ntype SharedOnboardingProperties<T = Record<string, string>> = T & {\n\tsource: \"SliceMachine\";\n};\n\ntype SliceMachineSharedOnboardingStepOpened = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_step_opened,\n\tSharedOnboardingProperties<OnboardingCommonPayload>\n>;\ntype SliceMachineSharedOnboardingStepCompleted = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_step_completed,\n\tSharedOnboardingProperties<OnboardingCommonPayload>\n>;\ntype SliceMachineSharedOnboardingCompleted = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_completed,\n\tSharedOnboardingProperties\n>;\ntype SliceMachineSharedOnboardingTutorial = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_tutorial,\n\tSharedOnboardingProperties\n>;\ntype SliceMachinePostPushEmptyStateCtaClicked = SegmentEvent<\n\ttypeof SegmentEventType.postPush_emptyStateCtaClicked\n>;\n\ntype SliceMachinePostPushToastCtaClicked = SegmentEvent<\n\ttypeof SegmentEventType.postPush_toastCtaClicked\n>;\n\ntype SliceMachineExperimentExposure = SegmentEvent<\n\ttypeof SegmentEventType.experiment_exposure,\n\t{\n\t\tflag_key: string;\n\t\tvariant: string;\n\t}\n>;\n\ntype SliceGenerationFeedback = SegmentEvent<\n\ttypeof SegmentEventType.sliceGenerationFeedback,\n\t{\n\t\ttype: \"model\";\n\t\tsliceId: string;\n\t\tvariationId: string;\n\t\tfeedback: \"up\" | \"down\";\n\t\tlangSmithUrl?: string;\n\t}\n>;\n\ntype NavigationDocumentationLinkClicked = SegmentEvent<\n\ttypeof SegmentEventType.navigation_documentationLinkClicked,\n\t{\n\t\tframework: string;\n\t}\n>;\n\ntype SidebarLinkClicked = SegmentEvent<\n\ttypeof SegmentEventType.sidebar_link_clicked,\n\t{\n\t\tlink_name: string;\n\t\tsource: string;\n\t}\n>;\n\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| FieldAddedSegmentEvent\n\t| FieldUpdatedSegmentEvent\n\t| FieldSettingsOpenedSegmentEvent\n\t| CustomTypeCreatedSegmentEvent\n\t| CustomTypeSliceZoneUpdatedSegmentEvent\n\t| CustomTypeOpenAddFromTemplatesEvent\n\t| CustomTypeSavedSegmentEvent\n\t| SliceCreatedSegmentEvent\n\t| LegacySliceConvertedSegmentEvent\n\t| ScreenshotTakenSegmentEvent\n\t| ChangesPushedSegmentEvent\n\t| ChangesGroupPushedSegmentEvent\n\t| ChangesLimitReachSegmentEvent\n\t| EditorWidgetUsedSegmentEvent\n\t| OpenPageSnippetSegmentEvent\n\t| CopyPageSnippetSegmentEvent\n\t| SwitchEnvironmentSegmentEvent\n\t| DevCollabJoinBetaClicked\n\t| DevCollabSetUpWorkflowOpened\n\t| DevCollabWorkflowStubDisplayed\n\t| SliceMachineStart\n\t| SliceMachineSharedOnboardingStepOpened\n\t| SliceMachineSharedOnboardingStepCompleted\n\t| SliceMachineSharedOnboardingCompleted\n\t| SliceMachineSharedOnboardingTutorial\n\t| SliceMachinePostPushEmptyStateCtaClicked\n\t| SliceMachinePostPushToastCtaClicked\n\t| SliceMachineExperimentExposure\n\t| SliceGenerationFeedback\n\t| NavigationDocumentationLinkClicked\n\t| SidebarLinkClicked;\n"],"names":[],"mappings":";;AAUO,MAAM,mBAAmB;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,uBAAuB;AAAA,EACvB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,2BAA2B;AAAA,EAC3B,+BAA+B;AAAA,EAC/B,iCAAiC;AAAA,EACjC,oBAAoB;AAAA,EACpB,+BAA+B;AAAA,EAC/B,0BAA0B;AAAA,EAC1B,qBAAqB;AAAA,EACrB,8BAA8B;AAAA,EAC9B,iCAAiC;AAAA,EACjC,4BAA4B;AAAA,EAC5B,2BAA2B;AAAA,EAC3B,yBAAyB;AAAA,EACzB,qCAAqC;AAAA,EACrC,sBAAsB;;AAKhB,MAAM,wBAAwB;AAAA,EACpC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,qBAAqB,GAAG;AAAA,EAC1C,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAi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ACD,CAAC,iBAAiB,yBAAyB,GAC1C;AAAA,EACD,CAAC,iBAAiB,uBAAuB,GAAG;AAAA,EAC5C,CAAC,iBAAiB,mCAAmC,GACpD;AAAA,EACD,CAAC,iBAAiB,oBAAoB,GAAG;;;;"}
|
|
@@ -40,6 +40,7 @@ export declare const SegmentEventType: {
|
|
|
40
40
|
readonly sharedOnboarding_tutorial: "shared-onboarding:follow-tutorial";
|
|
41
41
|
readonly sliceGenerationFeedback: "slice-generation-feedback";
|
|
42
42
|
readonly navigation_documentationLinkClicked: "navigation:documentation-link-clicked";
|
|
43
|
+
readonly sidebar_link_clicked: "sidebar:link-clicked";
|
|
43
44
|
};
|
|
44
45
|
type SegmentEventTypes = (typeof SegmentEventType)[keyof typeof SegmentEventType];
|
|
45
46
|
export declare const HumanSegmentEventType: {
|
|
@@ -80,6 +81,7 @@ export declare const HumanSegmentEventType: {
|
|
|
80
81
|
readonly "shared-onboarding:follow-tutorial": "Prismic Onboarding Guide Follow Tutorial";
|
|
81
82
|
readonly "slice-generation-feedback": "Slice Generation Feedback";
|
|
82
83
|
readonly "navigation:documentation-link-clicked": "SliceMachine Documentation Link Clicked";
|
|
84
|
+
readonly "sidebar:link-clicked": "Sidebar Link Clicked";
|
|
83
85
|
};
|
|
84
86
|
export type HumanSegmentEventTypes = (typeof HumanSegmentEventType)[keyof typeof HumanSegmentEventType];
|
|
85
87
|
type SegmentEvent<TType extends SegmentEventTypes, TProperties extends Record<string, unknown> | void = void> = TProperties extends void ? {
|
|
@@ -231,7 +233,6 @@ type DevCollabWorkflowStubDisplayed = SegmentEvent<typeof SegmentEventType.devCo
|
|
|
231
233
|
type SliceMachineStart = SegmentEvent<typeof SegmentEventType.sliceMachine_start, {
|
|
232
234
|
adapter?: string;
|
|
233
235
|
adapterVersion?: string;
|
|
234
|
-
gitProvider?: string;
|
|
235
236
|
isAdapterUpdateAvailable?: boolean;
|
|
236
237
|
isLoggedIn?: boolean;
|
|
237
238
|
isSliceMachineUpdateAvailable?: boolean;
|
|
@@ -272,4 +273,8 @@ type SliceGenerationFeedback = SegmentEvent<typeof SegmentEventType.sliceGenerat
|
|
|
272
273
|
type NavigationDocumentationLinkClicked = SegmentEvent<typeof SegmentEventType.navigation_documentationLinkClicked, {
|
|
273
274
|
framework: string;
|
|
274
275
|
}>;
|
|
275
|
-
|
|
276
|
+
type SidebarLinkClicked = SegmentEvent<typeof SegmentEventType.sidebar_link_clicked, {
|
|
277
|
+
link_name: string;
|
|
278
|
+
source: string;
|
|
279
|
+
}>;
|
|
280
|
+
export type SegmentEvents = CommandInitStartSegmentEvent | CommandInitIdentifySegmentEvent | CommandInitEndSegmentEvent | SliceSimulatorOpenSegmentEvent | SliceSimulatorIsNotRunningSegmentEvent | PageViewSegmentEvent | OpenVideoTutorialsSegmentEvent | FieldAddedSegmentEvent | FieldUpdatedSegmentEvent | FieldSettingsOpenedSegmentEvent | CustomTypeCreatedSegmentEvent | CustomTypeSliceZoneUpdatedSegmentEvent | CustomTypeOpenAddFromTemplatesEvent | CustomTypeSavedSegmentEvent | SliceCreatedSegmentEvent | LegacySliceConvertedSegmentEvent | ScreenshotTakenSegmentEvent | ChangesPushedSegmentEvent | ChangesGroupPushedSegmentEvent | ChangesLimitReachSegmentEvent | EditorWidgetUsedSegmentEvent | OpenPageSnippetSegmentEvent | CopyPageSnippetSegmentEvent | SwitchEnvironmentSegmentEvent | DevCollabJoinBetaClicked | DevCollabSetUpWorkflowOpened | DevCollabWorkflowStubDisplayed | SliceMachineStart | SliceMachineSharedOnboardingStepOpened | SliceMachineSharedOnboardingStepCompleted | SliceMachineSharedOnboardingCompleted | SliceMachineSharedOnboardingTutorial | SliceMachinePostPushEmptyStateCtaClicked | SliceMachinePostPushToastCtaClicked | SliceMachineExperimentExposure | SliceGenerationFeedback | NavigationDocumentationLinkClicked | SidebarLinkClicked;
|
|
@@ -35,7 +35,8 @@ const SegmentEventType = {
|
|
|
35
35
|
sharedOnboarding_completed: "shared-onboarding:completed",
|
|
36
36
|
sharedOnboarding_tutorial: "shared-onboarding:follow-tutorial",
|
|
37
37
|
sliceGenerationFeedback: "slice-generation-feedback",
|
|
38
|
-
navigation_documentationLinkClicked: "navigation:documentation-link-clicked"
|
|
38
|
+
navigation_documentationLinkClicked: "navigation:documentation-link-clicked",
|
|
39
|
+
sidebar_link_clicked: "sidebar:link-clicked"
|
|
39
40
|
};
|
|
40
41
|
const HumanSegmentEventType = {
|
|
41
42
|
[SegmentEventType.command_init_start]: "SliceMachine Init Start",
|
|
@@ -74,7 +75,8 @@ const HumanSegmentEventType = {
|
|
|
74
75
|
[SegmentEventType.sharedOnboarding_completed]: "Prismic Onboarding Guide Completed",
|
|
75
76
|
[SegmentEventType.sharedOnboarding_tutorial]: "Prismic Onboarding Guide Follow Tutorial",
|
|
76
77
|
[SegmentEventType.sliceGenerationFeedback]: "Slice Generation Feedback",
|
|
77
|
-
[SegmentEventType.navigation_documentationLinkClicked]: "SliceMachine Documentation Link Clicked"
|
|
78
|
+
[SegmentEventType.navigation_documentationLinkClicked]: "SliceMachine Documentation Link Clicked",
|
|
79
|
+
[SegmentEventType.sidebar_link_clicked]: "Sidebar Link Clicked"
|
|
78
80
|
};
|
|
79
81
|
export {
|
|
80
82
|
HumanSegmentEventType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import {\n\tFieldType,\n\tLinkConfig,\n} from \"@prismicio/types-internal/lib/customtypes/widgets\";\n\nimport { CustomTypeFormat } from \"../customTypes/types\";\nimport type { PushChangesLimitType } from \"../prismicRepository/types\";\n\nexport type { Variant } from \"@amplitude/experiment-node-server\";\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\tsliceSimulator_open: \"slice-simulator:open\",\n\tsliceSimulator_isNotRunning: \"slice-simulator:is-not-running\",\n\tpageView: \"page-view\",\n\topenVideoTutorials: \"open-video-tutorials\",\n\tfield_added: \"field:added\",\n\tfield_updated: \"field:updated\",\n\tfield_settingsOpened: \"field:settings-opened\",\n\tcustomType_created: \"custom-type:created\",\n\tcustomType_sliceZoneUpdated: \"custom-type:slice-zone-updated\",\n\tcustomType_openAddFromTemplates: \"custom-type:open-add-from-templates\",\n\tcustomType_saved: \"custom-type:saved\",\n\tslice_created: \"slice:created\",\n\tlegacySlice_converted: \"legacy-slice:converted\",\n\tscreenshotTaken: \"screenshot-taken\",\n\tchanges_pushed: \"changes:pushed\",\n\tchanges_groupPushed: \"changes:group-pushed\",\n\tchanges_limitReach: \"changes:limit-reach\",\n\teditor_widgetUsed: \"editor:widget-used\",\n\topen_page_snippet: \"page-type:open-snippet\",\n\tcopy_page_snippet: \"page-type:copy-snippet\",\n\tswitch_environment: \"environment:switch\",\n\tdevCollab_joinBetaClicked: \"dev-collab:join-beta-clicked\",\n\tdevCollab_setUpWorkflowOpened: \"dev-collab:set-up-workflow-opened\",\n\tdevCollab_workflowStubDisplayed: \"dev-collab:workflow-stub-displayed\",\n\tsliceMachine_start: \"slice-machine:start\",\n\tpostPush_emptyStateCtaClicked: \"post-push:empty-state-cta-clicked\",\n\tpostPush_toastCtaClicked: \"post-push:toast-cta-clicked\",\n\texperiment_exposure: \"experiment:exposure\",\n\tsharedOnboarding_step_opened: \"shared-onboarding:step-opened\",\n\tsharedOnboarding_step_completed: \"shared-onboarding:step-completed\",\n\tsharedOnboarding_completed: \"shared-onboarding:completed\",\n\tsharedOnboarding_tutorial: \"shared-onboarding:follow-tutorial\",\n\tsliceGenerationFeedback: \"slice-generation-feedback\",\n\tnavigation_documentationLinkClicked: \"navigation:documentation-link-clicked\",\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.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.field_added]: \"SliceMachine Field Added\",\n\t[SegmentEventType.field_updated]: \"SliceMachine Field Updated\",\n\t[SegmentEventType.field_settingsOpened]: \"SliceMachine Field Settings Opened\",\n\t[SegmentEventType.customType_created]: \"SliceMachine Custom Type Created\",\n\t[SegmentEventType.customType_sliceZoneUpdated]:\n\t\t\"SliceMachine Slicezone Updated\",\n\t[SegmentEventType.customType_openAddFromTemplates]:\n\t\t\"SliceMachine Open Add from templates\",\n\t[SegmentEventType.customType_saved]: \"SliceMachine Custom Type Saved\",\n\t[SegmentEventType.slice_created]: \"SliceMachine Slice Created\",\n\t[SegmentEventType.legacySlice_converted]:\n\t\t\"SliceMachine Legacy Slice Converted\",\n\t[SegmentEventType.screenshotTaken]: \"SliceMachine Screenshot Taken\",\n\t[SegmentEventType.changes_pushed]: \"SliceMachine Changes Pushed\",\n\t[SegmentEventType.changes_groupPushed]: \"SliceMachine Group Field Pushed\",\n\t[SegmentEventType.changes_limitReach]: \"SliceMachine Changes Limit Reach\",\n\t[SegmentEventType.editor_widgetUsed]: \"SliceMachine Editor Widget Used\",\n\t[SegmentEventType.open_page_snippet]:\n\t\t\"SliceMachine Opens Page Type Snippet Dialog\",\n\t[SegmentEventType.copy_page_snippet]:\n\t\t\"Slice Machine page code snippet copied\",\n\t[SegmentEventType.switch_environment]: \"SliceMachine environment switch\",\n\t[SegmentEventType.devCollab_joinBetaClicked]:\n\t\t\"SliceMachine Dev Collab Join Beta Clicked\",\n\t[SegmentEventType.devCollab_setUpWorkflowOpened]:\n\t\t\"SliceMachine Dev Collab Set Up Workflow Opened\",\n\t[SegmentEventType.devCollab_workflowStubDisplayed]:\n\t\t\"SliceMachine Dev Collab Workflow Stub Displayed\",\n\t[SegmentEventType.sliceMachine_start]: \"SliceMachine Start\",\n\t[SegmentEventType.postPush_emptyStateCtaClicked]:\n\t\t\"SliceMachine Post Push Empty State CTA Clicked\",\n\t[SegmentEventType.postPush_toastCtaClicked]:\n\t\t\"SliceMachine Post Push Toast CTA Clicked\",\n\t[SegmentEventType.experiment_exposure]: \"$exposure\",\n\t[SegmentEventType.sharedOnboarding_step_completed]:\n\t\t\"Prismic Onboarding Guide Step Completed\",\n\t[SegmentEventType.sharedOnboarding_step_opened]:\n\t\t\"Prismic Onboarding Guide Step Open\",\n\t[SegmentEventType.sharedOnboarding_completed]:\n\t\t\"Prismic Onboarding Guide Completed\",\n\t[SegmentEventType.sharedOnboarding_tutorial]:\n\t\t\"Prismic Onboarding Guide Follow Tutorial\",\n\t[SegmentEventType.sliceGenerationFeedback]: \"Slice Generation Feedback\",\n\t[SegmentEventType.navigation_documentationLinkClicked]:\n\t\t\"SliceMachine Documentation Link Clicked\",\n} as const;\n\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 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\t/*\n\t\t * We are tracking outer sizes instead of inner sizes as with the latter, we\n\t\t * can't differentiate between users with a high-density screen and those\n\t\t * zooming in/out with ⌘ + / ⌘ -. Indeed, when users zoom in/out, some\n\t\t * browsers (like Google Chrome) will update `window.devicePixelRatio` while\n\t\t * others (like Safari) will keep it unchanged so that it always reflects\n\t\t * the ratio of physical pixels to CSS pixels.\n\t\t */\n\t\touterWidth: number;\n\t\touterHeight: number;\n\t\tscreenWidth: number;\n\t\tscreenHeight: number;\n\t}\n>;\n\ntype OpenPageSnippetSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.open_page_snippet,\n\t{ framework: string }\n>;\n\ntype CopyPageSnippetSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.copy_page_snippet,\n\t{ framework: string }\n>;\n\ntype SwitchEnvironmentSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.switch_environment,\n\t{ domain: string }\n>;\n\ntype OpenVideoTutorialsSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.openVideoTutorials,\n\t{ video: string }\n>;\n\ntype FieldAddedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_added,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t\tallowText?: boolean;\n\t\trepeat?: boolean;\n\t\tvariants?: string[];\n\t\tlinkSelect?: LinkConfig[\"select\"];\n\t\tlinkPickedFields?: number;\n\t\tlinkNestedPickedFields?: number;\n\t}\n>;\n\ntype FieldUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_updated,\n\t{\n\t\tpreviousId: string;\n\t\tid: string;\n\t\tidUpdated: boolean;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t\tallowText?: boolean;\n\t\trepeat?: boolean;\n\t\tvariants?: string[];\n\t\tlinkSelect?: LinkConfig[\"select\"];\n\t\tlinkPickedFields?: number;\n\t\tlinkNestedPickedFields?: number;\n\t}\n>;\n\ntype FieldSettingsOpenedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_settingsOpened,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t}\n>;\n\ntype CustomTypeCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_created,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tformat: CustomTypeFormat;\n\t\ttype: \"repeatable\" | \"single\";\n\t\torigin: \"onboarding\" | \"table\";\n\t}\n>;\n\ntype CustomTypeSliceZoneUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_sliceZoneUpdated,\n\t{ customTypeId: string }\n>;\n\ntype CustomTypeOpenAddFromTemplatesEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_openAddFromTemplates,\n\t{ customTypeId: string; customTypeFormat: CustomTypeFormat }\n>;\n\ntype CustomTypeSavedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_saved,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tformat: CustomTypeFormat;\n\t\ttype: \"repeatable\" | \"single\";\n\t}\n>;\n\ntype SliceCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.slice_created,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tlibrary: string;\n\t\tlocation: \"custom_type\" | \"page_type\" | \"slices\";\n\t} & (\n\t\t| { mode: \"ai\"; langSmithUrl?: string }\n\t\t| { mode: \"manual\" }\n\t\t| { mode: \"template\"; sliceTemplate: string }\n\t)\n>;\n\ntype LegacySliceConvertedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.legacySlice_converted,\n\t{\n\t\tid: string;\n\t\tvariation: string;\n\t\tlibrary: string;\n\t\tconversionType:\n\t\t\t| \"as_new_slice\"\n\t\t\t| \"as_new_variation\"\n\t\t\t| \"merge_with_identical\";\n\t}\n>;\n\ntype ScreenshotTakenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.screenshotTaken,\n\t{\n\t\ttype: \"custom\";\n\t\tmethod: \"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 ChangesGroupPushedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_groupPushed,\n\t{\n\t\tisInStaticZone: boolean;\n\t\tisInSlice: boolean;\n\t} & {\n\t\t[key in FieldType]?: number;\n\t}\n>;\n\ntype ChangesLimitReachSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_limitReach,\n\t{ limitType: PushChangesLimitType }\n>;\n\ntype EditorWidgetUsedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.editor_widgetUsed,\n\t{ sliceId: string }\n>;\n\ntype DevCollabJoinBetaClicked = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_joinBetaClicked\n>;\n\ntype DevCollabSetUpWorkflowOpened = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_setUpWorkflowOpened\n>;\n\ntype DevCollabWorkflowStubDisplayed = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_workflowStubDisplayed\n>;\n\ntype SliceMachineStart = SegmentEvent<\n\ttypeof SegmentEventType.sliceMachine_start,\n\t{\n\t\tadapter?: string;\n\t\tadapterVersion?: string;\n\t\tgitProvider?: string;\n\t\tisAdapterUpdateAvailable?: boolean;\n\t\tisLoggedIn?: boolean;\n\t\tisSliceMachineUpdateAvailable?: boolean;\n\t\tisTypeScriptProject?: boolean;\n\t\tnodeVersion?: string;\n\t\tnumberOfCustomTypes?: number;\n\t\tnumberOfSlices?: number;\n\t\tosPlatform?: string;\n\t\tpackageManager?: string;\n\t\tprojectPort?: string;\n\t\tsliceMachineVersion?: string;\n\t\tversionControlSystem?: string;\n\t}\n>;\n\ntype OnboardingCommonPayload = { stepId: string; stepTitle: string };\ntype SharedOnboardingProperties<T = Record<string, string>> = T & {\n\tsource: \"SliceMachine\";\n};\n\ntype SliceMachineSharedOnboardingStepOpened = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_step_opened,\n\tSharedOnboardingProperties<OnboardingCommonPayload>\n>;\ntype SliceMachineSharedOnboardingStepCompleted = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_step_completed,\n\tSharedOnboardingProperties<OnboardingCommonPayload>\n>;\ntype SliceMachineSharedOnboardingCompleted = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_completed,\n\tSharedOnboardingProperties\n>;\ntype SliceMachineSharedOnboardingTutorial = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_tutorial,\n\tSharedOnboardingProperties\n>;\ntype SliceMachinePostPushEmptyStateCtaClicked = SegmentEvent<\n\ttypeof SegmentEventType.postPush_emptyStateCtaClicked\n>;\n\ntype SliceMachinePostPushToastCtaClicked = SegmentEvent<\n\ttypeof SegmentEventType.postPush_toastCtaClicked\n>;\n\ntype SliceMachineExperimentExposure = SegmentEvent<\n\ttypeof SegmentEventType.experiment_exposure,\n\t{\n\t\tflag_key: string;\n\t\tvariant: string;\n\t}\n>;\n\ntype SliceGenerationFeedback = SegmentEvent<\n\ttypeof SegmentEventType.sliceGenerationFeedback,\n\t{\n\t\ttype: \"model\";\n\t\tsliceId: string;\n\t\tvariationId: string;\n\t\tfeedback: \"up\" | \"down\";\n\t\tlangSmithUrl?: string;\n\t}\n>;\n\ntype NavigationDocumentationLinkClicked = SegmentEvent<\n\ttypeof SegmentEventType.navigation_documentationLinkClicked,\n\t{\n\t\tframework: string;\n\t}\n>;\n\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| FieldAddedSegmentEvent\n\t| FieldUpdatedSegmentEvent\n\t| FieldSettingsOpenedSegmentEvent\n\t| CustomTypeCreatedSegmentEvent\n\t| CustomTypeSliceZoneUpdatedSegmentEvent\n\t| CustomTypeOpenAddFromTemplatesEvent\n\t| CustomTypeSavedSegmentEvent\n\t| SliceCreatedSegmentEvent\n\t| LegacySliceConvertedSegmentEvent\n\t| ScreenshotTakenSegmentEvent\n\t| ChangesPushedSegmentEvent\n\t| ChangesGroupPushedSegmentEvent\n\t| ChangesLimitReachSegmentEvent\n\t| EditorWidgetUsedSegmentEvent\n\t| OpenPageSnippetSegmentEvent\n\t| CopyPageSnippetSegmentEvent\n\t| SwitchEnvironmentSegmentEvent\n\t| DevCollabJoinBetaClicked\n\t| DevCollabSetUpWorkflowOpened\n\t| DevCollabWorkflowStubDisplayed\n\t| SliceMachineStart\n\t| SliceMachineSharedOnboardingStepOpened\n\t| SliceMachineSharedOnboardingStepCompleted\n\t| SliceMachineSharedOnboardingCompleted\n\t| SliceMachineSharedOnboardingTutorial\n\t| SliceMachinePostPushEmptyStateCtaClicked\n\t| SliceMachinePostPushToastCtaClicked\n\t| SliceMachineExperimentExposure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AClC,CAAC,iBAAiB,oBAAoB,GAAG;AAAA,EACzC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,2BAA2B,GAC5C;AAAA,EACD,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,iBAAiB,aAAa,GAAG;AAAA,EAClC,CAAC,iBAAiB,qBAAqB,GACtC;AAAA,EACD,CAAC,iBAAiB,eAAe,GAAG;AAAA,EACpC,CAAC,iBAAiB,cAAc,GAAG;AAAA,EACnC,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,iBAAiB,GAAG;AAAA,EACtC,CAAC,iBAAiB,iBAAiB,GAClC;AAAA,EACD,CAAC,iBAAiB,iBAAiB,GAClC;AAAA,EACD,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,yBAAyB,GAC1C;AAAA,EACD,CAAC,iBAAiB,6BAA6B,GAC9C;AAAA,EACD,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,6BAA6B,GAC9C;AAAA,EACD,CAAC,iBAAiB,wBAAwB,GACzC;AAAA,EACD,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,4BAA4B,GAC7C;AAAA,EACD,CAAC,iBAAiB,0BAA0B,GAC3C;AAAA,EACD,CAAC,iBAAiB,yBAAyB,GAC1C;AAAA,EACD,CAAC,iBAAiB,uBAAuB,GAAG;AAAA,EAC5C,CAAC,iBAAiB,mCAAmC,GACpD;;"}
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import {\n\tFieldType,\n\tLinkConfig,\n} from \"@prismicio/types-internal/lib/customtypes/widgets\";\n\nimport { CustomTypeFormat } from \"../customTypes/types\";\nimport type { PushChangesLimitType } from \"../prismicRepository/types\";\n\nexport type { Variant } from \"@amplitude/experiment-node-server\";\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\tsliceSimulator_open: \"slice-simulator:open\",\n\tsliceSimulator_isNotRunning: \"slice-simulator:is-not-running\",\n\tpageView: \"page-view\",\n\topenVideoTutorials: \"open-video-tutorials\",\n\tfield_added: \"field:added\",\n\tfield_updated: \"field:updated\",\n\tfield_settingsOpened: \"field:settings-opened\",\n\tcustomType_created: \"custom-type:created\",\n\tcustomType_sliceZoneUpdated: \"custom-type:slice-zone-updated\",\n\tcustomType_openAddFromTemplates: \"custom-type:open-add-from-templates\",\n\tcustomType_saved: \"custom-type:saved\",\n\tslice_created: \"slice:created\",\n\tlegacySlice_converted: \"legacy-slice:converted\",\n\tscreenshotTaken: \"screenshot-taken\",\n\tchanges_pushed: \"changes:pushed\",\n\tchanges_groupPushed: \"changes:group-pushed\",\n\tchanges_limitReach: \"changes:limit-reach\",\n\teditor_widgetUsed: \"editor:widget-used\",\n\topen_page_snippet: \"page-type:open-snippet\",\n\tcopy_page_snippet: \"page-type:copy-snippet\",\n\tswitch_environment: \"environment:switch\",\n\tdevCollab_joinBetaClicked: \"dev-collab:join-beta-clicked\",\n\tdevCollab_setUpWorkflowOpened: \"dev-collab:set-up-workflow-opened\",\n\tdevCollab_workflowStubDisplayed: \"dev-collab:workflow-stub-displayed\",\n\tsliceMachine_start: \"slice-machine:start\",\n\tpostPush_emptyStateCtaClicked: \"post-push:empty-state-cta-clicked\",\n\tpostPush_toastCtaClicked: \"post-push:toast-cta-clicked\",\n\texperiment_exposure: \"experiment:exposure\",\n\tsharedOnboarding_step_opened: \"shared-onboarding:step-opened\",\n\tsharedOnboarding_step_completed: \"shared-onboarding:step-completed\",\n\tsharedOnboarding_completed: \"shared-onboarding:completed\",\n\tsharedOnboarding_tutorial: \"shared-onboarding:follow-tutorial\",\n\tsliceGenerationFeedback: \"slice-generation-feedback\",\n\tnavigation_documentationLinkClicked: \"navigation:documentation-link-clicked\",\n\tsidebar_link_clicked: \"sidebar:link-clicked\",\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.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.field_added]: \"SliceMachine Field Added\",\n\t[SegmentEventType.field_updated]: \"SliceMachine Field Updated\",\n\t[SegmentEventType.field_settingsOpened]: \"SliceMachine Field Settings Opened\",\n\t[SegmentEventType.customType_created]: \"SliceMachine Custom Type Created\",\n\t[SegmentEventType.customType_sliceZoneUpdated]:\n\t\t\"SliceMachine Slicezone Updated\",\n\t[SegmentEventType.customType_openAddFromTemplates]:\n\t\t\"SliceMachine Open Add from templates\",\n\t[SegmentEventType.customType_saved]: \"SliceMachine Custom Type Saved\",\n\t[SegmentEventType.slice_created]: \"SliceMachine Slice Created\",\n\t[SegmentEventType.legacySlice_converted]:\n\t\t\"SliceMachine Legacy Slice Converted\",\n\t[SegmentEventType.screenshotTaken]: \"SliceMachine Screenshot Taken\",\n\t[SegmentEventType.changes_pushed]: \"SliceMachine Changes Pushed\",\n\t[SegmentEventType.changes_groupPushed]: \"SliceMachine Group Field Pushed\",\n\t[SegmentEventType.changes_limitReach]: \"SliceMachine Changes Limit Reach\",\n\t[SegmentEventType.editor_widgetUsed]: \"SliceMachine Editor Widget Used\",\n\t[SegmentEventType.open_page_snippet]:\n\t\t\"SliceMachine Opens Page Type Snippet Dialog\",\n\t[SegmentEventType.copy_page_snippet]:\n\t\t\"Slice Machine page code snippet copied\",\n\t[SegmentEventType.switch_environment]: \"SliceMachine environment switch\",\n\t[SegmentEventType.devCollab_joinBetaClicked]:\n\t\t\"SliceMachine Dev Collab Join Beta Clicked\",\n\t[SegmentEventType.devCollab_setUpWorkflowOpened]:\n\t\t\"SliceMachine Dev Collab Set Up Workflow Opened\",\n\t[SegmentEventType.devCollab_workflowStubDisplayed]:\n\t\t\"SliceMachine Dev Collab Workflow Stub Displayed\",\n\t[SegmentEventType.sliceMachine_start]: \"SliceMachine Start\",\n\t[SegmentEventType.postPush_emptyStateCtaClicked]:\n\t\t\"SliceMachine Post Push Empty State CTA Clicked\",\n\t[SegmentEventType.postPush_toastCtaClicked]:\n\t\t\"SliceMachine Post Push Toast CTA Clicked\",\n\t[SegmentEventType.experiment_exposure]: \"$exposure\",\n\t[SegmentEventType.sharedOnboarding_step_completed]:\n\t\t\"Prismic Onboarding Guide Step Completed\",\n\t[SegmentEventType.sharedOnboarding_step_opened]:\n\t\t\"Prismic Onboarding Guide Step Open\",\n\t[SegmentEventType.sharedOnboarding_completed]:\n\t\t\"Prismic Onboarding Guide Completed\",\n\t[SegmentEventType.sharedOnboarding_tutorial]:\n\t\t\"Prismic Onboarding Guide Follow Tutorial\",\n\t[SegmentEventType.sliceGenerationFeedback]: \"Slice Generation Feedback\",\n\t[SegmentEventType.navigation_documentationLinkClicked]:\n\t\t\"SliceMachine Documentation Link Clicked\",\n\t[SegmentEventType.sidebar_link_clicked]: \"Sidebar Link Clicked\",\n} as const;\n\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 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\t/*\n\t\t * We are tracking outer sizes instead of inner sizes as with the latter, we\n\t\t * can't differentiate between users with a high-density screen and those\n\t\t * zooming in/out with ⌘ + / ⌘ -. Indeed, when users zoom in/out, some\n\t\t * browsers (like Google Chrome) will update `window.devicePixelRatio` while\n\t\t * others (like Safari) will keep it unchanged so that it always reflects\n\t\t * the ratio of physical pixels to CSS pixels.\n\t\t */\n\t\touterWidth: number;\n\t\touterHeight: number;\n\t\tscreenWidth: number;\n\t\tscreenHeight: number;\n\t}\n>;\n\ntype OpenPageSnippetSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.open_page_snippet,\n\t{ framework: string }\n>;\n\ntype CopyPageSnippetSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.copy_page_snippet,\n\t{ framework: string }\n>;\n\ntype SwitchEnvironmentSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.switch_environment,\n\t{ domain: string }\n>;\n\ntype OpenVideoTutorialsSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.openVideoTutorials,\n\t{ video: string }\n>;\n\ntype FieldAddedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_added,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t\tallowText?: boolean;\n\t\trepeat?: boolean;\n\t\tvariants?: string[];\n\t\tlinkSelect?: LinkConfig[\"select\"];\n\t\tlinkPickedFields?: number;\n\t\tlinkNestedPickedFields?: number;\n\t}\n>;\n\ntype FieldUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_updated,\n\t{\n\t\tpreviousId: string;\n\t\tid: string;\n\t\tidUpdated: boolean;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t\tallowText?: boolean;\n\t\trepeat?: boolean;\n\t\tvariants?: string[];\n\t\tlinkSelect?: LinkConfig[\"select\"];\n\t\tlinkPickedFields?: number;\n\t\tlinkNestedPickedFields?: number;\n\t}\n>;\n\ntype FieldSettingsOpenedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.field_settingsOpened,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\ttype: FieldType;\n\t\tisInAGroup: boolean;\n\t\tcontentType: \"page type\" | \"custom type\" | \"slice\";\n\t}\n>;\n\ntype CustomTypeCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_created,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tformat: CustomTypeFormat;\n\t\ttype: \"repeatable\" | \"single\";\n\t\torigin: \"onboarding\" | \"table\";\n\t}\n>;\n\ntype CustomTypeSliceZoneUpdatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_sliceZoneUpdated,\n\t{ customTypeId: string }\n>;\n\ntype CustomTypeOpenAddFromTemplatesEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_openAddFromTemplates,\n\t{ customTypeId: string; customTypeFormat: CustomTypeFormat }\n>;\n\ntype CustomTypeSavedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.customType_saved,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tformat: CustomTypeFormat;\n\t\ttype: \"repeatable\" | \"single\";\n\t}\n>;\n\ntype SliceCreatedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.slice_created,\n\t{\n\t\tid: string;\n\t\tname: string;\n\t\tlibrary: string;\n\t\tlocation: \"custom_type\" | \"page_type\" | \"slices\";\n\t} & (\n\t\t| { mode: \"ai\"; langSmithUrl?: string }\n\t\t| { mode: \"manual\" }\n\t\t| { mode: \"template\"; sliceTemplate: string }\n\t)\n>;\n\ntype LegacySliceConvertedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.legacySlice_converted,\n\t{\n\t\tid: string;\n\t\tvariation: string;\n\t\tlibrary: string;\n\t\tconversionType:\n\t\t\t| \"as_new_slice\"\n\t\t\t| \"as_new_variation\"\n\t\t\t| \"merge_with_identical\";\n\t}\n>;\n\ntype ScreenshotTakenSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.screenshotTaken,\n\t{\n\t\ttype: \"custom\";\n\t\tmethod: \"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 ChangesGroupPushedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_groupPushed,\n\t{\n\t\tisInStaticZone: boolean;\n\t\tisInSlice: boolean;\n\t} & {\n\t\t[key in FieldType]?: number;\n\t}\n>;\n\ntype ChangesLimitReachSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.changes_limitReach,\n\t{ limitType: PushChangesLimitType }\n>;\n\ntype EditorWidgetUsedSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.editor_widgetUsed,\n\t{ sliceId: string }\n>;\n\ntype DevCollabJoinBetaClicked = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_joinBetaClicked\n>;\n\ntype DevCollabSetUpWorkflowOpened = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_setUpWorkflowOpened\n>;\n\ntype DevCollabWorkflowStubDisplayed = SegmentEvent<\n\ttypeof SegmentEventType.devCollab_workflowStubDisplayed\n>;\n\ntype SliceMachineStart = SegmentEvent<\n\ttypeof SegmentEventType.sliceMachine_start,\n\t{\n\t\tadapter?: string;\n\t\tadapterVersion?: string;\n\t\tisAdapterUpdateAvailable?: boolean;\n\t\tisLoggedIn?: boolean;\n\t\tisSliceMachineUpdateAvailable?: boolean;\n\t\tisTypeScriptProject?: boolean;\n\t\tnodeVersion?: string;\n\t\tnumberOfCustomTypes?: number;\n\t\tnumberOfSlices?: number;\n\t\tosPlatform?: string;\n\t\tpackageManager?: string;\n\t\tprojectPort?: string;\n\t\tsliceMachineVersion?: string;\n\t\tversionControlSystem?: string;\n\t}\n>;\n\ntype OnboardingCommonPayload = { stepId: string; stepTitle: string };\ntype SharedOnboardingProperties<T = Record<string, string>> = T & {\n\tsource: \"SliceMachine\";\n};\n\ntype SliceMachineSharedOnboardingStepOpened = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_step_opened,\n\tSharedOnboardingProperties<OnboardingCommonPayload>\n>;\ntype SliceMachineSharedOnboardingStepCompleted = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_step_completed,\n\tSharedOnboardingProperties<OnboardingCommonPayload>\n>;\ntype SliceMachineSharedOnboardingCompleted = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_completed,\n\tSharedOnboardingProperties\n>;\ntype SliceMachineSharedOnboardingTutorial = SegmentEvent<\n\ttypeof SegmentEventType.sharedOnboarding_tutorial,\n\tSharedOnboardingProperties\n>;\ntype SliceMachinePostPushEmptyStateCtaClicked = SegmentEvent<\n\ttypeof SegmentEventType.postPush_emptyStateCtaClicked\n>;\n\ntype SliceMachinePostPushToastCtaClicked = SegmentEvent<\n\ttypeof SegmentEventType.postPush_toastCtaClicked\n>;\n\ntype SliceMachineExperimentExposure = SegmentEvent<\n\ttypeof SegmentEventType.experiment_exposure,\n\t{\n\t\tflag_key: string;\n\t\tvariant: string;\n\t}\n>;\n\ntype SliceGenerationFeedback = SegmentEvent<\n\ttypeof SegmentEventType.sliceGenerationFeedback,\n\t{\n\t\ttype: \"model\";\n\t\tsliceId: string;\n\t\tvariationId: string;\n\t\tfeedback: \"up\" | \"down\";\n\t\tlangSmithUrl?: string;\n\t}\n>;\n\ntype NavigationDocumentationLinkClicked = SegmentEvent<\n\ttypeof SegmentEventType.navigation_documentationLinkClicked,\n\t{\n\t\tframework: string;\n\t}\n>;\n\ntype SidebarLinkClicked = SegmentEvent<\n\ttypeof SegmentEventType.sidebar_link_clicked,\n\t{\n\t\tlink_name: string;\n\t\tsource: string;\n\t}\n>;\n\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| FieldAddedSegmentEvent\n\t| FieldUpdatedSegmentEvent\n\t| FieldSettingsOpenedSegmentEvent\n\t| CustomTypeCreatedSegmentEvent\n\t| CustomTypeSliceZoneUpdatedSegmentEvent\n\t| CustomTypeOpenAddFromTemplatesEvent\n\t| CustomTypeSavedSegmentEvent\n\t| SliceCreatedSegmentEvent\n\t| LegacySliceConvertedSegmentEvent\n\t| ScreenshotTakenSegmentEvent\n\t| ChangesPushedSegmentEvent\n\t| ChangesGroupPushedSegmentEvent\n\t| ChangesLimitReachSegmentEvent\n\t| EditorWidgetUsedSegmentEvent\n\t| OpenPageSnippetSegmentEvent\n\t| CopyPageSnippetSegmentEvent\n\t| SwitchEnvironmentSegmentEvent\n\t| DevCollabJoinBetaClicked\n\t| DevCollabSetUpWorkflowOpened\n\t| DevCollabWorkflowStubDisplayed\n\t| SliceMachineStart\n\t| SliceMachineSharedOnboardingStepOpened\n\t| SliceMachineSharedOnboardingStepCompleted\n\t| SliceMachineSharedOnboardingCompleted\n\t| SliceMachineSharedOnboardingTutorial\n\t| SliceMachinePostPushEmptyStateCtaClicked\n\t| SliceMachinePostPushToastCtaClicked\n\t| SliceMachineExperimentExposure\n\t| SliceGenerationFeedback\n\t| NavigationDocumentationLinkClicked\n\t| SidebarLinkClicked;\n"],"names":[],"mappings":"AAUO,MAAM,mBAAmB;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,uBAAuB;AAAA,EACvB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,oBAAoB;AAAA,EACpB,2BAA2B;AAAA,EAC3B,+BAA+B;AAAA,EAC/B,iCAAiC;AAAA,EACjC,oBAAoB;AAAA,EACpB,+BAA+B;AAAA,EAC/B,0BAA0B;AAAA,EAC1B,qBA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D,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,kBAAkB,GAAG;AAAA,EACvC,CAAC,iBAAiB,6BAA6B,GAC9C;AAAA,EACD,CAAC,iBAAiB,wBAAwB,GACzC;AAAA,EACD,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,4BAA4B,GAC7C;AAAA,EACD,CAAC,iBAAiB,0BAA0B,GAC3C;AAAA,EACD,CAAC,iBAAiB,yBAAyB,GAC1C;AAAA,EACD,CAAC,iBAAiB,uBAAuB,GAAG;AAAA,EAC5C,CAAC,iBAAiB,mCAAmC,GACpD;AAAA,EACD,CAAC,iBAAiB,oBAAoB,GAAG;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slicemachine/manager",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.3-alpha.dani-mcp.1",
|
|
4
4
|
"description": "Manage all aspects of a Slice Machine project.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@prismicio/mocks": "2.14.0",
|
|
71
71
|
"@prismicio/types-internal": "3.11.2",
|
|
72
72
|
"@segment/analytics-node": "^2.1.2",
|
|
73
|
-
"@slicemachine/plugin-kit": "0.4.
|
|
73
|
+
"@slicemachine/plugin-kit": "0.4.81-alpha.dani-mcp.1",
|
|
74
74
|
"cookie": "^1.0.1",
|
|
75
75
|
"cors": "^2.8.5",
|
|
76
76
|
"execa": "^7.1.1",
|
|
@@ -131,5 +131,5 @@
|
|
|
131
131
|
"publishConfig": {
|
|
132
132
|
"access": "public"
|
|
133
133
|
},
|
|
134
|
-
"stableVersion": "0.25.
|
|
134
|
+
"stableVersion": "0.25.2"
|
|
135
135
|
}
|
package/src/client/index.ts
CHANGED
|
@@ -7,8 +7,6 @@ export type {
|
|
|
7
7
|
SliceMachineManagerClient,
|
|
8
8
|
} from "../managers/createSliceMachineManagerClient";
|
|
9
9
|
|
|
10
|
-
export { GIT_PROVIDER, type GitProvider } from "../constants/GIT_PROVIDER";
|
|
11
|
-
|
|
12
10
|
export type { Environment } from "../managers/prismicRepository/types";
|
|
13
11
|
|
|
14
12
|
export type { SliceMachineManagerPushSliceReturnType } from "../managers/slices/SlicesManager";
|
package/src/index.ts
CHANGED
|
@@ -13,8 +13,6 @@ export { createSliceMachineManager } from "./managers/createSliceMachineManager"
|
|
|
13
13
|
export { createSliceMachineManagerMiddleware } from "./managers/createSliceMachineManagerMiddleware";
|
|
14
14
|
export type { CreateSliceMachineManagerMiddlewareArgs } from "./managers/createSliceMachineManagerMiddleware";
|
|
15
15
|
|
|
16
|
-
export type { GitOwner, GitRepo, GitRepoSpecifier } from "./managers/git/types";
|
|
17
|
-
|
|
18
16
|
export type {
|
|
19
17
|
Environment,
|
|
20
18
|
PushChangesLimit,
|
|
@@ -39,7 +39,6 @@ import { TelemetryManager } from "./telemetry/TelemetryManager";
|
|
|
39
39
|
import { buildPrismicRepositoryAPIEndpoint } from "../lib/buildPrismicRepositoryAPIEndpoint";
|
|
40
40
|
import { DocumentationManager } from "./documentation/DocumentationManager";
|
|
41
41
|
import { SliceTemplateLibraryManager } from "./sliceTemplateLibrary/SliceTemplateLibraryManager";
|
|
42
|
-
import { GitManager } from "./git/GitManager";
|
|
43
42
|
|
|
44
43
|
type SliceMachineManagerGetStateReturnType = {
|
|
45
44
|
env: {
|
|
@@ -117,7 +116,6 @@ export class SliceMachineManager {
|
|
|
117
116
|
telemetry: TelemetryManager;
|
|
118
117
|
user: UserManager;
|
|
119
118
|
versions: VersionsManager;
|
|
120
|
-
git: GitManager;
|
|
121
119
|
|
|
122
120
|
constructor(args?: SliceMachineManagerConstructorArgs) {
|
|
123
121
|
// _prismicAuthManager must be set at least before UserManager
|
|
@@ -145,8 +143,6 @@ export class SliceMachineManager {
|
|
|
145
143
|
|
|
146
144
|
this.telemetry = new TelemetryManager(this);
|
|
147
145
|
|
|
148
|
-
this.git = new GitManager(this);
|
|
149
|
-
|
|
150
146
|
this.cwd = args?.cwd ?? process.cwd();
|
|
151
147
|
}
|
|
152
148
|
|
|
@@ -319,6 +319,7 @@ export class PrismicRepositoryManager extends BaseManager {
|
|
|
319
319
|
const modelWithScreenshots =
|
|
320
320
|
await this.slices.updateSliceModelScreenshotsInPlace({
|
|
321
321
|
libraryID: change.libraryID,
|
|
322
|
+
variationImageUrlMap: change.variationImageUrlMap,
|
|
322
323
|
model,
|
|
323
324
|
});
|
|
324
325
|
|
|
@@ -341,6 +342,7 @@ export class PrismicRepositoryManager extends BaseManager {
|
|
|
341
342
|
const modelWithScreenshots =
|
|
342
343
|
await this.slices.updateSliceModelScreenshotsInPlace({
|
|
343
344
|
libraryID: change.libraryID,
|
|
345
|
+
variationImageUrlMap: change.variationImageUrlMap,
|
|
344
346
|
model,
|
|
345
347
|
});
|
|
346
348
|
|
|
@@ -124,6 +124,13 @@ type SliceChange = {
|
|
|
124
124
|
type: "Slice";
|
|
125
125
|
status: ChangeStatus;
|
|
126
126
|
libraryID: string;
|
|
127
|
+
/**
|
|
128
|
+
* A map of variation IDs to remote screenshot URLs. These URLs are used to
|
|
129
|
+
* detect if a screenshot has changed when comparing with local ones and to
|
|
130
|
+
* push slices with the current screenshot. If a matching screenshot is not
|
|
131
|
+
* found in this map, the current local screenshot is uploaded again.
|
|
132
|
+
*/
|
|
133
|
+
variationImageUrlMap: Record<string, string>;
|
|
127
134
|
};
|
|
128
135
|
|
|
129
136
|
export type TransactionalMergeArgs = {
|
|
@@ -85,9 +85,9 @@ type ProjectManagerUpdateEnvironmentArgs = {
|
|
|
85
85
|
environment: string | undefined;
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
type ProjectManagerFetchActiveEnvironmentReturnType =
|
|
89
|
-
activeEnvironment: Environment
|
|
90
|
-
};
|
|
88
|
+
type ProjectManagerFetchActiveEnvironmentReturnType =
|
|
89
|
+
| { type: "ok"; activeEnvironment: Environment }
|
|
90
|
+
| { type: "error"; error: InvalidActiveEnvironmentError };
|
|
91
91
|
|
|
92
92
|
export class ProjectManager extends BaseManager {
|
|
93
93
|
private _cachedRoot: string | undefined;
|
|
@@ -451,7 +451,7 @@ export class ProjectManager extends BaseManager {
|
|
|
451
451
|
this._cachedEnvironments || [],
|
|
452
452
|
);
|
|
453
453
|
if (cachedActiveEnvironment) {
|
|
454
|
-
return { activeEnvironment: cachedActiveEnvironment };
|
|
454
|
+
return { type: "ok", activeEnvironment: cachedActiveEnvironment };
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
// If the environment is not in the cached environments list, we
|
|
@@ -472,10 +472,13 @@ export class ProjectManager extends BaseManager {
|
|
|
472
472
|
);
|
|
473
473
|
|
|
474
474
|
if (!activeEnvironment) {
|
|
475
|
-
|
|
475
|
+
return {
|
|
476
|
+
type: "error",
|
|
477
|
+
error: new InvalidActiveEnvironmentError(),
|
|
478
|
+
};
|
|
476
479
|
}
|
|
477
480
|
|
|
478
|
-
return { activeEnvironment };
|
|
481
|
+
return { type: "ok", activeEnvironment: activeEnvironment };
|
|
479
482
|
}
|
|
480
483
|
|
|
481
484
|
async detectVersionControlSystem(): Promise<string | "_unknown"> {
|
|
@@ -147,9 +147,16 @@ type SliceMachineManagerUpdateSliceMocksArgsReturnType = {
|
|
|
147
147
|
errors: HookError[];
|
|
148
148
|
};
|
|
149
149
|
|
|
150
|
-
type
|
|
150
|
+
type SlicesManagerUpsertHostedSliceScreenshotsArgs = {
|
|
151
151
|
libraryID: string;
|
|
152
152
|
model: SharedSlice;
|
|
153
|
+
/**
|
|
154
|
+
* A map of variation IDs to remote screenshot URLs. These URLs are used to
|
|
155
|
+
* detect if a screenshot has changed when comparing with local ones and to
|
|
156
|
+
* push slices with the current screenshot. If a matching screenshot is not
|
|
157
|
+
* found in this map, the current local screenshot is uploaded again.
|
|
158
|
+
*/
|
|
159
|
+
variationImageUrlMap: Record<string, string>;
|
|
153
160
|
};
|
|
154
161
|
|
|
155
162
|
type SliceMachineManagerDeleteSliceArgs = {
|
|
@@ -759,8 +766,11 @@ export class SlicesManager extends BaseManager {
|
|
|
759
766
|
if (model) {
|
|
760
767
|
const modelWithScreenshots =
|
|
761
768
|
await this.updateSliceModelScreenshotsInPlace({
|
|
762
|
-
libraryID: args.libraryID,
|
|
763
769
|
model,
|
|
770
|
+
libraryID: args.libraryID,
|
|
771
|
+
// We are pushing it for the first time here, no remote image URLs to
|
|
772
|
+
// use during the update.
|
|
773
|
+
variationImageUrlMap: {},
|
|
764
774
|
});
|
|
765
775
|
|
|
766
776
|
const authenticationToken = await this.user.getAuthenticationToken();
|
|
@@ -1003,7 +1013,7 @@ export class SlicesManager extends BaseManager {
|
|
|
1003
1013
|
}
|
|
1004
1014
|
|
|
1005
1015
|
async updateSliceModelScreenshotsInPlace(
|
|
1006
|
-
args:
|
|
1016
|
+
args: SlicesManagerUpsertHostedSliceScreenshotsArgs,
|
|
1007
1017
|
): Promise<SharedSlice> {
|
|
1008
1018
|
const repositoryName = await this.project.getResolvedRepositoryName();
|
|
1009
1019
|
|
|
@@ -1023,13 +1033,19 @@ export class SlicesManager extends BaseManager {
|
|
|
1023
1033
|
};
|
|
1024
1034
|
}
|
|
1025
1035
|
|
|
1026
|
-
const
|
|
1036
|
+
const remoteImageUrl = args.variationImageUrlMap?.[variation.id];
|
|
1037
|
+
const hasScreenshotChanged = !remoteImageUrl?.includes(
|
|
1027
1038
|
createContentDigest(screenshot.data),
|
|
1028
1039
|
);
|
|
1029
1040
|
|
|
1030
|
-
// If screenshot hasn't changed,
|
|
1041
|
+
// If screenshot hasn't changed, no need to upload it again, just use
|
|
1042
|
+
// the existing variation with the remote image URL if it exists.
|
|
1031
1043
|
if (!hasScreenshotChanged) {
|
|
1032
|
-
return
|
|
1044
|
+
return {
|
|
1045
|
+
...variation,
|
|
1046
|
+
// Keep the existing remote screenshot URL if it exists.
|
|
1047
|
+
imageUrl: remoteImageUrl ?? variation.imageUrl,
|
|
1048
|
+
};
|
|
1033
1049
|
}
|
|
1034
1050
|
|
|
1035
1051
|
const keyPrefix = [
|
|
@@ -116,9 +116,14 @@ export class TelemetryManager extends BaseManager {
|
|
|
116
116
|
if (_includeEnvironmentKind) {
|
|
117
117
|
if (this.project.checkSupportsEnvironments()) {
|
|
118
118
|
try {
|
|
119
|
-
const
|
|
119
|
+
const activeEnvironmentResult =
|
|
120
120
|
await this.project.fetchActiveEnvironment();
|
|
121
|
-
|
|
121
|
+
|
|
122
|
+
if (activeEnvironmentResult.type === "ok") {
|
|
123
|
+
environmentKind = activeEnvironmentResult.activeEnvironment.kind;
|
|
124
|
+
} else {
|
|
125
|
+
throw activeEnvironmentResult.error;
|
|
126
|
+
}
|
|
122
127
|
} catch {
|
|
123
128
|
environmentKind = "_unknown";
|
|
124
129
|
}
|
|
@@ -46,6 +46,7 @@ export const SegmentEventType = {
|
|
|
46
46
|
sharedOnboarding_tutorial: "shared-onboarding:follow-tutorial",
|
|
47
47
|
sliceGenerationFeedback: "slice-generation-feedback",
|
|
48
48
|
navigation_documentationLinkClicked: "navigation:documentation-link-clicked",
|
|
49
|
+
sidebar_link_clicked: "sidebar:link-clicked",
|
|
49
50
|
} as const;
|
|
50
51
|
type SegmentEventTypes =
|
|
51
52
|
(typeof SegmentEventType)[keyof typeof SegmentEventType];
|
|
@@ -104,6 +105,7 @@ export const HumanSegmentEventType = {
|
|
|
104
105
|
[SegmentEventType.sliceGenerationFeedback]: "Slice Generation Feedback",
|
|
105
106
|
[SegmentEventType.navigation_documentationLinkClicked]:
|
|
106
107
|
"SliceMachine Documentation Link Clicked",
|
|
108
|
+
[SegmentEventType.sidebar_link_clicked]: "Sidebar Link Clicked",
|
|
107
109
|
} as const;
|
|
108
110
|
|
|
109
111
|
export type HumanSegmentEventTypes =
|
|
@@ -354,7 +356,6 @@ type SliceMachineStart = SegmentEvent<
|
|
|
354
356
|
{
|
|
355
357
|
adapter?: string;
|
|
356
358
|
adapterVersion?: string;
|
|
357
|
-
gitProvider?: string;
|
|
358
359
|
isAdapterUpdateAvailable?: boolean;
|
|
359
360
|
isLoggedIn?: boolean;
|
|
360
361
|
isSliceMachineUpdateAvailable?: boolean;
|
|
@@ -425,6 +426,14 @@ type NavigationDocumentationLinkClicked = SegmentEvent<
|
|
|
425
426
|
}
|
|
426
427
|
>;
|
|
427
428
|
|
|
429
|
+
type SidebarLinkClicked = SegmentEvent<
|
|
430
|
+
typeof SegmentEventType.sidebar_link_clicked,
|
|
431
|
+
{
|
|
432
|
+
link_name: string;
|
|
433
|
+
source: string;
|
|
434
|
+
}
|
|
435
|
+
>;
|
|
436
|
+
|
|
428
437
|
export type SegmentEvents =
|
|
429
438
|
| CommandInitStartSegmentEvent
|
|
430
439
|
| CommandInitIdentifySegmentEvent
|
|
@@ -462,4 +471,5 @@ export type SegmentEvents =
|
|
|
462
471
|
| SliceMachinePostPushToastCtaClicked
|
|
463
472
|
| SliceMachineExperimentExposure
|
|
464
473
|
| SliceGenerationFeedback
|
|
465
|
-
| NavigationDocumentationLinkClicked
|
|
474
|
+
| NavigationDocumentationLinkClicked
|
|
475
|
+
| SidebarLinkClicked;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GIT_PROVIDER.cjs","sources":["../../../src/constants/GIT_PROVIDER.ts"],"sourcesContent":["export const GIT_PROVIDER = {\n\tGitHub: \"gitHub\",\n} as const;\n\nexport type GitProvider = (typeof GIT_PROVIDER)[keyof typeof GIT_PROVIDER];\n"],"names":[],"mappings":";;AAAO,MAAM,eAAe;AAAA,EAC3B,QAAQ;;;"}
|