feeef 0.12.1 → 0.12.3
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
|
@@ -13,6 +13,8 @@ npm run publish:npm
|
|
|
13
13
|
npm run release
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
+
Related CLI package (separate publish): [`@feeef.dev/cli`](https://www.npmjs.com/package/@feeef.dev/cli) in monorepo `cli/`.
|
|
17
|
+
|
|
16
18
|
## Delivery parcel types
|
|
17
19
|
|
|
18
20
|
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
|
@@ -141,7 +141,8 @@ var ModelRepository = class {
|
|
|
141
141
|
* @returns A promise that resolves to the created model.
|
|
142
142
|
*/
|
|
143
143
|
async create(dataOrOptions, params) {
|
|
144
|
-
|
|
144
|
+
const looksLikeOptions = dataOrOptions && typeof dataOrOptions === "object" && "data" in dataOrOptions && Object.keys(dataOrOptions).every((k) => k === "data" || k === "params");
|
|
145
|
+
if (looksLikeOptions) {
|
|
145
146
|
const options2 = dataOrOptions;
|
|
146
147
|
const { data, params: optionsParams } = options2;
|
|
147
148
|
const requestParams = optionsParams || params;
|
|
@@ -2973,16 +2974,66 @@ var StoreTemplatesRepository = class extends ModelRepository {
|
|
|
2973
2974
|
return res.data;
|
|
2974
2975
|
}
|
|
2975
2976
|
/**
|
|
2976
|
-
* Set `stores.template_id`
|
|
2977
|
-
*
|
|
2978
|
-
* `store_templates` row — use [fork] to duplicate a template into a store.
|
|
2977
|
+
* Set `stores.template_id` (+ optional release pin) and copy release/listing
|
|
2978
|
+
* `data` into `store.metadata.templateData`. Paid listings require a license.
|
|
2979
2979
|
*/
|
|
2980
2980
|
async install(options) {
|
|
2981
2981
|
const res = await this.client.post(`/${this.resource}/${options.fromId}/install`, {
|
|
2982
|
+
storeId: options.storeId,
|
|
2983
|
+
...options.releaseId ? { releaseId: options.releaseId } : {}
|
|
2984
|
+
});
|
|
2985
|
+
return res.data;
|
|
2986
|
+
}
|
|
2987
|
+
/** One-time wallet purchase → forever store license. */
|
|
2988
|
+
async purchase(options) {
|
|
2989
|
+
const res = await this.client.post(`/${this.resource}/${options.fromId}/purchase`, {
|
|
2982
2990
|
storeId: options.storeId
|
|
2983
2991
|
});
|
|
2984
2992
|
return res.data;
|
|
2985
2993
|
}
|
|
2994
|
+
/** List immutable releases (newest first). */
|
|
2995
|
+
async listReleases(templateId, options) {
|
|
2996
|
+
const res = await this.client.get(`/${this.resource}/${templateId}/releases`, {
|
|
2997
|
+
params: options?.storeId ? { storeId: options.storeId } : void 0
|
|
2998
|
+
});
|
|
2999
|
+
return res.data;
|
|
3000
|
+
}
|
|
3001
|
+
async getRelease(templateId, releaseId, options) {
|
|
3002
|
+
const res = await this.client.get(`/${this.resource}/${templateId}/releases/${releaseId}`, {
|
|
3003
|
+
params: options?.storeId ? { storeId: options.storeId } : void 0
|
|
3004
|
+
});
|
|
3005
|
+
return res.data;
|
|
3006
|
+
}
|
|
3007
|
+
/** Author publishes a new immutable release. */
|
|
3008
|
+
async createRelease(templateId, input) {
|
|
3009
|
+
const res = await this.client.post(`/${this.resource}/${templateId}/releases`, input);
|
|
3010
|
+
return res.data;
|
|
3011
|
+
}
|
|
3012
|
+
/** Public render payload for historical / marketing preview (no auth required for public listings). */
|
|
3013
|
+
async renderRelease(templateId, releaseId) {
|
|
3014
|
+
const res = await this.client.get(
|
|
3015
|
+
`/${this.resource}/${templateId}/releases/${releaseId}/render`
|
|
3016
|
+
);
|
|
3017
|
+
return res.data;
|
|
3018
|
+
}
|
|
3019
|
+
async listReviews(templateId, options) {
|
|
3020
|
+
const res = await this.client.get(`/${this.resource}/${templateId}/reviews`, {
|
|
3021
|
+
params: options
|
|
3022
|
+
});
|
|
3023
|
+
return res.data;
|
|
3024
|
+
}
|
|
3025
|
+
async upsertReview(options) {
|
|
3026
|
+
const res = await this.client.post(`/${this.resource}/${options.templateId}/reviews`, {
|
|
3027
|
+
storeId: options.storeId,
|
|
3028
|
+
rating: options.rating,
|
|
3029
|
+
body: options.body ?? null
|
|
3030
|
+
});
|
|
3031
|
+
return res.data;
|
|
3032
|
+
}
|
|
3033
|
+
async earnings() {
|
|
3034
|
+
const res = await this.client.get(`/store_templates_earnings`);
|
|
3035
|
+
return res.data;
|
|
3036
|
+
}
|
|
2986
3037
|
/** GET locales bundle (`defaultLocale`, `locales`, `messages`). */
|
|
2987
3038
|
async listLocales(templateId) {
|
|
2988
3039
|
const res = await this.client.get(`/${this.resource}/${templateId}/locales`);
|