@wix/himalaya-cli 0.1621.0 → 0.1623.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/badges-v2/src/extensions.d.ts +42 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-badges.mjs +13 -0
- package/dist/cli.mjs +3427 -2546
- package/guides/himi-json-output.md +34 -0
- package/guides/one-app-to-himi-app.md +104 -0
- package/guides/sdk-reference.json +38 -0
- package/package.json +2 -2
- package/templates/branded-lite/tier5-src/_shared/access-gates-table.ts +8 -0
- package/templates/branded-lite/tier5-src/_shared/access-gates.ts +341 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-access-nav/index.ts +45 -0
|
@@ -1 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
import { type WixBadge, type WixCallOptions, type WixCursorPaging, type WixCursorPagingMetadata } from "./index.js";
|
|
2
|
+
/** One badge given to one member. */
|
|
3
|
+
export interface WixBadgeAssignment {
|
|
4
|
+
id?: string;
|
|
5
|
+
badgeId?: string;
|
|
6
|
+
memberId?: string;
|
|
7
|
+
createdDate?: string;
|
|
8
|
+
updatedDate?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface WixQueryBadgeAssignmentsRequest {
|
|
11
|
+
query?: {
|
|
12
|
+
filter?: Record<string, unknown>;
|
|
13
|
+
cursorPaging?: WixCursorPaging;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface WixQueryBadgeAssignmentsResponse {
|
|
17
|
+
badgeAssignments?: WixBadgeAssignment[];
|
|
18
|
+
pagingMetadata?: WixCursorPagingMetadata;
|
|
19
|
+
}
|
|
20
|
+
/** The badge icon exactly as the live API sends it. The generated `WixBadge.icon` is typed `string`
|
|
21
|
+
* from the upstream package, but the service returns this image object. */
|
|
22
|
+
export interface WixBadgeIcon {
|
|
23
|
+
id?: string;
|
|
24
|
+
url?: string;
|
|
25
|
+
height?: number;
|
|
26
|
+
width?: number;
|
|
27
|
+
}
|
|
28
|
+
/** Which badges members hold — POST /badges/v4/assignments/query. A Visitor can read it
|
|
29
|
+
* (`BADGES.BADGE_READ_MEMBERS`), so a members list can show badges without a sign-in.
|
|
30
|
+
* Filter by `memberId: { $in: [...] }` and page with `cursorPaging`: a member can hold dozens of
|
|
31
|
+
* badges, so one page of many members can need several calls.
|
|
32
|
+
*
|
|
33
|
+
* Prefer this over the generated `listMembersBadgeIds`, whose route
|
|
34
|
+
* (`POST /badges/v4/badges/members`) answers 404 on the live service.
|
|
35
|
+
*
|
|
36
|
+
* @scope visitor — an anonymous Visitor reads it (200, observed live). The generated spec declares the app
|
|
37
|
+
* identity only, so a signed-in member's read is not yet observed: an empty or refused answer means "no badge
|
|
38
|
+
* known", never "no badge held". */
|
|
39
|
+
export declare function queryBadgeAssignments(req?: WixQueryBadgeAssignmentsRequest, opts?: WixCallOptions): Promise<WixQueryBadgeAssignmentsResponse>;
|
|
40
|
+
/** The icon image URL of a badge, or "" when it has none. Reads the live `{ url }` object and also the
|
|
41
|
+
* plain string the generated type promises, so a caller needs no cast. */
|
|
42
|
+
export declare function badgeIconUrl(badge: Pick<WixBadge, "icon">): string;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
// ../../stdlib/wix-sdk/badges-v2/src/extensions.ts
|
|
2
|
+
function queryBadgeAssignments(req = {}, opts) {
|
|
3
|
+
return wixCall("POST", "/badges/v4/assignments/query", req, opts);
|
|
4
|
+
}
|
|
5
|
+
function badgeIconUrl(badge) {
|
|
6
|
+
const icon = badge.icon;
|
|
7
|
+
if (typeof icon === "string") return icon;
|
|
8
|
+
const url = icon?.url;
|
|
9
|
+
return typeof url === "string" ? url : "";
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
// ../../stdlib/wix-sdk/badges-v2/src/index.ts
|
|
2
13
|
function wixCallHeaders(opts) {
|
|
3
14
|
const site = opts?.site?.trim();
|
|
@@ -155,6 +166,7 @@ function updateBadgesOrder(req = {}, opts) {
|
|
|
155
166
|
}
|
|
156
167
|
export {
|
|
157
168
|
assignBadge,
|
|
169
|
+
badgeIconUrl,
|
|
158
170
|
count,
|
|
159
171
|
create,
|
|
160
172
|
get,
|
|
@@ -162,6 +174,7 @@ export {
|
|
|
162
174
|
listMembers,
|
|
163
175
|
listMembersBadgeIds,
|
|
164
176
|
query,
|
|
177
|
+
queryBadgeAssignments,
|
|
165
178
|
unassignBadge,
|
|
166
179
|
update,
|
|
167
180
|
updateBadgesOrder,
|