@shopify/ui-extensions-server-kit 0.0.0-snapshot-20250605123019 → 0.0.0-snapshot-20250623223113
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/CHANGELOG.md +2 -2
- package/dist/ExtensionServerClient/ExtensionServerClient.d.ts +1 -0
- package/dist/ExtensionServerClient/ExtensionServerClient.test.d.ts +8 -0
- package/dist/ExtensionServerClient/server-types.d.ts +42 -0
- package/dist/context/ExtensionServerProvider.cjs.js +1 -1
- package/dist/context/ExtensionServerProvider.es.js +12 -13
- package/dist/context/constants.cjs.js +1 -1
- package/dist/context/constants.d.ts +0 -1
- package/dist/context/constants.es.js +0 -1
- package/dist/context/types.d.ts +1 -0
- package/dist/hooks/index.d.ts +0 -2
- package/dist/i18n.cjs.js +1 -1
- package/dist/i18n.d.ts +1 -20
- package/dist/i18n.es.js +0 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +40 -49
- package/dist/state/actions/actions.cjs.js +1 -1
- package/dist/state/actions/actions.d.ts +1 -2
- package/dist/state/actions/actions.es.js +0 -7
- package/dist/state/actions/types.d.ts +1 -5
- package/dist/types.cjs.js +1 -1
- package/dist/types.d.ts +3 -9
- package/dist/types.es.js +2 -2
- package/dist/utilities/index.d.ts +0 -1
- package/package.json +7 -3
- package/src/ExtensionServerClient/ExtensionServerClient.test.ts +837 -330
- package/src/ExtensionServerClient/ExtensionServerClient.ts +8 -7
- package/src/ExtensionServerClient/server-types.ts +55 -0
- package/src/context/ExtensionServerProvider.test.tsx +202 -39
- package/src/context/ExtensionServerProvider.tsx +1 -2
- package/src/context/constants.ts +3 -2
- package/src/context/types.ts +1 -0
- package/src/hooks/index.ts +0 -2
- package/src/i18n.ts +3 -3
- package/src/state/actions/actions.ts +1 -8
- package/src/state/actions/types.ts +1 -12
- package/src/state/reducers/extensionServerReducer.test.ts +0 -14
- package/src/types.ts +3 -5
- package/src/utilities/index.ts +0 -1
- package/dist/hooks/useExtensionClient.cjs.js +0 -1
- package/dist/hooks/useExtensionClient.d.ts +0 -1
- package/dist/hooks/useExtensionClient.es.js +0 -8
- package/dist/hooks/useExtensionServerEvent.cjs.js +0 -1
- package/dist/hooks/useExtensionServerEvent.d.ts +0 -1
- package/dist/hooks/useExtensionServerEvent.es.js +0 -9
- package/dist/utilities/groupByKey.cjs.js +0 -1
- package/dist/utilities/groupByKey.d.ts +0 -3
- package/dist/utilities/groupByKey.es.js +0 -6
- package/src/hooks/useExtensionClient.ts +0 -6
- package/src/hooks/useExtensionServerEvent.ts +0 -11
- package/src/utilities/groupByKey.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @shopify/ui-extensions-server-kit
|
|
2
2
|
|
|
3
|
-
## 0.0.0-snapshot-
|
|
3
|
+
## 0.0.0-snapshot-20250623223113
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- 386bf0e: Add support for displaying UI Extension dev logs
|
|
8
8
|
|
|
9
9
|
## 5.2.1
|
|
10
10
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Surface } from './types.js';
|
|
2
|
+
import { ExtensionPayload, ExtensionPoint } from '../types';
|
|
3
|
+
import { FlattenedLocalization, Localization } from '../i18n';
|
|
4
|
+
export declare namespace ExtensionServer {
|
|
5
|
+
interface UIExtension extends ExtensionPayload {
|
|
6
|
+
extensionPoints: ExtensionPoint[];
|
|
7
|
+
localization?: FlattenedLocalization | Localization | null;
|
|
8
|
+
}
|
|
9
|
+
interface Client {
|
|
10
|
+
id: string;
|
|
11
|
+
connection: WebSocket;
|
|
12
|
+
options: Options;
|
|
13
|
+
connect(options?: Options): () => void;
|
|
14
|
+
on<TEvent extends keyof InboundEvents>(event: TEvent, listener: (payload: InboundEvents[TEvent]) => void): () => void;
|
|
15
|
+
persist<TEvent extends keyof OutboundPersistEvents>(event: TEvent, data: OutboundPersistEvents[TEvent]): void;
|
|
16
|
+
emit<TEvent extends keyof DispatchEvents>(...args: EmitArgs<TEvent>): void;
|
|
17
|
+
onConnection<TEvent extends 'close' | 'open'>(event: TEvent, listener: (event: Event) => void): () => void;
|
|
18
|
+
}
|
|
19
|
+
interface Options {
|
|
20
|
+
connection: {
|
|
21
|
+
url?: string;
|
|
22
|
+
automaticConnect?: boolean;
|
|
23
|
+
protocols?: string | string[];
|
|
24
|
+
};
|
|
25
|
+
surface?: Surface;
|
|
26
|
+
locales?: any;
|
|
27
|
+
}
|
|
28
|
+
interface ServerEvents {
|
|
29
|
+
event: string;
|
|
30
|
+
data: any;
|
|
31
|
+
}
|
|
32
|
+
interface InboundEvents {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
interface OutboundPersistEvents {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}
|
|
38
|
+
interface DispatchEvents {
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}
|
|
41
|
+
type EmitArgs<TEvent extends keyof DispatchEvents> = undefined extends DispatchEvents[TEvent] ? [event: TEvent] : [event: TEvent, payload: DispatchEvents[TEvent]];
|
|
42
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./constants.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("./constants.cjs.js"),o=require("../state/actions/actions.cjs.js"),d=require("../ExtensionServerClient/ExtensionServerClient.cjs.js"),a=require("../hooks/useIsomorphicLayoutEffect.cjs.js"),p=require("../hooks/useExtensionServerState.cjs.js"),r=require("react");function x({children:f,options:S}){const[i,n]=p.useExtensionServerState(),[c,v]=r.useState(S),[t]=r.useState(()=>new d.ExtensionServerClient),u=r.useCallback((s=c)=>{v(s)},[c]);a.useIsomorphicLayoutEffect(()=>t.connect(c),[t,c]),a.useIsomorphicLayoutEffect(()=>{const s=[t.on("update",e=>n(o.createUpdateAction(e))),t.on("connected",e=>n(o.createConnectedAction(e))),t.on("refresh",e=>n(o.createRefreshAction(e))),t.on("focus",e=>n(o.createFocusAction(e))),t.on("unfocus",e=>n(o.createUnfocusAction(e)))];return()=>s.forEach(e=>e())},[n]);const l=r.useMemo(()=>({dispatch:n,state:i,connect:u,client:t}),[n,u,i,t]);return r.createElement(E.extensionServerContext.Provider,{value:l},f)}exports.ExtensionServerProvider=x;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { extensionServerContext as
|
|
2
|
-
import { createUpdateAction as
|
|
1
|
+
import { extensionServerContext as d } from "./constants.es.js";
|
|
2
|
+
import { createUpdateAction as l, createConnectedAction as v, createRefreshAction as x, createFocusAction as E, createUnfocusAction as S } from "../state/actions/actions.es.js";
|
|
3
3
|
import { ExtensionServerClient as h } from "../ExtensionServerClient/ExtensionServerClient.es.js";
|
|
4
4
|
import { useIsomorphicLayoutEffect as i } from "../hooks/useIsomorphicLayoutEffect.es.js";
|
|
5
|
-
import { useExtensionServerState as
|
|
6
|
-
import
|
|
7
|
-
function
|
|
8
|
-
const [c, o] =
|
|
5
|
+
import { useExtensionServerState as A } from "../hooks/useExtensionServerState.es.js";
|
|
6
|
+
import C, { useState as a, useCallback as P, useMemo as R } from "react";
|
|
7
|
+
function I({ children: u, options: f }) {
|
|
8
|
+
const [c, o] = A(), [n, m] = a(f), [t] = a(() => new h()), s = P(
|
|
9
9
|
(r = n) => {
|
|
10
10
|
m(r);
|
|
11
11
|
},
|
|
@@ -13,18 +13,17 @@ function F({ children: u, options: f }) {
|
|
|
13
13
|
);
|
|
14
14
|
i(() => t.connect(n), [t, n]), i(() => {
|
|
15
15
|
const r = [
|
|
16
|
-
t.on("update", (e) => o(
|
|
16
|
+
t.on("update", (e) => o(l(e))),
|
|
17
17
|
t.on("connected", (e) => o(v(e))),
|
|
18
18
|
t.on("refresh", (e) => o(x(e))),
|
|
19
|
-
t.on("focus", (e) => o(
|
|
20
|
-
t.on("unfocus", (e) => o(
|
|
21
|
-
t.on("log", (e) => o(S(e)))
|
|
19
|
+
t.on("focus", (e) => o(E(e))),
|
|
20
|
+
t.on("unfocus", (e) => o(S(e)))
|
|
22
21
|
];
|
|
23
22
|
return () => r.forEach((e) => e());
|
|
24
23
|
}, [o]);
|
|
25
|
-
const p =
|
|
26
|
-
return /* @__PURE__ */
|
|
24
|
+
const p = R(() => ({ dispatch: o, state: c, connect: s, client: t }), [o, s, c, t]);
|
|
25
|
+
return /* @__PURE__ */ C.createElement(d.Provider, { value: p }, u);
|
|
27
26
|
}
|
|
28
27
|
export {
|
|
29
|
-
|
|
28
|
+
I as ExtensionServerProvider
|
|
30
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../ExtensionServerClient/ExtensionServerClient.cjs.js"),n=require("../state/reducers/constants.cjs.js"),e=require("../utilities/noop.cjs.js"),o=require("react"),r={connect:e.noop,dispatch:e.noop,state:n.INITIAL_STATE,client:new t.ExtensionServerClient},s=o.createContext(r);exports.extensionServerContext=s;
|
package/dist/context/types.d.ts
CHANGED
package/dist/hooks/index.d.ts
CHANGED
package/dist/i18n.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=["localization","name","description"];function L(n){const t=new Map;return u(n,(e,s)=>t.set(e,s)),t}function u(n,t,e){Object.keys(n).forEach(s=>{const o=n[s],r=e?`${e}.${s}`:s;o!=null&&(typeof o=="string"?t(r,o):u(o,t,r))})}function f(n,t){const e=a(n.translations[n.defaultLocale]),s=i(t),o=a(n.translations[s]),r=a(n.translations[t]);return d(new Map([...e,...o,...r]))}function a(n){return n?L(n):new Map}function c(n,t){const e=new Set(Object.keys(n.translations));if(e.size===0||e.has(t.user))return t.user;const s=i(t.user);if(e.has(s))return s;if(t.shop&&e.has(t.shop))return t.shop;const o=t.shop&&i(t.shop);return o&&e.has(o)?o:n.defaultLocale}function d(n){const t={};for(const[e,s]of n)t[e]=s;return t}function i(n){return n.split("-")[0]}function T(n,t){if(!n||!t)return;if(p(n))return n;const e=c(n,t),s=JSON.stringify(f(n,e));return{extensionLocale:e,translations:s,lastUpdated:n.lastUpdated}}function p(n){return typeof n.translations=="string"&&Object.prototype.hasOwnProperty.call(n,"extensionLocale")}exports.TRANSLATED_KEYS=l;exports.flattenDevExtensionTranslations=f;exports.getFlattenedLocalization=T;exports.isFlattenedTranslations=p;exports.resolveDevExtensionLocale=c;
|
package/dist/i18n.d.ts
CHANGED
|
@@ -22,9 +22,6 @@ export interface LocalesOptions {
|
|
|
22
22
|
user: string;
|
|
23
23
|
shop?: string;
|
|
24
24
|
}
|
|
25
|
-
export interface TranslationDictionary {
|
|
26
|
-
[key: string]: string | TranslationDictionary;
|
|
27
|
-
}
|
|
28
25
|
/**
|
|
29
26
|
* This is a flattened dictionary of extension translations for the active locale.
|
|
30
27
|
*
|
|
@@ -63,26 +60,10 @@ export interface TranslationDictionary {
|
|
|
63
60
|
* }
|
|
64
61
|
* ```
|
|
65
62
|
*/
|
|
66
|
-
|
|
63
|
+
interface ExtensionTranslationMap {
|
|
67
64
|
[key: string]: string;
|
|
68
65
|
}
|
|
69
66
|
export declare const TRANSLATED_KEYS: string[];
|
|
70
|
-
/**
|
|
71
|
-
* From a nested dictionary like the following :
|
|
72
|
-
*
|
|
73
|
-
* ```typescript
|
|
74
|
-
* const dictionary = {
|
|
75
|
-
* Foo: {
|
|
76
|
-
* Bar: {
|
|
77
|
-
* fooBar: 'something'
|
|
78
|
-
* }
|
|
79
|
-
* }
|
|
80
|
-
* }
|
|
81
|
-
*
|
|
82
|
-
* Returns a map containing this pair : {'Foo.Bar.fooBar': 'something'}
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
export declare function dictionaryToFlatMap(dictionary: TranslationDictionary): Map<string, string>;
|
|
86
67
|
export declare function flattenDevExtensionTranslations(localization: Localization, locale: string): ExtensionTranslationMap;
|
|
87
68
|
export declare function resolveDevExtensionLocale(localization: Localization, locales: {
|
|
88
69
|
user: string;
|
package/dist/i18n.es.js
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./context/ExtensionServerProvider.cjs.js"),r=require("./context/constants.cjs.js"),o=require("./ExtensionServerClient/ExtensionServerClient.cjs.js"),s=require("./ExtensionServerClient/types.cjs.js"),i=require("./hooks/useExtensionServerContext.cjs.js"),c=require("./hooks/useExtensionServerState.cjs.js"),a=require("./hooks/useIsomorphicLayoutEffect.cjs.js"),e=require("./state/actions/actions.cjs.js"),u=require("./state/reducers/constants.cjs.js"),S=require("./state/reducers/extensionServerReducer.cjs.js"),E=require("./types.cjs.js"),x=require("./utilities/noop.cjs.js"),l=require("./utilities/replaceUpdated.cjs.js"),v=require("./utilities/set.cjs.js"),A=require("./utilities/assetToString.cjs.js"),d=require("./utilities/isValidSurface.cjs.js"),q=require("./utilities/isUIExtension.cjs.js"),t=require("./i18n.cjs.js");exports.ExtensionServerProvider=n.ExtensionServerProvider;exports.extensionServerContext=r.extensionServerContext;exports.ExtensionServerClient=o.ExtensionServerClient;exports.AVAILABLE_SURFACES=s.AVAILABLE_SURFACES;exports.useExtensionServerContext=i.useExtensionServerContext;exports.useExtensionServerState=c.useExtensionServerState;exports.useIsomorphicLayoutEffect=a.useIsomorphicLayoutEffect;exports.createConnectedAction=e.createConnectedAction;exports.createFocusAction=e.createFocusAction;exports.createRefreshAction=e.createRefreshAction;exports.createUnfocusAction=e.createUnfocusAction;exports.createUpdateAction=e.createUpdateAction;exports.INITIAL_STATE=u.INITIAL_STATE;exports.extensionServerReducer=S.extensionServerReducer;exports.Status=E.Status;exports.noop=x.noop;exports.replaceUpdated=l.replaceUpdated;exports.set=v.set;exports.assetToString=A.assetToString;exports.isValidSurface=d.isValidSurface;exports.isUIExtension=q.isUIExtension;exports.TRANSLATED_KEYS=t.TRANSLATED_KEYS;exports.flattenDevExtensionTranslations=t.flattenDevExtensionTranslations;exports.getFlattenedLocalization=t.getFlattenedLocalization;exports.isFlattenedTranslations=t.isFlattenedTranslations;exports.resolveDevExtensionLocale=t.resolveDevExtensionLocale;
|
package/dist/index.es.js
CHANGED
|
@@ -1,55 +1,46 @@
|
|
|
1
1
|
import { ExtensionServerProvider as r } from "./context/ExtensionServerProvider.es.js";
|
|
2
|
-
import {
|
|
2
|
+
import { extensionServerContext as n } from "./context/constants.es.js";
|
|
3
3
|
import { ExtensionServerClient as s } from "./ExtensionServerClient/ExtensionServerClient.es.js";
|
|
4
|
-
import { AVAILABLE_SURFACES as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { isValidSurface as w } from "./utilities/isValidSurface.es.js";
|
|
20
|
-
import { isUIExtension as H } from "./utilities/isUIExtension.es.js";
|
|
21
|
-
import { TRANSLATED_KEYS as O, dictionaryToFlatMap as Q, flattenDevExtensionTranslations as W, getFlattenedLocalization as X, isFlattenedTranslations as Z, resolveDevExtensionLocale as $ } from "./i18n.es.js";
|
|
4
|
+
import { AVAILABLE_SURFACES as a } from "./ExtensionServerClient/types.es.js";
|
|
5
|
+
import { useExtensionServerContext as p } from "./hooks/useExtensionServerContext.es.js";
|
|
6
|
+
import { useExtensionServerState as m } from "./hooks/useExtensionServerState.es.js";
|
|
7
|
+
import { useIsomorphicLayoutEffect as A } from "./hooks/useIsomorphicLayoutEffect.es.js";
|
|
8
|
+
import { createConnectedAction as l, createFocusAction as v, createRefreshAction as d, createUnfocusAction as u, createUpdateAction as T } from "./state/actions/actions.es.js";
|
|
9
|
+
import { INITIAL_STATE as I } from "./state/reducers/constants.es.js";
|
|
10
|
+
import { extensionServerReducer as U } from "./state/reducers/extensionServerReducer.es.js";
|
|
11
|
+
import { Status as R } from "./types.es.js";
|
|
12
|
+
import { noop as _ } from "./utilities/noop.es.js";
|
|
13
|
+
import { replaceUpdated as h } from "./utilities/replaceUpdated.es.js";
|
|
14
|
+
import { set as V } from "./utilities/set.es.js";
|
|
15
|
+
import { assetToString as z } from "./utilities/assetToString.es.js";
|
|
16
|
+
import { isValidSurface as K } from "./utilities/isValidSurface.es.js";
|
|
17
|
+
import { isUIExtension as Y } from "./utilities/isUIExtension.es.js";
|
|
18
|
+
import { TRANSLATED_KEYS as j, flattenDevExtensionTranslations as k, getFlattenedLocalization as q, isFlattenedTranslations as w, resolveDevExtensionLocale as G } from "./i18n.es.js";
|
|
22
19
|
export {
|
|
23
|
-
|
|
24
|
-
n as DEFAULT_VALUE,
|
|
20
|
+
a as AVAILABLE_SURFACES,
|
|
25
21
|
s as ExtensionServerClient,
|
|
26
22
|
r as ExtensionServerProvider,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
K as
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
c as useExtensionClient,
|
|
51
|
-
E as useExtensionServerContext,
|
|
52
|
-
S as useExtensionServerEvent,
|
|
53
|
-
u as useExtensionServerState,
|
|
54
|
-
d as useIsomorphicLayoutEffect
|
|
23
|
+
I as INITIAL_STATE,
|
|
24
|
+
R as Status,
|
|
25
|
+
j as TRANSLATED_KEYS,
|
|
26
|
+
z as assetToString,
|
|
27
|
+
l as createConnectedAction,
|
|
28
|
+
v as createFocusAction,
|
|
29
|
+
d as createRefreshAction,
|
|
30
|
+
u as createUnfocusAction,
|
|
31
|
+
T as createUpdateAction,
|
|
32
|
+
n as extensionServerContext,
|
|
33
|
+
U as extensionServerReducer,
|
|
34
|
+
k as flattenDevExtensionTranslations,
|
|
35
|
+
q as getFlattenedLocalization,
|
|
36
|
+
w as isFlattenedTranslations,
|
|
37
|
+
Y as isUIExtension,
|
|
38
|
+
K as isValidSurface,
|
|
39
|
+
_ as noop,
|
|
40
|
+
h as replaceUpdated,
|
|
41
|
+
G as resolveDevExtensionLocale,
|
|
42
|
+
V as set,
|
|
43
|
+
p as useExtensionServerContext,
|
|
44
|
+
m as useExtensionServerState,
|
|
45
|
+
A as useIsomorphicLayoutEffect
|
|
55
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(e){return{type:"connected",payload:e}}function c(e){return{type:"update",payload:e}}function n(e){return{type:"refresh",payload:e}}function o(e){return{type:"focus",payload:e}}function r(e){return{type:"unfocus",payload:e}}
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(e){return{type:"connected",payload:e}}function c(e){return{type:"update",payload:e}}function n(e){return{type:"refresh",payload:e}}function o(e){return{type:"focus",payload:e}}function r(e){return{type:"unfocus",payload:e}}exports.createConnectedAction=t;exports.createFocusAction=o;exports.createRefreshAction=n;exports.createUnfocusAction=r;exports.createUpdateAction=c;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { ConnectedAction, UpdateAction, RefreshAction, FocusAction, UnfocusAction
|
|
1
|
+
import type { ConnectedAction, UpdateAction, RefreshAction, FocusAction, UnfocusAction } from './types';
|
|
2
2
|
export declare function createConnectedAction(payload: ConnectedAction['payload']): ConnectedAction;
|
|
3
3
|
export declare function createUpdateAction(payload: UpdateAction['payload']): UpdateAction;
|
|
4
4
|
export declare function createRefreshAction(payload: RefreshAction['payload']): RefreshAction;
|
|
5
5
|
export declare function createFocusAction(payload: FocusAction['payload']): FocusAction;
|
|
6
6
|
export declare function createUnfocusAction(payload: UnfocusAction['payload']): UnfocusAction;
|
|
7
|
-
export declare function createLogAction(payload: LogAction['payload']): LogAction;
|
|
@@ -28,16 +28,9 @@ function o(e) {
|
|
|
28
28
|
payload: e
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function u(e) {
|
|
32
|
-
return {
|
|
33
|
-
type: "log",
|
|
34
|
-
payload: e
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
31
|
export {
|
|
38
32
|
t as createConnectedAction,
|
|
39
33
|
r as createFocusAction,
|
|
40
|
-
u as createLogAction,
|
|
41
34
|
c as createRefreshAction,
|
|
42
35
|
o as createUnfocusAction,
|
|
43
36
|
n as createUpdateAction
|
|
@@ -18,8 +18,4 @@ export interface UnfocusAction {
|
|
|
18
18
|
type: 'unfocus';
|
|
19
19
|
payload: ExtensionServer.InboundEvents['unfocus'];
|
|
20
20
|
}
|
|
21
|
-
export
|
|
22
|
-
type: 'log';
|
|
23
|
-
payload: ExtensionServer.InboundEvents['log'];
|
|
24
|
-
}
|
|
25
|
-
export type ExtensionServerActions = ConnectedAction | UpdateAction | RefreshAction | FocusAction | UnfocusAction | LogAction;
|
|
21
|
+
export type ExtensionServerActions = ConnectedAction | UpdateAction | RefreshAction | FocusAction | UnfocusAction;
|
package/dist/types.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=(e=>(e.Success="success",e))(t||{});exports.Status=t;
|
package/dist/types.d.ts
CHANGED
|
@@ -47,11 +47,6 @@ declare global {
|
|
|
47
47
|
navigate: {
|
|
48
48
|
url: string;
|
|
49
49
|
};
|
|
50
|
-
log: {
|
|
51
|
-
level: string;
|
|
52
|
-
args: unknown[];
|
|
53
|
-
extensionName: string;
|
|
54
|
-
};
|
|
55
50
|
}
|
|
56
51
|
namespace API {
|
|
57
52
|
interface BaseResponse {
|
|
@@ -78,14 +73,14 @@ declare global {
|
|
|
78
73
|
export type DeepPartial<T> = {
|
|
79
74
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
80
75
|
};
|
|
81
|
-
|
|
76
|
+
interface ResourceURL {
|
|
82
77
|
url: string;
|
|
83
78
|
}
|
|
84
79
|
export interface Asset extends ResourceURL {
|
|
85
80
|
name: string;
|
|
86
81
|
lastUpdated: number;
|
|
87
82
|
}
|
|
88
|
-
|
|
83
|
+
interface Metafield {
|
|
89
84
|
namespace: string;
|
|
90
85
|
key: string;
|
|
91
86
|
}
|
|
@@ -102,7 +97,7 @@ export interface ExtensionPoint {
|
|
|
102
97
|
[name: string]: Asset;
|
|
103
98
|
};
|
|
104
99
|
}
|
|
105
|
-
|
|
100
|
+
type ExtensionPoints = string[] | ExtensionPoint[] | null;
|
|
106
101
|
interface CollectBuyerConsentCapabilities {
|
|
107
102
|
smsMarketing: boolean;
|
|
108
103
|
customerPrivacy: boolean;
|
|
@@ -157,7 +152,6 @@ export interface ExtensionPayload {
|
|
|
157
152
|
};
|
|
158
153
|
}
|
|
159
154
|
export declare enum Status {
|
|
160
|
-
Error = "error",
|
|
161
155
|
Success = "success"
|
|
162
156
|
}
|
|
163
157
|
export interface App {
|
package/dist/types.es.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/ui-extensions-server-kit",
|
|
3
|
-
"version": "0.0.0-snapshot-
|
|
3
|
+
"version": "0.0.0-snapshot-20250623223113",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/Shopify/cli.git",
|
|
9
|
+
"directory": "packages/ui-extensions-server-kit"
|
|
10
|
+
},
|
|
6
11
|
"exports": {
|
|
7
12
|
"./package.json": "./package.json",
|
|
8
13
|
".": {
|
|
@@ -42,11 +47,10 @@
|
|
|
42
47
|
"@shopify/ui-extensions-test-utils": "3.26.0",
|
|
43
48
|
"@types/react": "17.0.2",
|
|
44
49
|
"@vitejs/plugin-react-refresh": "^1.3.6",
|
|
45
|
-
"jest-websocket-mock": "^2.4.0",
|
|
46
50
|
"jsdom": "^20.0.3",
|
|
47
51
|
"react": "^17.0.2",
|
|
48
52
|
"vi-fetch": "^0.8.0",
|
|
49
|
-
"vite": "
|
|
53
|
+
"vite": "6.3.5"
|
|
50
54
|
},
|
|
51
55
|
"peerDependencies": {
|
|
52
56
|
"react": "^17.0.2"
|