step-definitions.js 1.3 KB

12345678910111213141516171819202122232425262728293031
  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: 'oauth-login', title: '刷新 OAuth 并登录' },
  11. { id: 7, order: 70, key: 'fetch-login-code', title: '获取登录验证码' },
  12. { id: 8, order: 80, key: 'confirm-oauth', title: '自动确认 OAuth' },
  13. { id: 9, order: 90, key: 'platform-verify', title: '平台回调验证' },
  14. ];
  15. function getSteps() {
  16. return STEP_DEFINITIONS.map((step) => ({ ...step }));
  17. }
  18. function getStepById(id) {
  19. const numericId = Number(id);
  20. const match = STEP_DEFINITIONS.find((step) => step.id === numericId);
  21. return match ? { ...match } : null;
  22. }
  23. return {
  24. STEP_DEFINITIONS,
  25. getStepById,
  26. getSteps,
  27. };
  28. });