@jay-framework/wix-data 0.20.0 → 0.22.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/index.client.js +4 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -4
- package/package.json +13 -14
- package/plugin.yaml +3 -4
package/dist/index.client.js
CHANGED
|
@@ -5,6 +5,9 @@ import { createJayContext, useGlobalContext } from "@jay-framework/runtime";
|
|
|
5
5
|
import { WIX_CLIENT_CONTEXT } from "@jay-framework/wix-server-client/client";
|
|
6
6
|
import { items } from "@wix/data";
|
|
7
7
|
const collectionItem = makeJayStackComponent().withProps();
|
|
8
|
+
function stripWixMediaResize(url) {
|
|
9
|
+
return url.replace(/\/v1\/(?:fit|fill|crop)\/[^/]+\/file\.\w+$/, "");
|
|
10
|
+
}
|
|
8
11
|
function parseWixMediaUrl(url) {
|
|
9
12
|
if (!url) return null;
|
|
10
13
|
const match = url.match(
|
|
@@ -41,7 +44,7 @@ function formatWixMediaUrl(_id, url, resize) {
|
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
if ((url == null ? void 0 : url.startsWith("http://")) || (url == null ? void 0 : url.startsWith("https://"))) {
|
|
44
|
-
return url;
|
|
47
|
+
return stripWixMediaResize(url) + resizeFragment;
|
|
45
48
|
}
|
|
46
49
|
return "";
|
|
47
50
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { BuildDescriptors } from '@wix/sdk-types';
|
|
|
7
7
|
import * as _jay_framework_runtime from '@jay-framework/runtime';
|
|
8
8
|
import * as _jay_framework_component from '@jay-framework/component';
|
|
9
9
|
import { WixDataItem } from '@wix/wix-data-items-sdk';
|
|
10
|
-
import { PluginSetupContext, PluginSetupResult,
|
|
10
|
+
import { PluginSetupContext, PluginSetupResult, PluginAgentKitContext, PluginAgentKitResult } from '@jay-framework/stack-server-runtime';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Wix Data Plugin Configuration Types
|
|
@@ -584,7 +584,7 @@ declare const init: _jay_framework_fullstack_component.JayInit<WixDataInitData>;
|
|
|
584
584
|
*/
|
|
585
585
|
|
|
586
586
|
declare function setupWixData(ctx: PluginSetupContext): Promise<PluginSetupResult>;
|
|
587
|
-
declare function
|
|
587
|
+
declare function generateWixDataAgentKit(ctx: PluginAgentKitContext): Promise<PluginAgentKitResult>;
|
|
588
588
|
|
|
589
589
|
/**
|
|
590
590
|
* Item Contract Generator
|
|
@@ -630,4 +630,4 @@ declare const generator$1: _jay_framework_fullstack_component.DynamicContractGen
|
|
|
630
630
|
*/
|
|
631
631
|
declare const generator: _jay_framework_fullstack_component.DynamicContractGenerator<[WixDataService]>;
|
|
632
632
|
|
|
633
|
-
export { type CategoryConfig, type CategoryItem, type CollectionConfig, type CollectionFetcher, type CollectionSchema, type ComponentsConfig, type FieldSchema, type GetCategoriesInput, type GetCategoriesOutput, type GetItemBySlugInput, type GetItemBySlugOutput, type ProcessedField, type ProcessedSchema, type QueryItemsInput, type QueryItemsOutput, type ReferenceConfig, type ResolvedWixDataConfig, WIX_DATA_CONTEXT, WIX_DATA_SERVICE_MARKER, type WixDataConfig, type WixDataContext, type WixDataFieldType, type WixDataInitData, type WixDataService, generator as cardContractGenerator, collectionCard, collectionItem, collectionList, collectionTable,
|
|
633
|
+
export { type CategoryConfig, type CategoryItem, type CollectionConfig, type CollectionFetcher, type CollectionSchema, type ComponentsConfig, type FieldSchema, type GetCategoriesInput, type GetCategoriesOutput, type GetItemBySlugInput, type GetItemBySlugOutput, type ProcessedField, type ProcessedSchema, type QueryItemsInput, type QueryItemsOutput, type ReferenceConfig, type ResolvedWixDataConfig, WIX_DATA_CONTEXT, WIX_DATA_SERVICE_MARKER, type WixDataConfig, type WixDataContext, type WixDataFieldType, type WixDataInitData, type WixDataService, generator as cardContractGenerator, collectionCard, collectionItem, collectionList, collectionTable, generateWixDataAgentKit, getCategories, getItemBySlug, getVisibleCollections, init, isCardField, isContentField, isTableField, generator$3 as itemContractGenerator, generator$2 as listContractGenerator, loadConfig, processSchema, provideWixDataService, queryItems, setupWixData, generator$1 as tableContractGenerator, toPascalCase, validateCollectionConfig, validateConfig };
|
package/dist/index.js
CHANGED
|
@@ -593,6 +593,9 @@ async function fetchReference(refValue, wixData) {
|
|
|
593
593
|
return null;
|
|
594
594
|
}
|
|
595
595
|
const collectionItem = makeJayStackComponent().withProps().withServices(WIX_DATA_SERVICE_MARKER).withLoadParams(loadItemParams).withSlowlyRender(renderSlowlyChanging$3);
|
|
596
|
+
function stripWixMediaResize(url) {
|
|
597
|
+
return url.replace(/\/v1\/(?:fit|fill|crop)\/[^/]+\/file\.\w+$/, "");
|
|
598
|
+
}
|
|
596
599
|
function parseWixMediaUrl(url) {
|
|
597
600
|
if (!url) return null;
|
|
598
601
|
const match = url.match(
|
|
@@ -629,7 +632,7 @@ function formatWixMediaUrl(_id, url, resize) {
|
|
|
629
632
|
}
|
|
630
633
|
}
|
|
631
634
|
if ((url == null ? void 0 : url.startsWith("http://")) || (url == null ? void 0 : url.startsWith("https://"))) {
|
|
632
|
-
return url;
|
|
635
|
+
return stripWixMediaResize(url) + resizeFragment;
|
|
633
636
|
}
|
|
634
637
|
return "";
|
|
635
638
|
}
|
|
@@ -1272,7 +1275,7 @@ async function setupWixData(ctx) {
|
|
|
1272
1275
|
message: `${totalCount} collections found (${visibleCount} visible)`
|
|
1273
1276
|
};
|
|
1274
1277
|
}
|
|
1275
|
-
async function
|
|
1278
|
+
async function generateWixDataAgentKit(ctx) {
|
|
1276
1279
|
if (ctx.initError) {
|
|
1277
1280
|
throw new Error(`init failed: ${ctx.initError.message}`);
|
|
1278
1281
|
}
|
|
@@ -1338,7 +1341,7 @@ async function generateWixDataReferences(ctx) {
|
|
|
1338
1341
|
"utf-8"
|
|
1339
1342
|
);
|
|
1340
1343
|
return {
|
|
1341
|
-
|
|
1344
|
+
agentKitCreated: [`agent-kit/references/${ctx.pluginName}/collections.yaml`],
|
|
1342
1345
|
message: `${collectionSummaries.length} collections (${collectionSummaries.filter((c) => c.visible).length} visible)`
|
|
1343
1346
|
};
|
|
1344
1347
|
}
|
|
@@ -1539,7 +1542,7 @@ export {
|
|
|
1539
1542
|
collectionItem,
|
|
1540
1543
|
collectionList,
|
|
1541
1544
|
collectionTable,
|
|
1542
|
-
|
|
1545
|
+
generateWixDataAgentKit,
|
|
1543
1546
|
getCategories,
|
|
1544
1547
|
getItemBySlug,
|
|
1545
1548
|
getVisibleCollections,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/wix-data",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Wix Data plugin for Jay Framework with dynamic contract generation",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,27 +31,26 @@
|
|
|
31
31
|
"test": ":"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@jay-framework/component": "^0.
|
|
35
|
-
"@jay-framework/fullstack-component": "^0.
|
|
36
|
-
"@jay-framework/reactive": "^0.
|
|
37
|
-
"@jay-framework/runtime": "^0.
|
|
38
|
-
"@jay-framework/secure": "^0.
|
|
39
|
-
"@jay-framework/stack-client-runtime": "^0.
|
|
40
|
-
"@jay-framework/stack-server-runtime": "^0.
|
|
41
|
-
"@jay-framework/wix-server-client": "^0.
|
|
42
|
-
"@jay-framework/wix-utils": "^0.
|
|
34
|
+
"@jay-framework/component": "^0.22.0",
|
|
35
|
+
"@jay-framework/fullstack-component": "^0.22.0",
|
|
36
|
+
"@jay-framework/reactive": "^0.22.0",
|
|
37
|
+
"@jay-framework/runtime": "^0.22.0",
|
|
38
|
+
"@jay-framework/secure": "^0.22.0",
|
|
39
|
+
"@jay-framework/stack-client-runtime": "^0.22.0",
|
|
40
|
+
"@jay-framework/stack-server-runtime": "^0.22.0",
|
|
41
|
+
"@jay-framework/wix-server-client": "^0.22.0",
|
|
42
|
+
"@jay-framework/wix-utils": "^0.22.0",
|
|
43
43
|
"@wix/data": "^1.0.433",
|
|
44
44
|
"@wix/sdk": "^1.21.5",
|
|
45
|
-
"@wix/sdk-runtime": "^1.0.11",
|
|
46
45
|
"js-yaml": "^4.1.0"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
48
|
"@babel/core": "^7.23.7",
|
|
50
49
|
"@babel/preset-env": "^7.23.8",
|
|
51
50
|
"@babel/preset-typescript": "^7.23.3",
|
|
52
|
-
"@jay-framework/compiler-jay-stack": "^0.
|
|
53
|
-
"@jay-framework/jay-cli": "^0.
|
|
54
|
-
"@jay-framework/vite-plugin": "^0.
|
|
51
|
+
"@jay-framework/compiler-jay-stack": "^0.22.0",
|
|
52
|
+
"@jay-framework/jay-cli": "^0.22.0",
|
|
53
|
+
"@jay-framework/vite-plugin": "^0.22.0",
|
|
55
54
|
"@types/js-yaml": "^4.0.9",
|
|
56
55
|
"@types/node": "^20.11.0",
|
|
57
56
|
"nodemon": "^3.0.3",
|
package/plugin.yaml
CHANGED
|
@@ -34,10 +34,9 @@ contexts:
|
|
|
34
34
|
marker: WIX_DATA_CONTEXT
|
|
35
35
|
description: Client-side access to Wix Data items API
|
|
36
36
|
|
|
37
|
-
setup:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
description: Validate CMS service; generate collection schema references
|
|
37
|
+
setup: setupWixData
|
|
38
|
+
agentkit: generateWixDataAgentKit
|
|
39
|
+
description: Validate CMS service; generate collection schema references
|
|
41
40
|
|
|
42
41
|
# Server actions for querying data
|
|
43
42
|
actions:
|