wetaca-cli 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +93 -2
- package/bin/wetaca.js +248 -0
- package/docs/GUIA.md +118 -0
- package/docs/agent-guide.md +71 -0
- package/docs/api-operations/wetaca_bundle__Doc0.graphql +40 -0
- package/docs/api-operations/wetaca_bundle__Doc1.graphql +14 -0
- package/docs/api-operations/wetaca_bundle__Doc10.graphql +45 -0
- package/docs/api-operations/wetaca_bundle__Doc11.graphql +9 -0
- package/docs/api-operations/wetaca_bundle__Doc2.graphql +7 -0
- package/docs/api-operations/wetaca_bundle__Doc3.graphql +39 -0
- package/docs/api-operations/wetaca_bundle__Doc4.graphql +36 -0
- package/docs/api-operations/wetaca_bundle__Doc5.graphql +40 -0
- package/docs/api-operations/wetaca_bundle__Doc6.graphql +33 -0
- package/docs/api-operations/wetaca_bundle__Doc7.graphql +48 -0
- package/docs/api-operations/wetaca_bundle__Doc8.graphql +92 -0
- package/docs/api-operations/wetaca_bundle__Doc9.graphql +95 -0
- package/docs/api-operations/wetaca_bundle__SaveWeeklySurveyStep.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__StartWeeklySurvey.graphql +33 -0
- package/docs/api-operations/wetaca_bundle__SubmitWeeklySurvey.graphql +16 -0
- package/docs/api-operations/wetaca_bundle__SubscriptionDeliveryChangePriceQueryV2.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__SuggestionDeliveryChangePriceQueryV2.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__activateSubscriptionAccount.graphql +45 -0
- package/docs/api-operations/wetaca_bundle__activeReferredReward.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__addProductsToProfileWhitelist.graphql +9 -0
- package/docs/api-operations/wetaca_bundle__addProductsToSubscriptionProfileBlacklist.graphql +9 -0
- package/docs/api-operations/wetaca_bundle__addProfileToSubscriptionAccount.graphql +56 -0
- package/docs/api-operations/wetaca_bundle__addRecurrenceVoucherToCustomer.graphql +23 -0
- package/docs/api-operations/wetaca_bundle__addSubscriptionProfileSuggestionOverwrites.graphql +9 -0
- package/docs/api-operations/wetaca_bundle__addresses.graphql +17 -0
- package/docs/api-operations/wetaca_bundle__addressesInManager.graphql +17 -0
- package/docs/api-operations/wetaca_bundle__allRecommenderIngredients.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__appendNewPaymentSubscriptionMethod.graphql +8 -0
- package/docs/api-operations/wetaca_bundle__applyOrderVoucher.graphql +33 -0
- package/docs/api-operations/wetaca_bundle__articleQuery.graphql +22 -0
- package/docs/api-operations/wetaca_bundle__articlesByCategoryQuery.graphql +13 -0
- package/docs/api-operations/wetaca_bundle__assignNextSuggestionVoucher.graphql +9 -0
- package/docs/api-operations/wetaca_bundle__authorizePaypalTokenGenerationPaymentIntention.graphql +7 -0
- package/docs/api-operations/wetaca_bundle__authorizeRedsysAppApplePayPayment.graphql +16 -0
- package/docs/api-operations/wetaca_bundle__authorizeRedsysAppGooglePayPayment.graphql +16 -0
- package/docs/api-operations/wetaca_bundle__authorizeRedsysApplePayPayment.graphql +16 -0
- package/docs/api-operations/wetaca_bundle__authorizeRedsysGooglePayPayment.graphql +16 -0
- package/docs/api-operations/wetaca_bundle__authorizeRedsysPaymentIntention.graphql +17 -0
- package/docs/api-operations/wetaca_bundle__bypassSMSValidationConfigQuery.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__calculateNextProfileSuggestions.graphql +31 -0
- package/docs/api-operations/wetaca_bundle__cancelConfirmedOrder.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__cancelSubscriptionAccount.graphql +45 -0
- package/docs/api-operations/wetaca_bundle__categoriesQuery.graphql +15 -0
- package/docs/api-operations/wetaca_bundle__changeOptionsQuery.graphql +21 -0
- package/docs/api-operations/wetaca_bundle__changeOrderDelivery.graphql +27 -0
- package/docs/api-operations/wetaca_bundle__changePasswordInProfile.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__changeSubscriptionOptInMode.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__changeSubscriptionPaymentPaymentMethodsEdit.graphql +8 -0
- package/docs/api-operations/wetaca_bundle__computeConfirmedOrderModificationPriceSummary.graphql +7 -0
- package/docs/api-operations/wetaca_bundle__confirmDeliveryReschedule.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__confirmedOrderEditContext.graphql +95 -0
- package/docs/api-operations/wetaca_bundle__currentRecurrenceVouchers.graphql +23 -0
- package/docs/api-operations/wetaca_bundle__customer.graphql +11 -0
- package/docs/api-operations/wetaca_bundle__customerBillingAddresses.graphql +18 -0
- package/docs/api-operations/wetaca_bundle__customerFF.graphql +7 -0
- package/docs/api-operations/wetaca_bundle__customerFeatureFlagBySlug.graphql +7 -0
- package/docs/api-operations/wetaca_bundle__customerFeatureFlagForAnalytics.graphql +8 -0
- package/docs/api-operations/wetaca_bundle__customerHasReferralVouchers.graphql +11 -0
- package/docs/api-operations/wetaca_bundle__customerPaymentMethods.graphql +23 -0
- package/docs/api-operations/wetaca_bundle__customerVouchers.graphql +224 -0
- package/docs/api-operations/wetaca_bundle__customerWalletScheduledDeposits.graphql +15 -0
- package/docs/api-operations/wetaca_bundle__customerWithSegment.graphql +61 -0
- package/docs/api-operations/wetaca_bundle__deleteCustomerAccount.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__deleteCustomerScheduledDeposit.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__deliveryOptionsByZipcode.graphql +27 -0
- package/docs/api-operations/wetaca_bundle__deliveryRescheduleWithAvailability.graphql +53 -0
- package/docs/api-operations/wetaca_bundle__dish.graphql +39 -0
- package/docs/api-operations/wetaca_bundle__editAccountBillingAddress.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__editDeliveryAccountInfo.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__editProfileSuggestionMenu.graphql +9 -0
- package/docs/api-operations/wetaca_bundle__editSubscriptionDelivery.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__editSubscriptionProfileAllergens.graphql +56 -0
- package/docs/api-operations/wetaca_bundle__editSubscriptionProfileDislikes.graphql +56 -0
- package/docs/api-operations/wetaca_bundle__editSubscriptionProfileMenu.graphql +56 -0
- package/docs/api-operations/wetaca_bundle__editSubscriptionProfileMenuAndNutrition.graphql +56 -0
- package/docs/api-operations/wetaca_bundle__editSubscriptionProfileSpicy.graphql +56 -0
- package/docs/api-operations/wetaca_bundle__editSubscriptionTastesProfile.graphql +38 -0
- package/docs/api-operations/wetaca_bundle__editSuggestionDelivery.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__featuredArticlesQuery.graphql +16 -0
- package/docs/api-operations/wetaca_bundle__getChargingSuggestionMetadata.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__getDeliveryConfigurationMaxQuantities.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__getDeliveryConfigurationProductAvailability.graphql +13 -0
- package/docs/api-operations/wetaca_bundle__getDeliveryConfigurationProductAvailabilityWithExceptions.graphql +28 -0
- package/docs/api-operations/wetaca_bundle__getSubscriptionAccountDeliveryConfigurationProductAvailability.graphql +38 -0
- package/docs/api-operations/wetaca_bundle__getUseGoogleSocialLoginInIosAppConfiguration.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__getWeeklySurveyConfig.graphql +7 -0
- package/docs/api-operations/wetaca_bundle__giftCardsConfiguration.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__globalConfigurations.graphql +10 -0
- package/docs/api-operations/wetaca_bundle__initNewRedsysPaymentIntention.graphql +10 -0
- package/docs/api-operations/wetaca_bundle__initPaypalTokenGenerationPaymentIntention.graphql +7 -0
- package/docs/api-operations/wetaca_bundle__initializePaymentProcessEvent.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__isNextSuggestionSkiped.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__landingTemplateCollectionQuery.graphql +157 -0
- package/docs/api-operations/wetaca_bundle__landingTemplateFloatingBarQuery.graphql +8 -0
- package/docs/api-operations/wetaca_bundle__lastUsedOrderOptions.graphql +34 -0
- package/docs/api-operations/wetaca_bundle__linkGoogleAccountByPassword.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__linkGoogleAccountBySMS.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__linkGoogleAccountPhone.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__linkPhoneNumberToAccount.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__markSuggestionAsViewedInEditableState.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__menuProductIds.graphql +8 -0
- package/docs/api-operations/wetaca_bundle__modifyConfirmedOrderProducts.graphql +7 -0
- package/docs/api-operations/wetaca_bundle__mostRecentZipCode.graphql +9 -0
- package/docs/api-operations/wetaca_bundle__myDetailsAccountWithProfiles.graphql +506 -0
- package/docs/api-operations/wetaca_bundle__newBlogLeadMutation.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__nextDeliveries.graphql +190 -0
- package/docs/api-operations/wetaca_bundle__nextSubscriptionStartOfChargeTimeQuery.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__nextSuggestion.graphql +231 -0
- package/docs/api-operations/wetaca_bundle__nextSuggestionAddVoucherPage.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__nextSuggestionIdAndVoucher.graphql +8 -0
- package/docs/api-operations/wetaca_bundle__nextSuggestionVoucherAndPrice.graphql +10 -0
- package/docs/api-operations/wetaca_bundle__orderDetails.graphql +124 -0
- package/docs/api-operations/wetaca_bundle__pauseProfile.graphql +56 -0
- package/docs/api-operations/wetaca_bundle__pauseResumeProfile.graphql +56 -0
- package/docs/api-operations/wetaca_bundle__pauseSubscriptionQuery.graphql +17 -0
- package/docs/api-operations/wetaca_bundle__pauseSuggestion.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__pauseSuggestionProfile.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__paySubscriptionPendingOrderWithPaymentMethod.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__payTransactionalOrder.graphql +39 -0
- package/docs/api-operations/wetaca_bundle__pendingDeliveryOrders.graphql +473 -0
- package/docs/api-operations/wetaca_bundle__pendingPaymentOrderById.graphql +63 -0
- package/docs/api-operations/wetaca_bundle__pendingTransactionalDeliveryOrders.graphql +80 -0
- package/docs/api-operations/wetaca_bundle__previousDeliveries.graphql +33 -0
- package/docs/api-operations/wetaca_bundle__profileHasEditTastes.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__profileSuggestionBySuggestionId.graphql +190 -0
- package/docs/api-operations/wetaca_bundle__profileSuggestionWithProfileById.graphql +142 -0
- package/docs/api-operations/wetaca_bundle__purchaseGiftCard.graphql +10 -0
- package/docs/api-operations/wetaca_bundle__rechargeCustomerWalletWithPaymentMethod.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__recommendedArticlesQuery.graphql +20 -0
- package/docs/api-operations/wetaca_bundle__recommenderIngredientsByNames.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__recoverPassword.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__recurrenceNextAssociatedVoucher.graphql +23 -0
- package/docs/api-operations/wetaca_bundle__redeemGiftCard.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__referralConfig.graphql +61 -0
- package/docs/api-operations/wetaca_bundle__registerLogout.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__registerPaymentProcessEvent.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__removeAddress.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__removeAddressInManager.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__removeCreditCard.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__removeCustomerBillingAddress.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__removeProfileWithSuggestions.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__requestDeliveryRescheduleSupport.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__resetPassword.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__resumeSuggestion.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__resumeSuggestionProfile.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__salesPlanCategory.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__saveAddress.graphql +13 -0
- package/docs/api-operations/wetaca_bundle__saveCustomerBillingAddress.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__saveSubscriptionShoppingCart.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__scheduleNewCustomerWalletRecharges.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__segmentBySlug.graphql +75 -0
- package/docs/api-operations/wetaca_bundle__segmentMenu.graphql +89 -0
- package/docs/api-operations/wetaca_bundle__sessionTokenByPassword.graphql +7 -0
- package/docs/api-operations/wetaca_bundle__sessionTokenBySms.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__setPasswordInProfile.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__shoppingCart.graphql +18 -0
- package/docs/api-operations/wetaca_bundle__signUp.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__signUpWithGoogle.graphql +15 -0
- package/docs/api-operations/wetaca_bundle__someProfileHasEditTastes.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__subscribeCustomer.graphql +11 -0
- package/docs/api-operations/wetaca_bundle__subscribeToReactivationUrlVoucher.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__subscribeToVoucherAddVoucherPage.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__subscriberAccountStatus.graphql +8 -0
- package/docs/api-operations/wetaca_bundle__subscriptionAccountByCustomerWithPayments.graphql +10 -0
- package/docs/api-operations/wetaca_bundle__subscriptionAccountChangePricing.graphql +92 -0
- package/docs/api-operations/wetaca_bundle__subscriptionAccountIntentPricing.graphql +156 -0
- package/docs/api-operations/wetaca_bundle__subscriptionAccountIntentPricingForMenu.graphql +134 -0
- package/docs/api-operations/wetaca_bundle__subscriptionAccountIntentPricingFunnelCart.graphql +26 -0
- package/docs/api-operations/wetaca_bundle__subscriptionAccountIntentPricingVoucher.graphql +9 -0
- package/docs/api-operations/wetaca_bundle__subscriptionAccountProductsSubscriptionPricing.graphql +26 -0
- package/docs/api-operations/wetaca_bundle__subscriptionAvailability.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__subscriptionIntentMenuProductsPricing.graphql +26 -0
- package/docs/api-operations/wetaca_bundle__subscriptionMenuWithWelcomeVoucherQuery.graphql +66 -0
- package/docs/api-operations/wetaca_bundle__subscriptionSegmentMenu.graphql +48 -0
- package/docs/api-operations/wetaca_bundle__subscriptionVoucher.graphql +27 -0
- package/docs/api-operations/wetaca_bundle__subscriptionWelcomeVoucher.graphql +10 -0
- package/docs/api-operations/wetaca_bundle__suggestioMenuProductsPricing.graphql +26 -0
- package/docs/api-operations/wetaca_bundle__suggestionById.graphql +52 -0
- package/docs/api-operations/wetaca_bundle__suggestionByIdData.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__suggestionChangePricing.graphql +122 -0
- package/docs/api-operations/wetaca_bundle__syncFeatureFlags.graphql +7 -0
- package/docs/api-operations/wetaca_bundle__tokenIsValid.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__totalOrdersSummaryByCustomer.graphql +21 -0
- package/docs/api-operations/wetaca_bundle__trackInternalEvent.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__trackInternalGEvent.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__trackInternalLPEvent.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__trackLoginInternalEvent.graphql +5 -0
- package/docs/api-operations/wetaca_bundle__transactionalSegmentMenu.graphql +47 -0
- package/docs/api-operations/wetaca_bundle__updateSubscriptionProfileCharacter.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__updateSubscriptionProfileName.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__updateUserProfile.graphql +10 -0
- package/docs/api-operations/wetaca_bundle__useCaptchaConfig.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__userSessionSubscription.graphql +20 -0
- package/docs/api-operations/wetaca_bundle__validateSegment.graphql +19 -0
- package/docs/api-operations/wetaca_bundle__validateSubscriptionIntent.graphql +6 -0
- package/docs/api-operations/wetaca_bundle__voucherCustomDisplay.graphql +22 -0
- package/docs/api-operations/wetaca_bundle__walletBalance.graphql +3 -0
- package/docs/api-operations/wetaca_bundle__walletOperations.graphql +11 -0
- package/docs/cli-spec.md +113 -0
- package/package.json +42 -4
- package/src/commands.js +700 -0
- package/src/guide.js +73 -0
- package/src/lib.js +371 -0
- package/src/queries.js +235 -0
package/docs/cli-spec.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# wetaca-cli spec
|
|
2
|
+
|
|
3
|
+
Status: v0.1, 2026-10-29. Vocabulary in section 2. The endpoint facts come from the
|
|
4
|
+
bundle of the wetaca.com website (SPA v49.6.0) and from live testing on that day. Unofficial API, may drift.
|
|
5
|
+
|
|
6
|
+
## 1. Name
|
|
7
|
+
|
|
8
|
+
Binary `wetaca`. npm package `wetaca-cli`, JavaScript (Node >= 18), zero dependencies.
|
|
9
|
+
|
|
10
|
+
## 2. Vocabulary
|
|
11
|
+
|
|
12
|
+
**Subscription (SubscriptionAccount)**: your recurring customer account, id `ModelId`. It has profiles, a delivery address, delivery slot and price.
|
|
13
|
+
|
|
14
|
+
**Profile (SubscriptionProfile)**: a person within the subscription, with their own menu, allergens and preferences.
|
|
15
|
+
|
|
16
|
+
**Suggestion (Suggestion)**: the proposed order for a week, identified by `id` (ModelId). It is what gets charged if nothing is touched. `skip=true` means a skipped week.
|
|
17
|
+
|
|
18
|
+
**Profile-suggestion (profileSuggestion)**: the menu of a profile within a Suggestion. The one edited with `suggestion edit`.
|
|
19
|
+
|
|
20
|
+
**Delivery (Delivery/Order)**: a concrete order, numeric id (`Int`), with `reference`, status and `invoiceUrl`.
|
|
21
|
+
|
|
22
|
+
**Slot (option)**: delivery time window (`start`, `end`, `price`).
|
|
23
|
+
|
|
24
|
+
**Next suggestion**: `nextSuggestion`, the upcoming not-yet-charged week. It is the one managed by `suggestion *`.
|
|
25
|
+
|
|
26
|
+
## 3. Command tree
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
auth login [--refresh-token COOKIE | --cookies FILE | --cookies-stdin | --token T [--clipboard]] | status | logout
|
|
30
|
+
me show
|
|
31
|
+
subscription show | pause [--weeks N] [--feedback S] | resume
|
|
32
|
+
suggestion show | pause [--feedback S] | resume | edit --profile-suggestion ID --set "id:qty,..."
|
|
33
|
+
deliveries next | options [--zipcode ZIP] | set-option <id>
|
|
34
|
+
menu list [--zipcode ZIP] weekly menu (dish ids for suggestion edit)
|
|
35
|
+
dish show <slug> dish details
|
|
36
|
+
profiles list | pause <id|name> | resume <id|name>
|
|
37
|
+
orders list [--limit N] [--offset N] | show <id> | cancel <id>
|
|
38
|
+
addresses list | save --street S --number N [--floor F] --zipcode ZIP --city CITY | remove <id>
|
|
39
|
+
save creates the address and assigns it to the subscription and to the next week
|
|
40
|
+
(website flow: saveAddress -> editDeliveryAccountInfo -> editSuggestionDelivery);
|
|
41
|
+
optional --notes --firstname --lastname --phone; confirmation unless --yes
|
|
42
|
+
remove only deletes addresses not in use
|
|
43
|
+
vouchers list
|
|
44
|
+
wallet show
|
|
45
|
+
config path | list | get <k> | set <k> <v>
|
|
46
|
+
doctor
|
|
47
|
+
skills list | get wetaca-usage
|
|
48
|
+
completion bash | zsh | fish
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 4. Global flags
|
|
52
|
+
|
|
53
|
+
`--format json|jsonl|pretty` (env `WETACA_FORMAT`), `--error-format text|json` (env `WETACA_ERROR_FORMAT`),
|
|
54
|
+
`--profile NAME` (env `WETACA_PROFILE`), `--yes`, `--no-input` (env `WETACA_NO_INPUT=1`),
|
|
55
|
+
`--dry-run`, `--debug`, `--no-color`, `--help`, `--version`.
|
|
56
|
+
|
|
57
|
+
## 5. Contract for agents
|
|
58
|
+
|
|
59
|
+
- stdout: JSON (one object per command; `orders list` and `addresses list` return an array; `--format jsonl` emits one line per item of those lists).
|
|
60
|
+
- stderr: warnings and errors. `--error-format json` -> `{ error: { code, category, reason, retryable, message, suggested_commands, details? } }`.
|
|
61
|
+
- Exit codes: `0` ok / `1` unexpected / `2` usage/validation/confirmation denied / `3` auth (login or expired token) / `4` network / `5` not found / `6` the API rejected the operation (graphql_error/http_*) / `7` contract drift (`contract_drift`, `null_field`).
|
|
62
|
+
- Confirmation: every mutation with real effects shows a summary and asks `y/N`; without a TTY (or with `--no-input`) it requires `--yes`. `--dry-run` (on `suggestion edit` and `orders cancel`) prints the payload with no effects.
|
|
63
|
+
- Embedded guide: `wetaca skills get wetaca-usage`.
|
|
64
|
+
|
|
65
|
+
## 6. Session
|
|
66
|
+
|
|
67
|
+
- **Recommended path - `refresh-token` cookie**: log in to wetaca.com, F12 -> Application -> Cookies -> `https://wetaca.com` -> copy the value of **`refresh-token`** (lasts ~120 days) and run `wetaca auth login --refresh-token <VALUE>` (or paste it when the CLI prompts for it, hidden). The CLI stores it in `credentials.json` (0600) and **renews only the session token** via `POST /session/refresh` (header `x-wetaca-session: 1`, cookie `refresh-token`), exactly like the website does. If the API rotates the refresh-token in the response, the CLI stores the new one.
|
|
68
|
+
- **Import from a cookie export**: `wetaca auth login --cookies cookies.txt` or `--cookies-stdin`. Formats: Netscape cookies.txt (includes `#HttpOnly_` lines), Cookie-Editor/EditThisCookie JSON (array or `{url, cookies}`), `Cookie:` header, or the bare value. Only wetaca.com cookies are read; if there is no `refresh-token` in the export, a clear error is shown.
|
|
69
|
+
- Direct session token import (alternative, expires in ~1h): F12 -> Network -> filter `api.wetaca.com` -> any request -> header `authorization: Bearer ***` -> `wetaca auth login --token <TOKEN>` (or `--clipboard`). Any format is accepted and validated by running the `customer` query.
|
|
70
|
+
- **The password is never requested or stored** (user's decision). The `sessionTokenByPassword` endpoints exist in the API but the CLI does not use them.
|
|
71
|
+
- Validation: the test that matters is that the `customer` query responds with the token (`tokenIsValid` is diagnostic only: it returned false with valid tokens).
|
|
72
|
+
- Storage: secrets (token, refreshToken) in `credentials.json` with restrictive permissions (0600 / user-only ACL); everything else in `config.json`. Env: `WETACA_TOKEN` (CI, highest priority), `WETACA_REFRESH_TOKEN` (CI, auto-refresh without disk). Profiles: `--profile` / `WETACA_PROFILE` / `defaultProfile`.
|
|
73
|
+
- Header: `authorization: Bearer ***` on every request.
|
|
74
|
+
|
|
75
|
+
## 7. API
|
|
76
|
+
|
|
77
|
+
- Endpoint: `POST https://api.wetaca.com/graphql` (Apollo Server, introspection disabled), JSON `{query, variables}`. `WETACA_API_URL` overrides it (tests).
|
|
78
|
+
- Types used by the CLI: `ModelId` (string), `Int` (order ids), `OrderProductMapGraph` (`{id, quantity}` in `productsInput`), `EditSuggestionDeliveryGraph` (not yet used by the CLI).
|
|
79
|
+
- Drift: top-level `null` field without errors -> exit 7. `UNAUTHENTICATED` error -> exit 3.
|
|
80
|
+
|
|
81
|
+
## 8. Operations used (v0.1)
|
|
82
|
+
|
|
83
|
+
| command | operation |
|
|
84
|
+
|---|---|
|
|
85
|
+
| auth login | `sessionTokenByPassword`, `tokenIsValid` |
|
|
86
|
+
| auth status | `tokenIsValid`, `customer` |
|
|
87
|
+
| auth logout | `registerLogout` |
|
|
88
|
+
| me | `customer`, `subscriptionAccountByCustomer` (status), `walletBalance` |
|
|
89
|
+
| subscription show | `subscriptionAccountByCustomer` (full) + `nextSuggestion` |
|
|
90
|
+
| subscription pause | `cancelSubscriptionAccount(pausedWeeks)` |
|
|
91
|
+
| subscription resume | `activateSubscriptionAccount` |
|
|
92
|
+
| suggestion show | `nextSuggestion` (per-profile menus, pricing, delivery) |
|
|
93
|
+
| suggestion pause/resume | `pauseSuggestion` / `resumeSuggestion` |
|
|
94
|
+
| suggestion edit | `editProfileSuggestionProducts` |
|
|
95
|
+
| deliveries next | `nextSuggestions` + `nextDeliveries` + `nextPaymentPendingOrder` |
|
|
96
|
+
| orders list | `previousDeliveries(limit, offset)` |
|
|
97
|
+
| orders show | `order(id)` |
|
|
98
|
+
| orders cancel | `cancelConfirmedOrder(orderId)` |
|
|
99
|
+
| addresses list | `addresses` |
|
|
100
|
+
| vouchers list | `vouchers(limit, skipExpired, skipFuture)` |
|
|
101
|
+
| wallet show | `walletBalance` |
|
|
102
|
+
|
|
103
|
+
## 9. Not supported yet (present on the website, not in the CLI)
|
|
104
|
+
|
|
105
|
+
Payments (Redsys/PayPal/GooglePay/ApplePay), changing the payment method, scheduled wallet top-ups,
|
|
106
|
+
changing the delivery address/slot (`editSuggestionDelivery`, the `EditSuggestionDeliveryGraph` input
|
|
107
|
+
is unvalidated), new account sign-up with SMS, Google OAuth, weekly survey, active referrals.
|
|
108
|
+
|
|
109
|
+
## 10. Known limitations
|
|
110
|
+
|
|
111
|
+
- The `productId`/`profileSuggestionId` ids are internal; they are obtained from `suggestion show`/`deliveries next`.
|
|
112
|
+
- The price is returned in cents (the `*Eur` field is already formatted in some responses).
|
|
113
|
+
- `subscription pause` uses `cancelSubscriptionAccount` with `pausedWeeks`; the API treats it as a temporary pause. Without `--weeks` it is an indefinite pause; reactivate with `subscription resume`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wetaca-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Gestiona tu Wetaca desde el terminal: suscripción, menú semanal, entregas y pedidos. Pensado para personas y para agentes IA.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"wetaca": "bin/wetaca.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"src",
|
|
12
|
+
"docs",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"keywords": [
|
|
17
|
+
"wetaca",
|
|
18
|
+
"cli",
|
|
19
|
+
"tupper",
|
|
20
|
+
"suscripcion",
|
|
21
|
+
"agentes-ia",
|
|
22
|
+
"graphql"
|
|
23
|
+
],
|
|
24
|
+
"author": {
|
|
25
|
+
"name": "Jorge Soler Padial",
|
|
26
|
+
"url": "https://github.com/gorgueugr"
|
|
27
|
+
},
|
|
28
|
+
"contributors": [
|
|
29
|
+
{
|
|
30
|
+
"name": "Hermes Agent (Nous Research)",
|
|
31
|
+
"url": "https://github.com/NousResearch/hermes-agent"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"homepage": "https://github.com/gorgueugr/wetaca-cli#readme",
|
|
35
|
+
"bugs": "https://github.com/gorgueugr/wetaca-cli/issues",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/gorgueugr/wetaca-cli.git"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=18"
|
|
42
|
+
},
|
|
43
|
+
"license": "MIT"
|
|
44
|
+
}
|