@epsilon-asi/actors 0.0.1
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/.ai/generators/_template.ts +37 -0
- package/.ai/generators/abstract.ts +24 -0
- package/.ai/generators/actor-task-form-filler.ts +140 -0
- package/.ai/generators/actor-task.ts +122 -0
- package/.ai/generators/auth-core.ts +126 -0
- package/.ai/generators/browser-runtime.ts +114 -0
- package/.ai/generators/cli-command.ts +96 -0
- package/.ai/generators/core-framework.ts +80 -0
- package/.ai/generators/docs.ts +92 -0
- package/.ai/generators/error-logging.ts +102 -0
- package/.ai/generators/extraction-helper.ts +96 -0
- package/.ai/generators/interaction-behavior.ts +129 -0
- package/.ai/generators/site-actor.ts +125 -0
- package/.ai/generators/site-login-flow.ts +117 -0
- package/.ai/generators/unit-test.ts +109 -0
- package/.ai/workflows/_template.ts +20 -0
- package/.ai/workflows/starter.ts +20 -0
- package/README.md +435 -0
- package/ai-gen.config.ts +67 -0
- package/dist/auth/AuthStateDetector.d.ts +6 -0
- package/dist/auth/AuthStateDetector.d.ts.map +1 -0
- package/dist/auth/AuthStateDetector.js +14 -0
- package/dist/auth/AuthStateDetector.js.map +1 -0
- package/dist/auth/CredentialsProvider.d.ts +22 -0
- package/dist/auth/CredentialsProvider.d.ts.map +1 -0
- package/dist/auth/CredentialsProvider.js +30 -0
- package/dist/auth/CredentialsProvider.js.map +1 -0
- package/dist/auth/LoginFlow.d.ts +27 -0
- package/dist/auth/LoginFlow.d.ts.map +1 -0
- package/dist/auth/LoginFlow.js +233 -0
- package/dist/auth/LoginFlow.js.map +1 -0
- package/dist/auth/LoginFlow.types.d.ts +123 -0
- package/dist/auth/LoginFlow.types.d.ts.map +1 -0
- package/dist/auth/LoginFlow.types.js +7 -0
- package/dist/auth/LoginFlow.types.js.map +1 -0
- package/dist/auth/SessionStore.d.ts +16 -0
- package/dist/auth/SessionStore.d.ts.map +1 -0
- package/dist/auth/SessionStore.js +8 -0
- package/dist/auth/SessionStore.js.map +1 -0
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +6 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/browser/BrowserFactory.d.ts +16 -0
- package/dist/browser/BrowserFactory.d.ts.map +1 -0
- package/dist/browser/BrowserFactory.js +209 -0
- package/dist/browser/BrowserFactory.js.map +1 -0
- package/dist/browser/BrowserSession.d.ts +15 -0
- package/dist/browser/BrowserSession.d.ts.map +1 -0
- package/dist/browser/BrowserSession.js +42 -0
- package/dist/browser/BrowserSession.js.map +1 -0
- package/dist/browser/PuppeteerLike.d.ts +45 -0
- package/dist/browser/PuppeteerLike.d.ts.map +1 -0
- package/dist/browser/PuppeteerLike.js +10 -0
- package/dist/browser/PuppeteerLike.js.map +1 -0
- package/dist/browser/RuntimeConfig.d.ts +82 -0
- package/dist/browser/RuntimeConfig.d.ts.map +1 -0
- package/dist/browser/RuntimeConfig.js +64 -0
- package/dist/browser/RuntimeConfig.js.map +1 -0
- package/dist/browser/index.d.ts +6 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +6 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/profileValidation.d.ts +6 -0
- package/dist/browser/profileValidation.d.ts.map +1 -0
- package/dist/browser/profileValidation.js +59 -0
- package/dist/browser/profileValidation.js.map +1 -0
- package/dist/cli/run.d.ts +3 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +103 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/core/Actor.d.ts +54 -0
- package/dist/core/Actor.d.ts.map +1 -0
- package/dist/core/Actor.js +68 -0
- package/dist/core/Actor.js.map +1 -0
- package/dist/core/ActorContext.d.ts +32 -0
- package/dist/core/ActorContext.d.ts.map +1 -0
- package/dist/core/ActorContext.js +2 -0
- package/dist/core/ActorContext.js.map +1 -0
- package/dist/core/ActorRegistry.d.ts +8 -0
- package/dist/core/ActorRegistry.d.ts.map +1 -0
- package/dist/core/ActorRegistry.js +22 -0
- package/dist/core/ActorRegistry.js.map +1 -0
- package/dist/core/ActorRunner.d.ts +57 -0
- package/dist/core/ActorRunner.d.ts.map +1 -0
- package/dist/core/ActorRunner.js +157 -0
- package/dist/core/ActorRunner.js.map +1 -0
- package/dist/core/defineActor.d.ts +3 -0
- package/dist/core/defineActor.d.ts.map +1 -0
- package/dist/core/defineActor.js +4 -0
- package/dist/core/defineActor.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -0
- package/dist/errors/AuthError.d.ts +5 -0
- package/dist/errors/AuthError.d.ts.map +1 -0
- package/dist/errors/AuthError.js +7 -0
- package/dist/errors/AuthError.js.map +1 -0
- package/dist/errors/AutomationError.d.ts +17 -0
- package/dist/errors/AutomationError.d.ts.map +1 -0
- package/dist/errors/AutomationError.js +17 -0
- package/dist/errors/AutomationError.js.map +1 -0
- package/dist/errors/ConfigError.d.ts +5 -0
- package/dist/errors/ConfigError.d.ts.map +1 -0
- package/dist/errors/ConfigError.js +7 -0
- package/dist/errors/ConfigError.js.map +1 -0
- package/dist/errors/ExtractionError.d.ts +5 -0
- package/dist/errors/ExtractionError.d.ts.map +1 -0
- package/dist/errors/ExtractionError.js +7 -0
- package/dist/errors/ExtractionError.js.map +1 -0
- package/dist/errors/NavigationError.d.ts +5 -0
- package/dist/errors/NavigationError.d.ts.map +1 -0
- package/dist/errors/NavigationError.js +7 -0
- package/dist/errors/NavigationError.js.map +1 -0
- package/dist/errors/SelectorError.d.ts +6 -0
- package/dist/errors/SelectorError.d.ts.map +1 -0
- package/dist/errors/SelectorError.js +9 -0
- package/dist/errors/SelectorError.js.map +1 -0
- package/dist/errors/index.d.ts +7 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +7 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/extraction/Extractor.d.ts +16 -0
- package/dist/extraction/Extractor.d.ts.map +1 -0
- package/dist/extraction/Extractor.js +54 -0
- package/dist/extraction/Extractor.js.map +1 -0
- package/dist/extraction/Pagination.d.ts +16 -0
- package/dist/extraction/Pagination.d.ts.map +1 -0
- package/dist/extraction/Pagination.js +36 -0
- package/dist/extraction/Pagination.js.map +1 -0
- package/dist/extraction/index.d.ts +3 -0
- package/dist/extraction/index.d.ts.map +1 -0
- package/dist/extraction/index.js +3 -0
- package/dist/extraction/index.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction/FieldClearer.d.ts +7 -0
- package/dist/interaction/FieldClearer.d.ts.map +1 -0
- package/dist/interaction/FieldClearer.js +53 -0
- package/dist/interaction/FieldClearer.js.map +1 -0
- package/dist/interaction/Forms.d.ts +13 -0
- package/dist/interaction/Forms.d.ts.map +1 -0
- package/dist/interaction/Forms.js +22 -0
- package/dist/interaction/Forms.js.map +1 -0
- package/dist/interaction/GhostCursorAdapter.d.ts +27 -0
- package/dist/interaction/GhostCursorAdapter.d.ts.map +1 -0
- package/dist/interaction/GhostCursorAdapter.js +51 -0
- package/dist/interaction/GhostCursorAdapter.js.map +1 -0
- package/dist/interaction/HumanInteractor.d.ts +29 -0
- package/dist/interaction/HumanInteractor.d.ts.map +1 -0
- package/dist/interaction/HumanInteractor.js +2 -0
- package/dist/interaction/HumanInteractor.js.map +1 -0
- package/dist/interaction/HumanTyping.d.ts +43 -0
- package/dist/interaction/HumanTyping.d.ts.map +1 -0
- package/dist/interaction/HumanTyping.js +85 -0
- package/dist/interaction/HumanTyping.js.map +1 -0
- package/dist/interaction/NativePuppeteerInteractor.d.ts +20 -0
- package/dist/interaction/NativePuppeteerInteractor.d.ts.map +1 -0
- package/dist/interaction/NativePuppeteerInteractor.js +47 -0
- package/dist/interaction/NativePuppeteerInteractor.js.map +1 -0
- package/dist/interaction/Navigation.d.ts +17 -0
- package/dist/interaction/Navigation.d.ts.map +1 -0
- package/dist/interaction/Navigation.js +28 -0
- package/dist/interaction/Navigation.js.map +1 -0
- package/dist/interaction/PageAdapter.d.ts +32 -0
- package/dist/interaction/PageAdapter.d.ts.map +1 -0
- package/dist/interaction/PageAdapter.js +62 -0
- package/dist/interaction/PageAdapter.js.map +1 -0
- package/dist/interaction/Waits.d.ts +3 -0
- package/dist/interaction/Waits.d.ts.map +1 -0
- package/dist/interaction/Waits.js +4 -0
- package/dist/interaction/Waits.js.map +1 -0
- package/dist/interaction/index.d.ts +10 -0
- package/dist/interaction/index.d.ts.map +1 -0
- package/dist/interaction/index.js +10 -0
- package/dist/interaction/index.js.map +1 -0
- package/dist/interaction/textToKeystrokeEvents.d.ts +13 -0
- package/dist/interaction/textToKeystrokeEvents.d.ts.map +1 -0
- package/dist/interaction/textToKeystrokeEvents.js +15 -0
- package/dist/interaction/textToKeystrokeEvents.js.map +1 -0
- package/dist/logging/ConsoleLogger.d.ts +12 -0
- package/dist/logging/ConsoleLogger.d.ts.map +1 -0
- package/dist/logging/ConsoleLogger.js +42 -0
- package/dist/logging/ConsoleLogger.js.map +1 -0
- package/dist/logging/Logger.d.ts +14 -0
- package/dist/logging/Logger.d.ts.map +1 -0
- package/dist/logging/Logger.js +2 -0
- package/dist/logging/Logger.js.map +1 -0
- package/dist/logging/MemoryLogger.d.ts +10 -0
- package/dist/logging/MemoryLogger.d.ts.map +1 -0
- package/dist/logging/MemoryLogger.js +28 -0
- package/dist/logging/MemoryLogger.js.map +1 -0
- package/dist/logging/NullLogger.d.ts +8 -0
- package/dist/logging/NullLogger.d.ts.map +1 -0
- package/dist/logging/NullLogger.js +7 -0
- package/dist/logging/NullLogger.js.map +1 -0
- package/dist/logging/index.d.ts +5 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +5 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/sites/example/example.actor.d.ts +6 -0
- package/dist/sites/example/example.actor.d.ts.map +1 -0
- package/dist/sites/example/example.actor.js +47 -0
- package/dist/sites/example/example.actor.js.map +1 -0
- package/dist/sites/example/example.selectors.d.ts +18 -0
- package/dist/sites/example/example.selectors.d.ts.map +1 -0
- package/dist/sites/example/example.selectors.js +18 -0
- package/dist/sites/example/example.selectors.js.map +1 -0
- package/dist/sites/example/example.types.d.ts +16 -0
- package/dist/sites/example/example.types.d.ts.map +1 -0
- package/dist/sites/example/example.types.js +2 -0
- package/dist/sites/example/example.types.js.map +1 -0
- package/dist/sites/example/index.d.ts +4 -0
- package/dist/sites/example/index.d.ts.map +1 -0
- package/dist/sites/example/index.js +4 -0
- package/dist/sites/example/index.js.map +1 -0
- package/dist/sites/index.d.ts +4 -0
- package/dist/sites/index.d.ts.map +1 -0
- package/dist/sites/index.js +4 -0
- package/dist/sites/index.js.map +1 -0
- package/dist/sites/myvistage-com/index.d.ts +4 -0
- package/dist/sites/myvistage-com/index.d.ts.map +1 -0
- package/dist/sites/myvistage-com/index.js +4 -0
- package/dist/sites/myvistage-com/index.js.map +1 -0
- package/dist/sites/myvistage-com/myvistage-com.actor.d.ts +6 -0
- package/dist/sites/myvistage-com/myvistage-com.actor.d.ts.map +1 -0
- package/dist/sites/myvistage-com/myvistage-com.actor.js +44 -0
- package/dist/sites/myvistage-com/myvistage-com.actor.js.map +1 -0
- package/dist/sites/myvistage-com/myvistage-com.selectors.d.ts +15 -0
- package/dist/sites/myvistage-com/myvistage-com.selectors.d.ts.map +1 -0
- package/dist/sites/myvistage-com/myvistage-com.selectors.js +15 -0
- package/dist/sites/myvistage-com/myvistage-com.selectors.js.map +1 -0
- package/dist/sites/myvistage-com/myvistage-com.types.d.ts +16 -0
- package/dist/sites/myvistage-com/myvistage-com.types.d.ts.map +1 -0
- package/dist/sites/myvistage-com/myvistage-com.types.js +2 -0
- package/dist/sites/myvistage-com/myvistage-com.types.js.map +1 -0
- package/dist/sites/upwork-com/index.d.ts +6 -0
- package/dist/sites/upwork-com/index.d.ts.map +1 -0
- package/dist/sites/upwork-com/index.js +6 -0
- package/dist/sites/upwork-com/index.js.map +1 -0
- package/dist/sites/upwork-com/upwork-com.actor.d.ts +6 -0
- package/dist/sites/upwork-com/upwork-com.actor.d.ts.map +1 -0
- package/dist/sites/upwork-com/upwork-com.actor.js +82 -0
- package/dist/sites/upwork-com/upwork-com.actor.js.map +1 -0
- package/dist/sites/upwork-com/upwork-com.runner.d.ts +2 -0
- package/dist/sites/upwork-com/upwork-com.runner.d.ts.map +1 -0
- package/dist/sites/upwork-com/upwork-com.runner.js +14 -0
- package/dist/sites/upwork-com/upwork-com.runner.js.map +1 -0
- package/dist/sites/upwork-com/upwork-com.selectors.d.ts +11 -0
- package/dist/sites/upwork-com/upwork-com.selectors.d.ts.map +1 -0
- package/dist/sites/upwork-com/upwork-com.selectors.js +11 -0
- package/dist/sites/upwork-com/upwork-com.selectors.js.map +1 -0
- package/dist/sites/upwork-com/upwork-com.types.d.ts +88 -0
- package/dist/sites/upwork-com/upwork-com.types.d.ts.map +1 -0
- package/dist/sites/upwork-com/upwork-com.types.js +63 -0
- package/dist/sites/upwork-com/upwork-com.types.js.map +1 -0
- package/dist/sites/upwork-com/upwork-com.util.d.ts +4 -0
- package/dist/sites/upwork-com/upwork-com.util.d.ts.map +1 -0
- package/dist/sites/upwork-com/upwork-com.util.js +43 -0
- package/dist/sites/upwork-com/upwork-com.util.js.map +1 -0
- package/dist/utils/delay.d.ts +2 -0
- package/dist/utils/delay.d.ts.map +1 -0
- package/dist/utils/delay.js +6 -0
- package/dist/utils/delay.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/invariant.d.ts +2 -0
- package/dist/utils/invariant.d.ts.map +1 -0
- package/dist/utils/invariant.js +7 -0
- package/dist/utils/invariant.js.map +1 -0
- package/dist/utils/redact.d.ts +6 -0
- package/dist/utils/redact.d.ts.map +1 -0
- package/dist/utils/redact.js +40 -0
- package/dist/utils/redact.js.map +1 -0
- package/dist/utils/retry.d.ts +8 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +23 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/utils/url.d.ts +2 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/url.js +9 -0
- package/dist/utils/url.js.map +1 -0
- package/package.json +39 -0
- package/src/auth/AuthStateDetector.ts +18 -0
- package/src/auth/CredentialsProvider.ts +48 -0
- package/src/auth/LoginFlow.ts +332 -0
- package/src/auth/LoginFlow.types.ts +141 -0
- package/src/auth/SessionStore.ts +21 -0
- package/src/auth/index.ts +5 -0
- package/src/browser/BrowserFactory.ts +253 -0
- package/src/browser/BrowserSession.ts +50 -0
- package/src/browser/PuppeteerLike.ts +65 -0
- package/src/browser/RuntimeConfig.ts +152 -0
- package/src/browser/index.ts +5 -0
- package/src/browser/profileValidation.ts +73 -0
- package/src/cli/run.ts +112 -0
- package/src/core/Actor.ts +167 -0
- package/src/core/ActorContext.ts +34 -0
- package/src/core/ActorRegistry.ts +26 -0
- package/src/core/ActorRunner.ts +240 -0
- package/src/core/defineActor.ts +5 -0
- package/src/core/index.ts +5 -0
- package/src/errors/AuthError.ts +7 -0
- package/src/errors/AutomationError.ts +26 -0
- package/src/errors/ConfigError.ts +7 -0
- package/src/errors/ExtractionError.ts +7 -0
- package/src/errors/NavigationError.ts +7 -0
- package/src/errors/SelectorError.ts +10 -0
- package/src/errors/index.ts +6 -0
- package/src/extraction/Extractor.ts +65 -0
- package/src/extraction/Pagination.ts +47 -0
- package/src/extraction/index.ts +2 -0
- package/src/index.ts +9 -0
- package/src/interaction/FieldClearer.ts +73 -0
- package/src/interaction/Forms.ts +27 -0
- package/src/interaction/GhostCursorAdapter.ts +79 -0
- package/src/interaction/HumanInteractor.ts +32 -0
- package/src/interaction/HumanTyping.ts +157 -0
- package/src/interaction/NativePuppeteerInteractor.ts +68 -0
- package/src/interaction/Navigation.ts +37 -0
- package/src/interaction/PageAdapter.ts +86 -0
- package/src/interaction/Waits.ts +5 -0
- package/src/interaction/index.ts +9 -0
- package/src/logging/ConsoleLogger.ts +44 -0
- package/src/logging/Logger.ts +15 -0
- package/src/logging/MemoryLogger.ts +34 -0
- package/src/logging/NullLogger.ts +8 -0
- package/src/logging/index.ts +4 -0
- package/src/sites/example/example.actor.ts +53 -0
- package/src/sites/example/example.selectors.ts +17 -0
- package/src/sites/example/example.types.ts +18 -0
- package/src/sites/example/index.ts +3 -0
- package/src/sites/index.ts +3 -0
- package/src/sites/myvistage-com/index.ts +3 -0
- package/src/sites/myvistage-com/login-action-list.json +349 -0
- package/src/sites/myvistage-com/myvistage-com.actor.ts +50 -0
- package/src/sites/myvistage-com/myvistage-com.selectors.ts +14 -0
- package/src/sites/myvistage-com/myvistage-com.types.ts +18 -0
- package/src/sites/myvistage-com/post-comment-action.json +81 -0
- package/src/sites/upwork-com/index.ts +6 -0
- package/src/sites/upwork-com/upwork-com.actor.ts +97 -0
- package/src/sites/upwork-com/upwork-com.runner.ts +17 -0
- package/src/sites/upwork-com/upwork-com.selectors.ts +10 -0
- package/src/sites/upwork-com/upwork-com.types.ts +102 -0
- package/src/sites/upwork-com/upwork-com.util.ts +41 -0
- package/src/utils/delay.ts +4 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/invariant.ts +7 -0
- package/src/utils/redact.ts +53 -0
- package/src/utils/retry.ts +31 -0
- package/src/utils/url.ts +7 -0
- package/tests/fixtures/FakeCredentialsProvider.ts +12 -0
- package/tests/fixtures/FakeCursor.ts +48 -0
- package/tests/fixtures/FakePage.ts +266 -0
- package/tests/fixtures/makeContext.ts +76 -0
- package/tests/unit/auth/AuthStateDetector.test.ts +80 -0
- package/tests/unit/auth/LoginFlow.test.ts +296 -0
- package/tests/unit/browser/BrowserFactory.test.ts +370 -0
- package/tests/unit/core/ActorRunner.test.ts +370 -0
- package/tests/unit/core/defineActor.test.ts +112 -0
- package/tests/unit/extraction/Extractor.test.ts +48 -0
- package/tests/unit/extraction/Pagination.test.ts +54 -0
- package/tests/unit/interaction/FieldClearer.test.ts +29 -0
- package/tests/unit/interaction/Forms.test.ts +35 -0
- package/tests/unit/interaction/GhostCursorAdapter.test.ts +68 -0
- package/tests/unit/interaction/HumanTyping.test.ts +54 -0
- package/tests/unit/interaction/NativePuppeteerInteractor.test.ts +22 -0
- package/tests/unit/interaction/PageAdapter.test.ts +25 -0
- package/tests/unit/logging/redact.test.ts +36 -0
- package/tests/unit/sites/myvistage-com.actor.test.ts +19 -0
- package/tests/unit/sites/myvistage-com.login.test.ts +22 -0
- package/tests/unit/sites/myvistage-com.postComment.test.ts +70 -0
- package/tests/unit/sites/upwork-com.login.test.ts +52 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.json +22 -0
- package/vitest.config.ts +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upwork-com.selectors.js","sourceRoot":"","sources":["../../../src/sites/upwork-com/upwork-com.selectors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE;QACL,QAAQ,EAAE,iBAAiB;QAC3B,QAAQ,EAAE,iBAAiB;QAC3B,kBAAkB,EAAE,0BAA0B;QAC9C,MAAM,EAAE,yBAAyB;QACjC,cAAc,EAAE,iCAAiC;QACjD,YAAY,EAAE,cAAc;KAC7B;CACO,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export declare enum JobSearchSort {
|
|
2
|
+
BestMatch = "best_match"
|
|
3
|
+
}
|
|
4
|
+
export declare enum DomesticFilter {
|
|
5
|
+
USOnly = "us_only"
|
|
6
|
+
}
|
|
7
|
+
export declare enum ContractorTier {
|
|
8
|
+
EntryLevel = "1",
|
|
9
|
+
Intermediate = "2",
|
|
10
|
+
Expert = "3"
|
|
11
|
+
}
|
|
12
|
+
export declare enum JobType {
|
|
13
|
+
Hourly = "hourly",
|
|
14
|
+
FixedPrice = "fixed_price"
|
|
15
|
+
}
|
|
16
|
+
export declare enum FixedPriceRange {
|
|
17
|
+
LessThan100 = "lt_100",
|
|
18
|
+
From100To500 = "100_to_500",
|
|
19
|
+
From500To1000 = "500_to_1000",
|
|
20
|
+
From1000To5000 = "1000_to_5000",
|
|
21
|
+
GreaterThan5000 = "gte_5000"
|
|
22
|
+
}
|
|
23
|
+
export declare enum ProposalRange {
|
|
24
|
+
FewerThan5 = "0-4",
|
|
25
|
+
From5To10 = "5-9",
|
|
26
|
+
From10To15 = "10-14",
|
|
27
|
+
From15To20 = "15-19",
|
|
28
|
+
From20To50 = "20-49"
|
|
29
|
+
}
|
|
30
|
+
export declare enum ClientInfoFilter {
|
|
31
|
+
PreviousClients = "previous_clients",
|
|
32
|
+
PaymentVerified = "payment_verified"
|
|
33
|
+
}
|
|
34
|
+
export declare enum ClientHiresRange {
|
|
35
|
+
NoHires = "0",
|
|
36
|
+
From1To9 = "1-9",
|
|
37
|
+
TenPlus = "10-"
|
|
38
|
+
}
|
|
39
|
+
export declare enum ProjectLength {
|
|
40
|
+
LessThanOneMonth = "week",
|
|
41
|
+
OneToThreeMonths = "month",
|
|
42
|
+
ThreeToSixMonths = "semester",
|
|
43
|
+
MoreThanSixMonths = "ongoing"
|
|
44
|
+
}
|
|
45
|
+
export declare enum HoursPerWeek {
|
|
46
|
+
LessThan30 = "as_needed",
|
|
47
|
+
MoreThan30 = "full_time"
|
|
48
|
+
}
|
|
49
|
+
export declare enum JobDuration {
|
|
50
|
+
ContractToHire = "contract_to_hire"
|
|
51
|
+
}
|
|
52
|
+
export type MoneyRange = {
|
|
53
|
+
min?: number;
|
|
54
|
+
max?: number;
|
|
55
|
+
currency?: 'USD';
|
|
56
|
+
};
|
|
57
|
+
export type UpworkJobSearchFields = {
|
|
58
|
+
sort?: JobSearchSort;
|
|
59
|
+
domestic?: DomesticFilter;
|
|
60
|
+
categories?: string[];
|
|
61
|
+
contractorTier?: ContractorTier[];
|
|
62
|
+
jobType?: JobType[];
|
|
63
|
+
hourlyRate?: MoneyRange;
|
|
64
|
+
fixedPriceRanges?: FixedPriceRange[];
|
|
65
|
+
fixedPriceCustom?: MoneyRange;
|
|
66
|
+
proposals?: ProposalRange[];
|
|
67
|
+
clientInfo?: ClientInfoFilter[];
|
|
68
|
+
clientHires?: ClientHiresRange[];
|
|
69
|
+
clientLocations?: string[];
|
|
70
|
+
clientTimezones?: string[];
|
|
71
|
+
projectLength?: ProjectLength[];
|
|
72
|
+
hoursPerWeek?: HoursPerWeek[];
|
|
73
|
+
jobDuration?: JobDuration[];
|
|
74
|
+
};
|
|
75
|
+
export interface UpworkJobSearchResult {
|
|
76
|
+
searchUrl: string;
|
|
77
|
+
query: string;
|
|
78
|
+
filters: UpworkJobSearchFields;
|
|
79
|
+
}
|
|
80
|
+
export interface UpworkApplyToJobInput {
|
|
81
|
+
coverLetter: string;
|
|
82
|
+
rate: number | string;
|
|
83
|
+
}
|
|
84
|
+
export interface UpworkApplyToJobResult {
|
|
85
|
+
coverLetter: string;
|
|
86
|
+
rate: number;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=upwork-com.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upwork-com.types.d.ts","sourceRoot":"","sources":["../../../src/sites/upwork-com/upwork-com.types.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB,SAAS,eAAe;CACzB;AAED,oBAAY,cAAc;IACxB,MAAM,YAAY;CACnB;AAED,oBAAY,cAAc;IACxB,UAAU,MAAM;IAChB,YAAY,MAAM;IAClB,MAAM,MAAM;CACb;AAED,oBAAY,OAAO;IACjB,MAAM,WAAW;IACjB,UAAU,gBAAgB;CAC3B;AAED,oBAAY,eAAe;IACzB,WAAW,WAAW;IACtB,YAAY,eAAe;IAC3B,aAAa,gBAAgB;IAC7B,cAAc,iBAAiB;IAC/B,eAAe,aAAa;CAC7B;AAED,oBAAY,aAAa;IACvB,UAAU,QAAQ;IAClB,SAAS,QAAQ;IACjB,UAAU,UAAU;I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EAAE,WAAW,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,qBAAqB,CAAC;CAChC;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export var JobSearchSort;
|
|
2
|
+
(function (JobSearchSort) {
|
|
3
|
+
JobSearchSort["BestMatch"] = "best_match";
|
|
4
|
+
})(JobSearchSort || (JobSearchSort = {}));
|
|
5
|
+
export var DomesticFilter;
|
|
6
|
+
(function (DomesticFilter) {
|
|
7
|
+
DomesticFilter["USOnly"] = "us_only";
|
|
8
|
+
})(DomesticFilter || (DomesticFilter = {}));
|
|
9
|
+
export var ContractorTier;
|
|
10
|
+
(function (ContractorTier) {
|
|
11
|
+
ContractorTier["EntryLevel"] = "1";
|
|
12
|
+
ContractorTier["Intermediate"] = "2";
|
|
13
|
+
ContractorTier["Expert"] = "3";
|
|
14
|
+
})(ContractorTier || (ContractorTier = {}));
|
|
15
|
+
export var JobType;
|
|
16
|
+
(function (JobType) {
|
|
17
|
+
JobType["Hourly"] = "hourly";
|
|
18
|
+
JobType["FixedPrice"] = "fixed_price";
|
|
19
|
+
})(JobType || (JobType = {}));
|
|
20
|
+
export var FixedPriceRange;
|
|
21
|
+
(function (FixedPriceRange) {
|
|
22
|
+
FixedPriceRange["LessThan100"] = "lt_100";
|
|
23
|
+
FixedPriceRange["From100To500"] = "100_to_500";
|
|
24
|
+
FixedPriceRange["From500To1000"] = "500_to_1000";
|
|
25
|
+
FixedPriceRange["From1000To5000"] = "1000_to_5000";
|
|
26
|
+
FixedPriceRange["GreaterThan5000"] = "gte_5000";
|
|
27
|
+
})(FixedPriceRange || (FixedPriceRange = {}));
|
|
28
|
+
export var ProposalRange;
|
|
29
|
+
(function (ProposalRange) {
|
|
30
|
+
ProposalRange["FewerThan5"] = "0-4";
|
|
31
|
+
ProposalRange["From5To10"] = "5-9";
|
|
32
|
+
ProposalRange["From10To15"] = "10-14";
|
|
33
|
+
ProposalRange["From15To20"] = "15-19";
|
|
34
|
+
ProposalRange["From20To50"] = "20-49";
|
|
35
|
+
})(ProposalRange || (ProposalRange = {}));
|
|
36
|
+
export var ClientInfoFilter;
|
|
37
|
+
(function (ClientInfoFilter) {
|
|
38
|
+
ClientInfoFilter["PreviousClients"] = "previous_clients";
|
|
39
|
+
ClientInfoFilter["PaymentVerified"] = "payment_verified";
|
|
40
|
+
})(ClientInfoFilter || (ClientInfoFilter = {}));
|
|
41
|
+
export var ClientHiresRange;
|
|
42
|
+
(function (ClientHiresRange) {
|
|
43
|
+
ClientHiresRange["NoHires"] = "0";
|
|
44
|
+
ClientHiresRange["From1To9"] = "1-9";
|
|
45
|
+
ClientHiresRange["TenPlus"] = "10-";
|
|
46
|
+
})(ClientHiresRange || (ClientHiresRange = {}));
|
|
47
|
+
export var ProjectLength;
|
|
48
|
+
(function (ProjectLength) {
|
|
49
|
+
ProjectLength["LessThanOneMonth"] = "week";
|
|
50
|
+
ProjectLength["OneToThreeMonths"] = "month";
|
|
51
|
+
ProjectLength["ThreeToSixMonths"] = "semester";
|
|
52
|
+
ProjectLength["MoreThanSixMonths"] = "ongoing";
|
|
53
|
+
})(ProjectLength || (ProjectLength = {}));
|
|
54
|
+
export var HoursPerWeek;
|
|
55
|
+
(function (HoursPerWeek) {
|
|
56
|
+
HoursPerWeek["LessThan30"] = "as_needed";
|
|
57
|
+
HoursPerWeek["MoreThan30"] = "full_time";
|
|
58
|
+
})(HoursPerWeek || (HoursPerWeek = {}));
|
|
59
|
+
export var JobDuration;
|
|
60
|
+
(function (JobDuration) {
|
|
61
|
+
JobDuration["ContractToHire"] = "contract_to_hire";
|
|
62
|
+
})(JobDuration || (JobDuration = {}));
|
|
63
|
+
//# sourceMappingURL=upwork-com.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upwork-com.types.js","sourceRoot":"","sources":["../../../src/sites/upwork-com/upwork-com.types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,yCAAwB,CAAA;AAC1B,CAAC,EAFW,aAAa,KAAb,aAAa,QAExB;AAED,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,oCAAkB,CAAA;AACpB,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,kCAAgB,CAAA;IAChB,oCAAkB,CAAA;IAClB,8BAAY,CAAA;AACd,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,CAAN,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,4BAAiB,CAAA;IACjB,qCAA0B,CAAA;AAC5B,CAAC,EAHW,OAAO,KAAP,OAAO,QAGlB;AAED,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,yCAAsB,CAAA;IACtB,8CAA2B,CAAA;IAC3B,gDAA6B,CAAA;IAC7B,kDAA+B,CAAA;IAC/B,+CAA4B,CAAA;AAC9B,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAED,MAAM,CAAN,IAAY,aAMX;AAND,WAAY,aAAa;IACvB,mCAAkB,CAAA;IAClB,kCAAiB,CAAA;IACjB,qCAAoB,CAAA;IACpB,qCAAoB,CAAA;IACpB,qCAAoB,CAAA;AACtB,CAAC,EANW,aAAa,KAAb,aAAa,QAMxB;AAED,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,wDAAoC,CAAA;IACpC,wDAAoC,CAAA;AACtC,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B;AAED,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,iCAAa,CAAA;IACb,oCAAgB,CAAA;IAChB,mCAAe,CAAA;AACjB,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B;AAED,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,0CAAyB,CAAA;IACzB,2CAA0B,CAAA;IAC1B,8CAA6B,CAAA;IAC7B,8CAA6B,CAAA;AAC/B,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAED,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC1B,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED,MAAM,CAAN,IAAY,WAEX;AAFD,WAAY,WAAW;IACrB,kDAAmC,CAAA;AACrC,CAAC,EAFW,WAAW,KAAX,WAAW,QAEtB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { UpworkApplyToJobInput, UpworkJobSearchFields } from "./upwork-com.types.js";
|
|
2
|
+
export declare function buildSearchParams(input: UpworkJobSearchFields): URLSearchParams;
|
|
3
|
+
export declare function parseRate(rate: UpworkApplyToJobInput['rate']): number;
|
|
4
|
+
//# sourceMappingURL=upwork-com.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upwork-com.util.d.ts","sourceRoot":"","sources":["../../../src/sites/upwork-com/upwork-com.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,qBAAqB,EAAE,qBAAqB,EAAC,MAAM,uBAAuB,CAAC;AAExF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,GAAG,eAAe,CA4B/E;AAOD,wBAAgB,SAAS,CAAC,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,GAAG,MAAM,CAGrE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export function buildSearchParams(input) {
|
|
2
|
+
const params = new URLSearchParams();
|
|
3
|
+
if (input.sort !== undefined)
|
|
4
|
+
params.set('sort', input.sort);
|
|
5
|
+
if (input.domestic !== undefined)
|
|
6
|
+
params.set('domestic', input.domestic);
|
|
7
|
+
appendList(params, 'categories', input.categories);
|
|
8
|
+
appendList(params, 'contractor_tier', input.contractorTier);
|
|
9
|
+
appendList(params, 'job_type', input.jobType);
|
|
10
|
+
if (input.hourlyRate?.min !== undefined)
|
|
11
|
+
params.set('hourly_rate_min', String(input.hourlyRate.min));
|
|
12
|
+
if (input.hourlyRate?.max !== undefined)
|
|
13
|
+
params.set('hourly_rate_max', String(input.hourlyRate.max));
|
|
14
|
+
if (input.hourlyRate?.currency !== undefined)
|
|
15
|
+
params.set('hourly_rate_currency', input.hourlyRate.currency);
|
|
16
|
+
appendList(params, 'fixed_price_ranges', input.fixedPriceRanges);
|
|
17
|
+
if (input.fixedPriceCustom?.min !== undefined)
|
|
18
|
+
params.set('fixed_price_min', String(input.fixedPriceCustom.min));
|
|
19
|
+
if (input.fixedPriceCustom?.max !== undefined)
|
|
20
|
+
params.set('fixed_price_max', String(input.fixedPriceCustom.max));
|
|
21
|
+
if (input.fixedPriceCustom?.currency !== undefined)
|
|
22
|
+
params.set('fixed_price_currency', input.fixedPriceCustom.currency);
|
|
23
|
+
appendList(params, 'proposals', input.proposals);
|
|
24
|
+
appendList(params, 'client_info', input.clientInfo);
|
|
25
|
+
appendList(params, 'client_hires', input.clientHires);
|
|
26
|
+
appendList(params, 'client_locations', input.clientLocations);
|
|
27
|
+
appendList(params, 'client_timezones', input.clientTimezones);
|
|
28
|
+
appendList(params, 'project_length', input.projectLength);
|
|
29
|
+
appendList(params, 'hours_per_week', input.hoursPerWeek);
|
|
30
|
+
appendList(params, 'job_duration', input.jobDuration);
|
|
31
|
+
return params;
|
|
32
|
+
}
|
|
33
|
+
function appendList(params, key, values) {
|
|
34
|
+
if (values === undefined || values.length === 0)
|
|
35
|
+
return;
|
|
36
|
+
params.set(key, values.join(','));
|
|
37
|
+
}
|
|
38
|
+
export function parseRate(rate) {
|
|
39
|
+
if (typeof rate === 'number')
|
|
40
|
+
return rate;
|
|
41
|
+
return Number(rate.trim());
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=upwork-com.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upwork-com.util.js","sourceRoot":"","sources":["../../../src/sites/upwork-com/upwork-com.util.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAAC,KAA4B;IAC1D,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;IAErC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7D,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACzE,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACnD,UAAU,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC5D,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAE9C,IAAI,KAAK,CAAC,UAAU,EAAE,GAAG,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACrG,IAAI,KAAK,CAAC,UAAU,EAAE,GAAG,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACrG,IAAI,KAAK,CAAC,UAAU,EAAE,QAAQ,KAAK,SAAS;QAA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tD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,SAAS,UAAU,CAAC,MAAuB,EAAE,GAAW,EAAE,MAAqC;IAC3F,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACxD,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAmC;IACzD,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delay.d.ts","sourceRoot":"","sources":["../../src/utils/delay.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delay.js","sourceRoot":"","sources":["../../src/utils/delay.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,KAAK,CAAC,EAAU;IAC9B,IAAI,EAAE,IAAI,CAAC;QAAE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACtC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../src/utils/invariant.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAIhF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invariant.js","sourceRoot":"","sources":["../../src/utils/invariant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,UAAU,SAAS,CAAC,SAAkB,EAAE,OAAe;IAC3D,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/utils/redact.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAWD,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,GAAE,aAAkB,GAAG,CAAC,CAsBlE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const DEFAULT_REDACTION_KEYS = [
|
|
2
|
+
'password',
|
|
3
|
+
'passwd',
|
|
4
|
+
'secret',
|
|
5
|
+
'token',
|
|
6
|
+
'apiKey',
|
|
7
|
+
'api_key',
|
|
8
|
+
'authorization',
|
|
9
|
+
'auth',
|
|
10
|
+
'cookie',
|
|
11
|
+
'session',
|
|
12
|
+
'credential',
|
|
13
|
+
'refreshToken',
|
|
14
|
+
'accessToken'
|
|
15
|
+
];
|
|
16
|
+
function isPlainObject(value) {
|
|
17
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
18
|
+
}
|
|
19
|
+
function keyIsSensitive(key, sensitiveKeys) {
|
|
20
|
+
const normalized = key.toLowerCase();
|
|
21
|
+
return sensitiveKeys.some(sensitiveKey => normalized.includes(sensitiveKey.toLowerCase()));
|
|
22
|
+
}
|
|
23
|
+
export function redact(value, options = {}) {
|
|
24
|
+
const replacement = options.replacement ?? '[REDACTED]';
|
|
25
|
+
const sensitiveKeys = options.sensitiveKeys ?? DEFAULT_REDACTION_KEYS;
|
|
26
|
+
const visit = (input) => {
|
|
27
|
+
if (Array.isArray(input)) {
|
|
28
|
+
return input.map(item => visit(item));
|
|
29
|
+
}
|
|
30
|
+
if (!isPlainObject(input)) {
|
|
31
|
+
return input;
|
|
32
|
+
}
|
|
33
|
+
return Object.fromEntries(Object.entries(input).map(([key, nestedValue]) => [
|
|
34
|
+
key,
|
|
35
|
+
keyIsSensitive(key, sensitiveKeys) ? replacement : visit(nestedValue)
|
|
36
|
+
]));
|
|
37
|
+
};
|
|
38
|
+
return visit(value);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=redact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.js","sourceRoot":"","sources":["../../src/utils/redact.ts"],"names":[],"mappings":"AAAA,MAAM,sBAAsB,GAAG;IAC7B,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,SAAS;IACT,eAAe;IACf,MAAM;IACN,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,cAAc;IACd,aAAa;CACd,CAAC;AAOF,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,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../../src/utils/retry.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAqBpF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { delay } from './delay.js';
|
|
2
|
+
export async function retry(fn, policy) {
|
|
3
|
+
if (!Number.isInteger(policy.attempts) || policy.attempts < 1) {
|
|
4
|
+
throw new Error('Retry attempts must be a positive integer.');
|
|
5
|
+
}
|
|
6
|
+
let lastError;
|
|
7
|
+
for (let attempt = 1; attempt <= policy.attempts; attempt += 1) {
|
|
8
|
+
try {
|
|
9
|
+
return await fn();
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
lastError = error;
|
|
13
|
+
if (attempt === policy.attempts)
|
|
14
|
+
break;
|
|
15
|
+
const exponentialDelay = policy.baseDelayMs * 2 ** (attempt - 1);
|
|
16
|
+
const cappedDelay = Math.min(exponentialDelay, policy.maxDelayMs ?? exponentialDelay);
|
|
17
|
+
const jitter = policy.jitter ? Math.floor(Math.random() * Math.max(1, cappedDelay / 3)) : 0;
|
|
18
|
+
await delay(cappedDelay + jitter);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
throw lastError;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AASnC,MAAM,CAAC,KAAK,UAAU,KAAK,CAAI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CAMrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,OAAe,EAAE,SAAiB;IAC3D,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;IAChD,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@epsilon-asi/actors",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A TypeScript Puppeteer actor framework using existing Chrome profiles and ghost-cursor.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"paf": "./dist/cli/run.js"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.build.json",
|
|
19
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:coverage": "vitest run --coverage",
|
|
22
|
+
"check": "npm run typecheck && npm test",
|
|
23
|
+
"clean": "rm -rf dist coverage"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"ghost-cursor": "^1.4.2",
|
|
27
|
+
"puppeteer-core": "^25.0.4"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^24.10.1",
|
|
31
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
32
|
+
"typescript": "^6.0.3",
|
|
33
|
+
"vitest": "^4.1.7"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=20.11"
|
|
37
|
+
},
|
|
38
|
+
"license": "MIT"
|
|
39
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ActorContext } from '../core/ActorContext.js';
|
|
2
|
+
import type { LoginFlowDefinition } from './LoginFlow.types.js';
|
|
3
|
+
|
|
4
|
+
export class AuthStateDetector {
|
|
5
|
+
async isLoggedIn(context: ActorContext, definition: LoginFlowDefinition): Promise<boolean> {
|
|
6
|
+
if (definition.behavior?.authCheckUrl !== undefined) {
|
|
7
|
+
await context.nav.goto(definition.behavior.authCheckUrl);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (definition.hooks?.verifyLoggedIn !== undefined) {
|
|
11
|
+
return Boolean(await definition.hooks.verifyLoggedIn(context));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return context.page.exists(definition.selectors.loggedInSignal, {
|
|
15
|
+
timeout: definition.behavior?.loggedInTimeoutMs ?? 2_000
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AuthError } from '../errors/AuthError.js';
|
|
2
|
+
|
|
3
|
+
export interface Credentials {
|
|
4
|
+
username: string;
|
|
5
|
+
password: string;
|
|
6
|
+
accountId?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface CredentialRef {
|
|
10
|
+
id: string;
|
|
11
|
+
usernameEnv?: string;
|
|
12
|
+
passwordEnv?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface CredentialsProvider {
|
|
16
|
+
getCredentials(ref: CredentialRef): Promise<Credentials>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class EnvCredentialsProvider implements CredentialsProvider {
|
|
20
|
+
async getCredentials(ref: CredentialRef): Promise<Credentials> {
|
|
21
|
+
const usernameKey = ref.usernameEnv ?? `${ref.id.toUpperCase()}_USERNAME`;
|
|
22
|
+
const passwordKey = ref.passwordEnv ?? `${ref.id.toUpperCase()}_PASSWORD`;
|
|
23
|
+
const username = process.env[usernameKey];
|
|
24
|
+
const password = process.env[passwordKey];
|
|
25
|
+
|
|
26
|
+
if (username === undefined || username.length === 0) {
|
|
27
|
+
throw new AuthError(`Missing username environment variable: ${usernameKey}`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (password === undefined || password.length === 0) {
|
|
31
|
+
throw new AuthError(`Missing password environment variable: ${passwordKey}`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return { username, password, accountId: ref.id };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class StaticCredentialsProvider implements CredentialsProvider {
|
|
39
|
+
constructor(private readonly credentials: Record<string, Credentials>) {}
|
|
40
|
+
|
|
41
|
+
async getCredentials(ref: CredentialRef): Promise<Credentials> {
|
|
42
|
+
const credential = this.credentials[ref.id];
|
|
43
|
+
if (credential === undefined) {
|
|
44
|
+
throw new AuthError(`No static credentials registered for credential id: ${ref.id}`);
|
|
45
|
+
}
|
|
46
|
+
return credential;
|
|
47
|
+
}
|
|
48
|
+
}
|