feeef 0.12.0 → 0.12.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/README.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  `feeefjs` is a TypeScript library for managing feeef e-commerce platforms for self-hosted stores. It provides a wrapper for feeef rest api such like send order..., also have frontend srvices like the `CartService` class for managing cart items, shipping methods, and calculating totals. The library also includes a `NotifiableService` base class for handling listeners that react to changes in the service state.
4
4
 
5
+ ## Publish to npm
6
+
7
+ Non-interactive publish (no login / OTP each time): see **[PUBLISH.md](./PUBLISH.md)**.
8
+
9
+ ```bash
10
+ # one-time: granular token + Bypass 2FA → ~/.config/feeef/npm_token or NPM_TOKEN
11
+ npm run publish:npm
12
+ # or version bump + tag + publish:
13
+ npm run release
14
+ ```
15
+
5
16
  ## Delivery parcel types
6
17
 
7
18
  Canonical shipment shapes mirror the API domain in `feeefapps/backend/services/delivery/domain/parcel.ts`. In this package they live under `src/delivery/parcel.ts` and are exported from the main entry (`ParcelCreate`, `ParcelUpdate`, `DeliveryCarrierClient`, …). Keep them in sync when the backend parcel model changes; published npm `feeef` should re-export the same definitions after each release.
package/build/index.js CHANGED
@@ -690,6 +690,29 @@ var StoreRepository = class extends ModelRepository {
690
690
  });
691
691
  return res.data;
692
692
  }
693
+ /**
694
+ * Upserts a draft theme preview (does not change live `metadata.templateData`).
695
+ */
696
+ async putTemplatePreview(storeId, body) {
697
+ const res = await this.client.put(`/${this.resource}/${storeId}/template-preview`, body);
698
+ return res.data;
699
+ }
700
+ /**
701
+ * Clears the draft theme preview for a store.
702
+ */
703
+ async clearTemplatePreview(storeId) {
704
+ const res = await this.client.delete(`/${this.resource}/${storeId}/template-preview`);
705
+ return res.data;
706
+ }
707
+ /**
708
+ * Fetches draft TemplateData with a signed preview token (public, token-gated).
709
+ */
710
+ async getTemplatePreview(storeId, token) {
711
+ const res = await this.client.get(`/${this.resource}/${storeId}/template-preview`, {
712
+ params: { token }
713
+ });
714
+ return res.data;
715
+ }
693
716
  };
694
717
 
695
718
  // src/feeef/repositories/users.ts
@@ -1168,15 +1191,18 @@ var OAuthRepository = class {
1168
1191
  }
1169
1192
  /**
1170
1193
  * Exchanges an authorization code for an access token.
1194
+ * Public clients omit `clientSecret` and must send `codeVerifier` (PKCE).
1171
1195
  */
1172
1196
  async exchangeAuthorizationCode(params) {
1173
1197
  const body = new URLSearchParams({
1174
1198
  grant_type: "authorization_code",
1175
1199
  code: params.code,
1176
1200
  redirect_uri: params.redirectUri,
1177
- client_id: params.clientId,
1178
- client_secret: params.clientSecret
1201
+ client_id: params.clientId
1179
1202
  });
1203
+ if (params.clientSecret) {
1204
+ body.set("client_secret", params.clientSecret);
1205
+ }
1180
1206
  if (params.codeVerifier) {
1181
1207
  body.set("code_verifier", params.codeVerifier);
1182
1208
  }