step-definitions.js 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. (function attachStepDefinitions(root, factory) {
  2. root.MultiPageStepDefinitions = factory();
  3. })(typeof self !== 'undefined' ? self : globalThis, function createStepDefinitionsModule() {
  4. const STEP_DEFINITIONS = [
  5. { id: 1, order: 10, key: 'open-chatgpt', title: '打开 ChatGPT 官网' },
  6. { id: 2, order: 20, key: 'submit-signup-email', title: '注册并输入邮箱' },
  7. { id: 3, order: 30, key: 'fill-password', title: '填写密码并继续' },
  8. { id: 4, order: 40, key: 'fetch-signup-code', title: '获取注册验证码' },
  9. { id: 5, order: 50, key: 'fill-profile', title: '填写姓名和生日' },
  10. { id: 6, order: 60, key: 'get-plus-link', title: '获取 Plus 订阅链接' },
  11. { id: 7, order: 70, key: 'fill-stripe-checkout', title: '填写 Stripe 结账表单' },
  12. { id: 8, order: 80, key: 'fill-paypal-login', title: '填写 PayPal 登录邮箱' },
  13. { id: 9, order: 90, key: 'fill-paypal-payment', title: '填写 PayPal 付款信息' },
  14. { id: 10, order: 100, key: 'sync-cpa-session', title: '同步 CPA 会话' },
  15. ];
  16. function getSteps() {
  17. return STEP_DEFINITIONS.map((step) => ({ ...step }));
  18. }
  19. function getStepById(id) {
  20. const numericId = Number(id);
  21. const match = STEP_DEFINITIONS.find((step) => step.id === numericId);
  22. return match ? { ...match } : null;
  23. }
  24. return {
  25. STEP_DEFINITIONS,
  26. getStepById,
  27. getSteps,
  28. };
  29. });