@juo/blocks 1.20.0 → 2.0.0-alpha.10
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/{ExtensionRoot-DfpvN94s.js → ExtensionRoot-CG9dH98z.js} +24 -6
- package/dist/block-BjJztStr.js +993 -0
- package/dist/{block-dVP4Rqgz.js → block-DnhzyZ1H.js} +29 -3
- package/dist/block.d.ts +56 -0
- package/dist/block.d.ts.map +1 -1
- package/dist/{bridge-4Eq-G73Z.js → bridge-Bss7Xq3D.js} +39 -31
- package/dist/core.js +1620 -333
- package/dist/css-runtime-CjZl0K48.js +755 -0
- package/dist/devtools/hook.d.ts +0 -5
- package/dist/devtools/hook.d.ts.map +1 -1
- package/dist/devtools/index.d.ts +0 -1
- package/dist/devtools/index.d.ts.map +1 -1
- package/dist/devtools/protocol.d.ts +15 -1
- package/dist/devtools/protocol.d.ts.map +1 -1
- package/dist/devtools.js +42 -9
- package/dist/editor/bridge.d.ts +7 -7
- package/dist/editor/bridge.d.ts.map +1 -1
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/main.d.ts +2 -1
- package/dist/editor/main.d.ts.map +1 -1
- package/dist/editor/messages.d.ts +13 -2
- package/dist/editor/messages.d.ts.map +1 -1
- package/dist/editor/overlays.d.ts +14 -0
- package/dist/editor/overlays.d.ts.map +1 -0
- package/dist/editor/overlays.test.d.ts +2 -0
- package/dist/editor/overlays.test.d.ts.map +1 -0
- package/dist/editor.js +47 -33
- package/dist/{gridstack-adapter-BZWybRw1.js → gridstack-adapter-C1Q8gbsH.js} +2 -2
- package/dist/main.d.ts +3 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/{morph-DHn3ol8M.js → morph-LwttdRML.js} +1 -1
- package/dist/overlay-wrapper.d.ts +69 -0
- package/dist/overlay-wrapper.d.ts.map +1 -0
- package/dist/overlay-wrapper.test.d.ts +2 -0
- package/dist/overlay-wrapper.test.d.ts.map +1 -0
- package/dist/overlays/OverlayService.d.ts +34 -0
- package/dist/overlays/OverlayService.d.ts.map +1 -0
- package/dist/overlays/OverlayService.test.d.ts +2 -0
- package/dist/overlays/OverlayService.test.d.ts.map +1 -0
- package/dist/preact/block.d.ts.map +1 -1
- package/dist/preact/context.d.ts.map +1 -1
- package/dist/preact/context.test.d.ts +2 -0
- package/dist/preact/context.test.d.ts.map +1 -0
- package/dist/preact/signals.d.ts +19 -0
- package/dist/preact/signals.d.ts.map +1 -1
- package/dist/preact/useContextSubscription.test.d.ts +2 -0
- package/dist/preact/useContextSubscription.test.d.ts.map +1 -0
- package/dist/preact.js +33 -7
- package/dist/{project-gridstack-C2cSYRMx.js → project-gridstack-CRZ_7HoT.js} +1 -1
- package/dist/react/block.d.ts.map +1 -1
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.test.d.ts +2 -0
- package/dist/react/context.test.d.ts.map +1 -0
- package/dist/react/signals.d.ts +19 -0
- package/dist/react/signals.d.ts.map +1 -1
- package/dist/react/useContextSubscription.test.d.ts +2 -0
- package/dist/react/useContextSubscription.test.d.ts.map +1 -0
- package/dist/react.js +40 -8
- package/dist/services/customer/adapter.d.ts +14 -1
- package/dist/services/customer/adapter.d.ts.map +1 -1
- package/dist/services/customer/adapter.test.d.ts +2 -0
- package/dist/services/customer/adapter.test.d.ts.map +1 -0
- package/dist/services/customer/customerService.d.ts.map +1 -1
- package/dist/services/customer/customerService.test.d.ts +2 -0
- package/dist/services/customer/customerService.test.d.ts.map +1 -0
- package/dist/services/customer/index.d.ts +2 -2
- package/dist/services/customer/index.d.ts.map +1 -1
- package/dist/services/customer/types.d.ts +29 -0
- package/dist/services/customer/types.d.ts.map +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/login/adapter.d.ts +0 -10
- package/dist/services/login/adapter.d.ts.map +1 -1
- package/dist/services/login/index.d.ts +3 -3
- package/dist/services/login/index.d.ts.map +1 -1
- package/dist/services/login/loginService.d.ts +13 -1
- package/dist/services/login/loginService.d.ts.map +1 -1
- package/dist/services/login/refreshLock.d.ts +28 -0
- package/dist/services/login/refreshLock.d.ts.map +1 -0
- package/dist/services/login/refreshLock.test.d.ts +2 -0
- package/dist/services/login/refreshLock.test.d.ts.map +1 -0
- package/dist/services/order/adapter.d.ts +17 -6
- package/dist/services/order/adapter.d.ts.map +1 -1
- package/dist/services/order/adapter.test.d.ts +2 -0
- package/dist/services/order/adapter.test.d.ts.map +1 -0
- package/dist/services/order/index.d.ts +3 -4
- package/dist/services/order/index.d.ts.map +1 -1
- package/dist/services/order/orderService.d.ts +2 -3
- package/dist/services/order/orderService.d.ts.map +1 -1
- package/dist/services/order/orderService.test.d.ts +2 -0
- package/dist/services/order/orderService.test.d.ts.map +1 -0
- package/dist/services/order/types.d.ts +103 -14
- package/dist/services/order/types.d.ts.map +1 -1
- package/dist/services/product/adapter.d.ts +42 -0
- package/dist/services/product/adapter.d.ts.map +1 -1
- package/dist/services/product/index.d.ts +1 -1
- package/dist/services/product/index.d.ts.map +1 -1
- package/dist/services/settings/types.d.ts +15 -0
- package/dist/services/settings/types.d.ts.map +1 -1
- package/dist/services/subscription/adapter.d.ts +48 -7
- package/dist/services/subscription/adapter.d.ts.map +1 -1
- package/dist/services/subscription/index.d.ts +3 -1
- package/dist/services/subscription/index.d.ts.map +1 -1
- package/dist/services/subscription/instantOrderErrors.d.ts +11 -0
- package/dist/services/subscription/instantOrderErrors.d.ts.map +1 -1
- package/dist/services/subscription/lineRemoval.d.ts +56 -0
- package/dist/services/subscription/lineRemoval.d.ts.map +1 -0
- package/dist/services/subscription/lineRemoval.test.d.ts +2 -0
- package/dist/services/subscription/lineRemoval.test.d.ts.map +1 -0
- package/dist/services/subscription/paymentInstrument.d.ts +119 -0
- package/dist/services/subscription/paymentInstrument.d.ts.map +1 -0
- package/dist/services/subscription/paymentInstrument.test.d.ts +2 -0
- package/dist/services/subscription/paymentInstrument.test.d.ts.map +1 -0
- package/dist/services/subscription/store.d.ts.map +1 -1
- package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
- package/dist/services/subscription/types.d.ts +265 -34
- package/dist/services/subscription/types.d.ts.map +1 -1
- package/dist/shared/context.d.ts +10 -3
- package/dist/shared/context.d.ts.map +1 -1
- package/dist/shared/touchSignals.d.ts +17 -0
- package/dist/shared/touchSignals.d.ts.map +1 -0
- package/dist/shared/touchSignals.test.d.ts +2 -0
- package/dist/shared/touchSignals.test.d.ts.map +1 -0
- package/dist/theme-state.d.ts +2 -1
- package/dist/theme-state.d.ts.map +1 -1
- package/dist/theme-state.params.test.d.ts +2 -0
- package/dist/theme-state.params.test.d.ts.map +1 -0
- package/dist/theme-state.translations.test.d.ts +2 -0
- package/dist/theme-state.translations.test.d.ts.map +1 -0
- package/dist/vue/block.d.ts.map +1 -1
- package/dist/vue.js +16 -13
- package/dist/web-components/ExtensionRoot.d.ts +1 -0
- package/dist/web-components/ExtensionRoot.d.ts.map +1 -1
- package/dist/web-components-editor.js +6 -5
- package/dist/web-components-runtime.js +3 -2
- package/package.json +1 -1
- package/dist/css-runtime-DTiXcYSs.js +0 -1576
- package/dist/devtools/instrumentation.d.ts +0 -47
- package/dist/devtools/instrumentation.d.ts.map +0 -1
- package/dist/index-JSv6UH_o.js +0 -169
- package/dist/services/login/errors.d.ts +0 -21
- package/dist/services/login/errors.d.ts.map +0 -1
- package/dist/services/orders/adapter.d.ts +0 -10
- package/dist/services/orders/adapter.d.ts.map +0 -1
- package/dist/services/orders/index.d.ts +0 -4
- package/dist/services/orders/index.d.ts.map +0 -1
- package/dist/services/orders/ordersService.d.ts +0 -6
- package/dist/services/orders/ordersService.d.ts.map +0 -1
- package/dist/services/orders/ordersService.test.d.ts +0 -2
- package/dist/services/orders/ordersService.test.d.ts.map +0 -1
- package/dist/services/orders/types.d.ts +0 -60
- package/dist/services/orders/types.d.ts.map +0 -1
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { BlockDefinition, BlockInstance } from '../block';
|
|
2
|
-
/** @internal Wires the block registry into the devtools instrumentation. */
|
|
3
|
-
export declare function __setDefinedBlocksReader(fn: () => BlockDefinition[]): void;
|
|
4
|
-
/**
|
|
5
|
-
* The single seam between the framework runtime and devtools.
|
|
6
|
-
*
|
|
7
|
-
* Regular code calls `getInstrumentation().X(...)` at each touchpoint — never
|
|
8
|
-
* `getHook()` and never a null check. In production (no devtools shell) the
|
|
9
|
-
* shared {@link noop} implementation is returned, so every call is a single
|
|
10
|
-
* global read followed by a do-nothing method (and `resolveProps` is the
|
|
11
|
-
* identity on `block.props`, with no allocation). When a devtools shell has
|
|
12
|
-
* installed the hook, the real implementation is created lazily and cached on
|
|
13
|
-
* the hook so it is shared across separately-bundled `block.ts` module
|
|
14
|
-
* instances (see `createDevtoolsInstrumentation`).
|
|
15
|
-
*/
|
|
16
|
-
export interface BlocksInstrumentation {
|
|
17
|
-
/** A block definition was registered. */
|
|
18
|
-
onBlockRegistered(def: BlockDefinition): void;
|
|
19
|
-
/** A block instance finished rendering into `el`. */
|
|
20
|
-
onBlockRendered(block: BlockInstance, el: HTMLElement): void;
|
|
21
|
-
/** A block instance was removed from the page (editor delete, cache prune, …). */
|
|
22
|
-
onBlockUnmounted(id: string): void;
|
|
23
|
-
/** A context value was provided. */
|
|
24
|
-
onContextProvided(context: unknown): void;
|
|
25
|
-
/** A context value was requested. */
|
|
26
|
-
onContextRequested(context: unknown): void;
|
|
27
|
-
/**
|
|
28
|
-
* Returns the props to render now: the block's base props merged with any
|
|
29
|
-
* recorded devtools override. The identity on `block.props` in production.
|
|
30
|
-
*/
|
|
31
|
-
resolveProps(block: BlockInstance): Record<string, unknown>;
|
|
32
|
-
/**
|
|
33
|
-
* Returns the props to render now and, for renderers that mount into a plain
|
|
34
|
-
* element (React/Preact/Vue) and aren't reactive to DOM property sets,
|
|
35
|
-
* registers a live setter that re-renders via `rerender` on each devtools
|
|
36
|
-
* edit. `getBaseProps` lets a renderer that keeps a live instance (Vue) supply
|
|
37
|
-
* its latest base props. Returns the base props (no setter) in production.
|
|
38
|
-
*/
|
|
39
|
-
bindLiveProps(block: BlockInstance, rerender: (props: Record<string, unknown>) => void, getBaseProps?: () => Record<string, unknown>): Record<string, unknown>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Returns the active instrumentation. The no-op when no devtools shell has
|
|
43
|
-
* installed the hook; otherwise the real implementation, created lazily and
|
|
44
|
-
* cached on the hook so it is shared across module instances.
|
|
45
|
-
*/
|
|
46
|
-
export declare function getInstrumentation(): BlocksInstrumentation;
|
|
47
|
-
//# sourceMappingURL=instrumentation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/devtools/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAa/D,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,MAAM,eAAe,EAAE,GAAG,IAAI,CAE1E;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,qBAAqB;IACpC,yCAAyC;IACzC,iBAAiB,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9C,qDAAqD;IACrD,eAAe,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7D,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,oCAAoC;IACpC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,qCAAqC;IACrC,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3C;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5D;;;;;;OAMG;IACH,aAAa,CACX,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EAClD,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5B;AAgLD;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,qBAAqB,CAO1D"}
|
package/dist/index-JSv6UH_o.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
const target = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : {};
|
|
2
|
-
const isBrowser = typeof window !== "undefined";
|
|
3
|
-
const PROTOCOL_VERSION = 1;
|
|
4
|
-
function isDevtoolsEvent(x) {
|
|
5
|
-
return typeof x === "object" && x !== null && x.v === PROTOCOL_VERSION && typeof x.kind === "string" && typeof x.ts === "number";
|
|
6
|
-
}
|
|
7
|
-
const HOOK_KEY = "__JUO_BLOCKS_DEVTOOLS_HOOK__";
|
|
8
|
-
function createHook() {
|
|
9
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
10
|
-
return {
|
|
11
|
-
version: PROTOCOL_VERSION,
|
|
12
|
-
emit(kind, payload) {
|
|
13
|
-
const event = {
|
|
14
|
-
v: PROTOCOL_VERSION,
|
|
15
|
-
kind,
|
|
16
|
-
ts: Date.now(),
|
|
17
|
-
payload
|
|
18
|
-
};
|
|
19
|
-
listeners.forEach((cb) => cb(event));
|
|
20
|
-
},
|
|
21
|
-
on(cb) {
|
|
22
|
-
listeners.add(cb);
|
|
23
|
-
return () => listeners.delete(cb);
|
|
24
|
-
},
|
|
25
|
-
off(cb) {
|
|
26
|
-
listeners.delete(cb);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function installHook() {
|
|
31
|
-
return target[HOOK_KEY] ?? (target[HOOK_KEY] = createHook());
|
|
32
|
-
}
|
|
33
|
-
function getHook() {
|
|
34
|
-
return target[HOOK_KEY];
|
|
35
|
-
}
|
|
36
|
-
let readDefinedBlocks = () => [];
|
|
37
|
-
function __setDefinedBlocksReader(fn) {
|
|
38
|
-
readDefinedBlocks = fn;
|
|
39
|
-
}
|
|
40
|
-
const noop = {
|
|
41
|
-
onBlockRegistered() {
|
|
42
|
-
},
|
|
43
|
-
onBlockRendered() {
|
|
44
|
-
},
|
|
45
|
-
onBlockUnmounted() {
|
|
46
|
-
},
|
|
47
|
-
onContextProvided() {
|
|
48
|
-
},
|
|
49
|
-
onContextRequested() {
|
|
50
|
-
},
|
|
51
|
-
resolveProps: (block) => block.props ?? {},
|
|
52
|
-
bindLiveProps: (block) => block.props ?? {}
|
|
53
|
-
};
|
|
54
|
-
function getState(hook) {
|
|
55
|
-
const holder = hook;
|
|
56
|
-
return holder.__blockDevtoolsState ?? (holder.__blockDevtoolsState = {
|
|
57
|
-
instances: /* @__PURE__ */ new Map(),
|
|
58
|
-
propSetters: /* @__PURE__ */ new Map(),
|
|
59
|
-
propOverrides: /* @__PURE__ */ new Map()
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function applyOverride(state, id, props) {
|
|
63
|
-
const override = state.propOverrides.get(id);
|
|
64
|
-
return override ? { ...props, ...override } : props;
|
|
65
|
-
}
|
|
66
|
-
function getPropsSchema(type) {
|
|
67
|
-
var _a;
|
|
68
|
-
const def = readDefinedBlocks().find((d) => d.name === type);
|
|
69
|
-
const schema = def == null ? void 0 : def.schema;
|
|
70
|
-
const props = (_a = schema == null ? void 0 : schema.properties) == null ? void 0 : _a.props;
|
|
71
|
-
return props && typeof props === "object" ? props : null;
|
|
72
|
-
}
|
|
73
|
-
function createDevtoolsInstrumentation(hook) {
|
|
74
|
-
const state = getState(hook);
|
|
75
|
-
const getBlockState = (id) => {
|
|
76
|
-
const inst = state.instances.get(id);
|
|
77
|
-
if (!inst) return null;
|
|
78
|
-
return {
|
|
79
|
-
props: applyOverride(state, id, inst.props),
|
|
80
|
-
propsSchema: getPropsSchema(inst.type)
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
const setBlockProp = (id, key, value) => {
|
|
84
|
-
const inst = state.instances.get(id);
|
|
85
|
-
if (!inst) return null;
|
|
86
|
-
state.propOverrides.set(id, {
|
|
87
|
-
...state.propOverrides.get(id) ?? {},
|
|
88
|
-
[key]: value
|
|
89
|
-
});
|
|
90
|
-
const setter = state.propSetters.get(id);
|
|
91
|
-
if (setter) {
|
|
92
|
-
setter(key, value);
|
|
93
|
-
} else if (inst.el) {
|
|
94
|
-
inst.el[key] = value;
|
|
95
|
-
}
|
|
96
|
-
return { props: applyOverride(state, id, inst.props) };
|
|
97
|
-
};
|
|
98
|
-
const getBlockCatalog = () => {
|
|
99
|
-
const catalog = {};
|
|
100
|
-
for (const def of readDefinedBlocks()) {
|
|
101
|
-
catalog[def.name] = def.displayName ?? def.name;
|
|
102
|
-
}
|
|
103
|
-
return catalog;
|
|
104
|
-
};
|
|
105
|
-
if (!hook.resolvers) {
|
|
106
|
-
hook.resolvers = { getBlockState, setBlockProp, getBlockCatalog };
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
onBlockRegistered(def) {
|
|
110
|
-
hook.emit("block:registered", {
|
|
111
|
-
name: def.name,
|
|
112
|
-
group: def.group,
|
|
113
|
-
displayName: def.displayName ?? def.name
|
|
114
|
-
});
|
|
115
|
-
},
|
|
116
|
-
onBlockRendered(block, el) {
|
|
117
|
-
state.instances.set(block.id, {
|
|
118
|
-
type: block.type,
|
|
119
|
-
props: block.props ?? {},
|
|
120
|
-
el
|
|
121
|
-
});
|
|
122
|
-
hook.emit("block:mounted", {
|
|
123
|
-
id: block.id,
|
|
124
|
-
type: block.type,
|
|
125
|
-
slot: null,
|
|
126
|
-
parentId: null,
|
|
127
|
-
propKeys: Object.keys(block.props ?? {})
|
|
128
|
-
});
|
|
129
|
-
},
|
|
130
|
-
onBlockUnmounted(id) {
|
|
131
|
-
state.instances.delete(id);
|
|
132
|
-
state.propSetters.delete(id);
|
|
133
|
-
state.propOverrides.delete(id);
|
|
134
|
-
hook.emit("block:unmounted", { id });
|
|
135
|
-
},
|
|
136
|
-
onContextProvided(context) {
|
|
137
|
-
hook.emit("context:provide", { context: String(context) });
|
|
138
|
-
},
|
|
139
|
-
onContextRequested(context) {
|
|
140
|
-
hook.emit("context:request", { context: String(context) });
|
|
141
|
-
},
|
|
142
|
-
resolveProps(block) {
|
|
143
|
-
return applyOverride(state, block.id, block.props ?? {});
|
|
144
|
-
},
|
|
145
|
-
bindLiveProps(block, rerender, getBaseProps = () => block.props ?? {}) {
|
|
146
|
-
state.propSetters.set(block.id, () => {
|
|
147
|
-
rerender(applyOverride(state, block.id, getBaseProps()));
|
|
148
|
-
});
|
|
149
|
-
return applyOverride(state, block.id, block.props ?? {});
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
function getInstrumentation() {
|
|
154
|
-
const hook = getHook();
|
|
155
|
-
if (!hook) return noop;
|
|
156
|
-
const holder = hook;
|
|
157
|
-
return holder.__instrumentation ?? (holder.__instrumentation = createDevtoolsInstrumentation(hook));
|
|
158
|
-
}
|
|
159
|
-
export {
|
|
160
|
-
PROTOCOL_VERSION as P,
|
|
161
|
-
__setDefinedBlocksReader as _,
|
|
162
|
-
getHook as a,
|
|
163
|
-
isBrowser as b,
|
|
164
|
-
createHook as c,
|
|
165
|
-
isDevtoolsEvent as d,
|
|
166
|
-
getInstrumentation as g,
|
|
167
|
-
installHook as i,
|
|
168
|
-
target as t
|
|
169
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The login error taxonomy, kept in a module of its own with no imports.
|
|
3
|
-
*
|
|
4
|
-
* `loginService` and `adapter` import each other, so an enum declared in either
|
|
5
|
-
* one is not safely readable at the other's module scope. Living here, it is —
|
|
6
|
-
* which is what lets the adapter's code lookup be a plain table.
|
|
7
|
-
*/
|
|
8
|
-
export declare enum AuthenticationErrorReason {
|
|
9
|
-
Expired = "expired",
|
|
10
|
-
IncorrectCode = "wrong-code",
|
|
11
|
-
TooManyTries = "too-many-tries",
|
|
12
|
-
NoEmail = "no-email",
|
|
13
|
-
Unknown = "unknown",
|
|
14
|
-
Missing = "missing"
|
|
15
|
-
}
|
|
16
|
-
export declare class AuthenticationError extends Error {
|
|
17
|
-
reason: AuthenticationErrorReason;
|
|
18
|
-
data: Record<string, unknown>;
|
|
19
|
-
constructor(reason: AuthenticationErrorReason, data?: Record<string, unknown>);
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/services/login/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oBAAY,yBAAyB;IACnC,OAAO,YAAY;IACnB,aAAa,eAAe;IAC5B,YAAY,mBAAmB;IAC/B,OAAO,aAAa;IACpB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,MAAM,EAAE,yBAAyB,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAG5B,MAAM,EAAE,yBAAyB,EACjC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAMjC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ApiFetcher } from '../../utils';
|
|
2
|
-
import { OrdersAdapter } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Returns a mock `OrdersAdapter` with sample orders including customAttributes.
|
|
5
|
-
* Hosts can override the methods to seed real fixtures.
|
|
6
|
-
* Used as a starting point by storybook helpers (`createMockOrdersService`) and theme preview.
|
|
7
|
-
*/
|
|
8
|
-
export declare function createMockOrdersAdapter(): OrdersAdapter;
|
|
9
|
-
export declare function createApiOrdersAdapter(fetcher: ApiFetcher): OrdersAdapter;
|
|
10
|
-
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/orders/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAoB,aAAa,EAAmB,MAAM,SAAS,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,aAAa,CA6DvD;AAwDD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,UAAU,GAAG,aAAa,CA2BzE"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export type { GetOrdersParams, Order, OrderLine, OrdersAdapter, OrdersService, } from './types';
|
|
2
|
-
export { createMockOrdersAdapter, createApiOrdersAdapter } from './adapter';
|
|
3
|
-
export { createOrdersService, OrdersServiceContext, } from './ordersService';
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/orders/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,KAAK,EACL,SAAS,EACT,aAAa,EACb,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAE5E,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ordersService.d.ts","sourceRoot":"","sources":["../../../src/services/orders/ordersService.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAWzE;AAED,eAAO,MAAM,oBAAoB;;CACgB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ordersService.test.d.ts","sourceRoot":"","sources":["../../../src/services/orders/ordersService.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Image, PaginatedList, Result } from '../../utils';
|
|
2
|
-
export interface OrderLine {
|
|
3
|
-
id: string;
|
|
4
|
-
title: string;
|
|
5
|
-
quantity: number;
|
|
6
|
-
variantImage: Image | null;
|
|
7
|
-
customAttributes?: Array<{
|
|
8
|
-
key: string;
|
|
9
|
-
value: string;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
12
|
-
export interface Order {
|
|
13
|
-
/** Numeric Shopify order id (the trailing segment of the order GID). The block prepends `#` for display. */
|
|
14
|
-
id: string;
|
|
15
|
-
createdAt: string;
|
|
16
|
-
placedAt: string | null;
|
|
17
|
-
currencyCode: string;
|
|
18
|
-
totalPrice: number | null;
|
|
19
|
-
/** Raw Shopify financial-status token (e.g. `PAID`, `PARTIALLY_REFUNDED`); the block humanizes it for display. `null` = unknown. */
|
|
20
|
-
financialStatus: string | null;
|
|
21
|
-
/** Raw Shopify fulfillment-status token (e.g. `FULFILLED`, `PARTIALLY_FULFILLED`); the block humanizes it for display. `null` = unknown. */
|
|
22
|
-
fulfillmentStatus: string | null;
|
|
23
|
-
lines: OrderLine[];
|
|
24
|
-
customAttributes?: Array<{
|
|
25
|
-
key: string;
|
|
26
|
-
value: string;
|
|
27
|
-
}>;
|
|
28
|
-
}
|
|
29
|
-
export interface GetOrdersParams {
|
|
30
|
-
limit?: number;
|
|
31
|
-
after?: string;
|
|
32
|
-
before?: string;
|
|
33
|
-
/**
|
|
34
|
-
* DEPRECATED: previously used for free-text / per-subscriptionId server-side
|
|
35
|
-
* search. The backend proxy implementation ignores this parameter; accepted
|
|
36
|
-
* for SDK backward compatibility only. Use `includeOneTime` to control
|
|
37
|
-
* which order types are returned.
|
|
38
|
-
*
|
|
39
|
-
* @deprecated
|
|
40
|
-
*/
|
|
41
|
-
query?: string;
|
|
42
|
-
/**
|
|
43
|
-
* When `false` (default), only subscription-driven orders are returned.
|
|
44
|
-
* When `true`, one-time orders are included alongside subscription orders.
|
|
45
|
-
*/
|
|
46
|
-
includeOneTime?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Sort order. When set to `"placedAt"`, orders are sorted by placement
|
|
49
|
-
* date (newest first). When omitted, the endpoint's default sort is used.
|
|
50
|
-
*/
|
|
51
|
-
sort?: "placedAt";
|
|
52
|
-
}
|
|
53
|
-
/** Adapter consumed by `createOrdersService`. Hosts (customer portal, theme, storybook) implement this. */
|
|
54
|
-
export interface OrdersAdapter {
|
|
55
|
-
getOrders(params?: GetOrdersParams): Promise<PaginatedList<Order>>;
|
|
56
|
-
}
|
|
57
|
-
export interface OrdersService {
|
|
58
|
-
getOrders(params?: GetOrdersParams): Promise<Result<PaginatedList<Order>>>;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/orders/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,KAAK,GAAG,IAAI,CAAC;IAC3B,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,KAAK;IACpB,4GAA4G;IAC5G,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,oIAAoI;IACpI,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,4IAA4I;IAC5I,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,2GAA2G;AAC3G,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;CACpE;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,CACP,MAAM,CAAC,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;CAC1C"}
|