@odg/chemical-x 2.1.3 → 2.3.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 CHANGED
@@ -27,6 +27,8 @@
27
27
 
28
28
  # Table of Contents
29
29
 
30
+ > See [agents.md](agents.md) for consumer API reference. Detailed guides in [docs/](docs/).
31
+
30
32
  - [🎇 Benefits](#-benefits)
31
33
  - [📗 Libraries](#-libraries)
32
34
  - [📁 Dependencies](#-dependencies)
package/agents.md ADDED
@@ -0,0 +1,158 @@
1
+ ## @odg/chemical-x - Consumer Guide
2
+
3
+ ## 🎯 Purpose
4
+
5
+ - Framework TypeScript para automação web (scraping, crawling) com abstração sobre Puppeteer/Playwright, retry com lifecycle hooks e DSL baseada em decorators.
6
+ - Helpers utilitários (`retry`, `sleep`, `timeout`, `throwIf`) para controle de fluxo assíncrono com tratamento de erros tipado.
7
+ - Arquitetura Page/Handler: Pages executam ações por **intenção** (não por URL); Handlers validam transições e declaram soluções ou exceções.
8
+
9
+ ## 🚀 Quick Start
10
+
11
+ ```typescript
12
+ // Helpers — sem browser driver necessário
13
+ import { retry, sleep, timeout, throwIf, RetryAction } from "@odg/chemical-x";
14
+
15
+ const result = await retry({
16
+ times: 3,
17
+ sleep: 1000,
18
+ callback: async (attempt) => { /* operação retriable */ },
19
+ });
20
+
21
+ // Crawler — requer Puppeteer ou Playwright instalado
22
+ import { BrowserManager, BasePage, BaseHandler, Container } from "@odg/chemical-x";
23
+ ```
24
+
25
+ ## 📜 Quick API Reference
26
+
27
+ **Helpers** — Controle de fluxo assíncrono:
28
+
29
+ | Função | Propósito |
30
+ |---|---|
31
+ | `retry(options)` | Retenta callback N vezes com sleep, abort signal e callback `when` para decidir ação por tentativa |
32
+ | `sleep(ms, options?)` | Pausa assíncrona com suporte a `AbortSignal` |
33
+ | `timeout(options)` | Envolve callback com limite de tempo; lança `TimeoutException` se exceder |
34
+ | `throwIf(condition, exception)` | Lança exceção condicionalmente; tipagem `never` quando `condition: true` |
35
+
36
+ 📖 See also: [docs/helpers.md](docs/helpers.md)
37
+
38
+ **Decorators** — DSL para classes:
39
+
40
+ | Decorator | Propósito |
41
+ |---|---|
42
+ | `@ODGDecorators.attemptableFlow()` | Retry a nível de classe com lifecycle hooks (`attempt`, `sleep`, `success`, `failure`, `retrying`, `finish`) |
43
+ | `@ODGDecorators.getterAccess()` | Proxy que intercepta todo acesso a propriedades via `__get(key, value)` |
44
+ | `@ODGDecorators.injectable(name, scope?)` | Registra classe no Container (Inversify) |
45
+ | `@ODGDecorators.registerListener(event, container, options)` | Registra listener de eventos em Container EventEmitter |
46
+
47
+ 📖 See also: [docs/decorators.md](docs/decorators.md)
48
+
49
+ **Crawler** — Automação web:
50
+
51
+ | Classe | Propósito |
52
+ |---|---|
53
+ | `BrowserManager` | Orquestrador: cria instâncias de Browser e Context via factories injetadas |
54
+ | `Browser` | Wrapper com `@ODGDecorators.getterAccess()` sobre engine do browser; gerencia Contexts |
55
+ | `Context` | Wrapper sobre contexto do browser; gerencia Pages |
56
+ | `Page` | Wrapper sobre page do browser com acesso ao Context pai |
57
+ | `BasePage` (abstract) | Define uma página por intenção; implementa `execute()` + `attempt()` + seletores `$s`/`$$s` |
58
+ | `BaseHandler` (abstract) | Valida transições; implementa `waitForHandler()` + `attempt()`; declara Solution ou Exception |
59
+
60
+ 📖 See also: [docs/crawlers.md](docs/crawlers.md)
61
+
62
+ **Support** — Utilidades tipadas:
63
+
64
+ | Classe | Propósito |
65
+ |---|---|
66
+ | `Str` | Manipulação de string: extração monetária (`money()`, `moneys()`), `onlyNumbers()`, `ucFirst()`, `isJson()`, `formatUnicorn()` |
67
+ | `Num` | Wrapper numérico com `toNative()` e `clone()` |
68
+ | `Arr<Type>` | Wrapper de array com `random(length?)` e `clone()` |
69
+ | `File` | Verificação de existência de arquivo via `exists()` |
70
+
71
+ **Enums:**
72
+
73
+ | Enum | Valores |
74
+ |---|---|
75
+ | `RetryAction` | `Retry` (forçar retry), `Throw` (lançar), `Resolve` (resolver com undefined), `Default` (seguir `times`) |
76
+
77
+ **Container:**
78
+
79
+ - `Container<T>` estende `TypedContainer` (Inversify); adiciona `getOptional(name)` que retorna `undefined` se não registrado.
80
+
81
+ ## 🚦 Key Rules
82
+
83
+ 1. **`@attemptableFlow` vs `retry()`**: Use `@attemptableFlow` para retry a nível de classe com lifecycle hooks completo (attempt, success, failure, retrying, finish, sleep). Use `retry()` para retentativa simples de um callback isolado.
84
+ 📖 See also: [docs/decorators.md](docs/decorators.md)
85
+
86
+ 2. **`@getterAccess` — Proxy total**: Todo acesso a propriedade/método passa por `__get(key, value)`. Implementações de Browser, Context e Page usam isso para delegar ao engine subjacente.
87
+ 📖 See also: [docs/decorators.md](docs/decorators.md)
88
+
89
+ 3. **Page Intent Design**: Pages agrupam por **intenção**, não por URL. Uma mesma URL pode ter múltiplas Pages (ex: `LoginPage` para autenticar, `HomeVerificationPage` para validar conteúdo).
90
+ 📖 See also: [docs/crawlers.md](docs/crawlers.md)
91
+
92
+ 4. **Handler Validation Contract**: Handlers **validam**, não executam. `waitForHandler()` retorna `Exception` ou `() => Promise<HandlerSolutionType>`. O handler declara Solution (próxima Page) ou lança Exception. Nunca falha silenciosamente.
93
+ 📖 See also: [docs/crawlers.md](docs/crawlers.md)
94
+
95
+ 5. **Container.loadModule() obrigatório**: Classes com `@ODGDecorators.injectable` precisam de `Container.loadModule()` antes da execução. DI binding é responsabilidade do consumidor.
96
+ 📖 See also: [docs/crawlers.md](docs/crawlers.md)
97
+
98
+ 6. **`retry()` com `when` callback**: O callback `when(exception, times)` retorna `RetryAction` para decidir por tentativa: `Retry` (forçar), `Throw` (parar), `Resolve` (resolver com `undefined`), `Default` (seguir contagem `times`).
99
+ 📖 See also: [docs/helpers.md](docs/helpers.md)
100
+
101
+ 7. **Seletores `$s` e `$$s` em Pages/Handlers**: `$s` define seletor único da página; `$$s` define mapa nomeado de seletores (`Record<string, SelectorType>`). Ambos são `abstract readonly` em `BasePage`/`BaseHandler`.
102
+ 📖 See also: [docs/crawlers.md](docs/crawlers.md)
103
+
104
+ 8. **`AttemptableInterface` — contrato base**: Tanto `BasePage` quanto `BaseHandler` implementam `AttemptableInterface`. Hooks opcionais: `success()`, `failure(exception)`, `retrying(exception, attempt)`, `finish(exception?)`, `sleep()`. Obrigatórios: `execute()`, `attempt()`.
105
+ 📖 See also: [docs/decorators.md](docs/decorators.md)
106
+
107
+ ## 💥 Critical Exceptions
108
+
109
+ | Exception | Quando é lançada | Handling |
110
+ |---|---|---|
111
+ | `BrowserException` | Falha em operação do browser em runtime (crash, perda de conexão) | Catch e retry ou fallback |
112
+ | `BrowserInstanceException` | Falha ao criar/inicializar instância do browser (extends `BrowserException`) | Verificar setup do driver, retry init |
113
+ | `RetryException` | Todas as tentativas de `retry()` esgotadas sem sucesso | Fallback final ou propagar erro |
114
+ | `TimeoutException` | Operação excede o limite de `timeout()` | Catch e tratar timeout; ajustar limite se válido |
115
+ | `InvalidArgumentException` | Parâmetros inválidos (ex: `times < 1`, timeout negativo) | Validar inputs antes de chamar API |
116
+ | `MoneyNotFoundException` | `Str.money()` não encontra valor monetário na string | Verificar formato da string antes |
117
+ | `MoneyMultipleResultException` | `Str.money()` encontra múltiplos valores; use `Str.moneys()` | Usar `moneys()` para múltiplos valores |
118
+
119
+ 📖 See also: [docs/exceptions.md](docs/exceptions.md) para referência completa com exemplos de try-catch.
120
+
121
+ ## ⚠️ Integration Pitfalls
122
+
123
+ 1. **Node 24+ obrigatório**: `engines.node >= 24.0` no package.json; versões anteriores não são suportadas.
124
+ 2. **Puppeteer/Playwright NÃO incluído**: Crawler APIs requerem driver de browser, mas o consumidor **deve instalar separadamente**. Helpers e Decorators funcionam sem driver.
125
+ 3. **DI é responsabilidade do consumidor**: Chemical-X usa Inversify mas **não auto-wira**. Consumidor deve registrar bindings e chamar `Container.loadModule()`.
126
+ 4. **Driver não é auto-selecionado**: Consumer configura qual driver usar via binding no Container ou construtor do `BrowserManager`. Puppeteer e Playwright são intercambiáveis via configuração.
127
+ 5. **`Container.loadModule()` antes de executar**: Sem essa chamada, classes registradas com `@ODGDecorators.injectable` não estarão disponíveis no container.
128
+ 6. **Pages por intenção, não por URL**: Não assuma 1:1 entre URL e Page. Modele Pages pela responsabilidade/ação desejada.
129
+ 7. **Handlers não agem — validam**: Handler nunca deve interagir com a page diretamente nem chamar outras Pages. Declara Solution ou lança Exception.
130
+ 8. **Dependências de runtime**: `@odg/exception`, `inversify` e `@inversifyjs/binding-decorators` são dependências obrigatórias em runtime.
131
+ 9. **Ordem decorators**: `@ODGDecorators.injectable()` deve ser o primeiro decorator, ficando a cima de todos os demais para evitar criar container sem os demais decorators registrados.
132
+
133
+ ## 📖 Detailed Documentation
134
+
135
+ | Documento | Conteúdo |
136
+ |---|---|
137
+ | [docs/helpers.md](docs/helpers.md) | Guia completo de `retry()`, `sleep()`, `timeout()`, `throwIf()` com padrões de uso |
138
+ | [docs/crawlers.md](docs/crawlers.md) | Arquitetura Crawler: BrowserManager, Pages, Handlers, Container/DI, workflow examples |
139
+ | [docs/decorators.md](docs/decorators.md) | `@ODGDecorators.attemptableFlow`, `@ODGDecorators.getterAccess`, `@ODGDecorators.injectable` com lifecycle e exemplos |
140
+ | [docs/exceptions.md](docs/exceptions.md) | Referência completa de exceções com trigger, handling e exemplos |
141
+
142
+ ## 🔗 Interfaces Públicas
143
+
144
+ | Interface | Propósito |
145
+ |---|---|
146
+ | `AttemptableInterface` | Contrato base para Pages e Handlers: `execute()`, `attempt()`, hooks opcionais |
147
+ | `PageInterface` | Extends `AttemptableInterface`; contrato para `BasePage` |
148
+ | `HandlerInterface` | Extends `AttemptableInterface`; adiciona `waitForHandler()` |
149
+ | `GetterAccessInterface` | Define `__get(key, value)` para classes com `@getterAccess` |
150
+ | `CloneableInterface` | Define `clone()` para Support utilities (`Str`, `Num`, `Arr`) |
151
+ | `NativeInterface<Type>` | Define `toNative()` para conversão ao tipo primitivo |
152
+ | `RetryOptionsInterface` | Parâmetros de `retry()`: `times`, `sleep`, `callback`, `signal` |
153
+ | `TimeoutOptionsInterface` | Parâmetros de `timeout()`: `name`, `timeout`, `callback` |
154
+
155
+ ## 🔍 Entry Points
156
+
157
+ - **Main**: `import { retry, sleep, BrowserManager, BasePage, ... } from "@odg/chemical-x"`
158
+ - **Container only**: `import { Container } from "@odg/chemical-x/container"`
@@ -1,10 +1,11 @@
1
1
  import type { TypedContainer } from "@inversifyjs/strongly-typed";
2
2
  import type { EventListener, EventNameType, EventObjectType, EventOptions } from "@odg/events";
3
+ import { type BindingScope } from "inversify";
3
4
  import type { AttemptableInterface, GetterAccessInterface } from "../../Interfaces";
4
5
  export declare class ODGDecorators {
5
- protected static readonly metaDataPageOrHandler: string;
6
+ protected static readonly metadataInjectable: string;
6
7
  protected static readonly metaDataEvent: string;
7
- static injectablePageOrHandler(name: string): CallableFunction;
8
+ static injectable(name: string, scope?: BindingScope): CallableFunction;
8
9
  static attemptableFlow<T extends new (...constructors: any[]) => AttemptableInterface>(): (constructor: T) => T;
9
10
  static getterAccess<T extends new (..._ignore: never[]) => GetterAccessInterface>(): (targetClass: T) => T;
10
11
  static registerListener(eventName: EventNameType, containerName: string, options: EventOptions): CallableFunction;
@@ -5,11 +5,11 @@ const exception_1 = require("@odg/exception");
5
5
  const inversify_1 = require("inversify");
6
6
  const _helpers_1 = require("../../Helpers");
7
7
  class ODGDecorators {
8
- static metaDataPageOrHandler = "odg:bind-page-metadata";
8
+ static metadataInjectable = "odg:bind-page-metadata";
9
9
  static metaDataEvent = "odg:bind-events-metadata";
10
- static injectablePageOrHandler(name) {
10
+ static injectable(name, scope) {
11
11
  return (target) => {
12
- (0, inversify_1.decorate)((0, inversify_1.injectable)(), target);
12
+ (0, inversify_1.decorate)((0, inversify_1.injectable)(scope), target);
13
13
  (0, inversify_1.decorate)((0, inversify_1.injectFromHierarchy)({
14
14
  extendConstructorArguments: true,
15
15
  extendProperties: true,
@@ -18,12 +18,12 @@ class ODGDecorators {
18
18
  extendPreDestroyMethods: true,
19
19
  },
20
20
  }), target);
21
- const previousMetadata = Reflect.getMetadata(ODGDecorators.metaDataPageOrHandler, Reflect);
21
+ const previousMetadata = Reflect.getMetadata(ODGDecorators.metadataInjectable, Reflect);
22
22
  const newMetadata = [
23
23
  { target, name },
24
24
  ...previousMetadata ?? [],
25
25
  ];
26
- Reflect.defineMetadata(ODGDecorators.metaDataPageOrHandler, newMetadata, Reflect);
26
+ Reflect.defineMetadata(ODGDecorators.metadataInjectable, newMetadata, Reflect);
27
27
  };
28
28
  }
29
29
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -80,7 +80,7 @@ class ODGDecorators {
80
80
  return allEvents;
81
81
  }
82
82
  static async loadModule(containerInstance) {
83
- const provideMetadata = Reflect.getMetadata(ODGDecorators.metaDataPageOrHandler, Reflect) ?? [];
83
+ const provideMetadata = Reflect.getMetadata(ODGDecorators.metadataInjectable, Reflect) ?? [];
84
84
  for (const metadata of provideMetadata) {
85
85
  containerInstance
86
86
  .bind(metadata.name)
@@ -1 +1 @@
1
- {"version":3,"file":"OdgDecorators.js","sourceRoot":"","sources":["../../../src/Support/Decorators/OdgDecorators.ts"],"names":[],"mappings":";;;AAQA,8CAAkD;AAClD,yCAImB;AAEnB,uCAAiC;AAIjC,MAAa,aAAa;IAEZ,MAAM,CAAU,qBAAqB,GAAW,wBAAwB,CAAC;IAEzE,MAAM,CAAU,aAAa,GAAW,0BAA0B,CAAC;IAEtE,MAAM,CAAC,uBAAuB,CAAC,IAAY;QAC9C,OAAO,CAAC,MAAiD,EAAE,EAAE;YACzD,IAAA,oBAAQ,EAAC,IAAA,sBAAU,GAAE,EAAE,MAAM,CAAC,CAAC;YAC/B,IAAA,oBAAQ,EAAC,IAAA,+BAAmB,EAAC;gBACzB,0BAA0B,EAAE,IAAI;gBAChC,gBAAgB,EAAE,IAAI;gBACtB,SAAS,EAAE;oBACP,0BAA0B,EAAE,IAAI;oBAChC,uBAAuB,EAAE,IAAI;iBAChC;aACJ,CAAC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