@slicemachine/manager 0.22.5-alpha.repeatable-link.3 → 0.22.5-alpha.xru-fix-env-push-admin.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/_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/managers/screenshots/ScreenshotsManager.cjs +1 -1
- package/dist/managers/screenshots/ScreenshotsManager.cjs.map +1 -1
- package/dist/managers/screenshots/ScreenshotsManager.js +1 -1
- package/dist/managers/screenshots/ScreenshotsManager.js.map +1 -1
- package/dist/managers/telemetry/types.cjs.map +1 -1
- package/dist/managers/telemetry/types.d.ts +0 -1
- package/dist/managers/telemetry/types.js.map +1 -1
- package/package.json +3 -3
- package/src/managers/screenshots/ScreenshotsManager.ts +1 -1
- package/src/managers/telemetry/types.ts +0 -1
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
const _commonjsHelpers = require("../../../../../../_virtual/_commonjsHelpers.cjs");
|
3
3
|
const client = require("../../../../../../_virtual/client2.cjs");
|
4
|
-
const index = require("../../../../../../_virtual/
|
4
|
+
const index = require("../../../../../../_virtual/index2.cjs");
|
5
5
|
const experimentCore_esm = require("../../../../../../_virtual/experiment-core.esm.cjs");
|
6
6
|
require("../assignment/assignment.cjs");
|
7
7
|
require("../assignment/assignment-filter.cjs");
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { commonjsGlobal } from "../../../../../../_virtual/_commonjsHelpers.js";
|
2
2
|
import { __exports as client } from "../../../../../../_virtual/client2.js";
|
3
|
-
import require$$0 from "../../../../../../_virtual/
|
3
|
+
import require$$0 from "../../../../../../_virtual/index2.js";
|
4
4
|
import require$$1 from "../../../../../../_virtual/experiment-core.esm.js";
|
5
5
|
import "../assignment/assignment.js";
|
6
6
|
import "../assignment/assignment-filter.js";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
const _commonjsHelpers = require("../../_virtual/_commonjsHelpers.cjs");
|
3
|
-
const index = require("../../_virtual/
|
3
|
+
const index = require("../../_virtual/index3.cjs");
|
4
4
|
const require$$0 = require("child_process");
|
5
5
|
const parse$1 = require("./lib/parse.cjs");
|
6
6
|
const enoent$1 = require("./lib/enoent.cjs");
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { getDefaultExportFromCjs } from "../../_virtual/_commonjsHelpers.js";
|
2
|
-
import { __module as crossSpawn$1 } from "../../_virtual/
|
2
|
+
import { __module as crossSpawn$1 } from "../../_virtual/index3.js";
|
3
3
|
import require$$0 from "child_process";
|
4
4
|
import { p as parse_1 } from "./lib/parse.js";
|
5
5
|
import { e as enoent$1 } from "./lib/enoent.js";
|
package/dist/_virtual/index2.cjs
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
const _commonjsHelpers = require("./_commonjsHelpers.cjs");
|
3
|
+
const index = require('./../_node_modules/@amplitude/analytics-node/lib/esm/index.cjs');
|
4
|
+
const require$$0 = /* @__PURE__ */ _commonjsHelpers.getAugmentedNamespace(index);
|
5
|
+
module.exports = require$$0;
|
5
6
|
//# sourceMappingURL=index2.cjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index2.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/dist/_virtual/index2.js
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
1
|
+
import { getAugmentedNamespace } from "./_commonjsHelpers.js";
|
2
|
+
import * as index from './../_node_modules/@amplitude/analytics-node/lib/esm/index.js';
|
3
|
+
const require$$0 = /* @__PURE__ */ getAugmentedNamespace(index);
|
2
4
|
export {
|
3
|
-
|
5
|
+
require$$0 as default
|
4
6
|
};
|
5
7
|
//# sourceMappingURL=index2.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/dist/_virtual/index3.cjs
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
module.exports = require$$0;
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
|
+
var crossSpawn = { exports: {} };
|
4
|
+
exports.__module = crossSpawn;
|
6
5
|
//# sourceMappingURL=index3.cjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index3.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index3.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/_virtual/index3.js
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
|
2
|
-
import * as index from './../_node_modules/@amplitude/analytics-node/lib/esm/index.js';
|
3
|
-
const require$$0 = /* @__PURE__ */ getAugmentedNamespace(index);
|
1
|
+
var crossSpawn = { exports: {} };
|
4
2
|
export {
|
5
|
-
|
3
|
+
crossSpawn as __module
|
6
4
|
};
|
7
5
|
//# sourceMappingURL=index3.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index3.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
@@ -147,7 +147,7 @@ class ScreenshotsManager extends BaseManager.BaseManager {
|
|
147
147
|
}
|
148
148
|
async _fetch(args) {
|
149
149
|
const authenticationToken = await this.user.getAuthenticationToken();
|
150
|
-
const repositoryName = await this.project.
|
150
|
+
const repositoryName = await this.project.getResolvedRepositoryName();
|
151
151
|
return await fetch.default(args.url, {
|
152
152
|
body: args.body ? JSON.stringify(args.body) : void 0,
|
153
153
|
headers: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ScreenshotsManager.cjs","sources":["../../../../src/managers/screenshots/ScreenshotsManager.ts"],"sourcesContent":["import * as t from \"io-ts\";\nimport { fileTypeFromBuffer } from \"file-type\";\nimport pLimit from \"p-limit\";\nimport fetch, { FormData, Blob, Response } from \"../../lib/fetch\";\n\nimport { createContentDigest } from \"../../lib/createContentDigest\";\nimport { decode } from \"../../lib/decode\";\n\nimport { S3ACL } from \"../../types\";\nimport { SLICE_MACHINE_USER_AGENT } from \"../../constants/SLICE_MACHINE_USER_AGENT\";\nimport { API_ENDPOINTS } from \"../../constants/API_ENDPOINTS\";\n\nimport { BaseManager } from \"../BaseManager\";\n\nfunction assertS3ACLInitialized(\n\ts3ACL: S3ACL | undefined,\n): asserts s3ACL is NonNullable<typeof s3ACL> {\n\tif (s3ACL == undefined) {\n\t\tthrow new Error(\n\t\t\t\"An S3 ACL has not been initialized. Run `SliceMachineManager.screenshots.prototype.initS3ACL()` before re-calling this method.\",\n\t\t);\n\t}\n}\n\nconst uploadScreenshotLimit = pLimit(10);\n\ntype ScreenshotsManagerUploadScreenshotArgs = {\n\tdata: Buffer;\n\tkeyPrefix?: string;\n};\n\ntype ScreenshotsManagerUploadScreenshotReturnType = {\n\turl: string;\n};\n\ntype ScreenshotsManagerDeleteScreenshotFolderArgs = {\n\tsliceID: string;\n};\n\nexport class ScreenshotsManager extends BaseManager {\n\tprivate _s3ACL: S3ACL | undefined;\n\n\tasync initS3ACL(): Promise<void> {\n\t\t// TODO: we need to find a way to create a new AWS ACL only when necessary (e.g., when it has expired).\n\t\t// if (this._s3ACL) {\n\t\t// \treturn;\n\t\t// }\n\n\t\tconst awsACLURL = new URL(\"create\", API_ENDPOINTS.AwsAclProvider);\n\t\tconst awsACLRes = await this._fetch({ url: awsACLURL });\n\n\t\tconst awsACLText = await awsACLRes.text();\n\t\tlet awsACLJSON: unknown;\n\t\ttry {\n\t\t\tawsACLJSON = JSON.parse(awsACLText);\n\t\t} catch (error) {\n\t\t\t// Response is not JSON\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid AWS ACL response from ${awsACLURL}: ${awsACLText}`,\n\t\t\t\t{\n\t\t\t\t\tcause: error,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\tconst { value: awsACL, error } = decode(\n\t\t\tt.intersection([\n\t\t\t\tt.type({\n\t\t\t\t\tvalues: t.type({\n\t\t\t\t\t\turl: t.string,\n\t\t\t\t\t\tfields: t.record(t.string, t.string),\n\t\t\t\t\t}),\n\t\t\t\t\timgixEndpoint: t.string,\n\t\t\t\t}),\n\t\t\t\tt.partial({\n\t\t\t\t\tmessage: t.string,\n\t\t\t\t\tMessage: t.string,\n\t\t\t\t\terror: t.string,\n\t\t\t\t}),\n\t\t\t]),\n\t\t\tawsACLJSON,\n\t\t);\n\n\t\tif (error) {\n\t\t\tthrow new Error(`Invalid AWS ACL response from ${awsACLURL}`, {\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t}\n\n\t\tconst errorMessage = awsACL.error || awsACL.message || awsACL.Message;\n\t\tif (errorMessage) {\n\t\t\tthrow new Error(`Failed to create an AWS ACL: ${errorMessage}`, {\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t}\n\n\t\tthis._s3ACL = {\n\t\t\tuploadEndpoint: awsACL.values.url,\n\t\t\trequiredFormDataFields: awsACL.values.fields,\n\t\t\timgixEndpoint: awsACL.imgixEndpoint,\n\t\t};\n\t}\n\n\tasync uploadScreenshot(\n\t\targs: ScreenshotsManagerUploadScreenshotArgs,\n\t): Promise<ScreenshotsManagerUploadScreenshotReturnType> {\n\t\tassertS3ACLInitialized(this._s3ACL);\n\n\t\tconst formData = new FormData();\n\n\t\tfor (const requiredFormDataFieldKey in this._s3ACL.requiredFormDataFields) {\n\t\t\tformData.append(\n\t\t\t\trequiredFormDataFieldKey,\n\t\t\t\tthis._s3ACL.requiredFormDataFields[requiredFormDataFieldKey],\n\t\t\t);\n\t\t}\n\n\t\tconst contentDigest = createContentDigest(args.data);\n\t\tconst fileType = await fileTypeFromBuffer(args.data);\n\t\tconst fileName = fileType\n\t\t\t? `${contentDigest}.${fileType.ext}`\n\t\t\t: contentDigest;\n\t\tconst key = args.keyPrefix ? `${args.keyPrefix}/${fileName}` : fileName;\n\n\t\tformData.set(\"key\", key);\n\n\t\tif (fileType) {\n\t\t\tformData.set(\"Content-Type\", fileType.mime);\n\t\t}\n\n\t\tformData.set(\"file\", new Blob([args.data], { type: fileType?.mime }));\n\n\t\tconst s3ACLEndpoint = this._s3ACL.uploadEndpoint;\n\t\tconst res = await uploadScreenshotLimit(() =>\n\t\t\tfetch(s3ACLEndpoint, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData,\n\t\t\t}),\n\t\t);\n\n\t\tif (res.ok) {\n\t\t\tconst url = new URL(key, this._s3ACL.imgixEndpoint);\n\t\t\turl.searchParams.set(\"auto\", \"compress,format\");\n\n\t\t\treturn {\n\t\t\t\turl: url.toString(),\n\t\t\t};\n\t\t} else {\n\t\t\tconst text = await res.text();\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to upload screenshot with status code: ${res.status}`,\n\t\t\t\t{\n\t\t\t\t\tcause: text,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tasync deleteScreenshotFolder(\n\t\targs: ScreenshotsManagerDeleteScreenshotFolderArgs,\n\t): Promise<void> {\n\t\tconst res = await this._fetch({\n\t\t\t// We're sending `args.sliceID` as `sliceName` because it's inconsistently\n\t\t\t// named in the ACL Provider API.\n\t\t\tbody: { sliceName: args.sliceID },\n\t\t\tmethod: \"POST\",\n\t\t\turl: new URL(\"delete-folder\", API_ENDPOINTS.AwsAclProvider),\n\t\t});\n\t\tif (!res.ok) {\n\t\t\tconst text = await res.text();\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to delete screenshot folder with status code: ${res.status}`,\n\t\t\t\t{\n\t\t\t\t\tcause: text,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate async _fetch(args: {\n\t\turl: URL;\n\t\tmethod?: \"GET\" | \"POST\";\n\t\tbody?: unknown;\n\t}): Promise<Response> {\n\t\tconst authenticationToken = await this.user.getAuthenticationToken();\n\t\tconst repositoryName = await this.project.
|
1
|
+
{"version":3,"file":"ScreenshotsManager.cjs","sources":["../../../../src/managers/screenshots/ScreenshotsManager.ts"],"sourcesContent":["import * as t from \"io-ts\";\nimport { fileTypeFromBuffer } from \"file-type\";\nimport pLimit from \"p-limit\";\nimport fetch, { FormData, Blob, Response } from \"../../lib/fetch\";\n\nimport { createContentDigest } from \"../../lib/createContentDigest\";\nimport { decode } from \"../../lib/decode\";\n\nimport { S3ACL } from \"../../types\";\nimport { SLICE_MACHINE_USER_AGENT } from \"../../constants/SLICE_MACHINE_USER_AGENT\";\nimport { API_ENDPOINTS } from \"../../constants/API_ENDPOINTS\";\n\nimport { BaseManager } from \"../BaseManager\";\n\nfunction assertS3ACLInitialized(\n\ts3ACL: S3ACL | undefined,\n): asserts s3ACL is NonNullable<typeof s3ACL> {\n\tif (s3ACL == undefined) {\n\t\tthrow new Error(\n\t\t\t\"An S3 ACL has not been initialized. Run `SliceMachineManager.screenshots.prototype.initS3ACL()` before re-calling this method.\",\n\t\t);\n\t}\n}\n\nconst uploadScreenshotLimit = pLimit(10);\n\ntype ScreenshotsManagerUploadScreenshotArgs = {\n\tdata: Buffer;\n\tkeyPrefix?: string;\n};\n\ntype ScreenshotsManagerUploadScreenshotReturnType = {\n\turl: string;\n};\n\ntype ScreenshotsManagerDeleteScreenshotFolderArgs = {\n\tsliceID: string;\n};\n\nexport class ScreenshotsManager extends BaseManager {\n\tprivate _s3ACL: S3ACL | undefined;\n\n\tasync initS3ACL(): Promise<void> {\n\t\t// TODO: we need to find a way to create a new AWS ACL only when necessary (e.g., when it has expired).\n\t\t// if (this._s3ACL) {\n\t\t// \treturn;\n\t\t// }\n\n\t\tconst awsACLURL = new URL(\"create\", API_ENDPOINTS.AwsAclProvider);\n\t\tconst awsACLRes = await this._fetch({ url: awsACLURL });\n\n\t\tconst awsACLText = await awsACLRes.text();\n\t\tlet awsACLJSON: unknown;\n\t\ttry {\n\t\t\tawsACLJSON = JSON.parse(awsACLText);\n\t\t} catch (error) {\n\t\t\t// Response is not JSON\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid AWS ACL response from ${awsACLURL}: ${awsACLText}`,\n\t\t\t\t{\n\t\t\t\t\tcause: error,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\tconst { value: awsACL, error } = decode(\n\t\t\tt.intersection([\n\t\t\t\tt.type({\n\t\t\t\t\tvalues: t.type({\n\t\t\t\t\t\turl: t.string,\n\t\t\t\t\t\tfields: t.record(t.string, t.string),\n\t\t\t\t\t}),\n\t\t\t\t\timgixEndpoint: t.string,\n\t\t\t\t}),\n\t\t\t\tt.partial({\n\t\t\t\t\tmessage: t.string,\n\t\t\t\t\tMessage: t.string,\n\t\t\t\t\terror: t.string,\n\t\t\t\t}),\n\t\t\t]),\n\t\t\tawsACLJSON,\n\t\t);\n\n\t\tif (error) {\n\t\t\tthrow new Error(`Invalid AWS ACL response from ${awsACLURL}`, {\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t}\n\n\t\tconst errorMessage = awsACL.error || awsACL.message || awsACL.Message;\n\t\tif (errorMessage) {\n\t\t\tthrow new Error(`Failed to create an AWS ACL: ${errorMessage}`, {\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t}\n\n\t\tthis._s3ACL = {\n\t\t\tuploadEndpoint: awsACL.values.url,\n\t\t\trequiredFormDataFields: awsACL.values.fields,\n\t\t\timgixEndpoint: awsACL.imgixEndpoint,\n\t\t};\n\t}\n\n\tasync uploadScreenshot(\n\t\targs: ScreenshotsManagerUploadScreenshotArgs,\n\t): Promise<ScreenshotsManagerUploadScreenshotReturnType> {\n\t\tassertS3ACLInitialized(this._s3ACL);\n\n\t\tconst formData = new FormData();\n\n\t\tfor (const requiredFormDataFieldKey in this._s3ACL.requiredFormDataFields) {\n\t\t\tformData.append(\n\t\t\t\trequiredFormDataFieldKey,\n\t\t\t\tthis._s3ACL.requiredFormDataFields[requiredFormDataFieldKey],\n\t\t\t);\n\t\t}\n\n\t\tconst contentDigest = createContentDigest(args.data);\n\t\tconst fileType = await fileTypeFromBuffer(args.data);\n\t\tconst fileName = fileType\n\t\t\t? `${contentDigest}.${fileType.ext}`\n\t\t\t: contentDigest;\n\t\tconst key = args.keyPrefix ? `${args.keyPrefix}/${fileName}` : fileName;\n\n\t\tformData.set(\"key\", key);\n\n\t\tif (fileType) {\n\t\t\tformData.set(\"Content-Type\", fileType.mime);\n\t\t}\n\n\t\tformData.set(\"file\", new Blob([args.data], { type: fileType?.mime }));\n\n\t\tconst s3ACLEndpoint = this._s3ACL.uploadEndpoint;\n\t\tconst res = await uploadScreenshotLimit(() =>\n\t\t\tfetch(s3ACLEndpoint, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData,\n\t\t\t}),\n\t\t);\n\n\t\tif (res.ok) {\n\t\t\tconst url = new URL(key, this._s3ACL.imgixEndpoint);\n\t\t\turl.searchParams.set(\"auto\", \"compress,format\");\n\n\t\t\treturn {\n\t\t\t\turl: url.toString(),\n\t\t\t};\n\t\t} else {\n\t\t\tconst text = await res.text();\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to upload screenshot with status code: ${res.status}`,\n\t\t\t\t{\n\t\t\t\t\tcause: text,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tasync deleteScreenshotFolder(\n\t\targs: ScreenshotsManagerDeleteScreenshotFolderArgs,\n\t): Promise<void> {\n\t\tconst res = await this._fetch({\n\t\t\t// We're sending `args.sliceID` as `sliceName` because it's inconsistently\n\t\t\t// named in the ACL Provider API.\n\t\t\tbody: { sliceName: args.sliceID },\n\t\t\tmethod: \"POST\",\n\t\t\turl: new URL(\"delete-folder\", API_ENDPOINTS.AwsAclProvider),\n\t\t});\n\t\tif (!res.ok) {\n\t\t\tconst text = await res.text();\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to delete screenshot folder with status code: ${res.status}`,\n\t\t\t\t{\n\t\t\t\t\tcause: text,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate async _fetch(args: {\n\t\turl: URL;\n\t\tmethod?: \"GET\" | \"POST\";\n\t\tbody?: unknown;\n\t}): Promise<Response> {\n\t\tconst authenticationToken = await this.user.getAuthenticationToken();\n\t\tconst repositoryName = await this.project.getResolvedRepositoryName();\n\n\t\treturn await fetch(args.url, {\n\t\t\tbody: args.body ? JSON.stringify(args.body) : undefined,\n\t\t\theaders: {\n\t\t\t\tAuthorization: `Bearer ${authenticationToken}`,\n\t\t\t\tRepository: repositoryName,\n\t\t\t\t\"User-Agent\": SLICE_MACHINE_USER_AGENT,\n\t\t\t\t...(args.body ? { \"Content-Type\": \"application/json\" } : {}),\n\t\t\t},\n\t\t\tmethod: args.method,\n\t\t});\n\t}\n}\n"],"names":["pLimit","BaseManager","API_ENDPOINTS","error","decode","t","FormData","createContentDigest","fileTypeFromBuffer","Blob","fetch","SLICE_MACHINE_USER_AGENT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,SAAS,uBACR,OAAwB;AAExB,MAAI,SAAS,QAAW;AACjB,UAAA,IAAI,MACT,gIAAgI;AAAA,EAElI;AACD;AAEA,MAAM,wBAAwBA,MAAO,EAAE;AAejC,MAAO,2BAA2BC,YAAAA,YAAW;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,IAAI,IAAI;AACN,YAAA,OAAO,MAAM,IAAI;AACvB,YAAM,IAAI,MACT,wDAAwD,IAAI,UAC5D;AAAA,QACC,OAAO;AAAA,MAAA,CACP;AAAA,IAEH;AAAA,EACD;AAAA,EAEQ,MAAM,OAAO,MAIpB;AACA,UAAM,sBAAsB,MAAM,KAAK,KAAK,uBAAsB;AAClE,UAAM,iBAAiB,MAAM,KAAK,QAAQ,0BAAyB;AAE5D,WAAA,MAAMQ,MAAAA,QAAM,KAAK,KAAK;AAAA,MAC5B,MAAM,KAAK,OAAO,KAAK,UAAU,KAAK,IAAI,IAAI;AAAA,MAC9C,SAAS;AAAA,QACR,eAAe,UAAU;AAAA,QACzB,YAAY;AAAA,QACZ,cAAcC,yBAAA;AAAA,QACd,GAAI,KAAK,OAAO,EAAE,gBAAgB,uBAAuB;MACzD;AAAA,MACD,QAAQ,KAAK;AAAA,IAAA,CACb;AAAA,EACF;AACA;;"}
|
@@ -128,7 +128,7 @@ class ScreenshotsManager extends BaseManager {
|
|
128
128
|
}
|
129
129
|
async _fetch(args) {
|
130
130
|
const authenticationToken = await this.user.getAuthenticationToken();
|
131
|
-
const repositoryName = await this.project.
|
131
|
+
const repositoryName = await this.project.getResolvedRepositoryName();
|
132
132
|
return await fetch(args.url, {
|
133
133
|
body: args.body ? JSON.stringify(args.body) : void 0,
|
134
134
|
headers: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ScreenshotsManager.js","sources":["../../../../src/managers/screenshots/ScreenshotsManager.ts"],"sourcesContent":["import * as t from \"io-ts\";\nimport { fileTypeFromBuffer } from \"file-type\";\nimport pLimit from \"p-limit\";\nimport fetch, { FormData, Blob, Response } from \"../../lib/fetch\";\n\nimport { createContentDigest } from \"../../lib/createContentDigest\";\nimport { decode } from \"../../lib/decode\";\n\nimport { S3ACL } from \"../../types\";\nimport { SLICE_MACHINE_USER_AGENT } from \"../../constants/SLICE_MACHINE_USER_AGENT\";\nimport { API_ENDPOINTS } from \"../../constants/API_ENDPOINTS\";\n\nimport { BaseManager } from \"../BaseManager\";\n\nfunction assertS3ACLInitialized(\n\ts3ACL: S3ACL | undefined,\n): asserts s3ACL is NonNullable<typeof s3ACL> {\n\tif (s3ACL == undefined) {\n\t\tthrow new Error(\n\t\t\t\"An S3 ACL has not been initialized. Run `SliceMachineManager.screenshots.prototype.initS3ACL()` before re-calling this method.\",\n\t\t);\n\t}\n}\n\nconst uploadScreenshotLimit = pLimit(10);\n\ntype ScreenshotsManagerUploadScreenshotArgs = {\n\tdata: Buffer;\n\tkeyPrefix?: string;\n};\n\ntype ScreenshotsManagerUploadScreenshotReturnType = {\n\turl: string;\n};\n\ntype ScreenshotsManagerDeleteScreenshotFolderArgs = {\n\tsliceID: string;\n};\n\nexport class ScreenshotsManager extends BaseManager {\n\tprivate _s3ACL: S3ACL | undefined;\n\n\tasync initS3ACL(): Promise<void> {\n\t\t// TODO: we need to find a way to create a new AWS ACL only when necessary (e.g., when it has expired).\n\t\t// if (this._s3ACL) {\n\t\t// \treturn;\n\t\t// }\n\n\t\tconst awsACLURL = new URL(\"create\", API_ENDPOINTS.AwsAclProvider);\n\t\tconst awsACLRes = await this._fetch({ url: awsACLURL });\n\n\t\tconst awsACLText = await awsACLRes.text();\n\t\tlet awsACLJSON: unknown;\n\t\ttry {\n\t\t\tawsACLJSON = JSON.parse(awsACLText);\n\t\t} catch (error) {\n\t\t\t// Response is not JSON\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid AWS ACL response from ${awsACLURL}: ${awsACLText}`,\n\t\t\t\t{\n\t\t\t\t\tcause: error,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\tconst { value: awsACL, error } = decode(\n\t\t\tt.intersection([\n\t\t\t\tt.type({\n\t\t\t\t\tvalues: t.type({\n\t\t\t\t\t\turl: t.string,\n\t\t\t\t\t\tfields: t.record(t.string, t.string),\n\t\t\t\t\t}),\n\t\t\t\t\timgixEndpoint: t.string,\n\t\t\t\t}),\n\t\t\t\tt.partial({\n\t\t\t\t\tmessage: t.string,\n\t\t\t\t\tMessage: t.string,\n\t\t\t\t\terror: t.string,\n\t\t\t\t}),\n\t\t\t]),\n\t\t\tawsACLJSON,\n\t\t);\n\n\t\tif (error) {\n\t\t\tthrow new Error(`Invalid AWS ACL response from ${awsACLURL}`, {\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t}\n\n\t\tconst errorMessage = awsACL.error || awsACL.message || awsACL.Message;\n\t\tif (errorMessage) {\n\t\t\tthrow new Error(`Failed to create an AWS ACL: ${errorMessage}`, {\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t}\n\n\t\tthis._s3ACL = {\n\t\t\tuploadEndpoint: awsACL.values.url,\n\t\t\trequiredFormDataFields: awsACL.values.fields,\n\t\t\timgixEndpoint: awsACL.imgixEndpoint,\n\t\t};\n\t}\n\n\tasync uploadScreenshot(\n\t\targs: ScreenshotsManagerUploadScreenshotArgs,\n\t): Promise<ScreenshotsManagerUploadScreenshotReturnType> {\n\t\tassertS3ACLInitialized(this._s3ACL);\n\n\t\tconst formData = new FormData();\n\n\t\tfor (const requiredFormDataFieldKey in this._s3ACL.requiredFormDataFields) {\n\t\t\tformData.append(\n\t\t\t\trequiredFormDataFieldKey,\n\t\t\t\tthis._s3ACL.requiredFormDataFields[requiredFormDataFieldKey],\n\t\t\t);\n\t\t}\n\n\t\tconst contentDigest = createContentDigest(args.data);\n\t\tconst fileType = await fileTypeFromBuffer(args.data);\n\t\tconst fileName = fileType\n\t\t\t? `${contentDigest}.${fileType.ext}`\n\t\t\t: contentDigest;\n\t\tconst key = args.keyPrefix ? `${args.keyPrefix}/${fileName}` : fileName;\n\n\t\tformData.set(\"key\", key);\n\n\t\tif (fileType) {\n\t\t\tformData.set(\"Content-Type\", fileType.mime);\n\t\t}\n\n\t\tformData.set(\"file\", new Blob([args.data], { type: fileType?.mime }));\n\n\t\tconst s3ACLEndpoint = this._s3ACL.uploadEndpoint;\n\t\tconst res = await uploadScreenshotLimit(() =>\n\t\t\tfetch(s3ACLEndpoint, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData,\n\t\t\t}),\n\t\t);\n\n\t\tif (res.ok) {\n\t\t\tconst url = new URL(key, this._s3ACL.imgixEndpoint);\n\t\t\turl.searchParams.set(\"auto\", \"compress,format\");\n\n\t\t\treturn {\n\t\t\t\turl: url.toString(),\n\t\t\t};\n\t\t} else {\n\t\t\tconst text = await res.text();\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to upload screenshot with status code: ${res.status}`,\n\t\t\t\t{\n\t\t\t\t\tcause: text,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tasync deleteScreenshotFolder(\n\t\targs: ScreenshotsManagerDeleteScreenshotFolderArgs,\n\t): Promise<void> {\n\t\tconst res = await this._fetch({\n\t\t\t// We're sending `args.sliceID` as `sliceName` because it's inconsistently\n\t\t\t// named in the ACL Provider API.\n\t\t\tbody: { sliceName: args.sliceID },\n\t\t\tmethod: \"POST\",\n\t\t\turl: new URL(\"delete-folder\", API_ENDPOINTS.AwsAclProvider),\n\t\t});\n\t\tif (!res.ok) {\n\t\t\tconst text = await res.text();\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to delete screenshot folder with status code: ${res.status}`,\n\t\t\t\t{\n\t\t\t\t\tcause: text,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate async _fetch(args: {\n\t\turl: URL;\n\t\tmethod?: \"GET\" | \"POST\";\n\t\tbody?: unknown;\n\t}): Promise<Response> {\n\t\tconst authenticationToken = await this.user.getAuthenticationToken();\n\t\tconst repositoryName = await this.project.
|
1
|
+
{"version":3,"file":"ScreenshotsManager.js","sources":["../../../../src/managers/screenshots/ScreenshotsManager.ts"],"sourcesContent":["import * as t from \"io-ts\";\nimport { fileTypeFromBuffer } from \"file-type\";\nimport pLimit from \"p-limit\";\nimport fetch, { FormData, Blob, Response } from \"../../lib/fetch\";\n\nimport { createContentDigest } from \"../../lib/createContentDigest\";\nimport { decode } from \"../../lib/decode\";\n\nimport { S3ACL } from \"../../types\";\nimport { SLICE_MACHINE_USER_AGENT } from \"../../constants/SLICE_MACHINE_USER_AGENT\";\nimport { API_ENDPOINTS } from \"../../constants/API_ENDPOINTS\";\n\nimport { BaseManager } from \"../BaseManager\";\n\nfunction assertS3ACLInitialized(\n\ts3ACL: S3ACL | undefined,\n): asserts s3ACL is NonNullable<typeof s3ACL> {\n\tif (s3ACL == undefined) {\n\t\tthrow new Error(\n\t\t\t\"An S3 ACL has not been initialized. Run `SliceMachineManager.screenshots.prototype.initS3ACL()` before re-calling this method.\",\n\t\t);\n\t}\n}\n\nconst uploadScreenshotLimit = pLimit(10);\n\ntype ScreenshotsManagerUploadScreenshotArgs = {\n\tdata: Buffer;\n\tkeyPrefix?: string;\n};\n\ntype ScreenshotsManagerUploadScreenshotReturnType = {\n\turl: string;\n};\n\ntype ScreenshotsManagerDeleteScreenshotFolderArgs = {\n\tsliceID: string;\n};\n\nexport class ScreenshotsManager extends BaseManager {\n\tprivate _s3ACL: S3ACL | undefined;\n\n\tasync initS3ACL(): Promise<void> {\n\t\t// TODO: we need to find a way to create a new AWS ACL only when necessary (e.g., when it has expired).\n\t\t// if (this._s3ACL) {\n\t\t// \treturn;\n\t\t// }\n\n\t\tconst awsACLURL = new URL(\"create\", API_ENDPOINTS.AwsAclProvider);\n\t\tconst awsACLRes = await this._fetch({ url: awsACLURL });\n\n\t\tconst awsACLText = await awsACLRes.text();\n\t\tlet awsACLJSON: unknown;\n\t\ttry {\n\t\t\tawsACLJSON = JSON.parse(awsACLText);\n\t\t} catch (error) {\n\t\t\t// Response is not JSON\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid AWS ACL response from ${awsACLURL}: ${awsACLText}`,\n\t\t\t\t{\n\t\t\t\t\tcause: error,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\n\t\tconst { value: awsACL, error } = decode(\n\t\t\tt.intersection([\n\t\t\t\tt.type({\n\t\t\t\t\tvalues: t.type({\n\t\t\t\t\t\turl: t.string,\n\t\t\t\t\t\tfields: t.record(t.string, t.string),\n\t\t\t\t\t}),\n\t\t\t\t\timgixEndpoint: t.string,\n\t\t\t\t}),\n\t\t\t\tt.partial({\n\t\t\t\t\tmessage: t.string,\n\t\t\t\t\tMessage: t.string,\n\t\t\t\t\terror: t.string,\n\t\t\t\t}),\n\t\t\t]),\n\t\t\tawsACLJSON,\n\t\t);\n\n\t\tif (error) {\n\t\t\tthrow new Error(`Invalid AWS ACL response from ${awsACLURL}`, {\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t}\n\n\t\tconst errorMessage = awsACL.error || awsACL.message || awsACL.Message;\n\t\tif (errorMessage) {\n\t\t\tthrow new Error(`Failed to create an AWS ACL: ${errorMessage}`, {\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t}\n\n\t\tthis._s3ACL = {\n\t\t\tuploadEndpoint: awsACL.values.url,\n\t\t\trequiredFormDataFields: awsACL.values.fields,\n\t\t\timgixEndpoint: awsACL.imgixEndpoint,\n\t\t};\n\t}\n\n\tasync uploadScreenshot(\n\t\targs: ScreenshotsManagerUploadScreenshotArgs,\n\t): Promise<ScreenshotsManagerUploadScreenshotReturnType> {\n\t\tassertS3ACLInitialized(this._s3ACL);\n\n\t\tconst formData = new FormData();\n\n\t\tfor (const requiredFormDataFieldKey in this._s3ACL.requiredFormDataFields) {\n\t\t\tformData.append(\n\t\t\t\trequiredFormDataFieldKey,\n\t\t\t\tthis._s3ACL.requiredFormDataFields[requiredFormDataFieldKey],\n\t\t\t);\n\t\t}\n\n\t\tconst contentDigest = createContentDigest(args.data);\n\t\tconst fileType = await fileTypeFromBuffer(args.data);\n\t\tconst fileName = fileType\n\t\t\t? `${contentDigest}.${fileType.ext}`\n\t\t\t: contentDigest;\n\t\tconst key = args.keyPrefix ? `${args.keyPrefix}/${fileName}` : fileName;\n\n\t\tformData.set(\"key\", key);\n\n\t\tif (fileType) {\n\t\t\tformData.set(\"Content-Type\", fileType.mime);\n\t\t}\n\n\t\tformData.set(\"file\", new Blob([args.data], { type: fileType?.mime }));\n\n\t\tconst s3ACLEndpoint = this._s3ACL.uploadEndpoint;\n\t\tconst res = await uploadScreenshotLimit(() =>\n\t\t\tfetch(s3ACLEndpoint, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: formData,\n\t\t\t}),\n\t\t);\n\n\t\tif (res.ok) {\n\t\t\tconst url = new URL(key, this._s3ACL.imgixEndpoint);\n\t\t\turl.searchParams.set(\"auto\", \"compress,format\");\n\n\t\t\treturn {\n\t\t\t\turl: url.toString(),\n\t\t\t};\n\t\t} else {\n\t\t\tconst text = await res.text();\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to upload screenshot with status code: ${res.status}`,\n\t\t\t\t{\n\t\t\t\t\tcause: text,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tasync deleteScreenshotFolder(\n\t\targs: ScreenshotsManagerDeleteScreenshotFolderArgs,\n\t): Promise<void> {\n\t\tconst res = await this._fetch({\n\t\t\t// We're sending `args.sliceID` as `sliceName` because it's inconsistently\n\t\t\t// named in the ACL Provider API.\n\t\t\tbody: { sliceName: args.sliceID },\n\t\t\tmethod: \"POST\",\n\t\t\turl: new URL(\"delete-folder\", API_ENDPOINTS.AwsAclProvider),\n\t\t});\n\t\tif (!res.ok) {\n\t\t\tconst text = await res.text();\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to delete screenshot folder with status code: ${res.status}`,\n\t\t\t\t{\n\t\t\t\t\tcause: text,\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate async _fetch(args: {\n\t\turl: URL;\n\t\tmethod?: \"GET\" | \"POST\";\n\t\tbody?: unknown;\n\t}): Promise<Response> {\n\t\tconst authenticationToken = await this.user.getAuthenticationToken();\n\t\tconst repositoryName = await this.project.getResolvedRepositoryName();\n\n\t\treturn await fetch(args.url, {\n\t\t\tbody: args.body ? JSON.stringify(args.body) : undefined,\n\t\t\theaders: {\n\t\t\t\tAuthorization: `Bearer ${authenticationToken}`,\n\t\t\t\tRepository: repositoryName,\n\t\t\t\t\"User-Agent\": SLICE_MACHINE_USER_AGENT,\n\t\t\t\t...(args.body ? { \"Content-Type\": \"application/json\" } : {}),\n\t\t\t},\n\t\t\tmethod: args.method,\n\t\t});\n\t}\n}\n"],"names":["error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,SAAS,uBACR,OAAwB;AAExB,MAAI,SAAS,QAAW;AACjB,UAAA,IAAI,MACT,gIAAgI;AAAA,EAElI;AACD;AAEA,MAAM,wBAAwB,OAAO,EAAE;AAejC,MAAO,2BAA2B,YAAW;AAAA,EAA7C;AAAA;AACG;AAAA;AAAA,EAER,MAAM,YAAS;AAMd,UAAM,YAAY,IAAI,IAAI,UAAU,cAAc,cAAc;AAChE,UAAM,YAAY,MAAM,KAAK,OAAO,EAAE,KAAK,WAAW;AAEhD,UAAA,aAAa,MAAM,UAAU;AAC/B,QAAA;AACA,QAAA;AACU,mBAAA,KAAK,MAAM,UAAU;AAAA,aAC1BA;AAER,YAAM,IAAI,MACT,iCAAiC,cAAc,cAC/C;AAAA,QACC,OAAOA;AAAAA,MAAA,CACP;AAAA,IAEH;AAEA,UAAM,EAAE,OAAO,QAAQ,MAAU,IAAA,OAChC,EAAE,aAAa;AAAA,MACd,EAAE,KAAK;AAAA,QACN,QAAQ,EAAE,KAAK;AAAA,UACd,KAAK,EAAE;AAAA,UACP,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;AAAA,QAAA,CACnC;AAAA,QACD,eAAe,EAAE;AAAA,MAAA,CACjB;AAAA,MACD,EAAE,QAAQ;AAAA,QACT,SAAS,EAAE;AAAA,QACX,SAAS,EAAE;AAAA,QACX,OAAO,EAAE;AAAA,MAAA,CACT;AAAA,IAAA,CACD,GACD,UAAU;AAGX,QAAI,OAAO;AACJ,YAAA,IAAI,MAAM,iCAAiC,aAAa;AAAA,QAC7D,OAAO;AAAA,MAAA,C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AAM,IAAI;AACvB,YAAM,IAAI,MACT,iDAAiD,IAAI,UACrD;AAAA,QACC,OAAO;AAAA,MAAA,CACP;AAAA,IAEH;AAAA,EACD;AAAA,EAEA,MAAM,uBACL,MAAkD;AAE5C,UAAA,MAAM,MAAM,KAAK,OAAO;AAAA;AAAA;AAAA,MAG7B,MAAM,EAAE,WAAW,KAAK,QAAS;AAAA,MACjC,QAAQ;AAAA,MACR,KAAK,IAAI,IAAI,iBAAiB,cAAc,cAAc;AAAA,IAAA,CAC1D;AACG,QAAA,CAAC,IAAI,IAAI;AACN,YAAA,OAAO,MAAM,IAAI;AACvB,YAAM,IAAI,MACT,wDAAwD,IAAI,UAC5D;AAAA,QACC,OAAO;AAAA,MAAA,CACP;AAAA,IAEH;AAAA,EACD;AAAA,EAEQ,MAAM,OAAO,MAIpB;AACA,UAAM,sBAAsB,MAAM,KAAK,KAAK,uBAAsB;AAClE,UAAM,iBAAiB,MAAM,KAAK,QAAQ,0BAAyB;AAE5D,WAAA,MAAM,MAAM,KAAK,KAAK;AAAA,MAC5B,MAAM,KAAK,OAAO,KAAK,UAAU,KAAK,IAAI,IAAI;AAAA,MAC9C,SAAS;AAAA,QACR,eAAe,UAAU;AAAA,QACzB,YAAY;AAAA,QACZ,cAAc;AAAA,QACd,GAAI,KAAK,OAAO,EAAE,gBAAgB,uBAAuB;MACzD;AAAA,MACD,QAAQ,KAAK;AAAA,IAAA,CACb;AAAA,EACF;AACA;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import { FieldType } 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\treview: \"review\",\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_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_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\tsliceLibrary_beta_modalOpened: \"slice-library:beta:modal-opened\",\n\tsliceLibrary_beta_codeOpened: \"slice-library:beta:code-opened\",\n\tpostPush_emptyStateCtaClicked: \"post-push:empty-state-cta-clicked\",\n\tpostPush_toastCtaClicked: \"post-push:toast-cta-clicked\",\n\texperiment_exposure: \"experiment:exposure\",\n\tonboarding_step_opened: \"onboarding:step-opened\",\n\tonboarding_step_completed: \"onboarding:step-completed\",\n\tonboarding_completed: \"onboarding:completed\",\n\tsharedOnboarding_step_opened: \"shared-onboarding:step-opened\",\n\tsharedOnboarding_step_completed: \"shared-onboarding:step-completed\",\n\tsharedOnboarding_completed: \"shared-onboarding:completed\",\n} as const;\ntype SegmentEventTypes =\n\t(typeof SegmentEventType)[keyof typeof SegmentEventType];\n\nexport const HumanSegmentEventType = {\n\t[SegmentEventType.command_init_start]: \"SliceMachine Init Start\",\n\t[SegmentEventType.command_init_identify]: \"SliceMachine Init Identify\",\n\t[SegmentEventType.command_init_end]: \"SliceMachine Init End\",\n\t[SegmentEventType.review]: \"SliceMachine Review\",\n\t[SegmentEventType.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_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_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.sliceLibrary_beta_modalOpened]:\n\t\t\"SliceMachine Slice Library [BETA] CTA modal displayed\",\n\t[SegmentEventType.sliceLibrary_beta_codeOpened]:\n\t\t\"SliceMachine Slice Library [BETA] CTA example code opened\",\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.onboarding_step_opened]:\n\t\t\"SliceMachine Onboarding Step Opened\",\n\t[SegmentEventType.onboarding_step_completed]:\n\t\t\"SliceMachine Onboarding Step Completed\",\n\t[SegmentEventType.onboarding_completed]: \"SliceMachine Onboarding Completed\",\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} 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 ReviewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.review,\n\t{\n\t\trating: number;\n\t\tcomment: string;\n\t\ttype: \"onboarding\" | \"advanced repository\";\n\t}\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}\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{ id: string; name: string; library: string; sliceTemplate?: string }\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 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 SliceLibraryBetaModalOpened = SegmentEvent<\n\ttypeof SegmentEventType.sliceLibrary_beta_modalOpened\n>;\n\ntype SliceLibraryBetaCodeOpened = SegmentEvent<\n\ttypeof SegmentEventType.sliceLibrary_beta_codeOpened\n>;\n\ntype OnboardingCommonPayload = { stepId: string; stepTitle: string };\ntype SharedOnboardingProperties<T = Record<string, string>> = T & {\n\tsource: \"SliceMachine\";\n};\n\ntype SliceMachineOnboardingStepOpened = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_step_opened,\n\tOnboardingCommonPayload\n>;\ntype SliceMachineOnboardingStepCompleted = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_step_completed,\n\tOnboardingCommonPayload\n>;\ntype SliceMachineOnboardingCompleted = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_completed\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>;\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\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| ReviewSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| FieldAddedSegmentEvent\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| 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| SliceLibraryBetaModalOpened\n\t| SliceLibraryBetaCodeOpened\n\t| SliceMachineOnboardingStepOpened\n\t| SliceMachineOnboardingStepCompleted\n\t| SliceMachineOnboardingCompleted\n\t| SliceMachineSharedOnboardingStepOpened\n\t| SliceMachineSharedOnboardingStepCompleted\n\t| SliceMachineSharedOnboardingCompleted\n\t| SliceMachinePostPushEmptyStateCtaClicked\n\t| SliceMachinePostPushToastCtaClicked\n\t| SliceMachineExperimentExposure;\n"],"names":[],"mappings":";;AAOO,MAAM,mBAAmB;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,QAAQ;AAAA,EACR,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,k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BAAiB,cAAc,GAAG;AAAA,EACnC,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,4BAA4B,GAC7C;AAAA,EACD,CAAC,iBAAiB,6BAA6B,GAC9C;AAAA,EACD,CAAC,iBAAiB,wBAAwB,GACzC;AAAA,EACD,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,sBAAsB,GACvC;AAAA,EACD,CAAC,iBAAiB,yBAAyB,GAC1C;AAAA,EACD,CAAC,iBAAiB,oBAAoB,GAAG;AAAA,EACzC,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,4BAA4B,GAC7C;AAAA,EACD,CAAC,iBAAiB,0BAA0B,GAC3C;;;;"}
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import { FieldType } 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\treview: \"review\",\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_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_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\tsliceLibrary_beta_modalOpened: \"slice-library:beta:modal-opened\",\n\tsliceLibrary_beta_codeOpened: \"slice-library:beta:code-opened\",\n\tpostPush_emptyStateCtaClicked: \"post-push:empty-state-cta-clicked\",\n\tpostPush_toastCtaClicked: \"post-push:toast-cta-clicked\",\n\texperiment_exposure: \"experiment:exposure\",\n\tonboarding_step_opened: \"onboarding:step-opened\",\n\tonboarding_step_completed: \"onboarding:step-completed\",\n\tonboarding_completed: \"onboarding:completed\",\n\tsharedOnboarding_step_opened: \"shared-onboarding:step-opened\",\n\tsharedOnboarding_step_completed: \"shared-onboarding:step-completed\",\n\tsharedOnboarding_completed: \"shared-onboarding:completed\",\n} as const;\ntype SegmentEventTypes =\n\t(typeof SegmentEventType)[keyof typeof SegmentEventType];\n\nexport const HumanSegmentEventType = {\n\t[SegmentEventType.command_init_start]: \"SliceMachine Init Start\",\n\t[SegmentEventType.command_init_identify]: \"SliceMachine Init Identify\",\n\t[SegmentEventType.command_init_end]: \"SliceMachine Init End\",\n\t[SegmentEventType.review]: \"SliceMachine Review\",\n\t[SegmentEventType.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_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_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.sliceLibrary_beta_modalOpened]:\n\t\t\"SliceMachine Slice Library [BETA] CTA modal displayed\",\n\t[SegmentEventType.sliceLibrary_beta_codeOpened]:\n\t\t\"SliceMachine Slice Library [BETA] CTA example code opened\",\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.onboarding_step_opened]:\n\t\t\"SliceMachine Onboarding Step Opened\",\n\t[SegmentEventType.onboarding_step_completed]:\n\t\t\"SliceMachine Onboarding Step Completed\",\n\t[SegmentEventType.onboarding_completed]: \"SliceMachine Onboarding Completed\",\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} 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 ReviewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.review,\n\t{\n\t\trating: number;\n\t\tcomment: string;\n\t\ttype: \"onboarding\" | \"advanced repository\";\n\t}\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}\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{ id: string; name: string; library: string; sliceTemplate?: string }\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 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 SliceLibraryBetaModalOpened = SegmentEvent<\n\ttypeof SegmentEventType.sliceLibrary_beta_modalOpened\n>;\n\ntype SliceLibraryBetaCodeOpened = SegmentEvent<\n\ttypeof SegmentEventType.sliceLibrary_beta_codeOpened\n>;\n\ntype OnboardingCommonPayload = { stepId: string; stepTitle: string };\ntype SharedOnboardingProperties<T = Record<string, string>> = T & {\n\tsource: \"SliceMachine\";\n};\n\ntype SliceMachineOnboardingStepOpened = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_step_opened,\n\tOnboardingCommonPayload\n>;\ntype SliceMachineOnboardingStepCompleted = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_step_completed,\n\tOnboardingCommonPayload\n>;\ntype SliceMachineOnboardingCompleted = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_completed\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>;\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\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| ReviewSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| FieldAddedSegmentEvent\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| 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| SliceLibraryBetaModalOpened\n\t| SliceLibraryBetaCodeOpened\n\t| SliceMachineOnboardingStepOpened\n\t| SliceMachineOnboardingStepCompleted\n\t| SliceMachineOnboardingCompleted\n\t| SliceMachineSharedOnboardingStepOpened\n\t| SliceMachineSharedOnboardingStepCompleted\n\t| SliceMachineSharedOnboardingCompleted\n\t| SliceMachinePostPushEmptyStateCtaClicked\n\t| SliceMachinePostPushToastCtaClicked\n\t| SliceMachineExperimentExposure;\n"],"names":[],"mappings":";;AAOO,MAAM,mBAAmB;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,QAAQ;AAAA,EACR,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,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,oBA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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,4BAA4B,GAC7C;AAAA,EACD,CAAC,iBAAiB,6BAA6B,GAC9C;AAAA,EACD,CAAC,iBAAiB,wBAAwB,GACzC;AAAA,EACD,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,sBAAsB,GACvC;AAAA,EACD,CAAC,iBAAiB,yBAAyB,GAC1C;AAAA,EACD,CAAC,iBAAiB,oBAAoB,GAAG;AAAA,EACzC,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,4BAA4B,GAC7C;AAAA,EACD,CAAC,iBAAiB,0BAA0B,GAC3C;;;;"}
|
@@ -136,7 +136,6 @@ type FieldAddedSegmentEvent = SegmentEvent<typeof SegmentEventType.field_added,
|
|
136
136
|
isInAGroup: boolean;
|
137
137
|
contentType: "page type" | "custom type" | "slice";
|
138
138
|
allowText?: boolean;
|
139
|
-
repeat?: boolean;
|
140
139
|
}>;
|
141
140
|
type FieldSettingsOpenedSegmentEvent = SegmentEvent<typeof SegmentEventType.field_settingsOpened, {
|
142
141
|
id: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import { FieldType } 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\treview: \"review\",\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_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_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\tsliceLibrary_beta_modalOpened: \"slice-library:beta:modal-opened\",\n\tsliceLibrary_beta_codeOpened: \"slice-library:beta:code-opened\",\n\tpostPush_emptyStateCtaClicked: \"post-push:empty-state-cta-clicked\",\n\tpostPush_toastCtaClicked: \"post-push:toast-cta-clicked\",\n\texperiment_exposure: \"experiment:exposure\",\n\tonboarding_step_opened: \"onboarding:step-opened\",\n\tonboarding_step_completed: \"onboarding:step-completed\",\n\tonboarding_completed: \"onboarding:completed\",\n\tsharedOnboarding_step_opened: \"shared-onboarding:step-opened\",\n\tsharedOnboarding_step_completed: \"shared-onboarding:step-completed\",\n\tsharedOnboarding_completed: \"shared-onboarding:completed\",\n} as const;\ntype SegmentEventTypes =\n\t(typeof SegmentEventType)[keyof typeof SegmentEventType];\n\nexport const HumanSegmentEventType = {\n\t[SegmentEventType.command_init_start]: \"SliceMachine Init Start\",\n\t[SegmentEventType.command_init_identify]: \"SliceMachine Init Identify\",\n\t[SegmentEventType.command_init_end]: \"SliceMachine Init End\",\n\t[SegmentEventType.review]: \"SliceMachine Review\",\n\t[SegmentEventType.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_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_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.sliceLibrary_beta_modalOpened]:\n\t\t\"SliceMachine Slice Library [BETA] CTA modal displayed\",\n\t[SegmentEventType.sliceLibrary_beta_codeOpened]:\n\t\t\"SliceMachine Slice Library [BETA] CTA example code opened\",\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.onboarding_step_opened]:\n\t\t\"SliceMachine Onboarding Step Opened\",\n\t[SegmentEventType.onboarding_step_completed]:\n\t\t\"SliceMachine Onboarding Step Completed\",\n\t[SegmentEventType.onboarding_completed]: \"SliceMachine Onboarding Completed\",\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} 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 ReviewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.review,\n\t{\n\t\trating: number;\n\t\tcomment: string;\n\t\ttype: \"onboarding\" | \"advanced repository\";\n\t}\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}\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{ id: string; name: string; library: string; sliceTemplate?: string }\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 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 SliceLibraryBetaModalOpened = SegmentEvent<\n\ttypeof SegmentEventType.sliceLibrary_beta_modalOpened\n>;\n\ntype SliceLibraryBetaCodeOpened = SegmentEvent<\n\ttypeof SegmentEventType.sliceLibrary_beta_codeOpened\n>;\n\ntype OnboardingCommonPayload = { stepId: string; stepTitle: string };\ntype SharedOnboardingProperties<T = Record<string, string>> = T & {\n\tsource: \"SliceMachine\";\n};\n\ntype SliceMachineOnboardingStepOpened = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_step_opened,\n\tOnboardingCommonPayload\n>;\ntype SliceMachineOnboardingStepCompleted = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_step_completed,\n\tOnboardingCommonPayload\n>;\ntype SliceMachineOnboardingCompleted = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_completed\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>;\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\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| ReviewSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| FieldAddedSegmentEvent\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| 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| SliceLibraryBetaModalOpened\n\t| SliceLibraryBetaCodeOpened\n\t| SliceMachineOnboardingStepOpened\n\t| SliceMachineOnboardingStepCompleted\n\t| SliceMachineOnboardingCompleted\n\t| SliceMachineSharedOnboardingStepOpened\n\t| SliceMachineSharedOnboardingStepCompleted\n\t| SliceMachineSharedOnboardingCompleted\n\t| SliceMachinePostPushEmptyStateCtaClicked\n\t| SliceMachinePostPushToastCtaClicked\n\t| SliceMachineExperimentExposure;\n"],"names":[],"mappings":"AAOO,MAAM,mBAAmB;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,QAAQ;AAAA,EACR,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,UAAU;AAAA,EACV,oBAAoB;AAAA,EACp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GAAG;AAAA,EAClC,CAAC,iBAAiB,qBAAqB,GACtC;AAAA,EACD,CAAC,iBAAiB,eAAe,GAAG;AAAA,EACpC,CAAC,iBAAiB,cAAc,GAAG;AAAA,EACnC,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,4BAA4B,GAC7C;AAAA,EACD,CAAC,iBAAiB,6BAA6B,GAC9C;AAAA,EACD,CAAC,iBAAiB,wBAAwB,GACzC;AAAA,EACD,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,sBAAsB,GACvC;AAAA,EACD,CAAC,iBAAiB,yBAAyB,GAC1C;AAAA,EACD,CAAC,iBAAiB,oBAAoB,GAAG;AAAA,EACzC,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,4BAA4B,GAC7C;AAAA,EACD,CAAC,iBAAiB,0BAA0B,GAC3C;;"}
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../src/managers/telemetry/types.ts"],"sourcesContent":["import { FieldType } 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\treview: \"review\",\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_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_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\tsliceLibrary_beta_modalOpened: \"slice-library:beta:modal-opened\",\n\tsliceLibrary_beta_codeOpened: \"slice-library:beta:code-opened\",\n\tpostPush_emptyStateCtaClicked: \"post-push:empty-state-cta-clicked\",\n\tpostPush_toastCtaClicked: \"post-push:toast-cta-clicked\",\n\texperiment_exposure: \"experiment:exposure\",\n\tonboarding_step_opened: \"onboarding:step-opened\",\n\tonboarding_step_completed: \"onboarding:step-completed\",\n\tonboarding_completed: \"onboarding:completed\",\n\tsharedOnboarding_step_opened: \"shared-onboarding:step-opened\",\n\tsharedOnboarding_step_completed: \"shared-onboarding:step-completed\",\n\tsharedOnboarding_completed: \"shared-onboarding:completed\",\n} as const;\ntype SegmentEventTypes =\n\t(typeof SegmentEventType)[keyof typeof SegmentEventType];\n\nexport const HumanSegmentEventType = {\n\t[SegmentEventType.command_init_start]: \"SliceMachine Init Start\",\n\t[SegmentEventType.command_init_identify]: \"SliceMachine Init Identify\",\n\t[SegmentEventType.command_init_end]: \"SliceMachine Init End\",\n\t[SegmentEventType.review]: \"SliceMachine Review\",\n\t[SegmentEventType.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_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_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.sliceLibrary_beta_modalOpened]:\n\t\t\"SliceMachine Slice Library [BETA] CTA modal displayed\",\n\t[SegmentEventType.sliceLibrary_beta_codeOpened]:\n\t\t\"SliceMachine Slice Library [BETA] CTA example code opened\",\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.onboarding_step_opened]:\n\t\t\"SliceMachine Onboarding Step Opened\",\n\t[SegmentEventType.onboarding_step_completed]:\n\t\t\"SliceMachine Onboarding Step Completed\",\n\t[SegmentEventType.onboarding_completed]: \"SliceMachine Onboarding Completed\",\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} 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 ReviewSegmentEvent = SegmentEvent<\n\ttypeof SegmentEventType.review,\n\t{\n\t\trating: number;\n\t\tcomment: string;\n\t\ttype: \"onboarding\" | \"advanced repository\";\n\t}\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}\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{ id: string; name: string; library: string; sliceTemplate?: string }\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 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 SliceLibraryBetaModalOpened = SegmentEvent<\n\ttypeof SegmentEventType.sliceLibrary_beta_modalOpened\n>;\n\ntype SliceLibraryBetaCodeOpened = SegmentEvent<\n\ttypeof SegmentEventType.sliceLibrary_beta_codeOpened\n>;\n\ntype OnboardingCommonPayload = { stepId: string; stepTitle: string };\ntype SharedOnboardingProperties<T = Record<string, string>> = T & {\n\tsource: \"SliceMachine\";\n};\n\ntype SliceMachineOnboardingStepOpened = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_step_opened,\n\tOnboardingCommonPayload\n>;\ntype SliceMachineOnboardingStepCompleted = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_step_completed,\n\tOnboardingCommonPayload\n>;\ntype SliceMachineOnboardingCompleted = SegmentEvent<\n\ttypeof SegmentEventType.onboarding_completed\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>;\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\nexport type SegmentEvents =\n\t| CommandInitStartSegmentEvent\n\t| CommandInitIdentifySegmentEvent\n\t| CommandInitEndSegmentEvent\n\t| ReviewSegmentEvent\n\t| SliceSimulatorOpenSegmentEvent\n\t| SliceSimulatorIsNotRunningSegmentEvent\n\t| PageViewSegmentEvent\n\t| OpenVideoTutorialsSegmentEvent\n\t| FieldAddedSegmentEvent\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| 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| SliceLibraryBetaModalOpened\n\t| SliceLibraryBetaCodeOpened\n\t| SliceMachineOnboardingStepOpened\n\t| SliceMachineOnboardingStepCompleted\n\t| SliceMachineOnboardingCompleted\n\t| SliceMachineSharedOnboardingStepOpened\n\t| SliceMachineSharedOnboardingStepCompleted\n\t| SliceMachineSharedOnboardingCompleted\n\t| SliceMachinePostPushEmptyStateCtaClicked\n\t| SliceMachinePostPushToastCtaClicked\n\t| SliceMachineExperimentExposure;\n"],"names":[],"mappings":"AAOO,MAAM,mBAAmB;AAAA,EAC/B,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,kBAAkB;AAAA,EAClB,QAAQ;AAAA,EACR,qBAAqB;AAAA,EACrB,6BAA6B;AAAA,EAC7B,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,aAAa;AAAA,EACb,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,6BAA6B;AAAA,EAC7B,iCAAiC;AAAA,EACjC,kBAA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iB,cAAc,GAAG;AAAA,EACnC,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,4BAA4B,GAC7C;AAAA,EACD,CAAC,iBAAiB,6BAA6B,GAC9C;AAAA,EACD,CAAC,iBAAiB,wBAAwB,GACzC;AAAA,EACD,CAAC,iBAAiB,mBAAmB,GAAG;AAAA,EACxC,CAAC,iBAAiB,sBAAsB,GACvC;AAAA,EACD,CAAC,iBAAiB,yBAAyB,GAC1C;AAAA,EACD,CAAC,iBAAiB,oBAAoB,GAAG;AAAA,EACzC,CAAC,iBAAiB,+BAA+B,GAChD;AAAA,EACD,CAAC,iBAAiB,4BAA4B,GAC7C;AAAA,EACD,CAAC,iBAAiB,0BAA0B,GAC3C;;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@slicemachine/manager",
|
3
|
-
"version": "0.22.5-alpha.
|
3
|
+
"version": "0.22.5-alpha.xru-fix-env-push-admin.1",
|
4
4
|
"description": "Manage all aspects of a Slice Machine project.",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -68,9 +68,9 @@
|
|
68
68
|
"@prismicio/client": "^7.11.0",
|
69
69
|
"@prismicio/custom-types-client": "2.1.0",
|
70
70
|
"@prismicio/mocks": "^2.4.0",
|
71
|
-
"@prismicio/types-internal": "
|
71
|
+
"@prismicio/types-internal": "^2.8.0",
|
72
72
|
"@segment/analytics-node": "^2.1.2",
|
73
|
-
"@slicemachine/plugin-kit": "0.4.59-alpha.
|
73
|
+
"@slicemachine/plugin-kit": "0.4.59-alpha.xru-fix-env-push-admin.1",
|
74
74
|
"cookie": "^1.0.1",
|
75
75
|
"cors": "^2.8.5",
|
76
76
|
"execa": "^7.1.1",
|
@@ -183,7 +183,7 @@ export class ScreenshotsManager extends BaseManager {
|
|
183
183
|
body?: unknown;
|
184
184
|
}): Promise<Response> {
|
185
185
|
const authenticationToken = await this.user.getAuthenticationToken();
|
186
|
-
const repositoryName = await this.project.
|
186
|
+
const repositoryName = await this.project.getResolvedRepositoryName();
|
187
187
|
|
188
188
|
return await fetch(args.url, {
|
189
189
|
body: args.body ? JSON.stringify(args.body) : undefined,
|