Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 99 additions & 16 deletions apps/web/scripts/dev/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"id": "ws_1KETZ919F83ZJH6A80HWEHW6E",
"name": "Acme, Inc.",
"slug": "acme",
"logo": "https://assets.dub.co/logo.png",
"plan": "enterprise",
"billingCycleStart": 1,
"usageLimit": 100000,
Expand Down Expand Up @@ -93,7 +94,21 @@
"slug": "default",
"color": null,
"leadRewardId": "rw_1K2J9DRWPPJ2F1RX53N92TSGD",
"saleRewardId": "rw_1K2J9DRWPPJ2F1RX53N92TSGE"
"saleRewardId": "rw_1K2J9DRWPPJ2F1RX53N92TSGE",
"additionalLinks": [
{
"domain": "acme.com",
"validationMode": "domain"
}
],
"defaultLinks": [
{
"url": "https://acme.com"
},
{
"url": "https://example.com"
}
]
}
],
"program": {
Expand All @@ -106,7 +121,8 @@
"url": "https://acme.com",
"termsUrl": "https://acme.com/terms",
"helpUrl": "https://acme.com/help",
"supportEmail": "support@acme.com"
"supportEmail": "support@acme.com",
"logo": "https://assets.dub.co/logo.png"
},
"partners": [
{
Expand Down Expand Up @@ -190,7 +206,13 @@
"developer": "Dub",
"website": "https://www.make.com/en/integrations/dub",
"logo": "https://dubassets.com/integrations/clzlmyxup0001jeqyaka3dvdd_GSp2tii",
"screenshots": ["https://dubassets.com/integration-screenshots/VCgvW2LjXsLoIFv2", "https://dubassets.com/integration-screenshots/i5VhxZPsiir0O4Mm", "https://dubassets.com/integration-screenshots/RydWo5Vuti1md99Y", "https://dubassets.com/integration-screenshots/B8vnuWTDNn522PeO", "https://dubassets.com/integration-screenshots/69orbl78A9a6sABs"],
"screenshots": [
"https://dubassets.com/integration-screenshots/VCgvW2LjXsLoIFv2",
"https://dubassets.com/integration-screenshots/i5VhxZPsiir0O4Mm",
"https://dubassets.com/integration-screenshots/RydWo5Vuti1md99Y",
"https://dubassets.com/integration-screenshots/B8vnuWTDNn522PeO",
"https://dubassets.com/integration-screenshots/69orbl78A9a6sABs"
],
"verified": 1,
"installUrl": "https://d.to/make",
"category": "Automations",
Expand All @@ -206,7 +228,14 @@
"developer": "Dub",
"website": "https://dub.co",
"logo": "https://dubassets.com/integrations/clzlmyzlx0005jeqy95pjrwbz_Yg767eU",
"screenshots": ["https://dubassets.com/integration-screenshots/b1SsigyIcIiCM5rg", "https://dubassets.com/integration-screenshots/elx3p7U5ryWEZR1T", "https://dubassets.com/integration-screenshots/eZlq9CUYDxHuNOYj", "https://dubassets.com/integration-screenshots/fHIXRcOf1ctCWbKZ", "https://dubassets.com/integration-screenshots/jUjNz70iIpN6vOoX", "https://dubassets.com/integration-screenshots/ueytiiNoIKpHaK83"],
"screenshots": [
"https://dubassets.com/integration-screenshots/b1SsigyIcIiCM5rg",
"https://dubassets.com/integration-screenshots/elx3p7U5ryWEZR1T",
"https://dubassets.com/integration-screenshots/eZlq9CUYDxHuNOYj",
"https://dubassets.com/integration-screenshots/fHIXRcOf1ctCWbKZ",
"https://dubassets.com/integration-screenshots/jUjNz70iIpN6vOoX",
"https://dubassets.com/integration-screenshots/ueytiiNoIKpHaK83"
],
"verified": 1,
"installUrl": "https://d.to/ray",
"category": "Productivity",
Expand All @@ -222,7 +251,12 @@
"developer": "Dub",
"website": "https://zapier.com/apps/dub/integrations",
"logo": "https://dubassets.com/integrations/clzlmz336000fjeqynwhfv8vo_S4yz4ak",
"screenshots": ["https://dubassets.com/integration-screenshots/bEld4Gv6Fq0fK71z", "https://dubassets.com/integration-screenshots/VNwGY2jNAWEyhbXm", "https://dubassets.com/integration-screenshots/6P30UyuQYJDHnXOm", "https://dubassets.com/integration-screenshots/eEhRKYPBxeqdzrHO"],
"screenshots": [
"https://dubassets.com/integration-screenshots/bEld4Gv6Fq0fK71z",
"https://dubassets.com/integration-screenshots/VNwGY2jNAWEyhbXm",
"https://dubassets.com/integration-screenshots/6P30UyuQYJDHnXOm",
"https://dubassets.com/integration-screenshots/eEhRKYPBxeqdzrHO"
],
"verified": 1,
"installUrl": "https://d.to/zapier",
"category": "Automations",
Expand All @@ -238,7 +272,13 @@
"developer": "Dub",
"website": "https://marketplace.stripe.com/apps/dub-conversions",
"logo": "https://dubassets.com/integrations/clzra1ya60001wnj4a89zcg9h_jtyaGa7",
"screenshots": ["https://dubassets.com/integration-screenshots/AP9z3b8HsDIOVQMq", "https://dubassets.com/integration-screenshots/y9CMwUxLbO7pjXJM", "https://dubassets.com/integration-screenshots/W94e40NcUlUlB5Bq", "https://dubassets.com/integration-screenshots/PZkxLsI8yG65qo0n", "https://dubassets.com/integration-screenshots/WkeZCSZOOSEukIlT"],
"screenshots": [
"https://dubassets.com/integration-screenshots/AP9z3b8HsDIOVQMq",
"https://dubassets.com/integration-screenshots/y9CMwUxLbO7pjXJM",
"https://dubassets.com/integration-screenshots/W94e40NcUlUlB5Bq",
"https://dubassets.com/integration-screenshots/PZkxLsI8yG65qo0n",
"https://dubassets.com/integration-screenshots/WkeZCSZOOSEukIlT"
],
"verified": 1,
"installUrl": "https://marketplace.stripe.com/apps/dub",
"category": "Payments",
Expand All @@ -254,7 +294,14 @@
"developer": "Dub",
"website": "https://wordpress.org/plugins/dubinc",
"logo": "https://dubassets.com/integrations/clzrjifgn0004tyvlu72oxcc2_GrLz146",
"screenshots": ["https://dubassets.com/integration-screenshots/pVyCJ0nCMk8vFdzV", "https://dubassets.com/integration-screenshots/Q16c06AFd08y1xWq", "https://dubassets.com/integration-screenshots/t213OS2erwTHuUY4", "https://dubassets.com/integration-screenshots/4BMcLwc1K5TzGZKW", "https://dubassets.com/integration-screenshots/Rn8LaG1kULTmmlgM", "https://dubassets.com/integration-screenshots/DGSvRclGjQtYLtWO"],
"screenshots": [
"https://dubassets.com/integration-screenshots/pVyCJ0nCMk8vFdzV",
"https://dubassets.com/integration-screenshots/Q16c06AFd08y1xWq",
"https://dubassets.com/integration-screenshots/t213OS2erwTHuUY4",
"https://dubassets.com/integration-screenshots/4BMcLwc1K5TzGZKW",
"https://dubassets.com/integration-screenshots/Rn8LaG1kULTmmlgM",
"https://dubassets.com/integration-screenshots/DGSvRclGjQtYLtWO"
],
"verified": 1,
"installUrl": "https://wordpress.org/plugins/dubinc",
"category": "CMS",
Expand All @@ -270,7 +317,12 @@
"developer": "Dub",
"website": "https://d.to/slack",
"logo": "https://dubassets.com/integrations/clzu59rx9000110bm5fnlzwuj_Y93aiyc",
"screenshots": ["https://dubassets.com/integration-screenshots/sjCSeH5xHsY9UW6C", "https://dubassets.com/integration-screenshots/vFYafTOdc2l7Sq5F", "https://dubassets.com/integration-screenshots/bW9pAcP5oPVL76VS", "https://dubassets.com/integration-screenshots/H8BqDHlDBGIQRZj0"],
"screenshots": [
"https://dubassets.com/integration-screenshots/sjCSeH5xHsY9UW6C",
"https://dubassets.com/integration-screenshots/vFYafTOdc2l7Sq5F",
"https://dubassets.com/integration-screenshots/bW9pAcP5oPVL76VS",
"https://dubassets.com/integration-screenshots/H8BqDHlDBGIQRZj0"
],
"verified": 1,
"installUrl": null,
"category": "Productivity",
Expand All @@ -286,7 +338,9 @@
"developer": "Dub",
"website": "https://www.better-auth.com",
"logo": "https://dubassets.com/integrations/int_1JTHYWTFB84YSJV3QEZ8XGZXN_JdEC95Z",
"screenshots": ["https://dubassets.com/integration-screenshots/BQ30guSSjzVAtzgm"],
"screenshots": [
"https://dubassets.com/integration-screenshots/BQ30guSSjzVAtzgm"
],
"verified": 1,
"installUrl": null,
"category": "Authentication",
Expand All @@ -302,7 +356,12 @@
"developer": "Cal.com",
"website": "https://cal.com",
"logo": "https://dubassets.com/integrations/int_1JV8YSBDPD2435DXQPFGHHB8C_LTVhJln",
"screenshots": ["https://dubassets.com/integration-screenshots/15mi44jeIytjtEjc", "https://dubassets.com/integration-screenshots/3tQKqxUUh2hQ4zTF", "https://dubassets.com/integration-screenshots/qzdJL2ZuJ1SzMyCx", "https://dubassets.com/integration-screenshots/H3q6KYXogQz1HRnL"],
"screenshots": [
"https://dubassets.com/integration-screenshots/15mi44jeIytjtEjc",
"https://dubassets.com/integration-screenshots/3tQKqxUUh2hQ4zTF",
"https://dubassets.com/integration-screenshots/qzdJL2ZuJ1SzMyCx",
"https://dubassets.com/integration-screenshots/H3q6KYXogQz1HRnL"
],
"verified": 1,
"installUrl": "https://app.cal.com/apps/dub",
"category": "Scheduling",
Expand All @@ -318,7 +377,9 @@
"developer": "Dub",
"website": "https://dub.co",
"logo": "https://dubassets.com/integrations/int_1K0YR77SXYCMRDEJ92KJG29T0_aC6yfk4",
"screenshots": ["https://dubassets.com/integration-screenshots/ZcTQulksETtgSM39"],
"screenshots": [
"https://dubassets.com/integration-screenshots/ZcTQulksETtgSM39"
],
"verified": 1,
"installUrl": null,
"category": "Analytics",
Expand Down Expand Up @@ -350,7 +411,12 @@
"developer": "Dub",
"website": "https://dub.co/docs/conversions/leads/hubspot",
"logo": "https://dubassets.com/integrations/int_ffw3qgrFAahY6qs1hXaH3wHS_JPoCPOh",
"screenshots": ["https://dubassets.com/integration-screenshots/HkHxRtAmXLznxS33", "https://dubassets.com/integration-screenshots/AVdtxIm3Neht6ten", "https://dubassets.com/integration-screenshots/Rw0a3Eoizx3JXczD", "https://dubassets.com/integration-screenshots/qIknpqLYkJVNy71x"],
"screenshots": [
"https://dubassets.com/integration-screenshots/HkHxRtAmXLznxS33",
"https://dubassets.com/integration-screenshots/AVdtxIm3Neht6ten",
"https://dubassets.com/integration-screenshots/Rw0a3Eoizx3JXczD",
"https://dubassets.com/integration-screenshots/qIknpqLYkJVNy71x"
],
"verified": 1,
"installUrl": null,
"category": "Scheduling",
Expand Down Expand Up @@ -398,7 +464,13 @@
"developer": "Dub",
"website": "https://apps.shopify.com/dub-conversion-tracking",
"logo": "https://dubassets.com/integrations/int_iWOtrZgmcyU6XDwKr4AYYqLN_jUmF77W",
"screenshots": ["https://dubassets.com/integration-screenshots/vHP96JXi6lu59CWA", "https://dubassets.com/integration-screenshots/SCe5zajrjz4SZxbq", "https://dubassets.com/integration-screenshots/rhRBhAxck04tkqdj", "https://dubassets.com/integration-screenshots/oLkfdYBTxIFAoY5u", "https://dubassets.com/integration-screenshots/WeibSgHT5GxFTXE2"],
"screenshots": [
"https://dubassets.com/integration-screenshots/vHP96JXi6lu59CWA",
"https://dubassets.com/integration-screenshots/SCe5zajrjz4SZxbq",
"https://dubassets.com/integration-screenshots/rhRBhAxck04tkqdj",
"https://dubassets.com/integration-screenshots/oLkfdYBTxIFAoY5u",
"https://dubassets.com/integration-screenshots/WeibSgHT5GxFTXE2"
],
"verified": 1,
"installUrl": "https://d.to/shopify",
"category": "Payments",
Expand All @@ -414,7 +486,13 @@
"developer": "Kalemi Code LLC",
"website": "https://publer.com/help/en/article/how-to-set-up-dub-url-shortener-16uuhzd/",
"logo": "https://dubassets.com/integrations/int_v9mi4mw68mW3ZUx3o5jdM6uG_0r1AqTO",
"screenshots": ["https://dubassets.com/integration-screenshots/y0LO3V9MtsbbWilH", "https://dubassets.com/integration-screenshots/R80UvlENvedyONIb", "https://dubassets.com/integration-screenshots/uoHsNKr6E1STC4rh", "https://dubassets.com/integration-screenshots/VBCVPcRC9ZBNoFFS", "https://dubassets.com/integration-screenshots/YlDIMeJdDWlRrLmn"],
"screenshots": [
"https://dubassets.com/integration-screenshots/y0LO3V9MtsbbWilH",
"https://dubassets.com/integration-screenshots/R80UvlENvedyONIb",
"https://dubassets.com/integration-screenshots/uoHsNKr6E1STC4rh",
"https://dubassets.com/integration-screenshots/VBCVPcRC9ZBNoFFS",
"https://dubassets.com/integration-screenshots/YlDIMeJdDWlRrLmn"
],
"verified": 1,
"installUrl": "https://publer.com/help/en/article/how-to-set-up-dub-url-shortener-16uuhzd",
"category": "Social Media",
Expand Down Expand Up @@ -462,12 +540,17 @@
"developer": "Dub",
"website": "https://segment.com/docs/connections/sources/catalog/cloud-apps/dub",
"logo": "https://dubassets.com/integrations/int_zGnSElTzimbz20OWnXerPoKv_Noy3Xhk",
"screenshots": ["https://dubassets.com/integration-screenshots/MvHnxSLGU3hMNMQk", "https://dubassets.com/integration-screenshots/oXrlBPJjgd2fGCiP", "https://dubassets.com/integration-screenshots/OPL4HS3z0i4R6q0B", "https://dubassets.com/integration-screenshots/xMh9URKttuacj3qR"],
"screenshots": [
"https://dubassets.com/integration-screenshots/MvHnxSLGU3hMNMQk",
"https://dubassets.com/integration-screenshots/oXrlBPJjgd2fGCiP",
"https://dubassets.com/integration-screenshots/OPL4HS3z0i4R6q0B",
"https://dubassets.com/integration-screenshots/xMh9URKttuacj3qR"
],
"verified": 1,
"installUrl": null,
"category": "Analytics",
"comingSoon": 0,
"guideUrl": null
}
]
}
}
37 changes: 35 additions & 2 deletions apps/web/scripts/dev/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Integration,
Partner,
PartnerGroup,
PartnerGroupDefaultLink,
Prisma,
Program,
Project,
Expand All @@ -25,6 +26,7 @@ type Workspace = Pick<
| "name"
| "slug"
| "plan"
| "logo"
| "billingCycleStart"
| "usageLimit"
| "linksLimit"
Expand Down Expand Up @@ -62,15 +64,24 @@ type RewardSeed = Pick<

type GroupSeed = Pick<
PartnerGroup,
"id" | "name" | "slug" | "color" | "leadRewardId" | "saleRewardId"
>;
| "id"
| "name"
| "slug"
| "color"
| "leadRewardId"
| "saleRewardId"
| "additionalLinks"
> & {
defaultLinks: Pick<PartnerGroupDefaultLink, "url">[];
};

type ProgramSeed = Omit<
Pick<
Program,
| "id"
| "name"
| "slug"
| "logo"
| "defaultFolderId"
| "defaultGroupId"
| "domain"
Expand Down Expand Up @@ -291,10 +302,31 @@ const createGroups = async (data: SeedData) => {
color: group.color ?? null,
leadRewardId: group.leadRewardId ?? null,
saleRewardId: group.saleRewardId ?? null,
additionalLinks: group.additionalLinks as Prisma.JsonArray,
})),
});

console.log(`Created ${count} groups`);

const defaultLinks = groups.flatMap((group) =>
group.defaultLinks.map((link) => ({
groupId: group.id,
url: link.url,
})),
);

const { count: defaultLinksCount } =
await prisma.partnerGroupDefaultLink.createMany({
data: defaultLinks.map((link) => ({
id: createId({ prefix: "pgdl_" }),
programId: program.id,
domain: program.domain!,
groupId: link.groupId,
url: link.url,
})),
});

console.log(`Created ${defaultLinksCount} default links`);
};

// Create program
Expand All @@ -312,6 +344,7 @@ const createProgram = async (data: SeedData) => {
workspaceId: workspace.id,
name: program.name,
slug: program.slug,
logo: program.logo,
defaultFolderId: program.defaultFolderId,
defaultGroupId: program.defaultGroupId,
domain: program.domain,
Expand Down