@upstart.gg/sdk 0.0.67 → 0.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/cli/api.d.ts +34 -0
- package/dist/node/cli/api.d.ts.map +1 -0
- package/dist/node/cli/api.js +4 -3
- package/dist/node/cli/commands/build/cmd-build.d.ts +3 -0
- package/dist/node/cli/commands/build/cmd-build.d.ts.map +1 -0
- package/dist/node/cli/commands/build/cmd-build.js +2 -1
- package/dist/node/cli/commands/login/cmd-login.d.ts +14 -0
- package/dist/node/cli/commands/login/cmd-login.d.ts.map +1 -0
- package/dist/node/cli/commands/login/cmd-login.js +6 -5
- package/dist/node/cli/commands/logout/cmd-logout.d.ts +3 -0
- package/dist/node/cli/commands/logout/cmd-logout.d.ts.map +1 -0
- package/dist/node/cli/commands/logout/cmd-logout.js +4 -3
- package/dist/node/cli/commands/publish/cmd-publish.d.ts +3 -0
- package/dist/node/cli/commands/publish/cmd-publish.d.ts.map +1 -0
- package/dist/node/cli/commands/publish/cmd-publish.js +22 -21
- package/dist/node/cli/commands/publish/parse-gitignore.d.ts +56 -0
- package/dist/node/cli/commands/publish/parse-gitignore.d.ts.map +1 -0
- package/dist/node/cli/commands/publish/parse-gitignore.js +2 -1
- package/dist/node/cli/commands/publish/uploader.d.ts +20 -0
- package/dist/node/cli/commands/publish/uploader.d.ts.map +1 -0
- package/dist/node/cli/commands/publish/uploader.js +9 -8
- package/dist/node/cli/constants.d.ts +11 -0
- package/dist/node/cli/constants.d.ts.map +1 -0
- package/dist/node/cli/constants.js +2 -1
- package/dist/node/cli/is-logged-in.d.ts +2 -0
- package/dist/node/cli/is-logged-in.d.ts.map +1 -0
- package/dist/node/cli/is-logged-in.js +4 -0
- package/dist/node/cli/program.d.ts +3 -0
- package/dist/node/cli/program.d.ts.map +1 -0
- package/dist/node/cli/program.js +33 -32
- package/dist/node/cli/store.d.ts +9 -0
- package/dist/node/cli/store.d.ts.map +1 -0
- package/dist/node/cli/store.js +3 -3
- package/dist/node/cli/tests/api.test.d.ts +2 -0
- package/dist/node/cli/tests/api.test.d.ts.map +1 -0
- package/dist/node/cli/types.d.ts +30 -0
- package/dist/node/cli/types.d.ts.map +1 -0
- package/dist/node/cli/types.js +2 -1
- package/dist/node/cli/utils.d.ts +6 -0
- package/dist/node/cli/utils.d.ts.map +1 -0
- package/dist/node/cli/utils.js +2 -1
- package/dist/node/metafile-esm.json +1 -1
- package/dist/node/shared/config.d.ts +16 -0
- package/dist/node/shared/config.d.ts.map +1 -0
- package/dist/node/shared/config.js +8 -7
- package/dist/node/shared/logger.d.ts +30 -0
- package/dist/node/shared/logger.d.ts.map +1 -0
- package/dist/node/shared/logger.js +4 -3
- package/dist/shared/ajv.d.ts +4 -6
- package/dist/shared/ajv.d.ts.map +1 -0
- package/dist/shared/analytics/init.d.ts +2 -3
- package/dist/shared/analytics/init.d.ts.map +1 -0
- package/dist/shared/analytics/init.js +2 -1
- package/dist/shared/analytics/track.d.ts +3 -5
- package/dist/shared/analytics/track.d.ts.map +1 -0
- package/dist/shared/analytics/track.js +2 -1
- package/dist/shared/analytics/types.d.ts +3 -3
- package/dist/shared/analytics/types.d.ts.map +1 -0
- package/dist/shared/analytics/types.js +2 -1
- package/dist/shared/attributes.d.ts +33 -37
- package/dist/shared/attributes.d.ts.map +1 -0
- package/dist/shared/attributes.js +3 -2
- package/dist/shared/brick-manifest.d.ts +64 -0
- package/dist/shared/brick-manifest.d.ts.map +1 -0
- package/dist/shared/brick-manifest.js +3 -0
- package/dist/shared/bricks/manifests/all-manifests.d.ts +5 -0
- package/dist/shared/bricks/manifests/all-manifests.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/all-manifests.js +3 -0
- package/dist/shared/bricks/manifests/button.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/button.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/button.manifest.js +3 -0
- package/dist/shared/bricks/manifests/card.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/card.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/card.manifest.js +3 -0
- package/dist/shared/bricks/manifests/carousel.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/carousel.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/carousel.manifest.js +3 -0
- package/dist/shared/bricks/manifests/countdown.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/countdown.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/countdown.manifest.js +3 -0
- package/dist/shared/bricks/manifests/footer.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/footer.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/footer.manifest.js +3 -0
- package/dist/shared/bricks/manifests/form.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/form.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/form.manifest.js +3 -0
- package/dist/shared/bricks/manifests/header.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/header.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/header.manifest.js +3 -0
- package/dist/shared/bricks/manifests/hero.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/hero.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/hero.manifest.js +3 -0
- package/dist/shared/bricks/manifests/icon.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/icon.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/icon.manifest.js +3 -0
- package/dist/shared/bricks/manifests/image.manifest.d.ts +97 -0
- package/dist/shared/bricks/manifests/image.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/image.manifest.js +3 -0
- package/dist/shared/bricks/manifests/images-wall.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/images-wall.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/images-wall.manifest.js +3 -0
- package/dist/shared/bricks/manifests/map.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/map.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/map.manifest.js +3 -0
- package/dist/shared/bricks/manifests/social-links.manifest.d.ts +99 -0
- package/dist/shared/bricks/manifests/social-links.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/social-links.manifest.js +3 -0
- package/dist/shared/bricks/manifests/text.manifest.d.ts +97 -0
- package/dist/shared/bricks/manifests/text.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/text.manifest.js +3 -0
- package/dist/shared/bricks/manifests/video.manifest.d.ts +81 -0
- package/dist/shared/bricks/manifests/video.manifest.d.ts.map +1 -0
- package/dist/shared/bricks/manifests/video.manifest.js +3 -0
- package/dist/shared/bricks/props/common.d.ts +12 -0
- package/dist/shared/bricks/props/common.d.ts.map +1 -0
- package/dist/shared/bricks/props/common.js +3 -0
- package/dist/shared/bricks/props/style-props.d.ts +20 -0
- package/dist/shared/bricks/props/style-props.d.ts.map +1 -0
- package/dist/shared/bricks/props/style-props.js +3 -0
- package/dist/shared/bricks.d.ts +499 -119
- package/dist/shared/bricks.d.ts.map +1 -0
- package/dist/shared/bricks.js +3 -2
- package/dist/shared/chunk-2MYSBGXT.js +16 -0
- package/dist/shared/chunk-2OS3QYKE.js +20 -0
- package/dist/shared/chunk-4NZGINOT.js +3 -0
- package/dist/shared/chunk-BND2TMDC.js +13 -0
- package/dist/shared/chunk-CXABUYX7.js +3 -0
- package/dist/shared/chunk-EU3VNNEO.js +7 -0
- package/dist/shared/chunk-FNY3QNEQ.js +11 -0
- package/dist/shared/chunk-HIXVR4RL.js +3 -0
- package/dist/shared/chunk-J6I3OMQO.js +9 -0
- package/dist/shared/chunk-KGJQ6Z5A.js +32 -0
- package/dist/shared/chunk-NCF46HSZ.js +13 -0
- package/dist/shared/chunk-PXAK7ZJ3.js +3 -0
- package/dist/shared/chunk-QOPZIE3U.js +3 -0
- package/dist/shared/chunk-QXB632SL.js +15 -0
- package/dist/shared/chunk-SL7GGSYB.js +22 -0
- package/dist/shared/chunk-TVKRK6P4.js +14 -0
- package/dist/shared/chunk-VEXGLSUP.js +9 -0
- package/dist/shared/chunk-W4DP2HKI.js +3 -0
- package/dist/shared/chunk-W6X5NC5M.js +3 -0
- package/dist/shared/chunk-WF7I53QW.js +20 -0
- package/dist/shared/chunk-XBV2Q4OR.js +16 -0
- package/dist/shared/chunk-XGI243DO.js +3 -0
- package/dist/shared/chunk-XL6LPHCI.js +3 -0
- package/dist/shared/chunk-Z4S5CCLQ.js +16 -0
- package/dist/shared/datasources/external/facebook/posts/fetcher.d.ts +7 -16
- package/dist/shared/datasources/external/facebook/posts/fetcher.d.ts.map +1 -0
- package/dist/shared/datasources/external/facebook/posts/sample.d.ts +26 -0
- package/dist/shared/datasources/external/facebook/posts/sample.d.ts.map +1 -0
- package/dist/shared/datasources/external/facebook/posts/schema.d.ts +23 -26
- package/dist/shared/datasources/external/facebook/posts/schema.d.ts.map +1 -0
- package/dist/shared/datasources/external/facebook/posts/tests/fetcher.test.d.ts +2 -0
- package/dist/shared/datasources/external/facebook/posts/tests/fetcher.test.d.ts.map +1 -0
- package/dist/shared/datasources/external/instagram/feed/fetcher.d.ts +7 -16
- package/dist/shared/datasources/external/instagram/feed/fetcher.d.ts.map +1 -0
- package/dist/shared/datasources/external/instagram/feed/sample.d.ts +3 -0
- package/dist/shared/datasources/external/instagram/feed/sample.d.ts.map +1 -0
- package/dist/shared/datasources/external/instagram/feed/schema.d.ts +16 -19
- package/dist/shared/datasources/external/instagram/feed/schema.d.ts.map +1 -0
- package/dist/shared/datasources/external/instagram/feed/tests/fetcher.test.d.ts +2 -0
- package/dist/shared/datasources/external/instagram/feed/tests/fetcher.test.d.ts.map +1 -0
- package/dist/shared/datasources/external/json/fetcher.d.ts +4 -13
- package/dist/shared/datasources/external/json/fetcher.d.ts.map +1 -0
- package/dist/shared/datasources/external/json/options.d.ts +7 -10
- package/dist/shared/datasources/external/json/options.d.ts.map +1 -0
- package/dist/shared/datasources/external/json/tests/fetcher.test.d.ts +2 -0
- package/dist/shared/datasources/external/json/tests/fetcher.test.d.ts.map +1 -0
- package/dist/shared/datasources/external/mastodon/account/fetcher.d.ts +5 -14
- package/dist/shared/datasources/external/mastodon/account/fetcher.d.ts.map +1 -0
- package/dist/shared/datasources/external/mastodon/account/sample.d.ts +30 -0
- package/dist/shared/datasources/external/mastodon/account/sample.d.ts.map +1 -0
- package/dist/shared/datasources/external/mastodon/account/schema.d.ts +37 -40
- package/dist/shared/datasources/external/mastodon/account/schema.d.ts.map +1 -0
- package/dist/shared/datasources/external/mastodon/account/tests/fetcher.test.d.ts +2 -0
- package/dist/shared/datasources/external/mastodon/account/tests/fetcher.test.d.ts.map +1 -0
- package/dist/shared/datasources/external/mastodon/options.d.ts +6 -9
- package/dist/shared/datasources/external/mastodon/options.d.ts.map +1 -0
- package/dist/shared/datasources/external/mastodon/status/fetcher.d.ts +5 -14
- package/dist/shared/datasources/external/mastodon/status/fetcher.d.ts.map +1 -0
- package/dist/shared/datasources/external/mastodon/status/sample.array.d.ts +2 -3
- package/dist/shared/datasources/external/mastodon/status/sample.array.d.ts.map +1 -0
- package/dist/shared/datasources/external/mastodon/status/sample.single.d.ts +2 -3
- package/dist/shared/datasources/external/mastodon/status/sample.single.d.ts.map +1 -0
- package/dist/shared/datasources/external/mastodon/status/schema.d.ts +233 -235
- package/dist/shared/datasources/external/mastodon/status/schema.d.ts.map +1 -0
- package/dist/shared/datasources/external/mastodon/status/tests/fetcher.test.d.ts +2 -0
- package/dist/shared/datasources/external/mastodon/status/tests/fetcher.test.d.ts.map +1 -0
- package/dist/shared/datasources/external/meta/oauth/config.d.ts +28 -21
- package/dist/shared/datasources/external/meta/oauth/config.d.ts.map +1 -0
- package/dist/shared/datasources/external/meta/oauth/config.js +3 -1
- package/dist/shared/datasources/external/meta/options.d.ts +6 -9
- package/dist/shared/datasources/external/meta/options.d.ts.map +1 -0
- package/dist/shared/datasources/external/rss/fetcher.d.ts +5 -14
- package/dist/shared/datasources/external/rss/fetcher.d.ts.map +1 -0
- package/dist/shared/datasources/external/rss/options.d.ts +6 -9
- package/dist/shared/datasources/external/rss/options.d.ts.map +1 -0
- package/dist/shared/datasources/external/rss/sample.d.ts +3 -0
- package/dist/shared/datasources/external/rss/sample.d.ts.map +1 -0
- package/dist/shared/datasources/external/rss/schema.d.ts +14 -17
- package/dist/shared/datasources/external/rss/schema.d.ts.map +1 -0
- package/dist/shared/datasources/external/rss/tests/fetcher.test.d.ts +2 -0
- package/dist/shared/datasources/external/rss/tests/fetcher.test.d.ts.map +1 -0
- package/dist/shared/datasources/external/threads/media/fetcher.d.ts +7 -16
- package/dist/shared/datasources/external/threads/media/fetcher.d.ts.map +1 -0
- package/dist/shared/datasources/external/threads/media/sample.d.ts +40 -0
- package/dist/shared/datasources/external/threads/media/sample.d.ts.map +1 -0
- package/dist/shared/datasources/external/threads/media/schema.d.ts +22 -25
- package/dist/shared/datasources/external/threads/media/schema.d.ts.map +1 -0
- package/dist/shared/datasources/external/tiktok/oauth/config.d.ts +20 -22
- package/dist/shared/datasources/external/tiktok/oauth/config.d.ts.map +1 -0
- package/dist/shared/datasources/external/tiktok/oauth/config.js +3 -1
- package/dist/shared/datasources/external/tiktok/video/fetcher.d.ts +7 -16
- package/dist/shared/datasources/external/tiktok/video/fetcher.d.ts.map +1 -0
- package/dist/shared/datasources/external/tiktok/video/options.d.ts +6 -9
- package/dist/shared/datasources/external/tiktok/video/options.d.ts.map +1 -0
- package/dist/shared/datasources/external/tiktok/video/sample.d.ts +15 -0
- package/dist/shared/datasources/external/tiktok/video/sample.d.ts.map +1 -0
- package/dist/shared/datasources/external/tiktok/video/schema.d.ts +18 -21
- package/dist/shared/datasources/external/tiktok/video/schema.d.ts.map +1 -0
- package/dist/shared/datasources/external/youtube/list/fetcher.d.ts +7 -16
- package/dist/shared/datasources/external/youtube/list/fetcher.d.ts.map +1 -0
- package/dist/shared/datasources/external/youtube/list/options.d.ts +10 -13
- package/dist/shared/datasources/external/youtube/list/options.d.ts.map +1 -0
- package/dist/shared/datasources/external/youtube/list/sample.d.ts +38 -0
- package/dist/shared/datasources/external/youtube/list/sample.d.ts.map +1 -0
- package/dist/shared/datasources/external/youtube/list/schema.d.ts +32 -35
- package/dist/shared/datasources/external/youtube/list/schema.d.ts.map +1 -0
- package/dist/shared/datasources/external/youtube/oauth/config.d.ts +20 -22
- package/dist/shared/datasources/external/youtube/oauth/config.d.ts.map +1 -0
- package/dist/shared/datasources/external/youtube/oauth/config.js +3 -1
- package/dist/shared/datasources/fetcher.d.ts +9 -0
- package/dist/shared/datasources/fetcher.d.ts.map +1 -0
- package/dist/shared/datasources/internal/contact-info/schema.d.ts +12 -15
- package/dist/shared/datasources/internal/contact-info/schema.d.ts.map +1 -0
- package/dist/shared/datasources/internal/faq/schema.d.ts +8 -11
- package/dist/shared/datasources/internal/faq/schema.d.ts.map +1 -0
- package/dist/shared/datasources/internal/links/schema.d.ts +8 -11
- package/dist/shared/datasources/internal/links/schema.d.ts.map +1 -0
- package/dist/shared/datasources/provider-options.d.ts +6 -0
- package/dist/shared/datasources/provider-options.d.ts.map +1 -0
- package/dist/shared/datasources/samples.d.ts +4 -13
- package/dist/shared/datasources/samples.d.ts.map +1 -0
- package/dist/shared/datasources/types.d.ts +100 -9
- package/dist/shared/datasources/types.d.ts.map +1 -0
- package/dist/shared/datasources/utils.d.ts +2 -3
- package/dist/shared/datasources/utils.d.ts.map +1 -0
- package/dist/shared/datasources.d.ts +4 -9
- package/dist/shared/datasources.d.ts.map +1 -0
- package/dist/shared/datasources.js +3 -2
- package/dist/shared/env.d.ts +3 -5
- package/dist/shared/env.d.ts.map +1 -0
- package/dist/shared/env.js +2 -1
- package/dist/shared/errors.d.ts +2 -1
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +2 -1
- package/dist/shared/index.d.ts +2 -2
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/layout-constants.d.ts +4 -5
- package/dist/shared/layout-constants.d.ts.map +1 -0
- package/dist/shared/layout-constants.js +3 -2
- package/dist/shared/manifest.d.ts +13 -34
- package/dist/shared/manifest.d.ts.map +1 -0
- package/dist/shared/metafile-esm.json +1 -1
- package/dist/shared/oauth.d.ts +10 -0
- package/dist/shared/oauth.d.ts.map +1 -0
- package/dist/shared/page.d.ts +921 -9
- package/dist/shared/page.d.ts.map +1 -0
- package/dist/shared/page.js +3 -2
- package/dist/shared/responsive.d.ts +4 -6
- package/dist/shared/responsive.d.ts.map +1 -0
- package/dist/shared/responsive.js +2 -1
- package/dist/shared/social-icons.d.ts +2 -3
- package/dist/shared/social-icons.d.ts.map +1 -0
- package/dist/shared/tests/attributes.test.d.ts +2 -0
- package/dist/shared/tests/attributes.test.d.ts.map +1 -0
- package/dist/shared/theme.d.ts +50 -33
- package/dist/shared/theme.d.ts.map +1 -0
- package/dist/shared/theme.js +3 -2
- package/dist/shared/themes/all-themes.d.ts +3 -6
- package/dist/shared/themes/all-themes.d.ts.map +1 -0
- package/dist/shared/themes/all-themes.js +2 -1
- package/dist/shared/themes/color-system.d.ts +24 -27
- package/dist/shared/themes/color-system.d.ts.map +1 -0
- package/dist/shared/themes/color-system.js +2 -1
- package/dist/shared/utils/invariant.d.ts +2 -3
- package/dist/shared/utils/invariant.d.ts.map +1 -0
- package/dist/shared/utils/invariant.js +3 -2
- package/package.json +5 -14
- package/custom-attrs.d.ts +0 -63
- package/dist/shared/ajv.js +0 -2
- package/dist/shared/datarecords/types.d.ts +0 -32
- package/dist/shared/datarecords/types.js +0 -2
- package/dist/shared/datasources/external/facebook/posts/fetcher.js +0 -2
- package/dist/shared/datasources/external/facebook/posts/schema.js +0 -2
- package/dist/shared/datasources/external/instagram/feed/fetcher.js +0 -2
- package/dist/shared/datasources/external/instagram/feed/schema.js +0 -2
- package/dist/shared/datasources/external/json/fetcher.js +0 -2
- package/dist/shared/datasources/external/json/options.js +0 -2
- package/dist/shared/datasources/external/mastodon/account/fetcher.js +0 -2
- package/dist/shared/datasources/external/mastodon/account/schema.js +0 -2
- package/dist/shared/datasources/external/mastodon/options.js +0 -2
- package/dist/shared/datasources/external/mastodon/status/fetcher.js +0 -2
- package/dist/shared/datasources/external/mastodon/status/sample.array.js +0 -2
- package/dist/shared/datasources/external/mastodon/status/sample.single.js +0 -2
- package/dist/shared/datasources/external/mastodon/status/schema.js +0 -2
- package/dist/shared/datasources/external/meta/options.js +0 -2
- package/dist/shared/datasources/external/rss/fetcher.js +0 -2
- package/dist/shared/datasources/external/rss/options.js +0 -2
- package/dist/shared/datasources/external/rss/schema.js +0 -2
- package/dist/shared/datasources/external/threads/media/fetcher.js +0 -2
- package/dist/shared/datasources/external/threads/media/schema.js +0 -2
- package/dist/shared/datasources/external/tiktok/video/fetcher.js +0 -2
- package/dist/shared/datasources/external/tiktok/video/options.js +0 -2
- package/dist/shared/datasources/external/tiktok/video/schema.js +0 -2
- package/dist/shared/datasources/external/youtube/list/fetcher.js +0 -2
- package/dist/shared/datasources/external/youtube/list/options.js +0 -2
- package/dist/shared/datasources/external/youtube/list/schema.js +0 -2
- package/dist/shared/datasources/internal/contact-info/schema.js +0 -2
- package/dist/shared/datasources/internal/faq/schema.js +0 -2
- package/dist/shared/datasources/internal/links/schema.js +0 -2
- package/dist/shared/datasources/samples.js +0 -2
- package/dist/shared/datasources/types.js +0 -2
- package/dist/shared/datasources/utils.js +0 -2
- package/dist/shared/datasources-97V9CclE.d.ts +0 -316
- package/dist/shared/index.js +0 -2
- package/dist/shared/manifest.js +0 -2
- package/dist/shared/social-icons.js +0 -2
- package/dist/shared/template-config.d.ts +0 -9
- package/dist/shared/template-config.js +0 -1
- package/dist/shared/utils/layout-utils.d.ts +0 -24
- package/dist/shared/utils/layout-utils.js +0 -2
- package/env.d.ts +0 -24
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* parse-gitignore <https://github.com/jonschlinkert/parse-gitignore>
|
|
3
|
+
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*
|
|
6
|
+
* Converted to typescript by Matthias E. <matthias@enpage.co>
|
|
7
|
+
*/
|
|
8
|
+
interface ParseOptions {
|
|
9
|
+
path?: string;
|
|
10
|
+
dedupe?: boolean;
|
|
11
|
+
unique?: boolean;
|
|
12
|
+
ignore?: string[];
|
|
13
|
+
unignore?: string[];
|
|
14
|
+
format?: boolean;
|
|
15
|
+
formatSection?: (section: Section) => string;
|
|
16
|
+
}
|
|
17
|
+
interface Section {
|
|
18
|
+
name: string;
|
|
19
|
+
comment?: string;
|
|
20
|
+
patterns: string[];
|
|
21
|
+
}
|
|
22
|
+
interface ParsedGitignore {
|
|
23
|
+
sections: Section[];
|
|
24
|
+
patterns: string[];
|
|
25
|
+
path?: string;
|
|
26
|
+
input: Buffer;
|
|
27
|
+
format: (opts?: ParseOptions) => string;
|
|
28
|
+
dedupe: (opts?: ParseOptions) => ParsedGitignore;
|
|
29
|
+
globs: (opts?: ParseOptions) => GlobResult[];
|
|
30
|
+
}
|
|
31
|
+
interface GlobResult {
|
|
32
|
+
type: "ignore" | "unignore";
|
|
33
|
+
path: string | null;
|
|
34
|
+
patterns: string[];
|
|
35
|
+
index: number;
|
|
36
|
+
}
|
|
37
|
+
declare const patterns: (input: string) => string[];
|
|
38
|
+
declare const parse: (input: string | ParsedGitignore, options?: ParseOptions) => ParsedGitignore;
|
|
39
|
+
declare const parseFile: (filepath: string, options?: ParseOptions) => ParsedGitignore;
|
|
40
|
+
declare const dedupe: (input: string | ParsedGitignore, options: ParseOptions) => ParsedGitignore;
|
|
41
|
+
declare const globs: (input: string | ParsedGitignore, options?: ParseOptions) => GlobResult[];
|
|
42
|
+
/**
|
|
43
|
+
* Formats a .gitignore section
|
|
44
|
+
*/
|
|
45
|
+
declare const formatSection: (section?: Section) => string;
|
|
46
|
+
/**
|
|
47
|
+
* Format a .gitignore file from the given input or object from `.parse()`.
|
|
48
|
+
* @param {String | ParsedGitignore} input File path or contents.
|
|
49
|
+
* @param {ParseOptions} options
|
|
50
|
+
* @return {String} Returns formatted string.
|
|
51
|
+
* @api public
|
|
52
|
+
*/
|
|
53
|
+
declare const format: (input: string | ParsedGitignore, options?: ParseOptions) => string;
|
|
54
|
+
export { parse, parseFile, dedupe, format, globs, formatSection, patterns, type ParseOptions, type Section, type ParsedGitignore, type GlobResult, };
|
|
55
|
+
export default parse;
|
|
56
|
+
//# sourceMappingURL=parse-gitignore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-gitignore.d.ts","sourceRoot":"","sources":["../../../../../src/node/cli/commands/publish/parse-gitignore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;CAC9C;AAED,UAAU,OAAO;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,UAAU,eAAe;IACvB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,eAAe,CAAC;IACjD,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,YAAY,KAAK,UAAU,EAAE,CAAC;CAC9C;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAaD,QAAA,MAAM,QAAQ,UAAW,MAAM,KAAG,MAAM,EAGc,CAAC;AAEvD,QAAA,MAAM,KAAK,UAAW,MAAM,GAAG,eAAe,YAAW,YAAY,KAAQ,eAuD5E,CAAC;AAEF,QAAA,MAAM,SAAS,aAAc,MAAM,YAAY,YAAY,KAAG,eACX,CAAC;AAEpD,QAAA,MAAM,MAAM,UAAW,MAAM,GAAG,eAAe,WAAW,YAAY,KAAG,eAkCxE,CAAC;AA2BF,QAAA,MAAM,KAAK,UAAW,MAAM,GAAG,eAAe,YAAW,YAAY,KAAQ,UAAU,EAyCtF,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,aAAa,aAAa,OAAO,KAAgC,MAStE,CAAC;AAEF;;;;;;GAMG;AACH,QAAA,MAAM,MAAM,UAAW,MAAM,GAAG,eAAe,YAAW,YAAY,KAAQ,MAY7E,CAAC;AAEF,OAAO,EACL,KAAK,EACL,SAAS,EACT,MAAM,EACN,MAAM,EACN,KAAK,EACL,aAAa,EACb,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
|
|
2
|
+
|
|
2
3
|
import*as p from"node:fs";var h=/[<>"|?*\n\r\t\f\x00-\x1F]/,P=/(?:^|\/)[*]{2}($|\/)/,G=248,S=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),y=t=>typeof t=="string"&&t.length<=G&&!h.test(t),d=t=>t.split(/\r\n?|\n/),b=t=>t.startsWith("#"),O=t=>S(t)&&Array.isArray(t.patterns)&&Array.isArray(t.sections),$=t=>d(t).map(e=>e.trim()).filter(e=>e!==""&&!b(e)),u=(t,e={})=>{let l=e.path;if(O(t))return t;y(t)&&p.existsSync(t)&&(l=t,t=p.readFileSync(t,"utf8"));let c=d(t),a=new Map,n={sections:[],patterns:[]},o={name:"default",patterns:[]},s=null;for(let r of c){let i=r.trim();if(i.startsWith("#")){let[,g]=/^#+\s*(.*)\s*$/.exec(i)||[];if(s){a.delete(s.name),s.comment=s.comment?`${s.comment}
|
|
3
4
|
${i}`:i,s.name=g?`${s.name.trim()}
|
|
4
5
|
${g.trim()}`:s.name.trim(),a.set(s.name.toLowerCase().trim(),s);continue}o={name:g?.trim()||"",comment:i,patterns:[]},a.set(o.name.toLowerCase(),o),n.sections.push(o),s=o;continue}i!==""&&(o.patterns.push(i),n.patterns.push(i)),s=null}return(e.dedupe===!0||e.unique===!0)&&(n=m(n,{...e,format:!1})),n.path=l,n.input=Buffer.from(t),n.format=r=>x(n,{...e,...r}),n.dedupe=r=>m(n,{...e,...r}),n.globs=r=>A(n,{path:l,...e,...r}),n},k=(t,e)=>u(p.readFileSync(t,"utf8"),e),m=(t,e)=>{let l=u(t,{...e,dedupe:!1}),c=new Map,a={sections:[],patterns:[]},n;for(let o of l.sections){let{name:s="",comment:r,patterns:i}=o,g=s.trim().toLowerCase();for(let f of i)a.patterns.includes(f)||a.patterns.push(f);s&&c.has(g)?(n=c.get(g),n.patterns=[...n.patterns,...i]):(n={name:s,comment:r,patterns:i},a.sections.push(n),c.set(g,n))}for(let o of a.sections)o.patterns=[...new Set(o.patterns)];return a},w=t=>{if(P.test(t))return t;let e=!1;return t.startsWith("/")?(t=t.slice(1),e=!0):t.slice(1,t.length-1).includes("/")&&(e=!0),t+=t.endsWith("/")?"**/":"/**",e?t:`**/${t}`},A=(t,e={})=>{let l=u(t,e),c=[],a=0,n=l.patterns.concat(e.ignore||[]).concat((e.unignore||[]).map(s=>s.startsWith("!")?s:`!${s}`)),o=(s,r)=>{let i=c[c.length-1],g=s?"unignore":"ignore";i&&i.type===g?i.patterns.includes(r)||i.patterns.push(r):(c.push({type:g,path:e.path||null,patterns:[r],index:a}),a++)};for(let s of n){let r="";s.startsWith("!")&&(s=s.slice(1),r="!"),o(r,s.startsWith("/")?s.slice(1):s),o(r,w(s))}return c},R=(t={name:"",patterns:[]})=>{let e=[t.comment||""];return t.patterns?.length&&(e.push(t.patterns.join(`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface UploadStats {
|
|
2
|
+
fileName: string;
|
|
3
|
+
fileSize: number;
|
|
4
|
+
uploadDuration: number;
|
|
5
|
+
statusCode: number;
|
|
6
|
+
serverResponse: string;
|
|
7
|
+
}
|
|
8
|
+
interface UploadConfig {
|
|
9
|
+
maxDataSize: number;
|
|
10
|
+
retryAttempts: number;
|
|
11
|
+
retryDelay: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function uploadTemplate(templateId: string, templateDir: string, token: string, dryRun?: boolean, config?: Partial<UploadConfig>): Promise<{
|
|
14
|
+
filesCount: number;
|
|
15
|
+
uploadedFiles: UploadStats[];
|
|
16
|
+
failedFiles: PromiseRejectedResult[];
|
|
17
|
+
success: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=uploader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../../../../src/node/cli/commands/publish/uploader.ts"],"names":[],"mappings":"AAkBA,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CACxB;AAaD,UAAU,YAAY;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAsLD,wBAAsB,cAAc,CAClC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,UAAQ,EACd,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM;;;;;GAoFnC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
|
|
2
|
+
|
|
3
|
+
import L from"node:path";import U from"node:fs";import ge from"node:crypto";import me from"fast-glob";var N="enpage-cli";var Oe=process.env.PUBLIC_ENPAGE_OAUTH_CLIENT_ID??"50000000-0000-0000-0000-000000000001",y=process.env.PUBLIC_ENPAGE_API_BASE_URL??"https://api.enpage.co",Ae=process.env.PUBLIC_ENPAGE_FRONTEND_BASE_URL??"https://enpage.co",I=10;import B from"node:http";import fe from"node:https";import{pipeline as ye}from"node:stream";import{createLogger as q}from"vite";var D="0.0.68";import _ from"chalk";function H(e,t,n=!1){let i=q(e==="debug"?"info":e,{prefix:"[enpage]",allowClearScreen:t});return n&&i.info(_.hex("#7270c6").bold(`\u{1F680} Enpage v${D}
|
|
4
|
+
`)),{...i,success:(r,s)=>i.info(_.green(r),s),error:(r,s)=>i.error(_.red(r),s),warn:(r,s)=>i.warn(_.yellow(r),s),warnOnce:(r,s)=>i.warnOnce(_.yellow(r),s),debug:(r,s)=>{e==="debug"&&i.info(_.gray(r),s)}}}var g=H();import z from"chalk";import he from"form-data";import*as C from"node:fs";var X=/[<>"|?*\n\r\t\f\x00-\x1F]/,J=/(?:^|\/)[*]{2}($|\/)/,V=248,K=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Y=e=>typeof e=="string"&&e.length<=V&&!X.test(e),Q=e=>e.split(/\r\n?|\n/);var Z=e=>K(e)&&Array.isArray(e.patterns)&&Array.isArray(e.sections);var $=(e,t={})=>{let n=t.path;if(Z(e))return e;Y(e)&&C.existsSync(e)&&(n=e,e=C.readFileSync(e,"utf8"));let i=Q(e),r=new Map,s={sections:[],patterns:[]},c={name:"default",patterns:[]},o=null;for(let a of i){let p=a.trim();if(p.startsWith("#")){let[,u]=/^#+\s*(.*)\s*$/.exec(p)||[];if(o){r.delete(o.name),o.comment=o.comment?`${o.comment}
|
|
4
5
|
${p}`:p,o.name=u?`${o.name.trim()}
|
|
5
|
-
${u.trim()}`:o.name.trim(),r.set(o.name.toLowerCase().trim(),o);continue}c={name:u?.trim()||"",comment:p,patterns:[]},r.set(c.name.toLowerCase(),c),s.sections.push(c),o=c;continue}p!==""&&(c.patterns.push(p),s.patterns.push(p)),o=null}return(t.dedupe===!0||t.unique===!0)&&(s=G(s,{...t,format:!1})),s.path=n,s.input=Buffer.from(e),s.format=a=>se(s,{...t,...a}),s.dedupe=a=>G(s,{...t,...a}),s.globs=a=>te(s,{path:n,...t,...a}),s};var G=(e,t)=>{let n
|
|
6
|
+
${u.trim()}`:o.name.trim(),r.set(o.name.toLowerCase().trim(),o);continue}c={name:u?.trim()||"",comment:p,patterns:[]},r.set(c.name.toLowerCase(),c),s.sections.push(c),o=c;continue}p!==""&&(c.patterns.push(p),s.patterns.push(p)),o=null}return(t.dedupe===!0||t.unique===!0)&&(s=G(s,{...t,format:!1})),s.path=n,s.input=Buffer.from(e),s.format=a=>se(s,{...t,...a}),s.dedupe=a=>G(s,{...t,...a}),s.globs=a=>te(s,{path:n,...t,...a}),s};var G=(e,t)=>{let n=$(e,{...t,dedupe:!1}),i=new Map,r={sections:[],patterns:[]},s;for(let c of n.sections){let{name:o="",comment:a,patterns:p}=c,u=o.trim().toLowerCase();for(let h of p)r.patterns.includes(h)||r.patterns.push(h);o&&i.has(u)?(s=i.get(u),s.patterns=[...s.patterns,...p]):(s={name:o,comment:a,patterns:p},r.sections.push(s),i.set(u,s))}for(let c of r.sections)c.patterns=[...new Set(c.patterns)];return r},ee=e=>{if(J.test(e))return e;let t=!1;return e.startsWith("/")?(e=e.slice(1),t=!0):e.slice(1,e.length-1).includes("/")&&(t=!0),e+=e.endsWith("/")?"**/":"/**",t?e:`**/${e}`},te=(e,t={})=>{let n=$(e,t),i=[],r=0,s=n.patterns.concat(t.ignore||[]).concat((t.unignore||[]).map(o=>o.startsWith("!")?o:`!${o}`)),c=(o,a)=>{let p=i[i.length-1],u=o?"unignore":"ignore";p&&p.type===u?p.patterns.includes(a)||p.patterns.push(a):(i.push({type:u,path:t.path||null,patterns:[a],index:r}),r++)};for(let o of s){let a="";o.startsWith("!")&&(o=o.slice(1),a="!"),c(a,o.startsWith("/")?o.slice(1):o),c(a,ee(o))}return i},re=(e={name:"",patterns:[]})=>{let t=[e.comment||""];return e.patterns?.length&&(t.push(e.patterns.join(`
|
|
6
7
|
`)),t.push("")),t.join(`
|
|
7
|
-
`)},se=(e,t={})=>{let n
|
|
8
|
-
`)};var j
|
|
9
|
-
`))}async function mt(e,t,n,i=!1,r={}){let s={..._e,...r},c=new Se({concurrency:I}),o=await we(t),a=o.length,p={},u=
|
|
10
|
-
`),g.info("The following files would have been uploaded:"),o.forEach(d=>g.info(`- ${d}`)),process.exit(0));let S=Ee(`Uploading ${a} files...`).start(),
|
|
8
|
+
`)},se=(e,t={})=>{let n=$(e,t),i=t.formatSection||re,r=n.sections||n,s=[];for(let c of[].concat(r))s.push(i(c));return s.join(`
|
|
9
|
+
`)};var j=$;import Se from"p-queue";import Ee from"ora";import{customAlphabet as Pe}from"nanoid";import oe from"conf";import b from"node:path";import ne from"node:crypto";import T from"node:fs";import{fileURLToPath as ie}from"node:url";import He from"chalk";var ae=ie(new URL(".",import.meta.url)),ce=le(),k=new oe({projectName:N,encryptionKey:ce,clearInvalidConfig:!0});function pe(){let e=ae;for(;e!==b.parse(e).root;){let t=b.join(e,"node_modules");if(T.existsSync(t))return t;e=b.dirname(e)}return null}function le(){let e=pe();if(!e)throw new Error("Could not find nearest node_modules directory.");let t=b.join(e,".enpage-tmp");T.existsSync(t)||T.mkdirSync(t,{recursive:!0,mode:448});let n=b.join(t,".enpage-key");if(!T.existsSync(n)){let r=ne.randomBytes(32).toString("hex");return T.writeFileSync(n,r,{mode:384,flush:!0}),r}return T.readFileSync(n,"utf8")}async function F(e,t,n={}){k.get("access_token")&&(n.Authorization=`Bearer ${k.get("access_token")}`);let i=await fetch(ue(e),{method:"POST",headers:{"Content-Type":t instanceof URLSearchParams?"application/x-www-form-urlencoded":"application/json",...n},body:t instanceof URLSearchParams?t:JSON.stringify(t)}).catch(r=>{g.error(`Fatal Error requesting API: ${r.message} (${r.cause.code})`),g.error("Please check your internet connection and try again, or retry later."),process.exit(1)});return de(i)}function ue(e){let t=new URL(y.endsWith("/")?y:`${y}/`);return new URL(e,t)}async function de(e){let t=e.headers.get("content-type")?.startsWith("application/json")?await e.json():await e.text();return e.ok?{isSuccess:!0,isError:!1,status:e.status,statusText:e.statusText,data:t}:{isSuccess:!1,isError:!0,status:e.status,statusText:e.statusText,data:t}}var w=class extends Error{constructor(n,i,r){super(`${n}: ${i}`);this.error=n;this.error_description=i;this.filename=r;this.name="UploadError"}},_e={maxDataSize:12*1024*1024,retryAttempts:2,retryDelay:1e3},Te=new B.Agent({keepAlive:!0,maxSockets:10,keepAliveMsecs:3e3});async function we(e){let t=L.join(e,".gitignore"),i=U.existsSync(t)?j(U.readFileSync(t,"utf-8")).patterns:[];return me("**/*",{cwd:e,onlyFiles:!0,dot:!0,absolute:!0,ignore:["node_modules/**",".cache/**","**/.DS_Store",".gitignore",".env",".env.*",".git/**","dist/**",...i]})}async function Re(e,t,n,i,r,s,c){let o=async a=>{try{return await xe(e,t,n,i,r,s,c)}catch(p){if(a<c.retryAttempts)return g.warn(`Retrying upload for ${t} (attempt ${a+1})`),await new Promise(u=>setTimeout(u,c.retryDelay)),o(a+1);throw p}};return o(0)}async function xe(e,t,n,i,r,s,c){return new Promise((o,a)=>{let p=U.statSync(e),u=L.basename(e),h=Date.now(),S=new he({maxDataSize:c.maxDataSize}),O=U.createReadStream(e),A=0,E=l=>{A+=l.length};O.on("data",E),S.append("file",O,{filename:u,knownLength:p.size});let P={agent:Te,method:"POST",headers:{authorization:`Bearer ${s}`,"x-enpage-template-file-path":t,"x-enpage-template-id":i,...S.getHeaders()}},f=(n.startsWith("https")?fe:B).request(n,P,l=>{let m="";l.on("data",R=>{m+=R}),l.on("end",()=>{let R=Date.now(),W={fileName:u,fileSize:p.size,uploadDuration:R-h,statusCode:l.statusCode??0,serverResponse:m};if(l.statusCode&&l.statusCode>=200&&l.statusCode<300)r.text=`Uploaded ${t}`,o(W);else{let x;if(l.headers["content-type"]?.startsWith("application/json")){let v=JSON.parse(m);x=new w(v.error||"unknown_error",v.error_description||"Unknown error occurred",t)}else x=new w("unknown_error",m||"Unknown error occurred",t);r.fail(`Failed to upload ${t} [${x.error}] ${x.error_description}`),a(x)}})});f.on("error",l=>{a(new w("request_error",l.message,t))}),ye(S,f,l=>{l&&a(new w("pipeline_error",`Pipeline failed for ${u}: ${l.message}`,t))})})}function be(e,t,n){n.length>0?(g.error(z.red(`Failed to upload ${n.length} files:`)),n.forEach(i=>{let r=i.reason;g.error(`- ${r.filename}: ${r.error_description} (${r.error})`)})):g.info(z.green(`Uploaded ${t.length} files successfully for template ${e}.
|
|
10
|
+
`))}async function mt(e,t,n,i=!1,r={}){let s={..._e,...r},c=new Se({concurrency:I}),o=await we(t),a=o.length,p={},u=Ue(),h=0;for(let d of o){let f=L.relative(t,d),l=await Le(d);p[f]=l}i&&(g.info(`Dry run mode enabled. Skipping upload.
|
|
11
|
+
`),g.info("The following files would have been uploaded:"),o.forEach(d=>g.info(`- ${d}`)),process.exit(0));let S=Ee(`Uploading ${a} files...`).start(),O=o.map(d=>{let f=L.resolve(t,d),l=L.relative(t,d),m=`${y}/v1/templates/${e}/upload/${u}`;return c.add(async()=>{let R=await Re(f,l,m,e,S,n,s);return h++,R})}),A=await Promise.allSettled(O);S.stop();let E=A.filter(d=>d.status==="fulfilled"),P=A.filter(d=>d.status==="rejected");if(be(e,E.map(d=>d.value),P),!P.length&&E.length){let d=`${y}/v1/templates/${e}/upload/${u}/finalize`,l=await F(d,{signatures:p});if(l.isError)return g.error(`Failed to finalize upload: ${l.data.error_description} (${l.data.error})`),{filesCount:a,uploadedFiles:E.map(m=>m.value),failedFiles:[],success:!1}}return{filesCount:a,uploadedFiles:E.map(d=>d.value),failedFiles:P,success:P.length===0}}async function Le(e){let t=await ge.subtle.digest("SHA-1",U.readFileSync(e));return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}function Ue(){let e=Pe("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",5),t=new Date,n=t.getUTCFullYear(),i=(t.getUTCMonth()+1).toString().padStart(2,"0"),r=t.getUTCDate().toString().padStart(2,"0"),s=t.getUTCHours().toString().padStart(2,"0"),c=t.getUTCMinutes().toString().padStart(2,"0"),o=t.getUTCSeconds().toString().padStart(2,"0");return`${n}${i}${r}${s}${c}${o}_${e()}`}export{mt as uploadTemplate};
|
|
11
12
|
/*!
|
|
12
13
|
* parse-gitignore <https://github.com/jonschlinkert/parse-gitignore>
|
|
13
14
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const CLI_PROJECT_NAME = "enpage-cli";
|
|
2
|
+
export declare const CLI_LOGIN_POLL_INTERVAL = 5000;
|
|
3
|
+
export declare const CLI_LOGIN_CLIENT_ID: string;
|
|
4
|
+
export declare const API_BASE_URL: string;
|
|
5
|
+
export declare const FRONTEND_BASE_URL: string;
|
|
6
|
+
export declare const DEFAULT_UPLOAD_MAX_CONCURRENCY = 10;
|
|
7
|
+
export declare const OAUTH_ENDPOINT_DEVICE_CODE = "oauth/devicecode";
|
|
8
|
+
export declare const OAUTH_ENDPOINT_TOKEN = "oauth/token";
|
|
9
|
+
export declare const OAUTH_ENDPOINT_USER_INFO = "oauth/userinfo";
|
|
10
|
+
export declare const API_ENDPOINT_REGISTER_TEMPLATE = "v1/templates";
|
|
11
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/node/cli/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAC5C,eAAO,MAAM,mBAAmB,QACqD,CAAC;AACtF,eAAO,MAAM,YAAY,QAAoE,CAAC;AAC9F,eAAO,MAAM,iBAAiB,QAAqE,CAAC;AACpG,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAC7D,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAClD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AAEzD,eAAO,MAAM,8BAA8B,iBAAiB,CAAC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
|
|
2
|
+
|
|
2
3
|
var _="enpage-cli",E=5e3,o=process.env.PUBLIC_ENPAGE_OAUTH_CLIENT_ID??"50000000-0000-0000-0000-000000000001",t=process.env.PUBLIC_ENPAGE_API_BASE_URL??"https://api.enpage.co",e=process.env.PUBLIC_ENPAGE_FRONTEND_BASE_URL??"https://enpage.co",N=10,I="oauth/devicecode",p="oauth/token",s="oauth/userinfo",A="v1/templates";export{t as API_BASE_URL,A as API_ENDPOINT_REGISTER_TEMPLATE,o as CLI_LOGIN_CLIENT_ID,E as CLI_LOGIN_POLL_INTERVAL,_ as CLI_PROJECT_NAME,N as DEFAULT_UPLOAD_MAX_CONCURRENCY,e as FRONTEND_BASE_URL,I as OAUTH_ENDPOINT_DEVICE_CODE,p as OAUTH_ENDPOINT_TOKEN,s as OAUTH_ENDPOINT_USER_INFO};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-logged-in.d.ts","sourceRoot":"","sources":["../../../src/node/cli/is-logged-in.ts"],"names":[],"mappings":"AAGA,wBAAsB,UAAU,CAAC,WAAW,UAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAwBtE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/enpage/enpage/blob/main/LICENSE */
|
|
2
|
+
|
|
3
|
+
var O=Object.defineProperty;var p=(e,t)=>()=>(e&&(t=e(e=0)),t);var S=(e,t)=>{for(var s in t)O(e,s,{get:t[s],enumerable:!0})};var y,F,g,M,f,m=p(()=>{"use strict";y="enpage-cli",F=process.env.PUBLIC_ENPAGE_OAUTH_CLIENT_ID??"50000000-0000-0000-0000-000000000001",g=process.env.PUBLIC_ENPAGE_API_BASE_URL??"https://api.enpage.co",M=process.env.PUBLIC_ENPAGE_FRONTEND_BASE_URL??"https://enpage.co",f="oauth/userinfo"});import N from"conf";import u from"node:path";import P from"node:crypto";import a from"node:fs";import{fileURLToPath as k}from"node:url";import X from"chalk";function I(){let e=v;for(;e!==u.parse(e).root;){let t=u.join(e,"node_modules");if(a.existsSync(t))return t;e=u.dirname(e)}return null}function b(){let e=I();if(!e)throw new Error("Could not find nearest node_modules directory.");let t=u.join(e,".enpage-tmp");a.existsSync(t)||a.mkdirSync(t,{recursive:!0,mode:448});let s=u.join(t,".enpage-key");if(!a.existsSync(s)){let r=P.randomBytes(32).toString("hex");return a.writeFileSync(s,r,{mode:384,flush:!0}),r}return a.readFileSync(s,"utf8")}var v,w,i,l=p(()=>{"use strict";m();v=k(new URL(".",import.meta.url)),w=b(),i=new N({projectName:y,encryptionKey:w,clearInvalidConfig:!0})});var h,E=p(()=>{h="0.0.68"});import{createLogger as U}from"vite";import c from"chalk";function C(e,t,s=!1){let o=U(e==="debug"?"info":e,{prefix:"[enpage]",allowClearScreen:t});return s&&o.info(c.hex("#7270c6").bold(`\u{1F680} Enpage v${h}
|
|
4
|
+
`)),{...o,success:(r,n)=>o.info(c.green(r),n),error:(r,n)=>o.error(c.red(r),n),warn:(r,n)=>o.warn(c.yellow(r),n),warnOnce:(r,n)=>o.warnOnce(c.yellow(r),n),debug:(r,n)=>{e==="debug"&&o.info(c.gray(r),n)}}}var d,_=p(()=>{"use strict";E();d=C()});var x={};S(x,{get:()=>j,post:()=>D});async function D(e,t,s={}){i.get("access_token")&&(s.Authorization=`Bearer ${i.get("access_token")}`);let o=await fetch(T(e),{method:"POST",headers:{"Content-Type":t instanceof URLSearchParams?"application/x-www-form-urlencoded":"application/json",...s},body:t instanceof URLSearchParams?t:JSON.stringify(t)}).catch(r=>{d.error(`Fatal Error requesting API: ${r.message} (${r.cause.code})`),d.error("Please check your internet connection and try again, or retry later."),process.exit(1)});return L(o)}async function j(e,t={}){i.get("access_token")&&(t.Authorization=`Bearer ${i.get("access_token")}`);let s=await fetch(T(e),{headers:t,method:"GET"}).catch(o=>{d.error(`Fatal Error requesting API: ${o.message} (${o.cause.code})`),d.error("Please check your internet connection and try again, or retry later."),process.exit(1)});return L(s)}function T(e){let t=new URL(g.endsWith("/")?g:`${g}/`);return new URL(e,t)}async function L(e){let t=e.headers.get("content-type")?.startsWith("application/json")?await e.json():await e.text();return e.ok?{isSuccess:!0,isError:!1,status:e.status,statusText:e.statusText,data:t}:{isSuccess:!1,isError:!0,status:e.status,statusText:e.statusText,data:t}}var R=p(()=>{"use strict";_();m();l()});m();l();async function ce(e=!1){let t=i.get("access_token"),s=i.get("expires_at");if(!t)return!1;if(s&&s<Date.now())return console.log("Seems like your token expired..."),!1;if(!e)return!0;let{get:o}=await Promise.resolve().then(()=>(R(),x)),{isSuccess:r}=await o(f);return r}export{ce as isLoggedIn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../../src/node/cli/program.ts"],"names":[],"mappings":""}
|