@wix/agent-skills 1.31.0 → 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/SKILL.md +7 -8
- package/skills/wix-app/references/DASHBOARD_PAGE.md +1 -1
- package/skills/wix-app/references/STORES_VERSIONING.md +1 -1
- package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +11 -50
- package/skills/wix-app/references/dashboard-page/DATA_SOURCES.md +14 -10
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +5 -8
- package/skills/wix-app/references/dashboard-page/TABLE_STATE.md +5 -4
- package/skills/wix-headless-kit/SKILL.md +31 -14
- package/skills/wix-headless-kit/guides/api-run.md +116 -31
- package/skills/wix-headless-kit/guides/existing-site.md +9 -2
- package/skills/wix-headless-kit/guides/reference-mode.md +9 -1
- package/skills/wix-headless-kit/install/AGENTS.md +10 -7
- package/skills/wix-headless-kit/install/attach.mjs +35 -30
- 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 +62 -8
- package/skills/wix-headless-kit/install/deploy.mjs +36 -11
- 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 +18 -27
- package/skills/wix-headless-kit/install/templates.mjs +4 -3
- 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.md +1 -1
- package/skills/wix-headless-templates/blog/seed/seed-blog.mjs +4 -3
- 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.md +1 -1
- package/skills/wix-headless-templates/bookings/seed/seed-bookings.mjs +4 -2
- 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.md +1 -1
- package/skills/wix-headless-templates/donations/seed/seed-donations.mjs +5 -3
- 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.md +1 -1
- package/skills/wix-headless-templates/events/seed/seed-events.mjs +5 -3
- 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.md +4 -2
- package/skills/wix-headless-templates/portfolio/seed/seed-portfolio.mjs +8 -7
- 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.md +1 -1
- package/skills/wix-headless-templates/rentals/seed/seed-rentals.mjs +4 -2
- 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.md +1 -1
- package/skills/wix-headless-templates/restaurants/seed/seed-restaurants.mjs +6 -4
- 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/images.mjs +41 -5
- 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 +44 -14
- package/skills/wix-headless-templates/storefront/seed/seed-store.mjs +23 -15
- package/skills/wix-manage/SKILL.md +28 -18
- 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/automations/activation-status.md +52 -0
- package/skills/wix-manage/references/automations/api-catalog.md +81 -0
- package/skills/wix-manage/references/automations/build-and-manage-automations.md +34 -0
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +3 -0
- package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +277 -363
- 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/custom-apps/use-app-skills-and-app-tools.md +3 -1
- 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/send-feedback-to-wix.md +92 -0
- package/skills/wix-manage/references/sites/upload-static-site.md +298 -283
- 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
- package/skills/wix-manage/references/bookings/create-appointment-service.md +0 -243
- package/skills/wix-manage/references/bookings/create-booking-service-from-prompt.md +0 -31
- package/skills/wix-manage/references/bookings/create-class-service.md +0 -222
- package/skills/wix-manage/references/bookings/create-course-service.md +0 -251
|
@@ -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
|
|
|
@@ -52,7 +52,7 @@ feed without covers looks broken.
|
|
|
52
52
|
- Cover — the default is a `coverImagePrompt` (AI-generated, ~1 Wix AI credit per image,
|
|
53
53
|
account-billed): brand-contextual — subject, aesthetic/mood, palette, lighting — always
|
|
54
54
|
ending "no text, no watermarks". At least one image in the set shows the real subject of the business — the actual product/space/service, not abstract decoration. For an asset the user actually supplied use
|
|
55
|
-
`coverImagePath` (a file on this machine — uploaded to Wix Media) or `coverImageUrl` (their
|
|
55
|
+
`coverImageMediaId` (a file already in the site's Media Manager, such as one the user uploaded there: used as it is, no copy; a `static.wixstatic.com/media/<file id>` URL of a site file counts as one), `coverImagePath` (a file on this machine — uploaded to Wix Media) or `coverImageUrl` (their
|
|
56
56
|
own hosted URL; verify it with `curl -sI` → 200) — never a stock-photo or guessed URL. Covers resolve
|
|
57
57
|
in parallel and never block the seed; a failed cover leaves that post text-only (the script
|
|
58
58
|
re-publishes each post it covers).
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// Plan shape (see SEED.md):
|
|
13
13
|
// { "categories"?: [name], "tags"?: [name],
|
|
14
14
|
// "posts": [{ "title", "content": [blocks] | "richContent"?, "category"?|"categories"?,
|
|
15
|
-
// "tags"?, "coverImageUrl"? | "coverImagePrompt"? }] }
|
|
15
|
+
// "tags"?, "coverImageMediaId"? | "coverImageUrl"? | "coverImagePrompt"? }] }
|
|
16
16
|
// content blocks: { type:"heading", text, level? } | { type:"paragraph", text }
|
|
17
17
|
// | { type:"quote", text } | { type:"bulleted"|"ordered", items:[text,…] }
|
|
18
18
|
//
|
|
@@ -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";
|
|
@@ -255,7 +256,7 @@ export async function setupBlog(ctx, { posts = [], categories = [], tags = [] }
|
|
|
255
256
|
// never depends on images.
|
|
256
257
|
const files = await resolveItemImages(ctx, created.map((c, i) => (
|
|
257
258
|
c?.id && c?.success
|
|
258
|
-
? { path: posts[i]?.coverImagePath, url: posts[i]?.coverImageUrl, prompt: posts[i]?.coverImagePrompt, displayName: `post-${i}.png` }
|
|
259
|
+
? { mediaId: posts[i]?.coverImageMediaId, path: posts[i]?.coverImagePath, url: posts[i]?.coverImageUrl, prompt: posts[i]?.coverImagePrompt, displayName: `post-${i}.png` }
|
|
259
260
|
: null
|
|
260
261
|
)));
|
|
261
262
|
const covers = created
|
|
@@ -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
|
|
|
@@ -19,7 +19,7 @@ service an image — the default is an `imagePrompt` (AI-generated, ~1 Wix AI cr
|
|
|
19
19
|
account-billed): brand-contextual — subject, aesthetic/mood, palette, lighting — always ending
|
|
20
20
|
"no text, no watermarks". At least one image in the set shows the real subject of the business —
|
|
21
21
|
the actual product/space/service, not abstract decoration. For an asset the user actually supplied
|
|
22
|
-
use `imagePath` (a file on this machine — uploaded to Wix Media) or `imageUrl` (their own hosted
|
|
22
|
+
use `imageMediaId` (a file already in the site's Media Manager, such as one the user uploaded there: used as it is, no copy; a `static.wixstatic.com/media/<file id>` URL of a site file counts as one), `imagePath` (a file on this machine — uploaded to Wix Media) or `imageUrl` (their own hosted
|
|
23
23
|
URL; verify it with `curl -sI` → 200) — never a stock-photo or guessed URL. Images resolve in
|
|
24
24
|
parallel and never block the seed; a failed image leaves that service text-only.
|
|
25
25
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
// "price"? (number | { "from": number }), "priceText"?, "free"?, "deposit"?, "payInFull"?,
|
|
18
18
|
// "duration"? (APPOINTMENT, minutes), "capacity"?, "waitlist"?, "maxParticipants"?,
|
|
19
19
|
// "requireManualApproval"?, "conferencing"?, "staff"? (name | [names]), "location"? (name),
|
|
20
|
-
// "category"? (name), "imageUrl"? | "imagePath"? | "imagePrompt"?,
|
|
20
|
+
// "category"? (name), "imageMediaId"? | "imageUrl"? | "imagePath"? | "imagePrompt"?,
|
|
21
21
|
// "sessions"?: [{ "start", "end", "capacity"? }], // CLASS: one-off sessions, local "YYYY-MM-DDThh:mm:ss"
|
|
22
22
|
// "weekly"?: { "days": ["MONDAY"], "time": "18:00", "duration": 60, "start", "end" } }] } // CLASS or COURSE: recurring
|
|
23
23
|
//
|
|
@@ -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";
|
|
@@ -355,6 +356,7 @@ export async function setupBookings(ctx, { services = [], staff = [], locations
|
|
|
355
356
|
// Pass 2 — images: resolve (import by url / generate by prompt) in one parallel wave, then
|
|
356
357
|
// attach. Failures leave the service text-only; the seed's exit never depends on images.
|
|
357
358
|
const files = await resolveItemImages(ctx, created.map((c, i) => ({
|
|
359
|
+
mediaId: services[i]?.imageMediaId,
|
|
358
360
|
url: services[i]?.imageUrl,
|
|
359
361
|
path: services[i]?.imagePath,
|
|
360
362
|
prompt: services[i]?.imagePrompt,
|
|
@@ -389,7 +391,7 @@ export async function setupBookings(ctx, { services = [], staff = [], locations
|
|
|
389
391
|
|
|
390
392
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
391
393
|
|
|
392
|
-
const invokedDirectly =
|
|
394
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
393
395
|
if (invokedDirectly) {
|
|
394
396
|
const planPath = process.argv[2];
|
|
395
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
|
|
|
@@ -16,7 +16,7 @@ amount with a minimum, the note and the cover-fee prompt on. A second campaign (
|
|
|
16
16
|
only when the brief lists several causes. Every campaign gets a cover image — the default is an
|
|
17
17
|
`imagePrompt` (AI-generated, ~1 Wix AI credit per image, account-billed): brand-contextual — subject,
|
|
18
18
|
mood, palette, lighting — always ending "no text, no watermarks"; a real subject of the cause, not
|
|
19
|
-
abstract decoration. For an asset the user supplied use `imagePath` (a file on this machine) or
|
|
19
|
+
abstract decoration. For an asset the user supplied use `imageMediaId` (a file already in the site's Media Manager, such as one the user uploaded there: used as it is, no copy; a `static.wixstatic.com/media/<file id>` URL of a site file counts as one), `imagePath` (a file on this machine) or
|
|
20
20
|
`imageUrl` (their own hosted URL; verify with `curl -sI` → 200) — never a stock or guessed URL.
|
|
21
21
|
Images resolve in parallel and never block the seed; a failed image leaves the campaign text-only.
|
|
22
22
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
// "customAmount"?: { "enabled", "min"?, "max"? },
|
|
17
17
|
// "goal"?: { "target", "endDate"?, "acceptAfterGoal"?, "acceptAfterEndDate"? },
|
|
18
18
|
// "comments"?: false, "askCoverFee"?: false,
|
|
19
|
-
// "imageUrl"? | "imagePath"? | "imagePrompt"? }] }
|
|
19
|
+
// "imageMediaId"? | "imageUrl"? | "imagePath"? | "imagePrompt"? }] }
|
|
20
20
|
//
|
|
21
21
|
// Seeding is ADDITIVE and idempotent — a non-archived campaign with the same name is reused, never
|
|
22
22
|
// duplicated; nothing is deleted or overwritten. Unexpected shapes → read the live API reference;
|
|
@@ -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
|
|
|
@@ -196,8 +197,9 @@ export async function setupDonations(ctx, { campaigns = [], currency } = {}) {
|
|
|
196
197
|
|
|
197
198
|
// Pass 2 — images: resolve (upload a local file / import by url / generate by prompt) in one
|
|
198
199
|
// parallel wave, then attach. Failures leave the campaign text-only; the exit never depends on them.
|
|
199
|
-
const wanted = created.filter((c) => c.created && (c.plan.imageUrl || c.plan.imagePath || c.plan.imagePrompt));
|
|
200
|
+
const wanted = created.filter((c) => c.created && (c.plan.imageMediaId || c.plan.imageUrl || c.plan.imagePath || c.plan.imagePrompt));
|
|
200
201
|
const files = await resolveItemImages(ctx, wanted.map((c) => ({
|
|
202
|
+
mediaId: c.plan.imageMediaId,
|
|
201
203
|
url: c.plan.imageUrl,
|
|
202
204
|
path: c.plan.imagePath,
|
|
203
205
|
prompt: c.plan.imagePrompt,
|
|
@@ -232,7 +234,7 @@ export async function setupDonations(ctx, { campaigns = [], currency } = {}) {
|
|
|
232
234
|
|
|
233
235
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
234
236
|
|
|
235
|
-
const invokedDirectly =
|
|
237
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
236
238
|
if (invokedDirectly) {
|
|
237
239
|
const planPath = process.argv[2];
|
|
238
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
|
|
|
@@ -17,7 +17,7 @@ the shape; the owner adds the rest in the dashboard) and make them exercise the
|
|
|
17
17
|
image (an events page without images looks broken) — the default is an `imagePrompt`
|
|
18
18
|
(AI-generated, ~1 Wix AI credit per image, account-billed): brand-contextual — subject,
|
|
19
19
|
aesthetic/mood, palette, lighting — always ending "no text, no watermarks". At least one image in the set shows the real subject of the business — the actual product/space/service, not abstract decoration. For an asset the user actually
|
|
20
|
-
supplied use `imagePath` (a file on this machine — uploaded to Wix Media) or `imageUrl`
|
|
20
|
+
supplied use `imageMediaId` (a file already in the site's Media Manager, such as one the user uploaded there: used as it is, no copy; a `static.wixstatic.com/media/<file id>` URL of a site file counts as one), `imagePath` (a file on this machine — uploaded to Wix Media) or `imageUrl`
|
|
21
21
|
(their own hosted URL; verify it with `curl -sI` → 200) — never a stock-photo or guessed URL. Images resolve in parallel and never block the
|
|
22
22
|
seed; a failed image leaves that event text-only.
|
|
23
23
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// "startDate", "endDate" (future ISO-8601 UTC), "timeZoneId",
|
|
15
15
|
// "location" ({name,type:"VENUE",address} | {name,type:"ONLINE"} | {locationTbd:true,name}),
|
|
16
16
|
// "ticketTiers"?: [{ "name" (≤30 chars), "price" (decimal STRING), "description"?, "initialLimit"?, "feeType"? }],
|
|
17
|
-
// "category"? (name), "imageUrl"? | "imagePrompt"?, "rsvpResponseType"? }] }
|
|
17
|
+
// "category"? (name), "imageMediaId"? | "imageUrl"? | "imagePrompt"?, "rsvpResponseType"? }] }
|
|
18
18
|
//
|
|
19
19
|
// Seeding is ADDITIVE — never deletes or overwrites existing content. Unexpected shapes →
|
|
20
20
|
// read the live API reference; every call below
|
|
@@ -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";
|
|
@@ -260,7 +261,7 @@ export async function setupEvents(ctx, { events = [], currency } = {}) {
|
|
|
260
261
|
catch (err) { console.error(`guest control skipped for "${ev.title}": ${err.message}`); }
|
|
261
262
|
}
|
|
262
263
|
await publishEvent(ctx, e.id);
|
|
263
|
-
created.push({ ...e, category: ev.category, imageUrl: ev.imageUrl, imagePrompt: ev.imagePrompt, ticketCount: tiers.length, feeTypes: tiers.map((t) => t.feeType), ...(ev.guests ? { guestControl } : {}) });
|
|
264
|
+
created.push({ ...e, category: ev.category, imageMediaId: ev.imageMediaId, imageUrl: ev.imageUrl, imagePrompt: ev.imagePrompt, ticketCount: tiers.length, feeTypes: tiers.map((t) => t.feeType), ...(ev.guests ? { guestControl } : {}) });
|
|
264
265
|
}
|
|
265
266
|
|
|
266
267
|
const names = [...new Set(created.map((e) => e.category).filter(Boolean))];
|
|
@@ -273,6 +274,7 @@ export async function setupEvents(ctx, { events = [], currency } = {}) {
|
|
|
273
274
|
// Pass 2 — images: resolve (import by url / generate by prompt) in one parallel wave, then
|
|
274
275
|
// attach. Failures leave the event text-only; the seed's exit never depends on images.
|
|
275
276
|
const files = await resolveItemImages(ctx, created.map((e) => ({
|
|
277
|
+
mediaId: e.imageMediaId,
|
|
276
278
|
url: e.imageUrl,
|
|
277
279
|
path: e.imagePath,
|
|
278
280
|
prompt: e.imagePrompt,
|
|
@@ -304,7 +306,7 @@ export async function setupEvents(ctx, { events = [], currency } = {}) {
|
|
|
304
306
|
|
|
305
307
|
// ---- CLI entry ----------------------------------------------------------------------------------
|
|
306
308
|
|
|
307
|
-
const invokedDirectly =
|
|
309
|
+
const invokedDirectly = isMain(import.meta.url);
|
|
308
310
|
if (invokedDirectly) {
|
|
309
311
|
const planPath = process.argv[2];
|
|
310
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
|
|