@wix/agent-skills 1.31.1 → 1.31.2
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/package.json +1 -1
- package/skills/wix-app/references/STORES_VERSIONING.md +1 -1
- package/skills/wix-headless-kit/SKILL.md +16 -7
- package/skills/wix-headless-kit/guides/api-run.md +81 -51
- package/skills/wix-headless-kit/guides/existing-site.md +6 -0
- package/skills/wix-headless-kit/install/AGENTS.md +3 -2
- package/skills/wix-headless-kit/install/attach.mjs +32 -27
- package/skills/wix-headless-kit/install/background.mjs +32 -0
- package/skills/wix-headless-kit/install/bootstrap.mjs +28 -11
- package/skills/wix-headless-kit/install/check.mjs +2 -2
- package/skills/wix-headless-kit/install/context.mjs +49 -5
- package/skills/wix-headless-kit/install/deploy.mjs +33 -8
- package/skills/wix-headless-kit/install/env-ignore.mjs +16 -0
- package/skills/wix-headless-kit/install/install.mjs +95 -0
- package/skills/wix-headless-kit/install/pins.json +1 -1
- package/skills/wix-headless-kit/install/proc.mjs +46 -0
- package/skills/wix-headless-kit/install/setup.mjs +16 -25
- package/skills/wix-headless-kit/install/templates.mjs +2 -2
- package/skills/wix-headless-templates/blog/app/components/blog/RichContent.tsx +3 -2
- package/skills/wix-headless-templates/blog/project/package-lock.json +1287 -1299
- package/skills/wix-headless-templates/blog/project/package.json +1 -1
- package/skills/wix-headless-templates/blog/project/src/components/blog/RichContent.tsx +3 -2
- package/skills/wix-headless-templates/blog/rest/authors.ts +5 -5
- package/skills/wix-headless-templates/blog/rest/comments.ts +4 -4
- package/skills/wix-headless-templates/blog/rest/post-likes.ts +3 -3
- package/skills/wix-headless-templates/blog/rest/posts.ts +4 -4
- package/skills/wix-headless-templates/blog/rest/taxonomy.ts +5 -5
- package/skills/wix-headless-templates/blog/seed/seed-blog.mjs +2 -1
- package/skills/wix-headless-templates/bookings/rest/booking.ts +4 -4
- package/skills/wix-headless-templates/bookings/rest/services.ts +4 -4
- package/skills/wix-headless-templates/bookings/seed/seed-bookings.mjs +2 -1
- package/skills/wix-headless-templates/cms/rest/collections.ts +3 -3
- package/skills/wix-headless-templates/cms/rest/items.ts +4 -4
- package/skills/wix-headless-templates/cms/seed/seed-cms.mjs +2 -1
- package/skills/wix-headless-templates/donations/rest/campaigns.ts +4 -4
- package/skills/wix-headless-templates/donations/rest/donate.ts +3 -3
- package/skills/wix-headless-templates/donations/seed/seed-donations.mjs +2 -1
- package/skills/wix-headless-templates/events/rest/events.ts +4 -4
- package/skills/wix-headless-templates/events/rest/orders.ts +4 -4
- package/skills/wix-headless-templates/events/rest/registration.ts +4 -4
- package/skills/wix-headless-templates/events/seed/seed-events.mjs +2 -1
- package/skills/wix-headless-templates/faq/rest/faq.ts +4 -4
- package/skills/wix-headless-templates/faq/seed/seed-faq.mjs +2 -1
- package/skills/wix-headless-templates/forms/rest/forms.ts +4 -4
- package/skills/wix-headless-templates/forms/rest/submissions.ts +4 -4
- package/skills/wix-headless-templates/forms/seed/seed-forms.mjs +2 -1
- package/skills/wix-headless-templates/members/rest/auth.ts +3 -3
- package/skills/wix-headless-templates/members/rest/members.ts +4 -4
- package/skills/wix-headless-templates/members/seed/seed-members.mjs +2 -1
- package/skills/wix-headless-templates/portfolio/rest/portfolio.ts +4 -4
- package/skills/wix-headless-templates/portfolio/seed/seed-portfolio.mjs +2 -1
- package/skills/wix-headless-templates/pricing-plans/rest/plan-access.ts +3 -3
- package/skills/wix-headless-templates/pricing-plans/rest/plans.ts +4 -4
- package/skills/wix-headless-templates/pricing-plans/rest/purchase.ts +3 -3
- package/skills/wix-headless-templates/pricing-plans/seed/seed-pricing-plans.mjs +2 -1
- package/skills/wix-headless-templates/rentals/rest/rentals.ts +4 -4
- package/skills/wix-headless-templates/rentals/seed/seed-rentals.mjs +2 -1
- package/skills/wix-headless-templates/restaurants/rest/menu.ts +4 -4
- package/skills/wix-headless-templates/restaurants/rest/ordering.ts +5 -5
- package/skills/wix-headless-templates/restaurants/rest/reservations.ts +4 -4
- package/skills/wix-headless-templates/restaurants/seed/seed-restaurants.mjs +2 -1
- package/skills/wix-headless-templates/shared/capabilities/site-search/rest/search.ts +4 -4
- package/skills/wix-headless-templates/shared/capabilities/site-search/seed/install.mjs +6 -4
- package/skills/wix-headless-templates/shared/seed/main.mjs +15 -0
- package/skills/wix-headless-templates/shared/seed/wix-cli.mjs +43 -11
- package/skills/wix-headless-templates/storefront/INSTRUCTIONS.md +1 -1
- package/skills/wix-headless-templates/storefront/rest/cart.ts +5 -5
- package/skills/wix-headless-templates/storefront/rest/catalog.ts +5 -5
- package/skills/wix-headless-templates/storefront/seed/SEED.md +27 -9
- package/skills/wix-headless-templates/storefront/seed/seed-store.mjs +2 -1
- package/skills/wix-manage/SKILL.md +3 -3
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +5 -1
- package/skills/wix-manage/references/app-installation/list-installed-apps.md +19 -9
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +3 -0
- package/skills/wix-manage/references/bookings/external-calendar-integration.md +3 -0
- package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +3 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +11 -2
- package/skills/wix-manage/references/cms/cms-publishing-flow.md +63 -16
- package/skills/wix-manage/references/forms/update-form.md +3 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +3 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +3 -0
- package/skills/wix-manage/references/sites/create-headless-site.md +7 -50
- package/skills/wix-manage/references/sites/manage-oauth-apps.md +4 -4
- package/skills/wix-manage/references/sites/read-site-context.md +4 -0
- package/skills/wix-manage/references/sites/upload-static-site.md +67 -31
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +3 -0
- package/skills/wix-manage/references/stores/change-store-currency.md +3 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v3.md +3 -0
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +3 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +192 -22
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// The post-body renderer — wire AS-IS (machinery, not a reference). A post body is a Ricos
|
|
2
2
|
// document, not HTML and not text: never innerHTML it, never String() its nodes. This is the
|
|
3
|
-
// documented render path (@wix/ricos
|
|
3
|
+
// documented render path (@wix/ricos/viewer + quick-start plugins: the viewer-only entry, 11.17+,
|
|
4
|
+
// without the editor, its dev tools and CodeMirror that the root import drags into every bundle).
|
|
4
5
|
//
|
|
5
6
|
// In Astro this component MUST be a `client:only="react"` island — the ricos viewer breaks
|
|
6
7
|
// under SSR. Dark theme: the ricos CSS hardcodes near-black text; scope an override on
|
|
7
8
|
// `.ricos-content` forcing the foreground token (in Astro use <style is:global> — React
|
|
8
9
|
// islands don't inherit scoped Astro styles).
|
|
9
|
-
import { quickStartViewerPlugins, RicosViewer } from "@wix/ricos";
|
|
10
|
+
import { quickStartViewerPlugins, RicosViewer } from "@wix/ricos/viewer";
|
|
10
11
|
import "@wix/ricos/css/all-plugins-viewer.css";
|
|
11
12
|
|
|
12
13
|
// Module-level, once — never rebuild the plugin list per render.
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
// the bodies, port the core once.
|
|
5
5
|
// docs: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/members/query-members.md
|
|
6
6
|
// docs: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/members/get-my-member.md
|
|
7
|
-
import { wixRequest } from "
|
|
8
|
-
import { imgSrc } from "
|
|
9
|
-
import { authorsQuery, indexAuthors, toAuthor, uniqueIds } from "
|
|
10
|
-
import type { Raw } from "
|
|
11
|
-
import type { BlogAuthor } from "
|
|
7
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
8
|
+
import { imgSrc } from "../../shared/rest/media.js";
|
|
9
|
+
import { authorsQuery, indexAuthors, toAuthor, uniqueIds } from "../app/wix/blog/authors-core.js";
|
|
10
|
+
import type { Raw } from "../app/wix/blog/posts-core.js";
|
|
11
|
+
import type { BlogAuthor } from "../app/wix/blog/types.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Every distinct author of one page in ONE request, keyed by member id. {} on failure.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// docs: https://dev.wix.com/docs/api-reference/crm/community/comments/comments/list-comments-by-resource.md
|
|
6
6
|
// docs: https://dev.wix.com/docs/api-reference/crm/community/comments/comments/create-comment.md
|
|
7
7
|
// docs: https://dev.wix.com/docs/api-reference/crm/community/comments/comments/delete-comment.md
|
|
8
|
-
import { wixRequest } from "
|
|
8
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
9
9
|
import { fetchAuthorsByIds } from "./authors.js";
|
|
10
10
|
import {
|
|
11
11
|
commentAuthorIds,
|
|
@@ -18,9 +18,9 @@ import {
|
|
|
18
18
|
toCommentThread,
|
|
19
19
|
type CreateCommentOptions,
|
|
20
20
|
type ListCommentsOptions,
|
|
21
|
-
} from "
|
|
22
|
-
import type { Raw } from "
|
|
23
|
-
import type { BlogComment, CommentPage, CommentThread } from "
|
|
21
|
+
} from "../app/wix/blog/comments-core.js";
|
|
22
|
+
import type { Raw } from "../app/wix/blog/posts-core.js";
|
|
23
|
+
import type { BlogComment, CommentPage, CommentThread } from "../app/wix/blog/types.js";
|
|
24
24
|
|
|
25
25
|
export { type CreateCommentOptions, type ListCommentsOptions };
|
|
26
26
|
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/blog/likes/create-like.md
|
|
6
6
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/blog/likes/query-likes.md
|
|
7
7
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/blog/likes/delete-like-by-fqdn-and-entity-id.md
|
|
8
|
-
import { wixRequest } from "
|
|
8
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
9
9
|
import { fetchPostMetrics } from "./posts.js";
|
|
10
|
-
import { BLOG_POST_FQDN, likeBody, likeStateQuery, type Raw } from "
|
|
11
|
-
import type { LikeState } from "
|
|
10
|
+
import { BLOG_POST_FQDN, likeBody, likeStateQuery, type Raw } from "../app/wix/blog/posts-core.js";
|
|
11
|
+
import type { LikeState } from "../app/wix/blog/types.js";
|
|
12
12
|
|
|
13
13
|
/** Like the post as the current viewer. POST /blog/v1/likes { like: { entityId, fqdn: "wix.blog.v3.post" } } */
|
|
14
14
|
export async function likePost(postId: string): Promise<void> {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/blog/posts-stats/query-posts.md
|
|
7
7
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/blog/posts-stats/get-post-by-slug.md
|
|
8
8
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/blog/posts-stats/get-post-metrics.md
|
|
9
|
-
import { wixRequest } from "
|
|
10
|
-
import { imgSrc } from "
|
|
9
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
10
|
+
import { imgSrc } from "../../shared/rest/media.js";
|
|
11
11
|
import { fetchAuthorsByIds } from "./authors.js";
|
|
12
12
|
import {
|
|
13
13
|
BLOG_APP_ID,
|
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
withAuthors,
|
|
32
32
|
type FetchPostsOptions,
|
|
33
33
|
type Raw,
|
|
34
|
-
} from "
|
|
35
|
-
import type { PostDetail, PostMetrics, PostPage, PostSummary } from "
|
|
34
|
+
} from "../app/wix/blog/posts-core.js";
|
|
35
|
+
import type { PostDetail, PostMetrics, PostPage, PostSummary } from "../app/wix/blog/types.js";
|
|
36
36
|
|
|
37
37
|
export { BLOG_APP_ID, categoryPath, formatCount, postMetaLine, postPath, relativeDateLabel, tagPath, type FetchPostsOptions };
|
|
38
38
|
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/blog/category/get-category-by-slug.md
|
|
7
7
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/blog/tags/query-tags.md
|
|
8
8
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/blog/tags/get-tag-by-slug.md
|
|
9
|
-
import { wixRequest } from "
|
|
10
|
-
import { imgSrc } from "
|
|
11
|
-
import { TAG_SORT, TAXONOMY_LIMIT, categoriesQuery, inIdOrder, tagsByIdsQuery, toCategory, toTag, type FetchCategoriesOptions } from "
|
|
12
|
-
import type { Raw } from "
|
|
13
|
-
import type { BlogCategory, BlogTag } from "
|
|
9
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
10
|
+
import { imgSrc } from "../../shared/rest/media.js";
|
|
11
|
+
import { TAG_SORT, TAXONOMY_LIMIT, categoriesQuery, inIdOrder, tagsByIdsQuery, toCategory, toTag, type FetchCategoriesOptions } from "../app/wix/blog/taxonomy-core.js";
|
|
12
|
+
import type { Raw } from "../app/wix/blog/posts-core.js";
|
|
13
|
+
import type { BlogCategory, BlogTag } from "../app/wix/blog/types.js";
|
|
14
14
|
|
|
15
15
|
export { inIdOrder, type FetchCategoriesOptions };
|
|
16
16
|
|
|
@@ -23,6 +23,7 @@ import { readFileSync } from "node:fs";
|
|
|
23
23
|
import { resolveItemImages } from "../../shared/seed/images.mjs";
|
|
24
24
|
import { seedSiteId } from "../../shared/seed/site-context.mjs";
|
|
25
25
|
import { wixToken } from "../../shared/seed/wix-cli.mjs";
|
|
26
|
+
import { isMain } from "../../shared/seed/main.mjs";
|
|
26
27
|
|
|
27
28
|
const API = "https://www.wixapis.com";
|
|
28
29
|
const BLOG_APP_ID = "14bcded7-0066-7c35-14d7-466cb3f09103";
|
|
@@ -319,7 +320,7 @@ async function ensureLabelsPersisted(ctx, { cats, tgs, created, posts, catId, ta
|
|
|
319
320
|
|
|
320
321
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
321
322
|
|
|
322
|
-
const invokedDirectly =
|
|
323
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
323
324
|
if (invokedDirectly) {
|
|
324
325
|
const planPath = process.argv[2];
|
|
325
326
|
if (!planPath) {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/create-cart.md
|
|
15
15
|
// docs: https://dev.wix.com/docs/api-reference/business-management/headless/redirects/create-redirect-session.md
|
|
16
16
|
// docs: https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/get-form-summary.md
|
|
17
|
-
import { wixRequest } from "
|
|
18
|
-
import { DEFAULT_BOOKINGS_SETTINGS, toBookingsSettings } from "
|
|
17
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
18
|
+
import { DEFAULT_BOOKINGS_SETTINGS, toBookingsSettings } from "../app/wix/bookings/services-core.js";
|
|
19
19
|
import {
|
|
20
20
|
FALLBACK_FIELDS,
|
|
21
21
|
addOnGroupsRequest,
|
|
@@ -49,8 +49,8 @@ import {
|
|
|
49
49
|
type NextAvailableOptions,
|
|
50
50
|
type Raw,
|
|
51
51
|
type SlotsWindow,
|
|
52
|
-
} from "
|
|
53
|
-
import type { AddOnGroup, BookingFormField, BookingResult, BookingsSettings, CourseAvailability, ServiceDetail, Session, Slot, SlotsPage, Weekday } from "
|
|
52
|
+
} from "../app/wix/bookings/booking-core.js";
|
|
53
|
+
import type { AddOnGroup, BookingFormField, BookingResult, BookingsSettings, CourseAvailability, ServiceDetail, Session, Slot, SlotsPage, Weekday } from "../app/wix/bookings/types.js";
|
|
54
54
|
|
|
55
55
|
export { resolveDisplayTimeZone, toLocalDateString };
|
|
56
56
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services.md
|
|
7
7
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-categories.md
|
|
8
8
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-locations.md
|
|
9
|
-
import { wixRequest } from "
|
|
10
|
-
import { imgSrc } from "
|
|
9
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
10
|
+
import { imgSrc } from "../../shared/rest/media.js";
|
|
11
11
|
import {
|
|
12
12
|
BOOKINGS_APP_ID,
|
|
13
13
|
CATEGORIES_QUERY,
|
|
@@ -25,8 +25,8 @@ import {
|
|
|
25
25
|
toSummary,
|
|
26
26
|
type Raw,
|
|
27
27
|
type ServicesFilterOptions,
|
|
28
|
-
} from "
|
|
29
|
-
import type { BookingCategory, LocationOption, ServiceDetail, ServiceSummary } from "
|
|
28
|
+
} from "../app/wix/bookings/services-core.js";
|
|
29
|
+
import type { BookingCategory, LocationOption, ServiceDetail, ServiceSummary } from "../app/wix/bookings/types.js";
|
|
30
30
|
|
|
31
31
|
export { BOOKINGS_APP_ID, OTHER_LOCATIONS_ID, SERVICES_PAGE_SIZE, STAFF_RESOURCE_TYPE_ID };
|
|
32
32
|
|
|
@@ -28,6 +28,7 @@ import { readFileSync } from "node:fs";
|
|
|
28
28
|
import { resolveItemImages } from "../../shared/seed/images.mjs";
|
|
29
29
|
import { seedSiteId } from "../../shared/seed/site-context.mjs";
|
|
30
30
|
import { wixToken } from "../../shared/seed/wix-cli.mjs";
|
|
31
|
+
import { isMain } from "../../shared/seed/main.mjs";
|
|
31
32
|
|
|
32
33
|
const API = "https://www.wixapis.com";
|
|
33
34
|
const BOOKINGS_APP_ID = "13d21c63-b5ec-5912-8397-c3a5ddb27a97";
|
|
@@ -390,7 +391,7 @@ export async function setupBookings(ctx, { services = [], staff = [], locations
|
|
|
390
391
|
|
|
391
392
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
392
393
|
|
|
393
|
-
const invokedDirectly =
|
|
394
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
394
395
|
if (invokedDirectly) {
|
|
395
396
|
const planPath = process.argv[2];
|
|
396
397
|
if (!planPath) {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// DTO; the mapper comes from collections-core (the SAME file the SDK transport uses, deployed flat
|
|
3
3
|
// next to this one by deploy.mjs --stack static), so this file is only the transport.
|
|
4
4
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-collections/create-data-collection.md (the Data Collections API; get is GET /wix-data/v2/collections/{id} per the SDK's route table)
|
|
5
|
-
import { WixApiError, wixRequest } from "
|
|
6
|
-
import { toCollectionSchema, type RawCollection } from "
|
|
7
|
-
import type { CmsCollectionSchema } from "
|
|
5
|
+
import { WixApiError, wixRequest } from "../../shared/rest/client.js";
|
|
6
|
+
import { toCollectionSchema, type RawCollection } from "../app/wix/cms/collections-core.js";
|
|
7
|
+
import type { CmsCollectionSchema } from "../app/wix/cms/types.js";
|
|
8
8
|
|
|
9
9
|
const unreadable = (e: unknown): boolean => e instanceof WixApiError && (e.status === 404 || e.status === 403);
|
|
10
10
|
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/get-data-item.md
|
|
10
10
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/patch-data-item.md
|
|
11
11
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/bulk-insert-data-item-references.md
|
|
12
|
-
import { WixApiError, wixRequest } from "
|
|
13
|
-
import { imgRatio, imgSrc } from "
|
|
12
|
+
import { WixApiError, wixRequest } from "../../shared/rest/client.js";
|
|
13
|
+
import { imgRatio, imgSrc } from "../../shared/rest/media.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_LIMIT,
|
|
16
16
|
DISTINCT_LIMIT,
|
|
@@ -26,8 +26,8 @@ import {
|
|
|
26
26
|
toValues,
|
|
27
27
|
type Media,
|
|
28
28
|
type Raw,
|
|
29
|
-
} from "
|
|
30
|
-
import type { CmsFilter, CmsItem, CmsPage, CmsQuery } from "
|
|
29
|
+
} from "../app/wix/cms/items-core.js";
|
|
30
|
+
import type { CmsFilter, CmsItem, CmsPage, CmsQuery } from "../app/wix/cms/types.js";
|
|
31
31
|
|
|
32
32
|
const media: Media = { imgSrc, imgRatio };
|
|
33
33
|
const notFound = (e: unknown): boolean => e instanceof WixApiError && e.status === 404;
|
|
@@ -25,6 +25,7 @@ import { readFileSync } from "node:fs";
|
|
|
25
25
|
import { resolveItemImages } from "../../shared/seed/images.mjs";
|
|
26
26
|
import { seedSiteId } from "../../shared/seed/site-context.mjs";
|
|
27
27
|
import { wixToken } from "../../shared/seed/wix-cli.mjs";
|
|
28
|
+
import { isMain } from "../../shared/seed/main.mjs";
|
|
28
29
|
|
|
29
30
|
const API = "https://www.wixapis.com";
|
|
30
31
|
const WIX_DATA_APP_ID = "e593b0bd-b783-45b8-97c2-873d42aacaf4";
|
|
@@ -303,7 +304,7 @@ export async function setupCms(ctx, { collections = [] } = {}) {
|
|
|
303
304
|
|
|
304
305
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
305
306
|
|
|
306
|
-
const invokedDirectly =
|
|
307
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
307
308
|
if (invokedDirectly) {
|
|
308
309
|
const planPath = process.argv[2];
|
|
309
310
|
if (!planPath) {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
// Porting: keep the path, keep the body, port the core once.
|
|
7
7
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/donations/donation-campaigns/query-donation-campaigns.md
|
|
8
8
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/donations/donation-campaigns/get-donation-campaign-metrics.md
|
|
9
|
-
import { WixApiError, wixRequest } from "
|
|
10
|
-
import { imgSrc } from "
|
|
11
|
-
import { campaignsQuery, currencyOf, isArchived, rawId, toDetail, toSummary, type Raw } from "
|
|
12
|
-
import type { CampaignDetail, CampaignSummary } from "
|
|
9
|
+
import { WixApiError, wixRequest } from "../../shared/rest/client.js";
|
|
10
|
+
import { imgSrc } from "../../shared/rest/media.js";
|
|
11
|
+
import { campaignsQuery, currencyOf, isArchived, rawId, toDetail, toSummary, type Raw } from "../app/wix/donations/donations-core.js";
|
|
12
|
+
import type { CampaignDetail, CampaignSummary } from "../app/wix/donations/types.js";
|
|
13
13
|
|
|
14
14
|
const BASE = "/donation-campaigns/v2/donation-campaigns";
|
|
15
15
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart-v2/create-cart.md
|
|
8
8
|
// docs: https://dev.wix.com/docs/api-reference/business-management/headless/redirects/create-redirect-session.md
|
|
9
9
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/orders/get-order.md
|
|
10
|
-
import { wixRequest } from "
|
|
10
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
11
11
|
import {
|
|
12
12
|
cartBody,
|
|
13
13
|
cartIdOf,
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
toReceipt,
|
|
18
18
|
type DonatePaths,
|
|
19
19
|
type Raw,
|
|
20
|
-
} from "
|
|
21
|
-
import type { DonationInput, DonationReceipt } from "
|
|
20
|
+
} from "../app/wix/donations/donations-core.js";
|
|
21
|
+
import type { DonationInput, DonationReceipt } from "../app/wix/donations/types.js";
|
|
22
22
|
|
|
23
23
|
export type { DonatePaths };
|
|
24
24
|
|
|
@@ -25,6 +25,7 @@ import { setSiteCurrency } from "../../shared/seed/site.mjs";
|
|
|
25
25
|
import { resolveItemImages } from "../../shared/seed/images.mjs";
|
|
26
26
|
import { seedSiteId } from "../../shared/seed/site-context.mjs";
|
|
27
27
|
import { wixToken } from "../../shared/seed/wix-cli.mjs";
|
|
28
|
+
import { isMain } from "../../shared/seed/main.mjs";
|
|
28
29
|
import { readFileSync } from "node:fs";
|
|
29
30
|
import { randomUUID } from "node:crypto";
|
|
30
31
|
|
|
@@ -233,7 +234,7 @@ export async function setupDonations(ctx, { campaigns = [], currency } = {}) {
|
|
|
233
234
|
|
|
234
235
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
235
236
|
|
|
236
|
-
const invokedDirectly =
|
|
237
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
237
238
|
if (invokedDirectly) {
|
|
238
239
|
const planPath = process.argv[2];
|
|
239
240
|
if (!planPath) {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/events/event-management/events-v3/get-event-by-slug.md
|
|
8
8
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/events/event-management/events-v3/get-event.md
|
|
9
9
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/events/event-management/categories/query-categories.md
|
|
10
|
-
import { WixApiError, wixRequest } from "
|
|
11
|
-
import { imgSrc } from "
|
|
10
|
+
import { WixApiError, wixRequest } from "../../shared/rest/client.js";
|
|
11
|
+
import { imgSrc } from "../../shared/rest/media.js";
|
|
12
12
|
import {
|
|
13
13
|
DEFAULT_PAGE_SIZE,
|
|
14
14
|
DETAIL_FIELDS,
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
toSummary,
|
|
24
24
|
type ListOptions,
|
|
25
25
|
type Raw,
|
|
26
|
-
} from "
|
|
27
|
-
import type { EventCategory, EventDetail, EventSummary } from "
|
|
26
|
+
} from "../app/wix/events/events-core.js";
|
|
27
|
+
import type { EventCategory, EventDetail, EventSummary } from "../app/wix/events/types.js";
|
|
28
28
|
|
|
29
29
|
export { EVENTS_APP_ID, type ListOptions };
|
|
30
30
|
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
// order on this visitor's session. Not guaranteed for every site's visitor scope: a 403 throws
|
|
5
5
|
// and the confirmation surface degrades to a confirmation without order details.
|
|
6
6
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/events/registration/ticketing/orders/get-order.md
|
|
7
|
-
import { WixApiError, wixRequest } from "
|
|
8
|
-
import { ORDER_FIELDSETS, toOrder } from "
|
|
9
|
-
import type { Raw } from "
|
|
10
|
-
import type { OrderSummary } from "
|
|
7
|
+
import { WixApiError, wixRequest } from "../../shared/rest/client.js";
|
|
8
|
+
import { ORDER_FIELDSETS, toOrder } from "../app/wix/events/orders-core.js";
|
|
9
|
+
import type { Raw } from "../app/wix/events/events-core.js";
|
|
10
|
+
import type { OrderSummary } from "../app/wix/events/types.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* One order by the pair the thank-you URL carries. Null on 404; throws on anything else.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/events/registration/ticketing/ticket-reservations/create-ticket-reservation.md
|
|
10
10
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/events/registration/rsvp-v2/create-rsvp.md
|
|
11
11
|
// docs: https://dev.wix.com/docs/api-reference/business-management/headless/redirects/create-redirect-session.md
|
|
12
|
-
import { wixRequest } from "
|
|
12
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
13
13
|
import {
|
|
14
14
|
availableTiersQuery,
|
|
15
15
|
checkoutCallbacks,
|
|
@@ -25,9 +25,9 @@ import {
|
|
|
25
25
|
type CheckoutPaths,
|
|
26
26
|
type RsvpValues,
|
|
27
27
|
type TierEvent,
|
|
28
|
-
} from "
|
|
29
|
-
import type { Raw } from "
|
|
30
|
-
import type { EventDetail, RegistrationResult, TicketSelection, TicketTier } from "
|
|
28
|
+
} from "../app/wix/events/registration-core.js";
|
|
29
|
+
import type { Raw } from "../app/wix/events/events-core.js";
|
|
30
|
+
import type { EventDetail, RegistrationResult, TicketSelection, TicketTier } from "../app/wix/events/types.js";
|
|
31
31
|
|
|
32
32
|
export { type CheckoutPaths, type RsvpValues, type TierEvent };
|
|
33
33
|
|
|
@@ -24,6 +24,7 @@ import { readFileSync } from "node:fs";
|
|
|
24
24
|
import { resolveItemImages } from "../../shared/seed/images.mjs";
|
|
25
25
|
import { seedSiteId } from "../../shared/seed/site-context.mjs";
|
|
26
26
|
import { wixToken } from "../../shared/seed/wix-cli.mjs";
|
|
27
|
+
import { isMain } from "../../shared/seed/main.mjs";
|
|
27
28
|
|
|
28
29
|
const API = "https://www.wixapis.com";
|
|
29
30
|
const EVENTS_APP_ID = "140603ad-af8d-84a5-2c80-a0f60cb47351";
|
|
@@ -305,7 +306,7 @@ export async function setupEvents(ctx, { events = [], currency } = {}) {
|
|
|
305
306
|
|
|
306
307
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
307
308
|
|
|
308
|
-
const invokedDirectly =
|
|
309
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
309
310
|
if (invokedDirectly) {
|
|
310
311
|
const planPath = process.argv[2];
|
|
311
312
|
if (!planPath) {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
// Porting: keep the paths, keep the bodies, port the core once.
|
|
8
8
|
// docs: https://dev.wix.com/docs/rest/business-management/faq-app/faq/category-v2/query-categories.md
|
|
9
9
|
// docs: https://dev.wix.com/docs/rest/business-management/faq-app/faq/question-entry-v2/query-question-entries.md
|
|
10
|
-
import { wixRequest } from "
|
|
11
|
-
import { imgSrc } from "
|
|
10
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
11
|
+
import { imgSrc } from "../../shared/rest/media.js";
|
|
12
12
|
import {
|
|
13
13
|
FAQ_APP_ID,
|
|
14
14
|
assembleFaq,
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
toCategory,
|
|
22
22
|
toQuestion,
|
|
23
23
|
type Raw,
|
|
24
|
-
} from "
|
|
25
|
-
import type { FaqCategory, FaqData, FaqQuestion, FaqQuestionPage, FetchQuestionsOptions } from "
|
|
24
|
+
} from "../app/wix/faq/faq-core.js";
|
|
25
|
+
import type { FaqCategory, FaqData, FaqQuestion, FaqQuestionPage, FetchQuestionsOptions } from "../app/wix/faq/types.js";
|
|
26
26
|
|
|
27
27
|
export { FAQ_APP_ID };
|
|
28
28
|
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
// reference page.
|
|
21
21
|
import { seedSiteId } from "../../shared/seed/site-context.mjs";
|
|
22
22
|
import { wixToken } from "../../shared/seed/wix-cli.mjs";
|
|
23
|
+
import { isMain } from "../../shared/seed/main.mjs";
|
|
23
24
|
import { readFileSync } from "node:fs";
|
|
24
25
|
|
|
25
26
|
const API = "https://www.wixapis.com";
|
|
@@ -281,7 +282,7 @@ export async function setupFaq(ctx, { categories = [] } = {}) {
|
|
|
281
282
|
|
|
282
283
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
283
284
|
|
|
284
|
-
const invokedDirectly =
|
|
285
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
285
286
|
if (invokedDirectly) {
|
|
286
287
|
const planPath = process.argv[2];
|
|
287
288
|
if (!planPath) {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
// Porting: keep the paths, keep the query, port the core once.
|
|
7
7
|
// docs: https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/get-form.md
|
|
8
8
|
// docs: https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/list-forms.md
|
|
9
|
-
import { wixRequest } from "
|
|
10
|
-
import { imgSrc } from "
|
|
11
|
-
import { FORMS_NAMESPACE, applyRules, isClosed, otherText, otherValue, toForm, type Raw } from "
|
|
12
|
-
import type { FormDto } from "
|
|
9
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
10
|
+
import { imgSrc } from "../../shared/rest/media.js";
|
|
11
|
+
import { FORMS_NAMESPACE, applyRules, isClosed, otherText, otherValue, toForm, type Raw } from "../app/wix/forms/forms-core.js";
|
|
12
|
+
import type { FormDto } from "../app/wix/forms/types.js";
|
|
13
13
|
|
|
14
14
|
export { FORMS_NAMESPACE, applyRules, isClosed, otherText, otherValue };
|
|
15
15
|
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
// docs: https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/create-submission.md
|
|
9
9
|
// docs: https://dev.wix.com/docs/api-reference/crm/forms/form-submissions/get-media-upload-url.md
|
|
10
10
|
// docs: https://dev.wix.com/docs/api-reference/business-management/headless/redirects/create-redirect-session.md
|
|
11
|
-
import { wixRequest } from "
|
|
12
|
-
import type { Raw } from "
|
|
11
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
12
|
+
import type { Raw } from "../app/wix/forms/forms-core.js";
|
|
13
13
|
import {
|
|
14
14
|
SUBMITTED_OK,
|
|
15
15
|
formLevelError,
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
toSubmissionValues,
|
|
24
24
|
uploadFilesWith,
|
|
25
25
|
uploadMimeType,
|
|
26
|
-
} from "
|
|
27
|
-
import type { FormFieldDto, FormValues, SubmissionDto, UploadedFile } from "
|
|
26
|
+
} from "../app/wix/forms/submissions-core.js";
|
|
27
|
+
import type { FormFieldDto, FormValues, SubmissionDto, UploadedFile } from "../app/wix/forms/types.js";
|
|
28
28
|
|
|
29
29
|
export { SUBMITTED_OK, formLevelError, normalizePhone, normalizeUrl, submissionErrors, toSubmissionValues };
|
|
30
30
|
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
// Seeding is ADDITIVE — never deletes or overwrites existing forms.
|
|
28
28
|
import { seedSiteId } from "../../shared/seed/site-context.mjs";
|
|
29
29
|
import { wixToken } from "../../shared/seed/wix-cli.mjs";
|
|
30
|
+
import { isMain } from "../../shared/seed/main.mjs";
|
|
30
31
|
import { readFileSync } from "node:fs";
|
|
31
32
|
import { randomUUID } from "node:crypto";
|
|
32
33
|
|
|
@@ -556,7 +557,7 @@ export async function setupForms(ctx, plan) {
|
|
|
556
557
|
|
|
557
558
|
// ---- CLI entry -------------------------------------------------------------------------------
|
|
558
559
|
|
|
559
|
-
const invokedDirectly =
|
|
560
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
560
561
|
if (invokedDirectly) {
|
|
561
562
|
const planPath = process.argv[2];
|
|
562
563
|
if (!planPath) {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
// client id; nothing elevated. Porting: keep the paths and bodies; the exchange is three calls.
|
|
9
9
|
// docs: https://dev.wix.com/docs/go-headless/authentication/members/custom-login-page/build-a-custom-login-page-rest.md
|
|
10
10
|
// docs: https://dev.wix.com/docs/api-reference/business-management/headless/redirects/create-redirect-session.md
|
|
11
|
-
import { WIX_CLIENT_ID } from "
|
|
12
|
-
import { WixApiError, clearTokens, loadTokens, mintTokens, setTokens, wixRequest, type Tokens } from "
|
|
11
|
+
import { WIX_CLIENT_ID } from "../../shared/rest/config.js";
|
|
12
|
+
import { WixApiError, clearTokens, loadTokens, mintTokens, setTokens, wixRequest, type Tokens } from "../../shared/rest/client.js";
|
|
13
13
|
import {
|
|
14
14
|
NO_SESSION_ERROR,
|
|
15
15
|
authOutcome,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
type LoginResult,
|
|
21
21
|
type LoginState,
|
|
22
22
|
type RawAuth,
|
|
23
|
-
} from "
|
|
23
|
+
} from "../app/wix/members/auth-core.js";
|
|
24
24
|
|
|
25
25
|
export type { LoginResult, LoginState };
|
|
26
26
|
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
// whatever token ./client.js holds — a member's after a rest/auth.ts login → the profile; a
|
|
5
5
|
// visitor's → 403 → null. Porting: keep the path and the fieldsets, port the core once.
|
|
6
6
|
// docs: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/members/get-my-member.md
|
|
7
|
-
import { wixRequest } from "
|
|
8
|
-
import { imgSrc } from "
|
|
9
|
-
import { MEMBER_FIELDSETS, memberId, toCurrentMember, type Raw } from "
|
|
10
|
-
import type { CurrentMember } from "
|
|
7
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
8
|
+
import { imgSrc } from "../../shared/rest/media.js";
|
|
9
|
+
import { MEMBER_FIELDSETS, memberId, toCurrentMember, type Raw } from "../app/wix/members/members-core.js";
|
|
10
|
+
import type { CurrentMember } from "../app/wix/members/types.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* The current member, or null: for a visitor (the call is refused — "Missing site member id"), for
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
// Members Area app's App Market id; the identity/profile split is described beside it.
|
|
16
16
|
import { seedSiteId } from "../../shared/seed/site-context.mjs";
|
|
17
17
|
import { wixToken } from "../../shared/seed/wix-cli.mjs";
|
|
18
|
+
import { isMain } from "../../shared/seed/main.mjs";
|
|
18
19
|
import { readFileSync } from "node:fs";
|
|
19
20
|
|
|
20
21
|
const API = "https://www.wixapis.com";
|
|
@@ -77,7 +78,7 @@ export async function setupMembers(ctx, { installMembersArea = true } = {}) {
|
|
|
77
78
|
|
|
78
79
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
79
80
|
|
|
80
|
-
const invokedDirectly =
|
|
81
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
81
82
|
if (invokedDirectly) {
|
|
82
83
|
const planPath = process.argv[2];
|
|
83
84
|
const plan = planPath ? JSON.parse(readFileSync(planPath, "utf8")) : {};
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/portfolio/projects/list-projects.md
|
|
9
9
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/portfolio/projects/query-projects.md
|
|
10
10
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/portfolio/project-items/list-project-items.md
|
|
11
|
-
import { wixRequest } from "
|
|
12
|
-
import { imgSrc } from "
|
|
11
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
12
|
+
import { imgSrc } from "../../shared/rest/media.js";
|
|
13
13
|
import {
|
|
14
14
|
galleryItems,
|
|
15
15
|
visibleCollection,
|
|
@@ -18,8 +18,8 @@ import {
|
|
|
18
18
|
visibleProjects,
|
|
19
19
|
type Raw,
|
|
20
20
|
type VideoSrc,
|
|
21
|
-
} from "
|
|
22
|
-
import type { CollectionSummary, GalleryItem, ProjectDetail, ProjectSummary } from "
|
|
21
|
+
} from "../app/wix/portfolio/portfolio-core.js";
|
|
22
|
+
import type { CollectionSummary, GalleryItem, ProjectDetail, ProjectSummary } from "../app/wix/portfolio/types.js";
|
|
23
23
|
|
|
24
24
|
// REST never returns the bare wix:video:// string — videoInfo arrives as { resolutions, posters },
|
|
25
25
|
// which the core reads directly. A string here has no resolver on this transport → dropped.
|
|
@@ -24,6 +24,7 @@ import { readFileSync } from "node:fs";
|
|
|
24
24
|
import { resolveItemImages } from "../../shared/seed/images.mjs";
|
|
25
25
|
import { seedSiteId } from "../../shared/seed/site-context.mjs";
|
|
26
26
|
import { wixToken } from "../../shared/seed/wix-cli.mjs";
|
|
27
|
+
import { isMain } from "../../shared/seed/main.mjs";
|
|
27
28
|
|
|
28
29
|
const API = "https://www.wixapis.com";
|
|
29
30
|
const PORTFOLIO_APP_ID = "d90652a2-f5a1-4c7c-84c4-d4cdcc41f130";
|
|
@@ -235,7 +236,7 @@ export async function setupPortfolio(ctx, { collections = [], projects = [] } =
|
|
|
235
236
|
|
|
236
237
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
237
238
|
|
|
238
|
-
const invokedDirectly =
|
|
239
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
239
240
|
if (invokedDirectly) {
|
|
240
241
|
const planPath = process.argv[2];
|
|
241
242
|
if (!planPath) {
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
// visitor, so callers check the session first (the store does) and never call for a visitor.
|
|
6
6
|
// Porting: keep the path and the query string; the rule is one line in the core.
|
|
7
7
|
// docs: https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/orders/member-list-orders.md
|
|
8
|
-
import { wixRequest } from "
|
|
9
|
-
import { hasPlanAccess, memberOrdersQuery, type MemberOrdersQuery } from "
|
|
10
|
-
import type { Raw } from "
|
|
8
|
+
import { wixRequest } from "../../shared/rest/client.js";
|
|
9
|
+
import { hasPlanAccess, memberOrdersQuery, type MemberOrdersQuery } from "../app/wix/pricing-plans/plan-access-core.js";
|
|
10
|
+
import type { Raw } from "../app/wix/pricing-plans/plans-core.js";
|
|
11
11
|
|
|
12
12
|
export type { MemberOrdersQuery };
|
|
13
13
|
|