@cimplify/sdk 0.44.34 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -16
- package/dist/styles.css +1 -1
- package/package.json +5 -9
- package/dist/cli/commands/deploy.mjs +0 -717
- package/dist/cli/commands/dev.mjs +0 -479
- package/dist/cli/commands/domains.mjs +0 -769
- package/dist/cli/commands/env.mjs +0 -705
- package/dist/cli/commands/link.mjs +0 -378
- package/dist/cli/commands/login.mjs +0 -584
- package/dist/cli/commands/logout.mjs +0 -75
- package/dist/cli/commands/logs.mjs +0 -432
- package/dist/cli/commands/projects.mjs +0 -473
- package/dist/cli/commands/repo.mjs +0 -584
- package/dist/cli/commands/rollback.mjs +0 -553
- package/dist/cli/commands/status.mjs +0 -450
- package/dist/cli/commands/unlink.mjs +0 -79
- package/dist/cli/commands/whoami.mjs +0 -285
- package/dist/cli.js +0 -184
- package/dist/dispatcher.mjs +0 -360
- package/registry/booking-page.json +0 -18
- package/registry/bookings-page.json +0 -17
- package/registry/service-card.json +0 -16
- package/registry/service-grid.json +0 -16
- package/templates/storefront-bakery/.claude/skills/cimplify-storefront/SKILL.md +0 -145
- package/templates/storefront-bakery/.cursor/rules/cimplify-storefront.mdc +0 -25
- package/templates/storefront-bakery/.env.example +0 -16
- package/templates/storefront-bakery/AGENTS.md +0 -120
- package/templates/storefront-bakery/CLAUDE.md +0 -22
- package/templates/storefront-bakery/README.md +0 -73
- package/templates/storefront-bakery/__tests__/brand.test.ts +0 -4
- package/templates/storefront-bakery/__tests__/cart-flow.test.ts +0 -4
- package/templates/storefront-bakery/__tests__/contract.test.ts +0 -4
- package/templates/storefront-bakery/app/about/page.tsx +0 -38
- package/templates/storefront-bakery/app/accessibility/page.tsx +0 -11
- package/templates/storefront-bakery/app/account/addresses/page.tsx +0 -21
- package/templates/storefront-bakery/app/account/orders/page.tsx +0 -21
- package/templates/storefront-bakery/app/account/page.tsx +0 -22
- package/templates/storefront-bakery/app/account/settings/page.tsx +0 -21
- package/templates/storefront-bakery/app/cart/page.tsx +0 -9
- package/templates/storefront-bakery/app/categories/[slug]/listing-client.tsx +0 -19
- package/templates/storefront-bakery/app/categories/[slug]/page.tsx +0 -118
- package/templates/storefront-bakery/app/checkout/page.tsx +0 -17
- package/templates/storefront-bakery/app/collections/[slug]/listing-client.tsx +0 -20
- package/templates/storefront-bakery/app/collections/[slug]/page.tsx +0 -118
- package/templates/storefront-bakery/app/contact/contact-form.tsx +0 -109
- package/templates/storefront-bakery/app/contact/page.tsx +0 -54
- package/templates/storefront-bakery/app/error.tsx +0 -60
- package/templates/storefront-bakery/app/faq/page.tsx +0 -46
- package/templates/storefront-bakery/app/globals.css +0 -47
- package/templates/storefront-bakery/app/layout.tsx +0 -82
- package/templates/storefront-bakery/app/llms.txt/route.ts +0 -94
- package/templates/storefront-bakery/app/login/page.tsx +0 -17
- package/templates/storefront-bakery/app/not-found.tsx +0 -39
- package/templates/storefront-bakery/app/opensearch.xml/route.ts +0 -37
- package/templates/storefront-bakery/app/orders/[id]/page.tsx +0 -21
- package/templates/storefront-bakery/app/page.tsx +0 -97
- package/templates/storefront-bakery/app/privacy/page.tsx +0 -44
- package/templates/storefront-bakery/app/returns/page.tsx +0 -11
- package/templates/storefront-bakery/app/robots.ts +0 -18
- package/templates/storefront-bakery/app/search/page.tsx +0 -38
- package/templates/storefront-bakery/app/search/search-client.tsx +0 -7
- package/templates/storefront-bakery/app/shipping/page.tsx +0 -16
- package/templates/storefront-bakery/app/shop/page.tsx +0 -31
- package/templates/storefront-bakery/app/shop/shop-client.tsx +0 -27
- package/templates/storefront-bakery/app/signup/page.tsx +0 -17
- package/templates/storefront-bakery/app/sitemap-page/page.tsx +0 -167
- package/templates/storefront-bakery/app/sitemap.ts +0 -62
- package/templates/storefront-bakery/app/terms/page.tsx +0 -44
- package/templates/storefront-bakery/app/track-order/page.tsx +0 -24
- package/templates/storefront-bakery/app/track-order/track-order-form.tsx +0 -69
- package/templates/storefront-bakery/components/account-iframe.tsx +0 -13
- package/templates/storefront-bakery/components/cart-drawer.tsx +0 -14
- package/templates/storefront-bakery/components/cart-pill.tsx +0 -36
- package/templates/storefront-bakery/components/category-grid.tsx +0 -28
- package/templates/storefront-bakery/components/collection-strip.tsx +0 -45
- package/templates/storefront-bakery/components/footer.tsx +0 -148
- package/templates/storefront-bakery/components/header.tsx +0 -43
- package/templates/storefront-bakery/components/hero.tsx +0 -25
- package/templates/storefront-bakery/components/nav-link.tsx +0 -20
- package/templates/storefront-bakery/components/policy-page.tsx +0 -49
- package/templates/storefront-bakery/components/product-modal.tsx +0 -104
- package/templates/storefront-bakery/components/providers.tsx +0 -35
- package/templates/storefront-bakery/components/store-product-card.tsx +0 -87
- package/templates/storefront-bakery/lib/brand.ts +0 -570
- package/templates/storefront-bakery/lib/cart.ts +0 -12
- package/templates/storefront-bakery/next.config.ts +0 -42
- package/templates/storefront-bakery/package.json +0 -35
- package/templates/storefront-bakery/postcss.config.mjs +0 -7
- package/templates/storefront-bakery/tsconfig.json +0 -23
- package/templates/storefront-bakery/vitest.config.ts +0 -9
- package/templates/storefront-fashion/.claude/skills/cimplify-storefront/SKILL.md +0 -145
- package/templates/storefront-fashion/.cursor/rules/cimplify-storefront.mdc +0 -25
- package/templates/storefront-fashion/.env.example +0 -16
- package/templates/storefront-fashion/AGENTS.md +0 -126
- package/templates/storefront-fashion/CLAUDE.md +0 -22
- package/templates/storefront-fashion/README.md +0 -77
- package/templates/storefront-fashion/__tests__/brand.test.ts +0 -4
- package/templates/storefront-fashion/__tests__/cart-flow.test.ts +0 -55
- package/templates/storefront-fashion/__tests__/contract.test.ts +0 -4
- package/templates/storefront-fashion/app/about/page.tsx +0 -41
- package/templates/storefront-fashion/app/accessibility/page.tsx +0 -11
- package/templates/storefront-fashion/app/account/addresses/page.tsx +0 -21
- package/templates/storefront-fashion/app/account/orders/page.tsx +0 -21
- package/templates/storefront-fashion/app/account/page.tsx +0 -22
- package/templates/storefront-fashion/app/account/settings/page.tsx +0 -21
- package/templates/storefront-fashion/app/cart/page.tsx +0 -9
- package/templates/storefront-fashion/app/categories/[slug]/listing-client.tsx +0 -19
- package/templates/storefront-fashion/app/categories/[slug]/page.tsx +0 -130
- package/templates/storefront-fashion/app/checkout/page.tsx +0 -17
- package/templates/storefront-fashion/app/collections/[slug]/listing-client.tsx +0 -20
- package/templates/storefront-fashion/app/collections/[slug]/page.tsx +0 -130
- package/templates/storefront-fashion/app/contact/contact-form.tsx +0 -109
- package/templates/storefront-fashion/app/contact/page.tsx +0 -54
- package/templates/storefront-fashion/app/error.tsx +0 -61
- package/templates/storefront-fashion/app/faq/page.tsx +0 -46
- package/templates/storefront-fashion/app/globals.css +0 -46
- package/templates/storefront-fashion/app/layout.tsx +0 -78
- package/templates/storefront-fashion/app/llms.txt/route.ts +0 -94
- package/templates/storefront-fashion/app/login/page.tsx +0 -17
- package/templates/storefront-fashion/app/lookbook/page.tsx +0 -132
- package/templates/storefront-fashion/app/not-found.tsx +0 -39
- package/templates/storefront-fashion/app/opensearch.xml/route.ts +0 -37
- package/templates/storefront-fashion/app/orders/[id]/page.tsx +0 -24
- package/templates/storefront-fashion/app/page.tsx +0 -183
- package/templates/storefront-fashion/app/privacy/page.tsx +0 -44
- package/templates/storefront-fashion/app/products/[slug]/page.tsx +0 -165
- package/templates/storefront-fashion/app/products/[slug]/product-detail.tsx +0 -70
- package/templates/storefront-fashion/app/returns/page.tsx +0 -11
- package/templates/storefront-fashion/app/robots.ts +0 -18
- package/templates/storefront-fashion/app/search/page.tsx +0 -38
- package/templates/storefront-fashion/app/search/search-client.tsx +0 -7
- package/templates/storefront-fashion/app/shipping/page.tsx +0 -16
- package/templates/storefront-fashion/app/shop/page.tsx +0 -63
- package/templates/storefront-fashion/app/shop/shop-client.tsx +0 -32
- package/templates/storefront-fashion/app/signup/page.tsx +0 -17
- package/templates/storefront-fashion/app/sitemap-page/page.tsx +0 -167
- package/templates/storefront-fashion/app/sitemap.ts +0 -59
- package/templates/storefront-fashion/app/size-guide/page.tsx +0 -155
- package/templates/storefront-fashion/app/terms/page.tsx +0 -44
- package/templates/storefront-fashion/app/track-order/page.tsx +0 -24
- package/templates/storefront-fashion/app/track-order/track-order-form.tsx +0 -69
- package/templates/storefront-fashion/components/account-iframe.tsx +0 -13
- package/templates/storefront-fashion/components/brand-marquee.tsx +0 -27
- package/templates/storefront-fashion/components/cart-drawer.tsx +0 -14
- package/templates/storefront-fashion/components/cart-pill.tsx +0 -36
- package/templates/storefront-fashion/components/category-grid.tsx +0 -28
- package/templates/storefront-fashion/components/category-tiles.tsx +0 -104
- package/templates/storefront-fashion/components/collection-strip.tsx +0 -45
- package/templates/storefront-fashion/components/feature-hero.tsx +0 -82
- package/templates/storefront-fashion/components/footer.tsx +0 -153
- package/templates/storefront-fashion/components/header.tsx +0 -43
- package/templates/storefront-fashion/components/hero.tsx +0 -28
- package/templates/storefront-fashion/components/nav-link.tsx +0 -20
- package/templates/storefront-fashion/components/newsletter.tsx +0 -50
- package/templates/storefront-fashion/components/policy-page.tsx +0 -49
- package/templates/storefront-fashion/components/promo-banner.tsx +0 -41
- package/templates/storefront-fashion/components/providers.tsx +0 -35
- package/templates/storefront-fashion/components/section-heading.tsx +0 -37
- package/templates/storefront-fashion/components/store-product-card.tsx +0 -87
- package/templates/storefront-fashion/components/trade-in-cta.tsx +0 -54
- package/templates/storefront-fashion/components/trust-bar.tsx +0 -66
- package/templates/storefront-fashion/e2e/visual.spec.ts +0 -52
- package/templates/storefront-fashion/lib/brand.ts +0 -518
- package/templates/storefront-fashion/lib/cart.ts +0 -12
- package/templates/storefront-fashion/next.config.ts +0 -42
- package/templates/storefront-fashion/package.json +0 -38
- package/templates/storefront-fashion/playwright.config.ts +0 -48
- package/templates/storefront-fashion/postcss.config.mjs +0 -7
- package/templates/storefront-fashion/tsconfig.json +0 -23
- package/templates/storefront-fashion/vitest.config.ts +0 -9
- package/templates/storefront-grocery/.claude/skills/cimplify-storefront/SKILL.md +0 -145
- package/templates/storefront-grocery/.cursor/rules/cimplify-storefront.mdc +0 -25
- package/templates/storefront-grocery/.env.example +0 -16
- package/templates/storefront-grocery/AGENTS.md +0 -96
- package/templates/storefront-grocery/CLAUDE.md +0 -22
- package/templates/storefront-grocery/README.md +0 -73
- package/templates/storefront-grocery/__tests__/brand.test.ts +0 -4
- package/templates/storefront-grocery/__tests__/cart-flow.test.ts +0 -4
- package/templates/storefront-grocery/__tests__/contract.test.ts +0 -4
- package/templates/storefront-grocery/app/about/page.tsx +0 -38
- package/templates/storefront-grocery/app/accessibility/page.tsx +0 -11
- package/templates/storefront-grocery/app/account/addresses/page.tsx +0 -21
- package/templates/storefront-grocery/app/account/orders/page.tsx +0 -21
- package/templates/storefront-grocery/app/account/page.tsx +0 -22
- package/templates/storefront-grocery/app/account/settings/page.tsx +0 -21
- package/templates/storefront-grocery/app/cart/page.tsx +0 -9
- package/templates/storefront-grocery/app/categories/[slug]/listing-client.tsx +0 -19
- package/templates/storefront-grocery/app/categories/[slug]/page.tsx +0 -118
- package/templates/storefront-grocery/app/checkout/page.tsx +0 -17
- package/templates/storefront-grocery/app/collections/[slug]/listing-client.tsx +0 -20
- package/templates/storefront-grocery/app/collections/[slug]/page.tsx +0 -118
- package/templates/storefront-grocery/app/contact/contact-form.tsx +0 -109
- package/templates/storefront-grocery/app/contact/page.tsx +0 -54
- package/templates/storefront-grocery/app/error.tsx +0 -60
- package/templates/storefront-grocery/app/faq/page.tsx +0 -46
- package/templates/storefront-grocery/app/globals.css +0 -45
- package/templates/storefront-grocery/app/layout.tsx +0 -77
- package/templates/storefront-grocery/app/llms.txt/route.ts +0 -94
- package/templates/storefront-grocery/app/login/page.tsx +0 -17
- package/templates/storefront-grocery/app/not-found.tsx +0 -39
- package/templates/storefront-grocery/app/opensearch.xml/route.ts +0 -37
- package/templates/storefront-grocery/app/orders/[id]/page.tsx +0 -21
- package/templates/storefront-grocery/app/page.tsx +0 -97
- package/templates/storefront-grocery/app/privacy/page.tsx +0 -44
- package/templates/storefront-grocery/app/returns/page.tsx +0 -11
- package/templates/storefront-grocery/app/robots.ts +0 -18
- package/templates/storefront-grocery/app/search/page.tsx +0 -38
- package/templates/storefront-grocery/app/search/search-client.tsx +0 -7
- package/templates/storefront-grocery/app/shipping/page.tsx +0 -16
- package/templates/storefront-grocery/app/shop/page.tsx +0 -31
- package/templates/storefront-grocery/app/shop/shop-client.tsx +0 -27
- package/templates/storefront-grocery/app/signup/page.tsx +0 -17
- package/templates/storefront-grocery/app/sitemap-page/page.tsx +0 -167
- package/templates/storefront-grocery/app/sitemap.ts +0 -62
- package/templates/storefront-grocery/app/terms/page.tsx +0 -44
- package/templates/storefront-grocery/app/track-order/page.tsx +0 -24
- package/templates/storefront-grocery/app/track-order/track-order-form.tsx +0 -69
- package/templates/storefront-grocery/components/account-iframe.tsx +0 -13
- package/templates/storefront-grocery/components/cart-drawer.tsx +0 -14
- package/templates/storefront-grocery/components/cart-pill.tsx +0 -36
- package/templates/storefront-grocery/components/category-grid.tsx +0 -28
- package/templates/storefront-grocery/components/collection-strip.tsx +0 -45
- package/templates/storefront-grocery/components/footer.tsx +0 -148
- package/templates/storefront-grocery/components/header.tsx +0 -43
- package/templates/storefront-grocery/components/hero.tsx +0 -25
- package/templates/storefront-grocery/components/nav-link.tsx +0 -20
- package/templates/storefront-grocery/components/policy-page.tsx +0 -49
- package/templates/storefront-grocery/components/product-modal.tsx +0 -104
- package/templates/storefront-grocery/components/providers.tsx +0 -35
- package/templates/storefront-grocery/components/store-product-card.tsx +0 -87
- package/templates/storefront-grocery/lib/brand.ts +0 -375
- package/templates/storefront-grocery/lib/cart.ts +0 -12
- package/templates/storefront-grocery/next.config.ts +0 -42
- package/templates/storefront-grocery/package.json +0 -35
- package/templates/storefront-grocery/postcss.config.mjs +0 -7
- package/templates/storefront-grocery/tsconfig.json +0 -23
- package/templates/storefront-grocery/vitest.config.ts +0 -9
- package/templates/storefront-restaurant/.claude/skills/cimplify-storefront/SKILL.md +0 -145
- package/templates/storefront-restaurant/.cursor/rules/cimplify-storefront.mdc +0 -25
- package/templates/storefront-restaurant/.env.example +0 -16
- package/templates/storefront-restaurant/AGENTS.md +0 -102
- package/templates/storefront-restaurant/CLAUDE.md +0 -22
- package/templates/storefront-restaurant/README.md +0 -73
- package/templates/storefront-restaurant/__tests__/brand.test.ts +0 -4
- package/templates/storefront-restaurant/__tests__/cart-flow.test.ts +0 -4
- package/templates/storefront-restaurant/__tests__/contract.test.ts +0 -4
- package/templates/storefront-restaurant/app/about/page.tsx +0 -38
- package/templates/storefront-restaurant/app/accessibility/page.tsx +0 -11
- package/templates/storefront-restaurant/app/account/addresses/page.tsx +0 -21
- package/templates/storefront-restaurant/app/account/orders/page.tsx +0 -21
- package/templates/storefront-restaurant/app/account/page.tsx +0 -22
- package/templates/storefront-restaurant/app/account/settings/page.tsx +0 -21
- package/templates/storefront-restaurant/app/cart/page.tsx +0 -9
- package/templates/storefront-restaurant/app/categories/[slug]/listing-client.tsx +0 -19
- package/templates/storefront-restaurant/app/categories/[slug]/page.tsx +0 -118
- package/templates/storefront-restaurant/app/checkout/page.tsx +0 -17
- package/templates/storefront-restaurant/app/collections/[slug]/listing-client.tsx +0 -20
- package/templates/storefront-restaurant/app/collections/[slug]/page.tsx +0 -118
- package/templates/storefront-restaurant/app/contact/contact-form.tsx +0 -109
- package/templates/storefront-restaurant/app/contact/page.tsx +0 -54
- package/templates/storefront-restaurant/app/error.tsx +0 -60
- package/templates/storefront-restaurant/app/faq/page.tsx +0 -46
- package/templates/storefront-restaurant/app/globals.css +0 -44
- package/templates/storefront-restaurant/app/layout.tsx +0 -82
- package/templates/storefront-restaurant/app/llms.txt/route.ts +0 -94
- package/templates/storefront-restaurant/app/login/page.tsx +0 -17
- package/templates/storefront-restaurant/app/not-found.tsx +0 -39
- package/templates/storefront-restaurant/app/opensearch.xml/route.ts +0 -37
- package/templates/storefront-restaurant/app/orders/[id]/page.tsx +0 -21
- package/templates/storefront-restaurant/app/page.tsx +0 -97
- package/templates/storefront-restaurant/app/privacy/page.tsx +0 -44
- package/templates/storefront-restaurant/app/reservations/page.tsx +0 -66
- package/templates/storefront-restaurant/app/reservations/reservations-client.tsx +0 -234
- package/templates/storefront-restaurant/app/returns/page.tsx +0 -11
- package/templates/storefront-restaurant/app/robots.ts +0 -18
- package/templates/storefront-restaurant/app/search/page.tsx +0 -38
- package/templates/storefront-restaurant/app/search/search-client.tsx +0 -7
- package/templates/storefront-restaurant/app/shipping/page.tsx +0 -16
- package/templates/storefront-restaurant/app/shop/page.tsx +0 -31
- package/templates/storefront-restaurant/app/shop/shop-client.tsx +0 -27
- package/templates/storefront-restaurant/app/signup/page.tsx +0 -17
- package/templates/storefront-restaurant/app/sitemap-page/page.tsx +0 -167
- package/templates/storefront-restaurant/app/sitemap.ts +0 -62
- package/templates/storefront-restaurant/app/terms/page.tsx +0 -44
- package/templates/storefront-restaurant/app/track-order/page.tsx +0 -24
- package/templates/storefront-restaurant/app/track-order/track-order-form.tsx +0 -69
- package/templates/storefront-restaurant/components/account-iframe.tsx +0 -13
- package/templates/storefront-restaurant/components/cart-drawer.tsx +0 -14
- package/templates/storefront-restaurant/components/cart-pill.tsx +0 -36
- package/templates/storefront-restaurant/components/category-grid.tsx +0 -28
- package/templates/storefront-restaurant/components/collection-strip.tsx +0 -45
- package/templates/storefront-restaurant/components/footer.tsx +0 -148
- package/templates/storefront-restaurant/components/header.tsx +0 -43
- package/templates/storefront-restaurant/components/hero.tsx +0 -25
- package/templates/storefront-restaurant/components/nav-link.tsx +0 -20
- package/templates/storefront-restaurant/components/policy-page.tsx +0 -49
- package/templates/storefront-restaurant/components/product-modal.tsx +0 -104
- package/templates/storefront-restaurant/components/providers.tsx +0 -35
- package/templates/storefront-restaurant/components/store-product-card.tsx +0 -87
- package/templates/storefront-restaurant/lib/brand.ts +0 -377
- package/templates/storefront-restaurant/lib/cart.ts +0 -12
- package/templates/storefront-restaurant/next.config.ts +0 -42
- package/templates/storefront-restaurant/package.json +0 -35
- package/templates/storefront-restaurant/postcss.config.mjs +0 -7
- package/templates/storefront-restaurant/tsconfig.json +0 -23
- package/templates/storefront-restaurant/vitest.config.ts +0 -9
- package/templates/storefront-retail/.claude/skills/cimplify-storefront/SKILL.md +0 -145
- package/templates/storefront-retail/.cursor/rules/cimplify-storefront.mdc +0 -25
- package/templates/storefront-retail/.env.example +0 -16
- package/templates/storefront-retail/AGENTS.md +0 -117
- package/templates/storefront-retail/CLAUDE.md +0 -22
- package/templates/storefront-retail/README.md +0 -77
- package/templates/storefront-retail/__tests__/brand.test.ts +0 -4
- package/templates/storefront-retail/__tests__/cart-flow.test.ts +0 -4
- package/templates/storefront-retail/__tests__/contract.test.ts +0 -4
- package/templates/storefront-retail/app/about/page.tsx +0 -41
- package/templates/storefront-retail/app/accessibility/page.tsx +0 -11
- package/templates/storefront-retail/app/account/addresses/page.tsx +0 -21
- package/templates/storefront-retail/app/account/orders/page.tsx +0 -21
- package/templates/storefront-retail/app/account/page.tsx +0 -22
- package/templates/storefront-retail/app/account/settings/page.tsx +0 -21
- package/templates/storefront-retail/app/cart/page.tsx +0 -9
- package/templates/storefront-retail/app/categories/[slug]/listing-client.tsx +0 -19
- package/templates/storefront-retail/app/categories/[slug]/page.tsx +0 -130
- package/templates/storefront-retail/app/checkout/page.tsx +0 -17
- package/templates/storefront-retail/app/collections/[slug]/listing-client.tsx +0 -20
- package/templates/storefront-retail/app/collections/[slug]/page.tsx +0 -130
- package/templates/storefront-retail/app/contact/contact-form.tsx +0 -109
- package/templates/storefront-retail/app/contact/page.tsx +0 -54
- package/templates/storefront-retail/app/error.tsx +0 -61
- package/templates/storefront-retail/app/faq/page.tsx +0 -46
- package/templates/storefront-retail/app/globals.css +0 -47
- package/templates/storefront-retail/app/layout.tsx +0 -77
- package/templates/storefront-retail/app/llms.txt/route.ts +0 -94
- package/templates/storefront-retail/app/login/page.tsx +0 -17
- package/templates/storefront-retail/app/not-found.tsx +0 -39
- package/templates/storefront-retail/app/opensearch.xml/route.ts +0 -37
- package/templates/storefront-retail/app/orders/[id]/page.tsx +0 -24
- package/templates/storefront-retail/app/page.tsx +0 -182
- package/templates/storefront-retail/app/privacy/page.tsx +0 -44
- package/templates/storefront-retail/app/products/[slug]/page.tsx +0 -165
- package/templates/storefront-retail/app/products/[slug]/product-detail.tsx +0 -70
- package/templates/storefront-retail/app/returns/page.tsx +0 -11
- package/templates/storefront-retail/app/robots.ts +0 -18
- package/templates/storefront-retail/app/search/page.tsx +0 -38
- package/templates/storefront-retail/app/search/search-client.tsx +0 -7
- package/templates/storefront-retail/app/shipping/page.tsx +0 -16
- package/templates/storefront-retail/app/shop/page.tsx +0 -63
- package/templates/storefront-retail/app/shop/shop-client.tsx +0 -32
- package/templates/storefront-retail/app/signup/page.tsx +0 -17
- package/templates/storefront-retail/app/sitemap-page/page.tsx +0 -167
- package/templates/storefront-retail/app/sitemap.ts +0 -59
- package/templates/storefront-retail/app/terms/page.tsx +0 -44
- package/templates/storefront-retail/app/track-order/page.tsx +0 -24
- package/templates/storefront-retail/app/track-order/track-order-form.tsx +0 -69
- package/templates/storefront-retail/components/account-iframe.tsx +0 -13
- package/templates/storefront-retail/components/brand-marquee.tsx +0 -27
- package/templates/storefront-retail/components/cart-drawer.tsx +0 -14
- package/templates/storefront-retail/components/cart-pill.tsx +0 -36
- package/templates/storefront-retail/components/category-grid.tsx +0 -28
- package/templates/storefront-retail/components/category-tiles.tsx +0 -104
- package/templates/storefront-retail/components/collection-strip.tsx +0 -45
- package/templates/storefront-retail/components/feature-hero.tsx +0 -84
- package/templates/storefront-retail/components/footer.tsx +0 -153
- package/templates/storefront-retail/components/header.tsx +0 -45
- package/templates/storefront-retail/components/hero.tsx +0 -28
- package/templates/storefront-retail/components/nav-link.tsx +0 -20
- package/templates/storefront-retail/components/newsletter.tsx +0 -50
- package/templates/storefront-retail/components/policy-page.tsx +0 -49
- package/templates/storefront-retail/components/promo-banner.tsx +0 -41
- package/templates/storefront-retail/components/providers.tsx +0 -35
- package/templates/storefront-retail/components/section-heading.tsx +0 -37
- package/templates/storefront-retail/components/store-product-card.tsx +0 -87
- package/templates/storefront-retail/components/trade-in-cta.tsx +0 -54
- package/templates/storefront-retail/components/trust-bar.tsx +0 -66
- package/templates/storefront-retail/lib/brand.ts +0 -664
- package/templates/storefront-retail/lib/cart.ts +0 -12
- package/templates/storefront-retail/next.config.ts +0 -42
- package/templates/storefront-retail/package.json +0 -35
- package/templates/storefront-retail/postcss.config.mjs +0 -7
- package/templates/storefront-retail/tsconfig.json +0 -23
- package/templates/storefront-retail/vitest.config.ts +0 -9
- package/templates/storefront-services/.claude/skills/cimplify-storefront/SKILL.md +0 -145
- package/templates/storefront-services/.cursor/rules/cimplify-storefront.mdc +0 -25
- package/templates/storefront-services/.env.example +0 -16
- package/templates/storefront-services/AGENTS.md +0 -101
- package/templates/storefront-services/CLAUDE.md +0 -22
- package/templates/storefront-services/README.md +0 -73
- package/templates/storefront-services/__tests__/brand.test.ts +0 -4
- package/templates/storefront-services/__tests__/cart-flow.test.ts +0 -4
- package/templates/storefront-services/__tests__/contract.test.ts +0 -4
- package/templates/storefront-services/app/about/page.tsx +0 -38
- package/templates/storefront-services/app/accessibility/page.tsx +0 -11
- package/templates/storefront-services/app/account/addresses/page.tsx +0 -21
- package/templates/storefront-services/app/account/orders/page.tsx +0 -21
- package/templates/storefront-services/app/account/page.tsx +0 -22
- package/templates/storefront-services/app/account/settings/page.tsx +0 -21
- package/templates/storefront-services/app/book/book-client.tsx +0 -195
- package/templates/storefront-services/app/book/page.tsx +0 -65
- package/templates/storefront-services/app/cart/page.tsx +0 -9
- package/templates/storefront-services/app/categories/[slug]/listing-client.tsx +0 -19
- package/templates/storefront-services/app/categories/[slug]/page.tsx +0 -118
- package/templates/storefront-services/app/checkout/page.tsx +0 -17
- package/templates/storefront-services/app/collections/[slug]/listing-client.tsx +0 -20
- package/templates/storefront-services/app/collections/[slug]/page.tsx +0 -118
- package/templates/storefront-services/app/contact/contact-form.tsx +0 -109
- package/templates/storefront-services/app/contact/page.tsx +0 -54
- package/templates/storefront-services/app/error.tsx +0 -60
- package/templates/storefront-services/app/faq/page.tsx +0 -46
- package/templates/storefront-services/app/globals.css +0 -45
- package/templates/storefront-services/app/layout.tsx +0 -82
- package/templates/storefront-services/app/llms.txt/route.ts +0 -94
- package/templates/storefront-services/app/login/page.tsx +0 -17
- package/templates/storefront-services/app/not-found.tsx +0 -39
- package/templates/storefront-services/app/opensearch.xml/route.ts +0 -37
- package/templates/storefront-services/app/orders/[id]/page.tsx +0 -21
- package/templates/storefront-services/app/page.tsx +0 -97
- package/templates/storefront-services/app/privacy/page.tsx +0 -44
- package/templates/storefront-services/app/returns/page.tsx +0 -11
- package/templates/storefront-services/app/robots.ts +0 -18
- package/templates/storefront-services/app/search/page.tsx +0 -38
- package/templates/storefront-services/app/search/search-client.tsx +0 -7
- package/templates/storefront-services/app/shipping/page.tsx +0 -16
- package/templates/storefront-services/app/shop/page.tsx +0 -31
- package/templates/storefront-services/app/shop/shop-client.tsx +0 -27
- package/templates/storefront-services/app/signup/page.tsx +0 -17
- package/templates/storefront-services/app/sitemap-page/page.tsx +0 -167
- package/templates/storefront-services/app/sitemap.ts +0 -62
- package/templates/storefront-services/app/terms/page.tsx +0 -44
- package/templates/storefront-services/app/track-order/page.tsx +0 -24
- package/templates/storefront-services/app/track-order/track-order-form.tsx +0 -69
- package/templates/storefront-services/components/account-iframe.tsx +0 -13
- package/templates/storefront-services/components/cart-drawer.tsx +0 -14
- package/templates/storefront-services/components/cart-pill.tsx +0 -36
- package/templates/storefront-services/components/category-grid.tsx +0 -28
- package/templates/storefront-services/components/collection-strip.tsx +0 -45
- package/templates/storefront-services/components/footer.tsx +0 -148
- package/templates/storefront-services/components/header.tsx +0 -43
- package/templates/storefront-services/components/hero.tsx +0 -25
- package/templates/storefront-services/components/nav-link.tsx +0 -20
- package/templates/storefront-services/components/policy-page.tsx +0 -49
- package/templates/storefront-services/components/product-modal.tsx +0 -104
- package/templates/storefront-services/components/providers.tsx +0 -35
- package/templates/storefront-services/components/store-product-card.tsx +0 -87
- package/templates/storefront-services/lib/brand.ts +0 -396
- package/templates/storefront-services/lib/cart.ts +0 -12
- package/templates/storefront-services/next.config.ts +0 -42
- package/templates/storefront-services/package.json +0 -35
- package/templates/storefront-services/postcss.config.mjs +0 -7
- package/templates/storefront-services/tsconfig.json +0 -23
- package/templates/storefront-services/vitest.config.ts +0 -9
|
@@ -1,717 +0,0 @@
|
|
|
1
|
-
import { promises } from 'fs';
|
|
2
|
-
import os from 'os';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { spawn } from 'child_process';
|
|
5
|
-
import readline from 'readline';
|
|
6
|
-
|
|
7
|
-
// src/cli/errors.ts
|
|
8
|
-
var CLI_ERROR_CODE = {
|
|
9
|
-
NOT_LOGGED_IN: "NOT_LOGGED_IN",
|
|
10
|
-
NOT_LINKED: "NOT_LINKED",
|
|
11
|
-
NETWORK_ERROR: "NETWORK_ERROR",
|
|
12
|
-
AUTH_FAILED: "AUTH_FAILED",
|
|
13
|
-
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
14
|
-
GIT_ERROR: "GIT_ERROR",
|
|
15
|
-
INVALID_INPUT: "INVALID_INPUT",
|
|
16
|
-
ALREADY_LINKED: "ALREADY_LINKED",
|
|
17
|
-
SERVER_ERROR: "SERVER_ERROR",
|
|
18
|
-
ABORTED: "ABORTED",
|
|
19
|
-
/** Operation needs interactive confirmation and the shell is non-interactive. */
|
|
20
|
-
INTERACTIVE_REQUIRED: "INTERACTIVE_REQUIRED"
|
|
21
|
-
};
|
|
22
|
-
var EXIT_CODE = {
|
|
23
|
-
OK: 0,
|
|
24
|
-
ERROR: 1,
|
|
25
|
-
SUPERSEDED: 2,
|
|
26
|
-
ABORTED: 3,
|
|
27
|
-
NOT_LINKED: 4,
|
|
28
|
-
ALREADY_LINKED: 5,
|
|
29
|
-
GIT_ERROR: 6,
|
|
30
|
-
INTERACTIVE_REQUIRED: 7,
|
|
31
|
-
PROJECT_NOT_FOUND: 8,
|
|
32
|
-
NETWORK_ERROR: 10,
|
|
33
|
-
SERVER_ERROR: 11,
|
|
34
|
-
TIMEOUT: 12,
|
|
35
|
-
NOT_LOGGED_IN: 20,
|
|
36
|
-
AUTH_FAILED: 21,
|
|
37
|
-
UNAUTHORIZED: 22,
|
|
38
|
-
INVALID_INPUT: 30
|
|
39
|
-
};
|
|
40
|
-
var EXIT_CODE_FOR = {
|
|
41
|
-
NOT_LOGGED_IN: EXIT_CODE.NOT_LOGGED_IN,
|
|
42
|
-
NOT_LINKED: EXIT_CODE.NOT_LINKED,
|
|
43
|
-
NETWORK_ERROR: EXIT_CODE.NETWORK_ERROR,
|
|
44
|
-
AUTH_FAILED: EXIT_CODE.AUTH_FAILED,
|
|
45
|
-
PROJECT_NOT_FOUND: EXIT_CODE.PROJECT_NOT_FOUND,
|
|
46
|
-
GIT_ERROR: EXIT_CODE.GIT_ERROR,
|
|
47
|
-
INVALID_INPUT: EXIT_CODE.INVALID_INPUT,
|
|
48
|
-
ALREADY_LINKED: EXIT_CODE.ALREADY_LINKED,
|
|
49
|
-
SERVER_ERROR: EXIT_CODE.SERVER_ERROR,
|
|
50
|
-
ABORTED: EXIT_CODE.ABORTED,
|
|
51
|
-
UNAUTHORIZED: EXIT_CODE.UNAUTHORIZED,
|
|
52
|
-
TIMEOUT: EXIT_CODE.TIMEOUT,
|
|
53
|
-
INTERACTIVE_REQUIRED: EXIT_CODE.INTERACTIVE_REQUIRED
|
|
54
|
-
};
|
|
55
|
-
var CliError = class extends Error {
|
|
56
|
-
constructor(code, message, options = {}) {
|
|
57
|
-
super(message);
|
|
58
|
-
this.name = "CliError";
|
|
59
|
-
this.code = code;
|
|
60
|
-
this.exitCode = options.exitCode ?? EXIT_CODE_FOR[code];
|
|
61
|
-
this.remediation = options.remediation;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// src/cli/api-client.ts
|
|
66
|
-
var DEFAULT_API_BASE_URL = "https://api.cimplify.io";
|
|
67
|
-
var ENV_API_BASE_URL = "CIMPLIFY_API_URL";
|
|
68
|
-
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
69
|
-
var HEADER_AUTHORIZATION = "Authorization";
|
|
70
|
-
var HEADER_CONTENT_TYPE = "Content-Type";
|
|
71
|
-
var HEADER_ACCEPT = "Accept";
|
|
72
|
-
var HEADER_USER_AGENT = "User-Agent";
|
|
73
|
-
var BEARER_PREFIX = "Bearer ";
|
|
74
|
-
var CONTENT_TYPE_JSON = "application/json";
|
|
75
|
-
var USER_AGENT = "cimplify-cli";
|
|
76
|
-
var METHOD_GET = "GET";
|
|
77
|
-
var METHOD_POST = "POST";
|
|
78
|
-
var METHOD_PUT = "PUT";
|
|
79
|
-
var METHOD_DELETE = "DELETE";
|
|
80
|
-
var STATUS_UNAUTHORIZED = 401;
|
|
81
|
-
var STATUS_FORBIDDEN = 403;
|
|
82
|
-
var STATUS_NOT_FOUND = 404;
|
|
83
|
-
var STATUS_CONFLICT = 409;
|
|
84
|
-
var STATUS_BAD_REQUEST_MIN = 400;
|
|
85
|
-
var STATUS_SERVER_ERROR_MIN = 500;
|
|
86
|
-
var ApiClient = class _ApiClient {
|
|
87
|
-
constructor(baseUrl, apiKey) {
|
|
88
|
-
this.baseUrl = baseUrl.replace(/\/+$/, "");
|
|
89
|
-
this.apiKey = apiKey;
|
|
90
|
-
}
|
|
91
|
-
static fromAuth(auth) {
|
|
92
|
-
return new _ApiClient(auth.apiBaseUrl, auth.apiKey);
|
|
93
|
-
}
|
|
94
|
-
static unauthenticated(baseUrl = resolveBaseUrl()) {
|
|
95
|
-
return new _ApiClient(baseUrl, "");
|
|
96
|
-
}
|
|
97
|
-
static withKey(apiKey, baseUrl = resolveBaseUrl()) {
|
|
98
|
-
return new _ApiClient(baseUrl, apiKey);
|
|
99
|
-
}
|
|
100
|
-
get(pathname, options) {
|
|
101
|
-
return this.request(METHOD_GET, pathname, void 0, options);
|
|
102
|
-
}
|
|
103
|
-
post(pathname, body, options) {
|
|
104
|
-
return this.request(METHOD_POST, pathname, body, options);
|
|
105
|
-
}
|
|
106
|
-
put(pathname, body, options) {
|
|
107
|
-
return this.request(METHOD_PUT, pathname, body, options);
|
|
108
|
-
}
|
|
109
|
-
delete(pathname, options) {
|
|
110
|
-
return this.request(METHOD_DELETE, pathname, void 0, options);
|
|
111
|
-
}
|
|
112
|
-
async request(method, pathname, body, options) {
|
|
113
|
-
const url = this.buildUrl(pathname, options?.query);
|
|
114
|
-
const headers = {
|
|
115
|
-
[HEADER_ACCEPT]: CONTENT_TYPE_JSON,
|
|
116
|
-
[HEADER_USER_AGENT]: USER_AGENT
|
|
117
|
-
};
|
|
118
|
-
if (this.apiKey) {
|
|
119
|
-
headers[HEADER_AUTHORIZATION] = `${BEARER_PREFIX}${this.apiKey}`;
|
|
120
|
-
}
|
|
121
|
-
let payload;
|
|
122
|
-
if (body !== void 0) {
|
|
123
|
-
headers[HEADER_CONTENT_TYPE] = CONTENT_TYPE_JSON;
|
|
124
|
-
payload = JSON.stringify(body);
|
|
125
|
-
}
|
|
126
|
-
const controller = new AbortController();
|
|
127
|
-
const timeoutMs = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
128
|
-
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
129
|
-
let response;
|
|
130
|
-
try {
|
|
131
|
-
response = await fetch(url, {
|
|
132
|
-
method,
|
|
133
|
-
headers,
|
|
134
|
-
body: payload,
|
|
135
|
-
signal: controller.signal
|
|
136
|
-
});
|
|
137
|
-
} catch (err) {
|
|
138
|
-
clearTimeout(timer);
|
|
139
|
-
throw toNetworkError(err);
|
|
140
|
-
}
|
|
141
|
-
clearTimeout(timer);
|
|
142
|
-
return parseResponse(response);
|
|
143
|
-
}
|
|
144
|
-
buildUrl(pathname, query) {
|
|
145
|
-
const base = pathname.startsWith("/") ? pathname : `/${pathname}`;
|
|
146
|
-
const url = new URL(`${this.baseUrl}${base}`);
|
|
147
|
-
if (query) {
|
|
148
|
-
for (const [k, v] of Object.entries(query)) {
|
|
149
|
-
if (v === void 0 || v === null) continue;
|
|
150
|
-
url.searchParams.set(k, String(v));
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
return url.toString();
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
function resolveBaseUrl(override) {
|
|
157
|
-
const fromEnv = process.env[ENV_API_BASE_URL];
|
|
158
|
-
return fromEnv && fromEnv.length > 0 ? fromEnv : DEFAULT_API_BASE_URL;
|
|
159
|
-
}
|
|
160
|
-
async function parseResponse(response) {
|
|
161
|
-
const text = await response.text();
|
|
162
|
-
let body = void 0;
|
|
163
|
-
if (text.length > 0) {
|
|
164
|
-
try {
|
|
165
|
-
body = JSON.parse(text);
|
|
166
|
-
} catch {
|
|
167
|
-
throw new CliError(
|
|
168
|
-
CLI_ERROR_CODE.SERVER_ERROR,
|
|
169
|
-
`Server returned non-JSON response (status ${response.status}): ${truncate(text)}`
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (response.ok) {
|
|
174
|
-
if (body && typeof body === "object" && "data" in body) {
|
|
175
|
-
return body.data;
|
|
176
|
-
}
|
|
177
|
-
return body;
|
|
178
|
-
}
|
|
179
|
-
const code = mapStatusToCode(response.status);
|
|
180
|
-
const message = extractErrorMessage(body, response.status);
|
|
181
|
-
throw new CliError(code, message);
|
|
182
|
-
}
|
|
183
|
-
function mapStatusToCode(status) {
|
|
184
|
-
if (status === STATUS_UNAUTHORIZED) return CLI_ERROR_CODE.AUTH_FAILED;
|
|
185
|
-
if (status === STATUS_FORBIDDEN) return CLI_ERROR_CODE.AUTH_FAILED;
|
|
186
|
-
if (status === STATUS_NOT_FOUND) return CLI_ERROR_CODE.PROJECT_NOT_FOUND;
|
|
187
|
-
if (status === STATUS_CONFLICT) return CLI_ERROR_CODE.ALREADY_LINKED;
|
|
188
|
-
if (status >= STATUS_SERVER_ERROR_MIN) return CLI_ERROR_CODE.SERVER_ERROR;
|
|
189
|
-
if (status >= STATUS_BAD_REQUEST_MIN) return CLI_ERROR_CODE.INVALID_INPUT;
|
|
190
|
-
return CLI_ERROR_CODE.SERVER_ERROR;
|
|
191
|
-
}
|
|
192
|
-
function extractErrorMessage(body, status) {
|
|
193
|
-
if (body && typeof body === "object") {
|
|
194
|
-
const envelope = body;
|
|
195
|
-
if (envelope.error && typeof envelope.error.error_message === "string") {
|
|
196
|
-
return envelope.error.error_code ? `${envelope.error.error_code}: ${envelope.error.error_message}` : envelope.error.error_message;
|
|
197
|
-
}
|
|
198
|
-
if (typeof envelope.message === "string") return envelope.message;
|
|
199
|
-
}
|
|
200
|
-
return `HTTP ${status}`;
|
|
201
|
-
}
|
|
202
|
-
function toNetworkError(err) {
|
|
203
|
-
if (err instanceof DOMException && err.name === "AbortError") {
|
|
204
|
-
return new CliError(CLI_ERROR_CODE.NETWORK_ERROR, "Request timed out.");
|
|
205
|
-
}
|
|
206
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
207
|
-
return new CliError(CLI_ERROR_CODE.NETWORK_ERROR, `Network error: ${message}`);
|
|
208
|
-
}
|
|
209
|
-
function truncate(value, max = 200) {
|
|
210
|
-
return value.length > max ? `${value.slice(0, max)}\u2026` : value;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// src/cli/args.ts
|
|
214
|
-
function parseArgs(argv) {
|
|
215
|
-
const positional = [];
|
|
216
|
-
const flags = /* @__PURE__ */ new Map();
|
|
217
|
-
for (let i = 0; i < argv.length; i++) {
|
|
218
|
-
const arg = argv[i];
|
|
219
|
-
if (!arg.startsWith("--")) {
|
|
220
|
-
positional.push(arg);
|
|
221
|
-
continue;
|
|
222
|
-
}
|
|
223
|
-
const eq = arg.indexOf("=");
|
|
224
|
-
if (eq !== -1) {
|
|
225
|
-
flags.set(arg.slice(2, eq), arg.slice(eq + 1));
|
|
226
|
-
continue;
|
|
227
|
-
}
|
|
228
|
-
const name = arg.slice(2);
|
|
229
|
-
const next = argv[i + 1];
|
|
230
|
-
if (next !== void 0 && !next.startsWith("--")) {
|
|
231
|
-
flags.set(name, next);
|
|
232
|
-
i++;
|
|
233
|
-
} else {
|
|
234
|
-
flags.set(name, true);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return { positional, flags };
|
|
238
|
-
}
|
|
239
|
-
function flagString(args, name) {
|
|
240
|
-
const v = args.flags.get(name);
|
|
241
|
-
return typeof v === "string" ? v : void 0;
|
|
242
|
-
}
|
|
243
|
-
function flagBool(args, name) {
|
|
244
|
-
return args.flags.has(name);
|
|
245
|
-
}
|
|
246
|
-
var AUTH_FILE_NAME = "auth.json";
|
|
247
|
-
var PROJECT_FILE_NAME = "project.json";
|
|
248
|
-
var STATE_FILE_NAME = "state.json";
|
|
249
|
-
var PROJECT_DIR_NAME = ".cimplify";
|
|
250
|
-
var ENV_XDG_CONFIG_HOME = "XDG_CONFIG_HOME";
|
|
251
|
-
var APP_CONFIG_DIR_NAME = "cimplify";
|
|
252
|
-
var HOME_CONFIG_DIR_NAME = ".config";
|
|
253
|
-
var FILE_MODE_DIR = 448;
|
|
254
|
-
var ENCODING_UTF8 = "utf8";
|
|
255
|
-
function authConfigDir() {
|
|
256
|
-
const xdg = process.env[ENV_XDG_CONFIG_HOME];
|
|
257
|
-
return xdg ? path.join(xdg, APP_CONFIG_DIR_NAME) : path.join(os.homedir(), HOME_CONFIG_DIR_NAME, APP_CONFIG_DIR_NAME);
|
|
258
|
-
}
|
|
259
|
-
function authConfigPath() {
|
|
260
|
-
return path.join(authConfigDir(), AUTH_FILE_NAME);
|
|
261
|
-
}
|
|
262
|
-
function projectConfigDir(cwd = process.cwd()) {
|
|
263
|
-
return path.join(cwd, PROJECT_DIR_NAME);
|
|
264
|
-
}
|
|
265
|
-
function projectConfigPath(cwd = process.cwd()) {
|
|
266
|
-
return path.join(projectConfigDir(cwd), PROJECT_FILE_NAME);
|
|
267
|
-
}
|
|
268
|
-
function projectStatePath(cwd = process.cwd()) {
|
|
269
|
-
return path.join(projectConfigDir(cwd), STATE_FILE_NAME);
|
|
270
|
-
}
|
|
271
|
-
async function readJsonFile(filePath) {
|
|
272
|
-
try {
|
|
273
|
-
const raw = await promises.readFile(filePath, ENCODING_UTF8);
|
|
274
|
-
return JSON.parse(raw);
|
|
275
|
-
} catch (err) {
|
|
276
|
-
if (err.code === "ENOENT") return null;
|
|
277
|
-
throw err;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
async function writeJsonFile(filePath, value, mode) {
|
|
281
|
-
await promises.mkdir(path.dirname(filePath), { recursive: true, mode: FILE_MODE_DIR });
|
|
282
|
-
const payload = `${JSON.stringify(value, null, 2)}
|
|
283
|
-
`;
|
|
284
|
-
await promises.writeFile(filePath, payload, { encoding: ENCODING_UTF8, mode });
|
|
285
|
-
}
|
|
286
|
-
async function readAuth() {
|
|
287
|
-
const data = await readJsonFile(authConfigPath());
|
|
288
|
-
if (!data) {
|
|
289
|
-
throw new CliError(
|
|
290
|
-
CLI_ERROR_CODE.NOT_LOGGED_IN,
|
|
291
|
-
"Not logged in. Run `cimplify login` first."
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
return data;
|
|
295
|
-
}
|
|
296
|
-
async function readProjectLink(cwd = process.cwd()) {
|
|
297
|
-
const data = await readJsonFile(projectConfigPath(cwd));
|
|
298
|
-
if (!data) {
|
|
299
|
-
throw new CliError(
|
|
300
|
-
CLI_ERROR_CODE.NOT_LINKED,
|
|
301
|
-
"No project linked. Run `cimplify link <project-id>` first."
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
return data;
|
|
305
|
-
}
|
|
306
|
-
async function writeProjectState(state, cwd = process.cwd()) {
|
|
307
|
-
await writeJsonFile(projectStatePath(cwd), state);
|
|
308
|
-
}
|
|
309
|
-
var GIT_BINARY = "git";
|
|
310
|
-
var ENCODING_UTF82 = "utf8";
|
|
311
|
-
var REMOTE_DEFAULT = "origin";
|
|
312
|
-
var ARGS_STATUS_PORCELAIN = ["status", "--porcelain=v1"];
|
|
313
|
-
var ARGS_REV_PARSE_HEAD = ["rev-parse", "HEAD"];
|
|
314
|
-
var ARGS_REV_PARSE_ABBREV_REF = ["rev-parse", "--abbrev-ref", "HEAD"];
|
|
315
|
-
var ARGS_REV_PARSE_SHOW_TOPLEVEL = ["rev-parse", "--show-toplevel"];
|
|
316
|
-
var ARGS_REMOTE_GET_URL = ["remote", "get-url"];
|
|
317
|
-
var ARGS_PUSH = ["push"];
|
|
318
|
-
async function runGit(args, cwd) {
|
|
319
|
-
return new Promise((resolve, reject) => {
|
|
320
|
-
const child = spawn(GIT_BINARY, args, { cwd, stdio: ["ignore", "pipe", "pipe"] });
|
|
321
|
-
const stdoutChunks = [];
|
|
322
|
-
const stderrChunks = [];
|
|
323
|
-
child.stdout.on("data", (chunk) => stdoutChunks.push(chunk));
|
|
324
|
-
child.stderr.on("data", (chunk) => stderrChunks.push(chunk));
|
|
325
|
-
child.on("error", (err) => {
|
|
326
|
-
reject(new CliError(CLI_ERROR_CODE.GIT_ERROR, `git not found: ${err.message}`));
|
|
327
|
-
});
|
|
328
|
-
child.on("close", (code) => {
|
|
329
|
-
resolve({
|
|
330
|
-
code: code ?? -1,
|
|
331
|
-
stdout: Buffer.concat(stdoutChunks).toString(ENCODING_UTF82),
|
|
332
|
-
stderr: Buffer.concat(stderrChunks).toString(ENCODING_UTF82)
|
|
333
|
-
});
|
|
334
|
-
});
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
async function runGitOk(args, cwd) {
|
|
338
|
-
const { code, stdout, stderr } = await runGit(args, cwd);
|
|
339
|
-
if (code !== 0) {
|
|
340
|
-
throw new CliError(
|
|
341
|
-
CLI_ERROR_CODE.GIT_ERROR,
|
|
342
|
-
`git ${args.join(" ")} failed: ${stderr.trim() || stdout.trim() || `exit ${code}`}`
|
|
343
|
-
);
|
|
344
|
-
}
|
|
345
|
-
return stdout.trimEnd();
|
|
346
|
-
}
|
|
347
|
-
async function gitStatusPorcelain(cwd) {
|
|
348
|
-
return runGitOk(ARGS_STATUS_PORCELAIN, cwd);
|
|
349
|
-
}
|
|
350
|
-
async function gitCurrentSha(cwd) {
|
|
351
|
-
return runGitOk(ARGS_REV_PARSE_HEAD, cwd);
|
|
352
|
-
}
|
|
353
|
-
async function gitCurrentBranch(cwd) {
|
|
354
|
-
return runGitOk(ARGS_REV_PARSE_ABBREV_REF, cwd);
|
|
355
|
-
}
|
|
356
|
-
async function gitDetectRoot(cwd) {
|
|
357
|
-
const { code, stdout } = await runGit(ARGS_REV_PARSE_SHOW_TOPLEVEL, cwd);
|
|
358
|
-
if (code !== 0) return null;
|
|
359
|
-
return stdout.trimEnd() || null;
|
|
360
|
-
}
|
|
361
|
-
async function gitGetRemoteUrl(cwd, name = REMOTE_DEFAULT) {
|
|
362
|
-
const { code, stdout } = await runGit([...ARGS_REMOTE_GET_URL, name], cwd);
|
|
363
|
-
if (code !== 0) return null;
|
|
364
|
-
return stdout.trimEnd() || null;
|
|
365
|
-
}
|
|
366
|
-
async function gitPush(cwd, branch) {
|
|
367
|
-
const args = branch ? [...ARGS_PUSH, REMOTE_DEFAULT, branch] : [...ARGS_PUSH];
|
|
368
|
-
await runGitOk(args, cwd);
|
|
369
|
-
}
|
|
370
|
-
async function gitPushToUrl(cwd, url, branch) {
|
|
371
|
-
await runGitOk([...ARGS_PUSH, url, branch], cwd);
|
|
372
|
-
}
|
|
373
|
-
var FREESTYLE_GIT_HOST = "git.freestyle.sh";
|
|
374
|
-
function isFreestyleRemote(url) {
|
|
375
|
-
if (!url) return false;
|
|
376
|
-
try {
|
|
377
|
-
return new URL(url).hostname === FREESTYLE_GIT_HOST;
|
|
378
|
-
} catch {
|
|
379
|
-
return url.includes(FREESTYLE_GIT_HOST);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
// src/cli/output.ts
|
|
384
|
-
var RESET = "\x1B[0m";
|
|
385
|
-
var DIM_OPEN = "\x1B[2m";
|
|
386
|
-
var RED_OPEN = "\x1B[31m";
|
|
387
|
-
var GREEN_OPEN = "\x1B[32m";
|
|
388
|
-
var CYAN_OPEN = "\x1B[36m";
|
|
389
|
-
var PREFIX_STEP = "\u25B8";
|
|
390
|
-
var PREFIX_SUCCESS = "\u2713";
|
|
391
|
-
var PREFIX_FAILURE = "\u2717";
|
|
392
|
-
var ENV_JSON = "CIMPLIFY_JSON";
|
|
393
|
-
var ENV_YES = "CIMPLIFY_YES";
|
|
394
|
-
function envFlag(name) {
|
|
395
|
-
const v = process.env[name];
|
|
396
|
-
return v === "1" || v === "true";
|
|
397
|
-
}
|
|
398
|
-
function isJsonMode() {
|
|
399
|
-
return envFlag(ENV_JSON);
|
|
400
|
-
}
|
|
401
|
-
function isAutoYes() {
|
|
402
|
-
return envFlag(ENV_YES);
|
|
403
|
-
}
|
|
404
|
-
function isInteractive() {
|
|
405
|
-
return Boolean(process.stdout.isTTY) && Boolean(process.stdin.isTTY);
|
|
406
|
-
}
|
|
407
|
-
function wrap(open, value) {
|
|
408
|
-
return `${open}${value}${RESET}`;
|
|
409
|
-
}
|
|
410
|
-
function dim(value) {
|
|
411
|
-
return isJsonMode() ? value : wrap(DIM_OPEN, value);
|
|
412
|
-
}
|
|
413
|
-
function red(value) {
|
|
414
|
-
return isJsonMode() ? value : wrap(RED_OPEN, value);
|
|
415
|
-
}
|
|
416
|
-
function green(value) {
|
|
417
|
-
return isJsonMode() ? value : wrap(GREEN_OPEN, value);
|
|
418
|
-
}
|
|
419
|
-
function cyan(value) {
|
|
420
|
-
return isJsonMode() ? value : wrap(CYAN_OPEN, value);
|
|
421
|
-
}
|
|
422
|
-
function step(message) {
|
|
423
|
-
if (isJsonMode()) return;
|
|
424
|
-
console.log(`${cyan(PREFIX_STEP)} ${message}`);
|
|
425
|
-
}
|
|
426
|
-
function success(message) {
|
|
427
|
-
if (isJsonMode()) return;
|
|
428
|
-
console.log(`${green(PREFIX_SUCCESS)} ${message}`);
|
|
429
|
-
}
|
|
430
|
-
function failure(message) {
|
|
431
|
-
if (isJsonMode()) return;
|
|
432
|
-
console.error(`${red(PREFIX_FAILURE)} ${message}`);
|
|
433
|
-
}
|
|
434
|
-
function info(message) {
|
|
435
|
-
if (isJsonMode()) return;
|
|
436
|
-
console.log(message);
|
|
437
|
-
}
|
|
438
|
-
var ENV_EMITTED = "__CIMPLIFY_RESULT_EMITTED";
|
|
439
|
-
function result(data) {
|
|
440
|
-
if (!isJsonMode()) return;
|
|
441
|
-
if (process.env[ENV_EMITTED] === "1") return;
|
|
442
|
-
process.env[ENV_EMITTED] = "1";
|
|
443
|
-
process.stdout.write(`${JSON.stringify({ ok: true, data })}
|
|
444
|
-
`);
|
|
445
|
-
}
|
|
446
|
-
async function promptLine(question) {
|
|
447
|
-
if (!isInteractive()) {
|
|
448
|
-
throw new CliError(
|
|
449
|
-
CLI_ERROR_CODE.INTERACTIVE_REQUIRED,
|
|
450
|
-
"this operation needs interactive input but stdin is not a TTY",
|
|
451
|
-
{ remediation: "run interactively, or supply the value via a flag" }
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
455
|
-
try {
|
|
456
|
-
return await new Promise((resolve) => {
|
|
457
|
-
rl.question(question, (answer) => resolve(answer));
|
|
458
|
-
});
|
|
459
|
-
} finally {
|
|
460
|
-
rl.close();
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
async function promptYesNo(question, defaultNo = true) {
|
|
464
|
-
if (isAutoYes()) return true;
|
|
465
|
-
if (!isInteractive()) {
|
|
466
|
-
throw new CliError(
|
|
467
|
-
CLI_ERROR_CODE.INTERACTIVE_REQUIRED,
|
|
468
|
-
`this operation needs confirmation: ${question}`,
|
|
469
|
-
{ remediation: "re-run with --yes to accept, or run interactively" }
|
|
470
|
-
);
|
|
471
|
-
}
|
|
472
|
-
const suffix = defaultNo ? " [y/N] " : " [Y/n] ";
|
|
473
|
-
const answer = (await promptLine(`${question}${suffix}`)).trim().toLowerCase();
|
|
474
|
-
if (answer === "") return !defaultNo;
|
|
475
|
-
return answer === "y" || answer === "yes";
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
// src/cli/types.ts
|
|
479
|
-
var ENV_SCOPE = {
|
|
480
|
-
PREVIEW: "preview",
|
|
481
|
-
PRODUCTION: "production"
|
|
482
|
-
};
|
|
483
|
-
var DEPLOY_TRIGGER = {
|
|
484
|
-
CLI: "cli"};
|
|
485
|
-
var DEPLOYMENT_STATUS = {
|
|
486
|
-
ACTIVE: "active",
|
|
487
|
-
FAILED: "failed",
|
|
488
|
-
CANCELLED: "cancelled",
|
|
489
|
-
SUPERSEDED: "superseded"
|
|
490
|
-
};
|
|
491
|
-
var TERMINAL_DEPLOYMENT_STATUSES = /* @__PURE__ */ new Set([
|
|
492
|
-
DEPLOYMENT_STATUS.ACTIVE,
|
|
493
|
-
DEPLOYMENT_STATUS.FAILED,
|
|
494
|
-
DEPLOYMENT_STATUS.CANCELLED,
|
|
495
|
-
DEPLOYMENT_STATUS.SUPERSEDED
|
|
496
|
-
]);
|
|
497
|
-
var REPO_PROVIDER = {
|
|
498
|
-
FREESTYLE: "freestyle",
|
|
499
|
-
GITHUB: "github",
|
|
500
|
-
GITEA: "gitea",
|
|
501
|
-
EXTERNAL: "external"
|
|
502
|
-
};
|
|
503
|
-
new Set(Object.values(REPO_PROVIDER));
|
|
504
|
-
var TOKEN_PURPOSE = {
|
|
505
|
-
EDITOR: "editor"
|
|
506
|
-
};
|
|
507
|
-
|
|
508
|
-
// src/cli/progress.ts
|
|
509
|
-
var POLL_INTERVAL_MS = 1e3;
|
|
510
|
-
var POLL_MAX_MS = 30 * 60 * 1e3;
|
|
511
|
-
var BAR_WIDTH = 24;
|
|
512
|
-
var PROGRESS_MIN = 0;
|
|
513
|
-
var PROGRESS_MAX = 100;
|
|
514
|
-
function progressEndpoint(businessId, projectId, deploymentId) {
|
|
515
|
-
return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/deployments/${encodeURIComponent(deploymentId)}/progress`;
|
|
516
|
-
}
|
|
517
|
-
function renderBar(percent) {
|
|
518
|
-
const clamped = Math.max(PROGRESS_MIN, Math.min(PROGRESS_MAX, percent));
|
|
519
|
-
const filled = Math.round(clamped / PROGRESS_MAX * BAR_WIDTH);
|
|
520
|
-
const empty = BAR_WIDTH - filled;
|
|
521
|
-
return `[${"#".repeat(filled)}${"-".repeat(empty)}] ${String(clamped).padStart(3)}%`;
|
|
522
|
-
}
|
|
523
|
-
function writeStatusLine(line) {
|
|
524
|
-
if (process.stdout.isTTY) {
|
|
525
|
-
process.stdout.write(`\r\x1B[2K${line}`);
|
|
526
|
-
} else {
|
|
527
|
-
process.stdout.write(`${line}
|
|
528
|
-
`);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
function endStatusLine() {
|
|
532
|
-
if (process.stdout.isTTY) process.stdout.write("\n");
|
|
533
|
-
}
|
|
534
|
-
function sleep(ms) {
|
|
535
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
536
|
-
}
|
|
537
|
-
async function pollDeployment(client, businessId, projectId, deploymentId, options) {
|
|
538
|
-
const interval = POLL_INTERVAL_MS;
|
|
539
|
-
const maxDuration = POLL_MAX_MS;
|
|
540
|
-
const endpoint = progressEndpoint(businessId, projectId, deploymentId);
|
|
541
|
-
const startedAt = Date.now();
|
|
542
|
-
while (true) {
|
|
543
|
-
const progress = await client.get(endpoint);
|
|
544
|
-
const message = progress.status_message ?? progress.status;
|
|
545
|
-
writeStatusLine(`${renderBar(progress.progress ?? 0)} ${dim(message)}`);
|
|
546
|
-
if (TERMINAL_DEPLOYMENT_STATUSES.has(progress.status)) {
|
|
547
|
-
endStatusLine();
|
|
548
|
-
reportTerminal(progress);
|
|
549
|
-
return progress;
|
|
550
|
-
}
|
|
551
|
-
if (Date.now() - startedAt > maxDuration) {
|
|
552
|
-
endStatusLine();
|
|
553
|
-
throw new Error("Deployment polling timed out.");
|
|
554
|
-
}
|
|
555
|
-
await sleep(interval);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
function reportTerminal(progress) {
|
|
559
|
-
switch (progress.status) {
|
|
560
|
-
case DEPLOYMENT_STATUS.ACTIVE: {
|
|
561
|
-
const url = progress.url;
|
|
562
|
-
success(url ? `Deployed: ${url}` : "Deployment active.");
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
case DEPLOYMENT_STATUS.FAILED: {
|
|
566
|
-
failure(`Deployment failed: ${progress.error_message ?? progress.status_message ?? "no message"}`);
|
|
567
|
-
return;
|
|
568
|
-
}
|
|
569
|
-
case DEPLOYMENT_STATUS.CANCELLED: {
|
|
570
|
-
failure("Deployment cancelled.");
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
case DEPLOYMENT_STATUS.SUPERSEDED: {
|
|
574
|
-
failure(
|
|
575
|
-
progress.superseded_by_deployment_id ? `Deployment superseded by ${progress.superseded_by_deployment_id}.` : "Deployment superseded."
|
|
576
|
-
);
|
|
577
|
-
return;
|
|
578
|
-
}
|
|
579
|
-
default:
|
|
580
|
-
return;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
// src/cli/commands/repo.ts
|
|
585
|
-
function repoEndpoint(businessId, projectId) {
|
|
586
|
-
return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/repo`;
|
|
587
|
-
}
|
|
588
|
-
function cloneTokenEndpoint(businessId, projectId) {
|
|
589
|
-
return `${repoEndpoint(businessId, projectId)}/clone-token`;
|
|
590
|
-
}
|
|
591
|
-
async function fetchCloneToken(client, businessId, projectId, purpose = TOKEN_PURPOSE.EDITOR) {
|
|
592
|
-
return client.post(cloneTokenEndpoint(businessId, projectId), {
|
|
593
|
-
purpose
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
// src/cli/commands/deploy.ts
|
|
598
|
-
var FLAG_PROD = "prod";
|
|
599
|
-
var FLAG_REF = "ref";
|
|
600
|
-
var FLAG_NO_PUSH = "no-push";
|
|
601
|
-
var FLAG_ALLOW_DIRTY = "allow-dirty";
|
|
602
|
-
var FLAG_NO_POLL = "no-poll";
|
|
603
|
-
function deployEndpoint(businessId, projectId) {
|
|
604
|
-
return `/v1/businesses/${encodeURIComponent(businessId)}/projects/${encodeURIComponent(projectId)}/deploy`;
|
|
605
|
-
}
|
|
606
|
-
async function run(argv) {
|
|
607
|
-
const args = parseArgs(argv);
|
|
608
|
-
const auth = await readAuth();
|
|
609
|
-
const link = await readProjectLink();
|
|
610
|
-
const client = ApiClient.fromAuth(auth);
|
|
611
|
-
const cwd = process.cwd();
|
|
612
|
-
const root = await gitDetectRoot(cwd);
|
|
613
|
-
if (!root) {
|
|
614
|
-
throw new CliError(
|
|
615
|
-
CLI_ERROR_CODE.GIT_ERROR,
|
|
616
|
-
"Not inside a git repository. `cimplify deploy` needs git history."
|
|
617
|
-
);
|
|
618
|
-
}
|
|
619
|
-
const allowDirty = flagBool(args, FLAG_ALLOW_DIRTY);
|
|
620
|
-
const dirty = (await gitStatusPorcelain(root)).length > 0;
|
|
621
|
-
if (dirty && !allowDirty) {
|
|
622
|
-
const proceed = await promptYesNo(
|
|
623
|
-
"You have uncommitted changes. Continue anyway?",
|
|
624
|
-
true
|
|
625
|
-
);
|
|
626
|
-
if (!proceed) {
|
|
627
|
-
throw new CliError(CLI_ERROR_CODE.ABORTED, "Aborted by user.");
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
const explicitRef = flagString(args, FLAG_REF);
|
|
631
|
-
const branch = await gitCurrentBranch(root);
|
|
632
|
-
const localSha = await gitCurrentSha(root);
|
|
633
|
-
const gitRef = explicitRef ?? localSha;
|
|
634
|
-
if (!flagBool(args, FLAG_NO_PUSH)) {
|
|
635
|
-
const originUrl = await gitGetRemoteUrl(root);
|
|
636
|
-
if (isFreestyleRemote(originUrl)) {
|
|
637
|
-
step(`Pushing ${branch} to Freestyle (with minted clone token)`);
|
|
638
|
-
const token = await fetchCloneToken(
|
|
639
|
-
client,
|
|
640
|
-
link.businessId,
|
|
641
|
-
link.projectId,
|
|
642
|
-
TOKEN_PURPOSE.EDITOR
|
|
643
|
-
);
|
|
644
|
-
await gitPushToUrl(root, token.clone_url, branch);
|
|
645
|
-
} else {
|
|
646
|
-
step(`Pushing ${branch} to origin`);
|
|
647
|
-
await gitPush(root, branch);
|
|
648
|
-
}
|
|
649
|
-
} else {
|
|
650
|
-
info(dim("Skipping git push (--no-push)"));
|
|
651
|
-
}
|
|
652
|
-
const envScope = flagBool(args, FLAG_PROD) ? ENV_SCOPE.PRODUCTION : ENV_SCOPE.PREVIEW;
|
|
653
|
-
const body = {
|
|
654
|
-
git_ref: gitRef,
|
|
655
|
-
env_scope: envScope,
|
|
656
|
-
trigger: DEPLOY_TRIGGER.CLI
|
|
657
|
-
};
|
|
658
|
-
step(`Triggering ${envScope} deploy for ${gitRef.slice(0, 12)}`);
|
|
659
|
-
const enqueued = await client.post(
|
|
660
|
-
deployEndpoint(link.businessId, link.projectId),
|
|
661
|
-
body
|
|
662
|
-
);
|
|
663
|
-
await writeProjectState({
|
|
664
|
-
lastDeploymentId: enqueued.deployment_id,
|
|
665
|
-
lastDeploymentSha: enqueued.git_sha,
|
|
666
|
-
lastDeploymentEnv: envScope,
|
|
667
|
-
lastDeploymentAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
668
|
-
});
|
|
669
|
-
if (enqueued.existing) {
|
|
670
|
-
info(
|
|
671
|
-
dim(
|
|
672
|
-
`Existing deployment ${enqueued.deployment_id} for sha ${enqueued.git_sha.slice(0, 12)} is already in progress; resuming poll`
|
|
673
|
-
)
|
|
674
|
-
);
|
|
675
|
-
} else {
|
|
676
|
-
success(`Enqueued deployment ${enqueued.deployment_id} (sha ${enqueued.git_sha.slice(0, 12)})`);
|
|
677
|
-
}
|
|
678
|
-
if (flagBool(args, FLAG_NO_POLL)) {
|
|
679
|
-
result({
|
|
680
|
-
deployment: {
|
|
681
|
-
id: enqueued.deployment_id,
|
|
682
|
-
git_sha: enqueued.git_sha,
|
|
683
|
-
existing: enqueued.existing,
|
|
684
|
-
environment: envScope,
|
|
685
|
-
status: enqueued.existing ? "in_progress" : "queued"
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
return;
|
|
689
|
-
}
|
|
690
|
-
const final = await pollDeployment(
|
|
691
|
-
client,
|
|
692
|
-
link.businessId,
|
|
693
|
-
link.projectId,
|
|
694
|
-
enqueued.deployment_id
|
|
695
|
-
);
|
|
696
|
-
result({
|
|
697
|
-
deployment: {
|
|
698
|
-
id: enqueued.deployment_id,
|
|
699
|
-
git_sha: enqueued.git_sha,
|
|
700
|
-
environment: envScope,
|
|
701
|
-
status: final.status,
|
|
702
|
-
url: final.url ?? null,
|
|
703
|
-
error_message: final.error_message ?? null
|
|
704
|
-
}
|
|
705
|
-
});
|
|
706
|
-
if (final.status === DEPLOYMENT_STATUS.ACTIVE) {
|
|
707
|
-
process.exitCode = EXIT_CODE.OK;
|
|
708
|
-
return;
|
|
709
|
-
}
|
|
710
|
-
if (final.status === DEPLOYMENT_STATUS.SUPERSEDED) {
|
|
711
|
-
process.exitCode = EXIT_CODE.SUPERSEDED;
|
|
712
|
-
return;
|
|
713
|
-
}
|
|
714
|
-
process.exitCode = EXIT_CODE.ERROR;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
export { run as default };
|