@wix/himalaya-cli 0.1036.0 → 0.1037.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/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/portfolio/src/index.d.ts +46 -9
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-portfolio.mjs +14 -2
- package/dist/cli.mjs +476 -109
- package/dist/preview-assets.generated.bin +0 -0
- package/fixtures/wix-canned.json +51 -2
- package/guides/sdk-reference.json +16 -10
- package/guides/wix-business-context.md +13 -1
- package/guides/wix-site-to-himi-app.md +10 -1
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/himi-booking-bookings/index.ts +14 -8
- package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +12 -1
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-module-data.ts +2 -2
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-appointments/index.ts +4 -1
- package/templates/branded-lite/tier5-src/himi-booking-bookings/index.ts +14 -8
- package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +12 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio/index.ts +2 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio-project/index.ts +3 -3
- package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +12 -1
- package/templates/community-club-owner/tier5-src/_shared/owner-module-data.ts +2 -2
- package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +12 -1
- package/templates/events-meetups-owner/tier5-src/_shared/owner-module-data.ts +2 -2
- package/templates/gym-fitness/tier5-src/himi-booking-bookings/index.ts +14 -8
- package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +12 -1
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-module-data.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-appointments/index.ts +4 -1
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +12 -1
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-module-data.ts +2 -2
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-appointments/index.ts +4 -1
- package/templates/owner-lite/tier5-src/_shared/owner-module-data.ts +2 -2
- package/templates/owner-lite/tier5-src/himi-owner-lite-appointments/index.ts +4 -1
- package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +12 -1
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-module-data.ts +2 -2
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +12 -1
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio/index.ts +2 -2
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio-project/index.ts +3 -3
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-module-data.ts +2 -2
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-appointments/index.ts +4 -1
- package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +12 -1
- package/templates/restaurant-owner/tier5-src/_shared/owner-module-data.ts +2 -2
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-appointments/index.ts +4 -1
- package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +12 -1
- package/templates/retail-store-owner/tier5-src/_shared/owner-module-data.ts +2 -2
- package/templates/yoga-studio/tier5-src/himi-booking-bookings/index.ts +14 -8
- package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +12 -1
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-module-data.ts +2 -2
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-appointments/index.ts +4 -1
|
@@ -5,12 +5,36 @@ declare global {
|
|
|
5
5
|
};
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
+
/** A Wix Portfolio media image — a project / collection cover or a project item's image. */
|
|
9
|
+
export interface WixMediaImage {
|
|
10
|
+
type?: string;
|
|
11
|
+
imageInfo?: {
|
|
12
|
+
id?: string;
|
|
13
|
+
url?: string;
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The Wix media reference of a Portfolio cover or item image — its `imageInfo.url`, else
|
|
20
|
+
* its `imageInfo.id` — for `wixMediaUrl` to resolve and size. `""` when there is none.
|
|
21
|
+
* A bare string is still accepted, so a cover stored as a url string keeps rendering.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const image = wixMediaUrl(portfolioCoverRef(project.coverImage));
|
|
25
|
+
*/
|
|
26
|
+
export declare function portfolioCoverRef(cover: WixMediaImage | string | null | undefined): string;
|
|
8
27
|
export interface WixPortfolioProject {
|
|
9
28
|
id: string;
|
|
10
29
|
title?: string;
|
|
11
30
|
description?: string;
|
|
12
|
-
/**
|
|
13
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Project cover. The live wire shape is a media OBJECT
|
|
33
|
+
* (`{type:"WIX_MEDIA", imageInfo:{id,url,width,height}}`), not a url string —
|
|
34
|
+
* read it with {@link portfolioCoverRef}; `wixMediaUrl` returns `""` for the object.
|
|
35
|
+
* A url string is still accepted, for projects constructed by hand.
|
|
36
|
+
*/
|
|
37
|
+
coverImage?: WixMediaImage | string;
|
|
14
38
|
slug?: string;
|
|
15
39
|
hidden?: boolean;
|
|
16
40
|
createdDate?: string;
|
|
@@ -28,12 +52,6 @@ export interface WixListProjectsResponse {
|
|
|
28
52
|
}
|
|
29
53
|
/** GET /portfolio/v1/projects — list projects (paged). */
|
|
30
54
|
export declare function listProjects(limit?: number, cursor?: string): Promise<WixListProjectsResponse>;
|
|
31
|
-
export interface WixMediaImage {
|
|
32
|
-
imageInfo?: {
|
|
33
|
-
id?: string;
|
|
34
|
-
url?: string;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
55
|
export interface WixPortfolioCollection {
|
|
38
56
|
id: string;
|
|
39
57
|
title?: string;
|
|
@@ -72,6 +90,10 @@ export interface WixPortfolioProjectItem {
|
|
|
72
90
|
}
|
|
73
91
|
export interface WixListProjectItemsResponse {
|
|
74
92
|
items?: WixPortfolioProjectItem[];
|
|
93
|
+
/**
|
|
94
|
+
* Paging, under the name this function always documented. A Wix query reports it as
|
|
95
|
+
* `metadata`; {@link listProjectItems} copies that here when `pagingMetadata` is absent.
|
|
96
|
+
*/
|
|
75
97
|
pagingMetadata?: {
|
|
76
98
|
count?: number;
|
|
77
99
|
cursors?: {
|
|
@@ -79,6 +101,21 @@ export interface WixListProjectItemsResponse {
|
|
|
79
101
|
};
|
|
80
102
|
hasNext?: boolean;
|
|
81
103
|
};
|
|
104
|
+
/** The query endpoint's own name for the paging block. */
|
|
105
|
+
metadata?: {
|
|
106
|
+
count?: number;
|
|
107
|
+
cursors?: {
|
|
108
|
+
next?: string;
|
|
109
|
+
};
|
|
110
|
+
hasNext?: boolean;
|
|
111
|
+
};
|
|
82
112
|
}
|
|
83
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* POST /portfolio/v1/items/query — list a project's items.
|
|
115
|
+
*
|
|
116
|
+
* A first page filters on `projectId` with `paging.limit`. Passing a `cursor` (a previous
|
|
117
|
+
* page's `pagingMetadata.cursors.next`) switches to `cursorPaging` and drops the filter,
|
|
118
|
+
* because a Wix query cursor already carries it. Items come back in the order Wix returns
|
|
119
|
+
* them — sort on `sortOrder` for the author's order.
|
|
120
|
+
*/
|
|
84
121
|
export declare function listProjectItems(projectId: string, limit?: number, cursor?: string): Promise<WixListProjectItemsResponse>;
|
|
@@ -10,6 +10,14 @@ function wixCall(method, path, body) {
|
|
|
10
10
|
}
|
|
11
11
|
return globalThis.himalaya.wixApi.call(method, path, body);
|
|
12
12
|
}
|
|
13
|
+
function portfolioCoverRef(cover) {
|
|
14
|
+
if (typeof cover === "string") return cover.trim();
|
|
15
|
+
if (!cover || typeof cover !== "object") return "";
|
|
16
|
+
const info = cover.imageInfo;
|
|
17
|
+
const url = typeof info?.url === "string" ? info.url.trim() : "";
|
|
18
|
+
if (url) return url;
|
|
19
|
+
return typeof info?.id === "string" ? info.id.trim() : "";
|
|
20
|
+
}
|
|
13
21
|
function listProjects(limit = 100, cursor) {
|
|
14
22
|
return wixCall("GET", `/portfolio/v1/projects?${pagingQuery(limit, cursor)}`);
|
|
15
23
|
}
|
|
@@ -17,11 +25,15 @@ function listCollections(limit = 100, cursor) {
|
|
|
17
25
|
return wixCall("GET", `/portfolio/v1/collections?${pagingQuery(limit, cursor)}`);
|
|
18
26
|
}
|
|
19
27
|
function listProjectItems(projectId, limit = 100, cursor) {
|
|
20
|
-
|
|
28
|
+
const query = cursor ? { cursorPaging: { limit, cursor } } : { filter: { projectId }, paging: { limit } };
|
|
29
|
+
return wixCall("POST", "/portfolio/v1/items/query", { query }).then(
|
|
30
|
+
(response) => response && !response.pagingMetadata && response.metadata ? { ...response, pagingMetadata: response.metadata } : response
|
|
31
|
+
);
|
|
21
32
|
}
|
|
22
33
|
export {
|
|
23
34
|
listCollections,
|
|
24
35
|
listProjectItems,
|
|
25
|
-
listProjects
|
|
36
|
+
listProjects,
|
|
37
|
+
portfolioCoverRef
|
|
26
38
|
};
|
|
27
39
|
//# sourceMappingURL=wix-portfolio.mjs.map
|