@slicemachine/manager 0.20.8-alpha.BI-dt-2380-add-shared-onboarding.1 → 0.20.8-alpha.BI-dt-2380-add-shared-onboarding.3

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.
@@ -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/index2.cjs");
4
+ const index = require("../../../../../../_virtual/index3.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/index2.js";
3
+ import require$$0 from "../../../../../../_virtual/index3.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/index3.cjs");
3
+ const index = require("../../_virtual/index2.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/index3.js";
2
+ import { __module as crossSpawn$1 } from "../../_virtual/index2.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";
@@ -1,6 +1,5 @@
1
1
  "use strict";
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;
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var crossSpawn = { exports: {} };
4
+ exports.__module = crossSpawn;
6
5
  //# 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":";;;;"}
@@ -1,7 +1,5 @@
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);
1
+ var crossSpawn = { exports: {} };
4
2
  export {
5
- require$$0 as default
3
+ crossSpawn as __module
6
4
  };
7
5
  //# 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":";"}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var crossSpawn = { exports: {} };
4
- exports.__module = crossSpawn;
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=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":";;;;;"}
@@ -1,5 +1,7 @@
1
- var crossSpawn = { exports: {} };
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
- crossSpawn as __module
5
+ require$$0 as default
4
6
  };
5
7
  //# 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":";;;"}
@@ -71,16 +71,25 @@ const Environment = t__namespace.type({
71
71
  id: t__namespace.string
72
72
  }))
73
73
  });
74
+ const supportedSliceMachineFrameworks = [
75
+ "next",
76
+ "nuxt",
77
+ "sveltekit"
78
+ ];
79
+ function isSupportedFramework(value) {
80
+ return supportedSliceMachineFrameworks.includes(value);
81
+ }
82
+ const repositoryFramework = index.default.preprocess((value) => {
83
+ if (typeof value === "string" && isSupportedFramework(value)) {
84
+ return value;
85
+ }
86
+ return "other";
87
+ }, index.default.enum([...supportedSliceMachineFrameworks, "other"]));
74
88
  const OnboardingState = index.default.object({
75
89
  completedSteps: index.default.array(index.default.string()),
76
90
  isDismissed: index.default.boolean(),
77
91
  context: index.default.object({
78
- framework: index.default.union([
79
- index.default.literal("next"),
80
- index.default.literal("nuxt"),
81
- index.default.literal("sveltekit"),
82
- index.default.literal("other")
83
- ]),
92
+ framework: repositoryFramework.optional().default("other"),
84
93
  starterId: index.default.string().nullable()
85
94
  })
86
95
  });
@@ -90,4 +99,6 @@ exports.PrismicRepository = PrismicRepository;
90
99
  exports.PrismicRepositoryRole = PrismicRepositoryRole;
91
100
  exports.PrismicRepositoryUserAgent = PrismicRepositoryUserAgent;
92
101
  exports.PushChangesRawLimit = PushChangesRawLimit;
102
+ exports.repositoryFramework = repositoryFramework;
103
+ exports.supportedSliceMachineFrameworks = supportedSliceMachineFrameworks;
93
104
  //# sourceMappingURL=types.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sources":["../../../../src/managers/prismicRepository/types.ts"],"sourcesContent":["import {\n\tCustomType,\n\tSharedSlice,\n} from \"@prismicio/types-internal/lib/customtypes\";\nimport * as t from \"io-ts\";\nimport { z } from \"zod\";\n\nexport const PrismicRepositoryUserAgent = {\n\tSliceMachine: \"prismic-cli/sm\",\n\tLegacyZero: \"prismic-cli/0\",\n} as const;\nexport type PrismicRepositoryUserAgents =\n\t(typeof PrismicRepositoryUserAgent)[keyof typeof PrismicRepositoryUserAgent];\n\nexport const PrismicRepositoryRole = {\n\tSuperUser: \"SuperUser\",\n\tAdministrator: \"Administrator\",\n\tOwner: \"Owner\",\n\tManager: \"Manager\",\n\tPublisher: \"Publisher\",\n\tWriter: \"Writer\",\n\tReadonly: \"Readonly\",\n} as const;\nexport type PrismicRepositoryRoles =\n\t(typeof PrismicRepositoryRole)[keyof typeof PrismicRepositoryRole];\n\nexport const PrismicRepository = t.type({\n\tdomain: t.string,\n\tname: t.string,\n\trole: t.union([\n\t\tt.keyof(PrismicRepositoryRole),\n\t\tt.record(t.string, t.keyof(PrismicRepositoryRole)),\n\t]),\n});\nexport type PrismicRepository = t.TypeOf<typeof PrismicRepository>;\n\nexport enum ChangeTypes {\n\tSLICE_INSERT = \"SLICE_INSERT\",\n\tSLICE_UPDATE = \"SLICE_UPDATE\",\n\tSLICE_DELETE = \"SLICE_DELETE\",\n\tCUSTOM_TYPE_INSERT = \"CUSTOM_TYPE_INSERT\",\n\tCUSTOM_TYPE_UPDATE = \"CUSTOM_TYPE_UPDATE\",\n\tCUSTOM_TYPE_DELETE = \"CUSTOM_TYPE_DELETE\",\n}\ninterface Change {\n\ttype: ChangeTypes;\n\tid: string;\n\tpayload: Record<string, unknown>;\n}\ninterface DeleteChange extends Change {\n\tpayload: {\n\t\tid: Change[\"id\"];\n\t};\n}\nexport interface SliceInsertChange extends Change {\n\ttype: ChangeTypes.SLICE_INSERT;\n\tpayload: SharedSlice;\n}\nexport interface SliceUpdateChange extends Change {\n\ttype: ChangeTypes.SLICE_UPDATE;\n\tpayload: SharedSlice;\n}\nexport interface SliceDeleteChange extends DeleteChange {\n\ttype: ChangeTypes.SLICE_DELETE;\n}\nexport interface CustomTypeInsertChange extends Change {\n\ttype: ChangeTypes.CUSTOM_TYPE_INSERT;\n\tpayload: CustomType;\n}\nexport interface CustomTypeUpdateChange extends Change {\n\ttype: ChangeTypes.CUSTOM_TYPE_UPDATE;\n\tpayload: CustomType;\n}\nexport interface CustomTypeDeleteChange extends DeleteChange {\n\ttype: ChangeTypes.CUSTOM_TYPE_DELETE;\n}\nexport type AllChangeTypes =\n\t| SliceInsertChange\n\t| SliceUpdateChange\n\t| SliceDeleteChange\n\t| CustomTypeInsertChange\n\t| CustomTypeUpdateChange\n\t| CustomTypeDeleteChange;\nexport interface BulkBody extends Record<string, unknown> {\n\tconfirmDeleteDocuments: boolean;\n\tchanges: AllChangeTypes[];\n}\n\nexport const PushChangesRawLimit = t.type({\n\tdetails: t.type({\n\t\tcustomTypes: t.array(\n\t\t\tt.type({\n\t\t\t\tid: t.string,\n\t\t\t\tnumberOfDocuments: t.number,\n\t\t\t\turl: t.string,\n\t\t\t}),\n\t\t),\n\t}),\n});\nexport type PushChangesRawLimit = t.TypeOf<typeof PushChangesRawLimit>;\nexport enum PushChangesLimitType {\n\tSOFT = \"SOFT\",\n\tHARD = \"HARD\",\n}\nexport type PushChangesLimit = PushChangesRawLimit & {\n\ttype: PushChangesLimitType;\n};\n\nexport interface ClientError {\n\tstatus: number;\n\tmessage: string;\n}\n\ntype ChangeStatus = \"NEW\" | \"MODIFIED\" | \"DELETED\";\n\ntype CustomTypeChange = {\n\tid: string;\n\ttype: \"CustomType\";\n\tstatus: ChangeStatus;\n};\n\ntype SliceChange = {\n\tid: string;\n\ttype: \"Slice\";\n\tstatus: ChangeStatus;\n\tlibraryID: string;\n};\n\nexport type TransactionalMergeArgs = {\n\tconfirmDeleteDocuments: boolean;\n\tchanges: (CustomTypeChange | SliceChange)[];\n};\n\nexport type TransactionalMergeReturnType = PushChangesLimit | null;\n\n/**\n * Framework id sent to Segment from wroom. Property used for the \"framework\"\n * and \"hasSlicemachine\" properties.\n *\n * Values from:\n * https://github.com/prismicio/wroom/blob/65d4f53fd46df7d366d80e7ba9c965339ac7369d/subprojects/common/app/models/Framework.scala#LL20C6-L20C6\n */\nexport type FrameworkWroomTelemetryID = \"next\" | \"nuxt\" | \"sveltekit\" | \"other\";\n\n/**\n * Starter id sent to Segment from wroom.Property used for the \"starter\"\n * properties.\n *\n * Values from:\n * https://github.com/prismicio/wroom/blob/65d4f53fd46df7d366d80e7ba9c965339ac7369d/conf/application.conf#L938\n */\nexport type StarterId =\n\t| \"next_multi_page\"\n\t| \"next_blog\"\n\t| \"next_multi_lang\"\n\t| \"nuxt_multi_page\"\n\t| \"nuxt_blog\"\n\t| \"nuxt_multi_lang\";\n\nexport const Environment = t.type({\n\tkind: t.union([t.literal(\"prod\"), t.literal(\"stage\"), t.literal(\"dev\")]),\n\tname: t.string,\n\tdomain: t.string,\n\tusers: t.array(\n\t\tt.type({\n\t\t\tid: t.string,\n\t\t}),\n\t),\n});\nexport type Environment = t.TypeOf<typeof Environment>;\n\nexport const OnboardingState = z.object({\n\tcompletedSteps: z.array(z.string()),\n\tisDismissed: z.boolean(),\n\tcontext: z.object({\n\t\tframework: z.union([\n\t\t\tz.literal(\"next\"),\n\t\t\tz.literal(\"nuxt\"),\n\t\t\tz.literal(\"sveltekit\"),\n\t\t\tz.literal(\"other\"),\n\t\t]),\n\t\tstarterId: z.string().nullable(),\n\t}),\n});\nexport type OnboardingState = z.infer<typeof OnboardingState>;\n"],"names":["t","ChangeTypes","PushChangesLimitType","z"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOO,MAAM,6BAA6B;AAAA,EACzC,cAAc;AAAA,EACd,YAAY;;AAKN,MAAM,wBAAwB;AAAA,EACpC,WAAW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A,aAAE;AAAA,EAAA,CACN,CAAC;AAEH,CAAA;AAGY,MAAA,kBAAkBG,cAAE,OAAO;AAAA,EACvC,gBAAgBA,MAAAA,QAAE,MAAMA,MAAA,QAAE,QAAQ;AAAA,EAClC,aAAaA,cAAE,QAAS;AAAA,EACxB,SAASA,cAAE,OAAO;AAAA,IACjB,WAAWA,cAAE,MAAM;AAAA,MAClBA,MAAA,QAAE,QAAQ,MAAM;AAAA,MAChBA,MAAA,QAAE,QAAQ,MAAM;AAAA,MAChBA,MAAA,QAAE,QAAQ,WAAW;AAAA,MACrBA,MAAA,QAAE,QAAQ,OAAO;AAAA,IAAA,CACjB;AAAA,IACD,WAAWA,MAAA,QAAE,OAAQ,EAAC,SAAU;AAAA,EAAA,CAChC;AACD,CAAA;;;;;;;"}
1
+ {"version":3,"file":"types.cjs","sources":["../../../../src/managers/prismicRepository/types.ts"],"sourcesContent":["import {\n\tCustomType,\n\tSharedSlice,\n} from \"@prismicio/types-internal/lib/customtypes\";\nimport * as t from \"io-ts\";\nimport { z } from \"zod\";\n\nexport const PrismicRepositoryUserAgent = {\n\tSliceMachine: \"prismic-cli/sm\",\n\tLegacyZero: \"prismic-cli/0\",\n} as const;\nexport type PrismicRepositoryUserAgents =\n\t(typeof PrismicRepositoryUserAgent)[keyof typeof PrismicRepositoryUserAgent];\n\nexport const PrismicRepositoryRole = {\n\tSuperUser: \"SuperUser\",\n\tAdministrator: \"Administrator\",\n\tOwner: \"Owner\",\n\tManager: \"Manager\",\n\tPublisher: \"Publisher\",\n\tWriter: \"Writer\",\n\tReadonly: \"Readonly\",\n} as const;\nexport type PrismicRepositoryRoles =\n\t(typeof PrismicRepositoryRole)[keyof typeof PrismicRepositoryRole];\n\nexport const PrismicRepository = t.type({\n\tdomain: t.string,\n\tname: t.string,\n\trole: t.union([\n\t\tt.keyof(PrismicRepositoryRole),\n\t\tt.record(t.string, t.keyof(PrismicRepositoryRole)),\n\t]),\n});\nexport type PrismicRepository = t.TypeOf<typeof PrismicRepository>;\n\nexport enum ChangeTypes {\n\tSLICE_INSERT = \"SLICE_INSERT\",\n\tSLICE_UPDATE = \"SLICE_UPDATE\",\n\tSLICE_DELETE = \"SLICE_DELETE\",\n\tCUSTOM_TYPE_INSERT = \"CUSTOM_TYPE_INSERT\",\n\tCUSTOM_TYPE_UPDATE = \"CUSTOM_TYPE_UPDATE\",\n\tCUSTOM_TYPE_DELETE = \"CUSTOM_TYPE_DELETE\",\n}\ninterface Change {\n\ttype: ChangeTypes;\n\tid: string;\n\tpayload: Record<string, unknown>;\n}\ninterface DeleteChange extends Change {\n\tpayload: {\n\t\tid: Change[\"id\"];\n\t};\n}\nexport interface SliceInsertChange extends Change {\n\ttype: ChangeTypes.SLICE_INSERT;\n\tpayload: SharedSlice;\n}\nexport interface SliceUpdateChange extends Change {\n\ttype: ChangeTypes.SLICE_UPDATE;\n\tpayload: SharedSlice;\n}\nexport interface SliceDeleteChange extends DeleteChange {\n\ttype: ChangeTypes.SLICE_DELETE;\n}\nexport interface CustomTypeInsertChange extends Change {\n\ttype: ChangeTypes.CUSTOM_TYPE_INSERT;\n\tpayload: CustomType;\n}\nexport interface CustomTypeUpdateChange extends Change {\n\ttype: ChangeTypes.CUSTOM_TYPE_UPDATE;\n\tpayload: CustomType;\n}\nexport interface CustomTypeDeleteChange extends DeleteChange {\n\ttype: ChangeTypes.CUSTOM_TYPE_DELETE;\n}\nexport type AllChangeTypes =\n\t| SliceInsertChange\n\t| SliceUpdateChange\n\t| SliceDeleteChange\n\t| CustomTypeInsertChange\n\t| CustomTypeUpdateChange\n\t| CustomTypeDeleteChange;\nexport interface BulkBody extends Record<string, unknown> {\n\tconfirmDeleteDocuments: boolean;\n\tchanges: AllChangeTypes[];\n}\n\nexport const PushChangesRawLimit = t.type({\n\tdetails: t.type({\n\t\tcustomTypes: t.array(\n\t\t\tt.type({\n\t\t\t\tid: t.string,\n\t\t\t\tnumberOfDocuments: t.number,\n\t\t\t\turl: t.string,\n\t\t\t}),\n\t\t),\n\t}),\n});\nexport type PushChangesRawLimit = t.TypeOf<typeof PushChangesRawLimit>;\nexport enum PushChangesLimitType {\n\tSOFT = \"SOFT\",\n\tHARD = \"HARD\",\n}\nexport type PushChangesLimit = PushChangesRawLimit & {\n\ttype: PushChangesLimitType;\n};\n\nexport interface ClientError {\n\tstatus: number;\n\tmessage: string;\n}\n\ntype ChangeStatus = \"NEW\" | \"MODIFIED\" | \"DELETED\";\n\ntype CustomTypeChange = {\n\tid: string;\n\ttype: \"CustomType\";\n\tstatus: ChangeStatus;\n};\n\ntype SliceChange = {\n\tid: string;\n\ttype: \"Slice\";\n\tstatus: ChangeStatus;\n\tlibraryID: string;\n};\n\nexport type TransactionalMergeArgs = {\n\tconfirmDeleteDocuments: boolean;\n\tchanges: (CustomTypeChange | SliceChange)[];\n};\n\nexport type TransactionalMergeReturnType = PushChangesLimit | null;\n\n/**\n * Framework id sent to Segment from wroom. Property used for the \"framework\"\n * and \"hasSlicemachine\" properties.\n *\n * Values from:\n * https://github.com/prismicio/wroom/blob/65d4f53fd46df7d366d80e7ba9c965339ac7369d/subprojects/common/app/models/Framework.scala#LL20C6-L20C6\n */\nexport type FrameworkWroomTelemetryID = \"next\" | \"nuxt\" | \"sveltekit\" | \"other\";\n\n/**\n * Starter id sent to Segment from wroom.Property used for the \"starter\"\n * properties.\n *\n * Values from:\n * https://github.com/prismicio/wroom/blob/65d4f53fd46df7d366d80e7ba9c965339ac7369d/conf/application.conf#L938\n */\nexport type StarterId =\n\t| \"next_multi_page\"\n\t| \"next_blog\"\n\t| \"next_multi_lang\"\n\t| \"nuxt_multi_page\"\n\t| \"nuxt_blog\"\n\t| \"nuxt_multi_lang\";\n\nexport const Environment = t.type({\n\tkind: t.union([t.literal(\"prod\"), t.literal(\"stage\"), t.literal(\"dev\")]),\n\tname: t.string,\n\tdomain: t.string,\n\tusers: t.array(\n\t\tt.type({\n\t\t\tid: t.string,\n\t\t}),\n\t),\n});\nexport type Environment = t.TypeOf<typeof Environment>;\n\nexport const supportedSliceMachineFrameworks = [\n\t\"next\",\n\t\"nuxt\",\n\t\"sveltekit\",\n] as const;\n\ntype SupportedFramework = (typeof supportedSliceMachineFrameworks)[number];\n\nfunction isSupportedFramework(value: string): value is SupportedFramework {\n\treturn supportedSliceMachineFrameworks.includes(value as SupportedFramework);\n}\n\nexport const repositoryFramework = z.preprocess(\n\t(value) => {\n\t\t// NOTE: we persist a lot of different frameworks in the DB, but only the SM supported are relevant to us\n\t\t// Any other framework is treated like \"other\"\n\t\tif (typeof value === \"string\" && isSupportedFramework(value)) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn \"other\";\n\t},\n\tz.enum([...supportedSliceMachineFrameworks, \"other\"]),\n);\n\nexport type RepositoryFramework = z.TypeOf<typeof repositoryFramework>;\n\nexport const OnboardingState = z.object({\n\tcompletedSteps: z.array(z.string()),\n\tisDismissed: z.boolean(),\n\tcontext: z.object({\n\t\tframework: repositoryFramework.optional().default(\"other\"),\n\t\tstarterId: z.string().nullable(),\n\t}),\n});\nexport type OnboardingState = z.infer<typeof OnboardingState>;\n"],"names":["t","ChangeTypes","PushChangesLimitType","z"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOO,MAAM,6BAA6B;AAAA,EACzC,cAAc;AAAA,EACd,YAAY;;AAKN,MAAM,wBAAwB;AAAA,EACpC,WAAW;AAAA,EACX,eAAe;AAAA,EACf,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,UAAU;;AAKE,MAAA,oBAAoBA,aAAE,KAAK;AAAA,EACvC,QAAQA,aAAE;AAAA,EACV,MAAMA,aAAE;AAAA,EACR,MAAMA,aAAE,MAAM;AAAA,IACbA,aAAE,MAAM,qBAAqB;AAAA,IAC7BA,aAAE,OAAOA,aAAE,QAAQA,aAAE,MAAM,qBAAqB,CAAC;AAAA,EAAA,CACjD;AACD,CAAA;AAGWC,QAAA,cAAA;AAAA,CAAZ,SAAYA,cAAW;AACtBA,eAA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AAO;AAAA,EACvC,gBAAgBA,MAAAA,QAAE,MAAMA,MAAA,QAAE,QAAQ;AAAA,EAClC,aAAaA,cAAE,QAAS;AAAA,EACxB,SAASA,cAAE,OAAO;AAAA,IACjB,WAAW,oBAAoB,WAAW,QAAQ,OAAO;AAAA,IACzD,WAAWA,MAAA,QAAE,OAAQ,EAAC,SAAU;AAAA,EAAA,CAChC;AACD,CAAA;;;;;;;;;"}
@@ -146,18 +146,21 @@ export declare const Environment: t.TypeC<{
146
146
  }>>;
147
147
  }>;
148
148
  export type Environment = t.TypeOf<typeof Environment>;
149
+ export declare const supportedSliceMachineFrameworks: readonly ["next", "nuxt", "sveltekit"];
150
+ export declare const repositoryFramework: z.ZodEffects<z.ZodEnum<["next", "nuxt", "sveltekit", "other"]>, "next" | "nuxt" | "sveltekit" | "other", unknown>;
151
+ export type RepositoryFramework = z.TypeOf<typeof repositoryFramework>;
149
152
  export declare const OnboardingState: z.ZodObject<{
150
153
  completedSteps: z.ZodArray<z.ZodString, "many">;
151
154
  isDismissed: z.ZodBoolean;
152
155
  context: z.ZodObject<{
153
- framework: z.ZodUnion<[z.ZodLiteral<"next">, z.ZodLiteral<"nuxt">, z.ZodLiteral<"sveltekit">, z.ZodLiteral<"other">]>;
156
+ framework: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodEnum<["next", "nuxt", "sveltekit", "other"]>, "next" | "nuxt" | "sveltekit" | "other", unknown>>>;
154
157
  starterId: z.ZodNullable<z.ZodString>;
155
158
  }, "strip", z.ZodTypeAny, {
156
159
  framework: "next" | "nuxt" | "sveltekit" | "other";
157
160
  starterId: string | null;
158
161
  }, {
159
- framework: "next" | "nuxt" | "sveltekit" | "other";
160
162
  starterId: string | null;
163
+ framework?: unknown;
161
164
  }>;
162
165
  }, "strip", z.ZodTypeAny, {
163
166
  completedSteps: string[];
@@ -170,8 +173,8 @@ export declare const OnboardingState: z.ZodObject<{
170
173
  completedSteps: string[];
171
174
  isDismissed: boolean;
172
175
  context: {
173
- framework: "next" | "nuxt" | "sveltekit" | "other";
174
176
  starterId: string | null;
177
+ framework?: unknown;
175
178
  };
176
179
  }>;
177
180
  export type OnboardingState = z.infer<typeof OnboardingState>;
@@ -52,16 +52,25 @@ const Environment = t.type({
52
52
  id: t.string
53
53
  }))
54
54
  });
55
+ const supportedSliceMachineFrameworks = [
56
+ "next",
57
+ "nuxt",
58
+ "sveltekit"
59
+ ];
60
+ function isSupportedFramework(value) {
61
+ return supportedSliceMachineFrameworks.includes(value);
62
+ }
63
+ const repositoryFramework = z.preprocess((value) => {
64
+ if (typeof value === "string" && isSupportedFramework(value)) {
65
+ return value;
66
+ }
67
+ return "other";
68
+ }, z.enum([...supportedSliceMachineFrameworks, "other"]));
55
69
  const OnboardingState = z.object({
56
70
  completedSteps: z.array(z.string()),
57
71
  isDismissed: z.boolean(),
58
72
  context: z.object({
59
- framework: z.union([
60
- z.literal("next"),
61
- z.literal("nuxt"),
62
- z.literal("sveltekit"),
63
- z.literal("other")
64
- ]),
73
+ framework: repositoryFramework.optional().default("other"),
65
74
  starterId: z.string().nullable()
66
75
  })
67
76
  });
@@ -73,6 +82,8 @@ export {
73
82
  PrismicRepositoryRole,
74
83
  PrismicRepositoryUserAgent,
75
84
  PushChangesLimitType,
76
- PushChangesRawLimit
85
+ PushChangesRawLimit,
86
+ repositoryFramework,
87
+ supportedSliceMachineFrameworks
77
88
  };
78
89
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../src/managers/prismicRepository/types.ts"],"sourcesContent":["import {\n\tCustomType,\n\tSharedSlice,\n} from \"@prismicio/types-internal/lib/customtypes\";\nimport * as t from \"io-ts\";\nimport { z } from \"zod\";\n\nexport const PrismicRepositoryUserAgent = {\n\tSliceMachine: \"prismic-cli/sm\",\n\tLegacyZero: \"prismic-cli/0\",\n} as const;\nexport type PrismicRepositoryUserAgents =\n\t(typeof PrismicRepositoryUserAgent)[keyof typeof PrismicRepositoryUserAgent];\n\nexport const PrismicRepositoryRole = {\n\tSuperUser: \"SuperUser\",\n\tAdministrator: \"Administrator\",\n\tOwner: \"Owner\",\n\tManager: \"Manager\",\n\tPublisher: \"Publisher\",\n\tWriter: \"Writer\",\n\tReadonly: \"Readonly\",\n} as const;\nexport type PrismicRepositoryRoles =\n\t(typeof PrismicRepositoryRole)[keyof typeof PrismicRepositoryRole];\n\nexport const PrismicRepository = t.type({\n\tdomain: t.string,\n\tname: t.string,\n\trole: t.union([\n\t\tt.keyof(PrismicRepositoryRole),\n\t\tt.record(t.string, t.keyof(PrismicRepositoryRole)),\n\t]),\n});\nexport type PrismicRepository = t.TypeOf<typeof PrismicRepository>;\n\nexport enum ChangeTypes {\n\tSLICE_INSERT = \"SLICE_INSERT\",\n\tSLICE_UPDATE = \"SLICE_UPDATE\",\n\tSLICE_DELETE = \"SLICE_DELETE\",\n\tCUSTOM_TYPE_INSERT = \"CUSTOM_TYPE_INSERT\",\n\tCUSTOM_TYPE_UPDATE = \"CUSTOM_TYPE_UPDATE\",\n\tCUSTOM_TYPE_DELETE = \"CUSTOM_TYPE_DELETE\",\n}\ninterface Change {\n\ttype: ChangeTypes;\n\tid: string;\n\tpayload: Record<string, unknown>;\n}\ninterface DeleteChange extends Change {\n\tpayload: {\n\t\tid: Change[\"id\"];\n\t};\n}\nexport interface SliceInsertChange extends Change {\n\ttype: ChangeTypes.SLICE_INSERT;\n\tpayload: SharedSlice;\n}\nexport interface SliceUpdateChange extends Change {\n\ttype: ChangeTypes.SLICE_UPDATE;\n\tpayload: SharedSlice;\n}\nexport interface SliceDeleteChange extends DeleteChange {\n\ttype: ChangeTypes.SLICE_DELETE;\n}\nexport interface CustomTypeInsertChange extends Change {\n\ttype: ChangeTypes.CUSTOM_TYPE_INSERT;\n\tpayload: CustomType;\n}\nexport interface CustomTypeUpdateChange extends Change {\n\ttype: ChangeTypes.CUSTOM_TYPE_UPDATE;\n\tpayload: CustomType;\n}\nexport interface CustomTypeDeleteChange extends DeleteChange {\n\ttype: ChangeTypes.CUSTOM_TYPE_DELETE;\n}\nexport type AllChangeTypes =\n\t| SliceInsertChange\n\t| SliceUpdateChange\n\t| SliceDeleteChange\n\t| CustomTypeInsertChange\n\t| CustomTypeUpdateChange\n\t| CustomTypeDeleteChange;\nexport interface BulkBody extends Record<string, unknown> {\n\tconfirmDeleteDocuments: boolean;\n\tchanges: AllChangeTypes[];\n}\n\nexport const PushChangesRawLimit = t.type({\n\tdetails: t.type({\n\t\tcustomTypes: t.array(\n\t\t\tt.type({\n\t\t\t\tid: t.string,\n\t\t\t\tnumberOfDocuments: t.number,\n\t\t\t\turl: t.string,\n\t\t\t}),\n\t\t),\n\t}),\n});\nexport type PushChangesRawLimit = t.TypeOf<typeof PushChangesRawLimit>;\nexport enum PushChangesLimitType {\n\tSOFT = \"SOFT\",\n\tHARD = \"HARD\",\n}\nexport type PushChangesLimit = PushChangesRawLimit & {\n\ttype: PushChangesLimitType;\n};\n\nexport interface ClientError {\n\tstatus: number;\n\tmessage: string;\n}\n\ntype ChangeStatus = \"NEW\" | \"MODIFIED\" | \"DELETED\";\n\ntype CustomTypeChange = {\n\tid: string;\n\ttype: \"CustomType\";\n\tstatus: ChangeStatus;\n};\n\ntype SliceChange = {\n\tid: string;\n\ttype: \"Slice\";\n\tstatus: ChangeStatus;\n\tlibraryID: string;\n};\n\nexport type TransactionalMergeArgs = {\n\tconfirmDeleteDocuments: boolean;\n\tchanges: (CustomTypeChange | SliceChange)[];\n};\n\nexport type TransactionalMergeReturnType = PushChangesLimit | null;\n\n/**\n * Framework id sent to Segment from wroom. Property used for the \"framework\"\n * and \"hasSlicemachine\" properties.\n *\n * Values from:\n * https://github.com/prismicio/wroom/blob/65d4f53fd46df7d366d80e7ba9c965339ac7369d/subprojects/common/app/models/Framework.scala#LL20C6-L20C6\n */\nexport type FrameworkWroomTelemetryID = \"next\" | \"nuxt\" | \"sveltekit\" | \"other\";\n\n/**\n * Starter id sent to Segment from wroom.Property used for the \"starter\"\n * properties.\n *\n * Values from:\n * https://github.com/prismicio/wroom/blob/65d4f53fd46df7d366d80e7ba9c965339ac7369d/conf/application.conf#L938\n */\nexport type StarterId =\n\t| \"next_multi_page\"\n\t| \"next_blog\"\n\t| \"next_multi_lang\"\n\t| \"nuxt_multi_page\"\n\t| \"nuxt_blog\"\n\t| \"nuxt_multi_lang\";\n\nexport const Environment = t.type({\n\tkind: t.union([t.literal(\"prod\"), t.literal(\"stage\"), t.literal(\"dev\")]),\n\tname: t.string,\n\tdomain: t.string,\n\tusers: t.array(\n\t\tt.type({\n\t\t\tid: t.string,\n\t\t}),\n\t),\n});\nexport type Environment = t.TypeOf<typeof Environment>;\n\nexport const OnboardingState = z.object({\n\tcompletedSteps: z.array(z.string()),\n\tisDismissed: z.boolean(),\n\tcontext: z.object({\n\t\tframework: z.union([\n\t\t\tz.literal(\"next\"),\n\t\t\tz.literal(\"nuxt\"),\n\t\t\tz.literal(\"sveltekit\"),\n\t\t\tz.literal(\"other\"),\n\t\t]),\n\t\tstarterId: z.string().nullable(),\n\t}),\n});\nexport type OnboardingState = z.infer<typeof OnboardingState>;\n"],"names":["ChangeTypes","PushChangesLimitType"],"mappings":";;AAOO,MAAM,6BAA6B;AAAA,EACzC,cAAc;AAAA,EACd,YAAY;;AAKN,MAAM,wBAAwB;AAAA,EACpC,WAAW;AAAA,EACX,eAAe;AAAA,EACf,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,UAAU;;AAKE,MAAA,oBAAoB,EAAE,KAAK;AAAA,EACvC,QAAQ,EAAE;AAAA,EACV,MAAM,EAAE;AAAA,EACR,MAAM,EAAE,MAAM;AAAA,IACb,EAAE,MAAM,qBAAqB;AAAA,IAC7B,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAAA,EAAA,CACjD;AACD,CAAA;AAGW,IAAA;AAAA,CAAZ,SAAYA,cAAW;AACtBA,eAAA,cAAA,IAAA;AACAA,eAAA,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/types.ts"],"sourcesContent":["import {\n\tCustomType,\n\tSharedSlice,\n} from \"@prismicio/types-internal/lib/customtypes\";\nimport * as t from \"io-ts\";\nimport { z } from \"zod\";\n\nexport const PrismicRepositoryUserAgent = {\n\tSliceMachine: \"prismic-cli/sm\",\n\tLegacyZero: \"prismic-cli/0\",\n} as const;\nexport type PrismicRepositoryUserAgents =\n\t(typeof PrismicRepositoryUserAgent)[keyof typeof PrismicRepositoryUserAgent];\n\nexport const PrismicRepositoryRole = {\n\tSuperUser: \"SuperUser\",\n\tAdministrator: \"Administrator\",\n\tOwner: \"Owner\",\n\tManager: \"Manager\",\n\tPublisher: \"Publisher\",\n\tWriter: \"Writer\",\n\tReadonly: \"Readonly\",\n} as const;\nexport type PrismicRepositoryRoles =\n\t(typeof PrismicRepositoryRole)[keyof typeof PrismicRepositoryRole];\n\nexport const PrismicRepository = t.type({\n\tdomain: t.string,\n\tname: t.string,\n\trole: t.union([\n\t\tt.keyof(PrismicRepositoryRole),\n\t\tt.record(t.string, t.keyof(PrismicRepositoryRole)),\n\t]),\n});\nexport type PrismicRepository = t.TypeOf<typeof PrismicRepository>;\n\nexport enum ChangeTypes {\n\tSLICE_INSERT = \"SLICE_INSERT\",\n\tSLICE_UPDATE = \"SLICE_UPDATE\",\n\tSLICE_DELETE = \"SLICE_DELETE\",\n\tCUSTOM_TYPE_INSERT = \"CUSTOM_TYPE_INSERT\",\n\tCUSTOM_TYPE_UPDATE = \"CUSTOM_TYPE_UPDATE\",\n\tCUSTOM_TYPE_DELETE = \"CUSTOM_TYPE_DELETE\",\n}\ninterface Change {\n\ttype: ChangeTypes;\n\tid: string;\n\tpayload: Record<string, unknown>;\n}\ninterface DeleteChange extends Change {\n\tpayload: {\n\t\tid: Change[\"id\"];\n\t};\n}\nexport interface SliceInsertChange extends Change {\n\ttype: ChangeTypes.SLICE_INSERT;\n\tpayload: SharedSlice;\n}\nexport interface SliceUpdateChange extends Change {\n\ttype: ChangeTypes.SLICE_UPDATE;\n\tpayload: SharedSlice;\n}\nexport interface SliceDeleteChange extends DeleteChange {\n\ttype: ChangeTypes.SLICE_DELETE;\n}\nexport interface CustomTypeInsertChange extends Change {\n\ttype: ChangeTypes.CUSTOM_TYPE_INSERT;\n\tpayload: CustomType;\n}\nexport interface CustomTypeUpdateChange extends Change {\n\ttype: ChangeTypes.CUSTOM_TYPE_UPDATE;\n\tpayload: CustomType;\n}\nexport interface CustomTypeDeleteChange extends DeleteChange {\n\ttype: ChangeTypes.CUSTOM_TYPE_DELETE;\n}\nexport type AllChangeTypes =\n\t| SliceInsertChange\n\t| SliceUpdateChange\n\t| SliceDeleteChange\n\t| CustomTypeInsertChange\n\t| CustomTypeUpdateChange\n\t| CustomTypeDeleteChange;\nexport interface BulkBody extends Record<string, unknown> {\n\tconfirmDeleteDocuments: boolean;\n\tchanges: AllChangeTypes[];\n}\n\nexport const PushChangesRawLimit = t.type({\n\tdetails: t.type({\n\t\tcustomTypes: t.array(\n\t\t\tt.type({\n\t\t\t\tid: t.string,\n\t\t\t\tnumberOfDocuments: t.number,\n\t\t\t\turl: t.string,\n\t\t\t}),\n\t\t),\n\t}),\n});\nexport type PushChangesRawLimit = t.TypeOf<typeof PushChangesRawLimit>;\nexport enum PushChangesLimitType {\n\tSOFT = \"SOFT\",\n\tHARD = \"HARD\",\n}\nexport type PushChangesLimit = PushChangesRawLimit & {\n\ttype: PushChangesLimitType;\n};\n\nexport interface ClientError {\n\tstatus: number;\n\tmessage: string;\n}\n\ntype ChangeStatus = \"NEW\" | \"MODIFIED\" | \"DELETED\";\n\ntype CustomTypeChange = {\n\tid: string;\n\ttype: \"CustomType\";\n\tstatus: ChangeStatus;\n};\n\ntype SliceChange = {\n\tid: string;\n\ttype: \"Slice\";\n\tstatus: ChangeStatus;\n\tlibraryID: string;\n};\n\nexport type TransactionalMergeArgs = {\n\tconfirmDeleteDocuments: boolean;\n\tchanges: (CustomTypeChange | SliceChange)[];\n};\n\nexport type TransactionalMergeReturnType = PushChangesLimit | null;\n\n/**\n * Framework id sent to Segment from wroom. Property used for the \"framework\"\n * and \"hasSlicemachine\" properties.\n *\n * Values from:\n * https://github.com/prismicio/wroom/blob/65d4f53fd46df7d366d80e7ba9c965339ac7369d/subprojects/common/app/models/Framework.scala#LL20C6-L20C6\n */\nexport type FrameworkWroomTelemetryID = \"next\" | \"nuxt\" | \"sveltekit\" | \"other\";\n\n/**\n * Starter id sent to Segment from wroom.Property used for the \"starter\"\n * properties.\n *\n * Values from:\n * https://github.com/prismicio/wroom/blob/65d4f53fd46df7d366d80e7ba9c965339ac7369d/conf/application.conf#L938\n */\nexport type StarterId =\n\t| \"next_multi_page\"\n\t| \"next_blog\"\n\t| \"next_multi_lang\"\n\t| \"nuxt_multi_page\"\n\t| \"nuxt_blog\"\n\t| \"nuxt_multi_lang\";\n\nexport const Environment = t.type({\n\tkind: t.union([t.literal(\"prod\"), t.literal(\"stage\"), t.literal(\"dev\")]),\n\tname: t.string,\n\tdomain: t.string,\n\tusers: t.array(\n\t\tt.type({\n\t\t\tid: t.string,\n\t\t}),\n\t),\n});\nexport type Environment = t.TypeOf<typeof Environment>;\n\nexport const supportedSliceMachineFrameworks = [\n\t\"next\",\n\t\"nuxt\",\n\t\"sveltekit\",\n] as const;\n\ntype SupportedFramework = (typeof supportedSliceMachineFrameworks)[number];\n\nfunction isSupportedFramework(value: string): value is SupportedFramework {\n\treturn supportedSliceMachineFrameworks.includes(value as SupportedFramework);\n}\n\nexport const repositoryFramework = z.preprocess(\n\t(value) => {\n\t\t// NOTE: we persist a lot of different frameworks in the DB, but only the SM supported are relevant to us\n\t\t// Any other framework is treated like \"other\"\n\t\tif (typeof value === \"string\" && isSupportedFramework(value)) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn \"other\";\n\t},\n\tz.enum([...supportedSliceMachineFrameworks, \"other\"]),\n);\n\nexport type RepositoryFramework = z.TypeOf<typeof repositoryFramework>;\n\nexport const OnboardingState = z.object({\n\tcompletedSteps: z.array(z.string()),\n\tisDismissed: z.boolean(),\n\tcontext: z.object({\n\t\tframework: repositoryFramework.optional().default(\"other\"),\n\t\tstarterId: z.string().nullable(),\n\t}),\n});\nexport type OnboardingState = z.infer<typeof OnboardingState>;\n"],"names":["ChangeTypes","PushChangesLimitType"],"mappings":";;AAOO,MAAM,6BAA6B;AAAA,EACzC,cAAc;AAAA,EACd,YAAY;;AAKN,MAAM,wBAAwB;AAAA,EACpC,WAAW;AAAA,EACX,eAAe;AAAA,EACf,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,UAAU;;AAKE,MAAA,oBAAoB,EAAE,KAAK;AAAA,EACvC,QAAQ,EAAE;AAAA,EACV,MAAM,EAAE;AAAA,EACR,MAAM,EAAE,MAAM;AAAA,IACb,EAAE,MAAM,qBAAqB;AAAA,IAC7B,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAAA,EAAA,CACjD;AACD,CAAA;AAGW,IAAA;AAAA,CAAZ,SAAYA,cAAW;AACtBA,eAAA,cAAA,IAAA;AACAA,eAAA,cAAA,IAAA;AACAA,eAAA,cAAA,IAAA;AACAA,eAAA,oBAAA,IAAA;AACAA,eAAA,oBAAA,IAAA;AACAA,eAAA,oBAAA,IAAA;AACD,GAPY,gBAAA,cAOX,CAAA,EAAA;AA6CY,MAAA,sBAAsB,EAAE,KAAK;AAAA,EACzC,SAAS,EAAE,KAAK;AAAA,IACf,aAAa,EAAE,MACd,EAAE,KAAK;AAAA,MACN,IAAI,EAAE;AAAA,MACN,mBAAmB,EAAE;AAAA,MACrB,KAAK,EAAE;AAAA,IAAA,CACP,CAAC;AAAA,EAAA,CAEH;AACD,CAAA;AAEW,IAAA;AAAA,CAAZ,SAAYC,uBAAoB;AAC/BA,wBAAA,MAAA,IAAA;AACAA,wBAAA,MAAA,IAAA;AACD,GAHY,yBAAA,uBAGX,CAAA,EAAA;AAwDY,MAAA,cAAc,EAAE,KAAK;AAAA,EACjC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,MAAM,GAAG,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,KAAK,CAAC,CAAC;AAAA,EACvE,MAAM,EAAE;AAAA,EACR,QAAQ,EAAE;AAAA,EACV,OAAO,EAAE,MACR,EAAE,KAAK;AAAA,IACN,IAAI,EAAE;AAAA,EAAA,CACN,CAAC;AAEH,CAAA;AAGM,MAAM,kCAAkC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;;AAKD,SAAS,qBAAqB,OAAa;AACnC,SAAA,gCAAgC,SAAS,KAA2B;AAC5E;AAEO,MAAM,sBAAsB,EAAE,WACpC,CAAC,UAAS;AAGT,MAAI,OAAO,UAAU,YAAY,qBAAqB,KAAK,GAAG;AACtD,WAAA;AAAA,EACR;AAEO,SAAA;AACR,GACA,EAAE,KAAK,CAAC,GAAG,iCAAiC,OAAO,CAAC,CAAC;AAKzC,MAAA,kBAAkB,EAAE,OAAO;AAAA,EACvC,gBAAgB,EAAE,MAAM,EAAE,QAAQ;AAAA,EAClC,aAAa,EAAE,QAAS;AAAA,EACxB,SAAS,EAAE,OAAO;AAAA,IACjB,WAAW,oBAAoB,WAAW,QAAQ,OAAO;AAAA,IACzD,WAAW,EAAE,OAAQ,EAAC,SAAU;AAAA,EAAA,CAChC;AACD,CAAA;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slicemachine/manager",
3
- "version": "0.20.8-alpha.BI-dt-2380-add-shared-onboarding.1",
3
+ "version": "0.20.8-alpha.BI-dt-2380-add-shared-onboarding.3",
4
4
  "description": "Manage all aspects of a Slice Machine project.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -70,7 +70,7 @@
70
70
  "@prismicio/mocks": "^2.4.0",
71
71
  "@prismicio/types-internal": "^2.8.0",
72
72
  "@segment/analytics-node": "^2.1.2",
73
- "@slicemachine/plugin-kit": "0.4.52-alpha.BI-dt-2380-add-shared-onboarding.1",
73
+ "@slicemachine/plugin-kit": "0.4.52-alpha.BI-dt-2380-add-shared-onboarding.3",
74
74
  "cookie": "^0.5.0",
75
75
  "cors": "^2.8.5",
76
76
  "execa": "^7.1.1",
@@ -169,16 +169,38 @@ export const Environment = t.type({
169
169
  });
170
170
  export type Environment = t.TypeOf<typeof Environment>;
171
171
 
172
+ export const supportedSliceMachineFrameworks = [
173
+ "next",
174
+ "nuxt",
175
+ "sveltekit",
176
+ ] as const;
177
+
178
+ type SupportedFramework = (typeof supportedSliceMachineFrameworks)[number];
179
+
180
+ function isSupportedFramework(value: string): value is SupportedFramework {
181
+ return supportedSliceMachineFrameworks.includes(value as SupportedFramework);
182
+ }
183
+
184
+ export const repositoryFramework = z.preprocess(
185
+ (value) => {
186
+ // NOTE: we persist a lot of different frameworks in the DB, but only the SM supported are relevant to us
187
+ // Any other framework is treated like "other"
188
+ if (typeof value === "string" && isSupportedFramework(value)) {
189
+ return value;
190
+ }
191
+
192
+ return "other";
193
+ },
194
+ z.enum([...supportedSliceMachineFrameworks, "other"]),
195
+ );
196
+
197
+ export type RepositoryFramework = z.TypeOf<typeof repositoryFramework>;
198
+
172
199
  export const OnboardingState = z.object({
173
200
  completedSteps: z.array(z.string()),
174
201
  isDismissed: z.boolean(),
175
202
  context: z.object({
176
- framework: z.union([
177
- z.literal("next"),
178
- z.literal("nuxt"),
179
- z.literal("sveltekit"),
180
- z.literal("other"),
181
- ]),
203
+ framework: repositoryFramework.optional().default("other"),
182
204
  starterId: z.string().nullable(),
183
205
  }),
184
206
  });