@shipengine/elements-sdk 0.9.1 → 1.0.1
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/elements-root.d.ts +23 -0
- package/package.json +1 -1
- package/public-sdk.d.ts +122 -43
- package/shipengine-element.d.ts +14 -0
- package/shipengine-elements-sdk.mjs +51152 -60156
- package/styles.d.ts +34 -0
- package/utils.d.ts +26 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ISidePanelDefaultHeaderProps, SidePanelProps } from "@shipengine/giger";
|
|
2
|
+
import { ElementsProviderProps } from "@shipengine/elements";
|
|
3
|
+
export type SidePanelHeaderProps = ISidePanelDefaultHeaderProps & {
|
|
4
|
+
title: string;
|
|
5
|
+
};
|
|
6
|
+
export type SidePanelSDKProps = Omit<SidePanelProps, "isOpen">;
|
|
7
|
+
export type ElementsEvent = {
|
|
8
|
+
Element: any;
|
|
9
|
+
props: any;
|
|
10
|
+
container?: Element;
|
|
11
|
+
id: string;
|
|
12
|
+
sidePanelHeaderProps?: SidePanelHeaderProps;
|
|
13
|
+
sidePanelProps?: SidePanelSDKProps;
|
|
14
|
+
};
|
|
15
|
+
export type UnmountElementsEvent = {
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
export type UpdateElementsEvent = Pick<ElementsEvent, "props" | "id">;
|
|
19
|
+
export type ElementsRegistry = Record<string, Omit<ElementsEvent, "id">>;
|
|
20
|
+
export declare const MOUNT_ELEMENTS_EVENT = "se.lmnt.mountElement";
|
|
21
|
+
export declare const UNMOUNT_ELEMENTS_EVENT = "se.lmnt.unmountElement";
|
|
22
|
+
export declare const UPDATE_ELEMENTS_EVENT = "se.lmnt.updateElement";
|
|
23
|
+
export declare const ElementsRoot: (providerProps: Omit<ElementsProviderProps, "children">) => import("@emotion/react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
package/public-sdk.d.ts
CHANGED
|
@@ -1,50 +1,129 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
type
|
|
6
|
-
|
|
1
|
+
import { ShipEngineElement } from "./shipengine-element";
|
|
2
|
+
import { ShipEngineAPIConfig } from "@shipengine/js-api";
|
|
3
|
+
import { SidePanelHeaderProps, SidePanelSDKProps } from "./elements-root";
|
|
4
|
+
import { ElementsProviderProps, PurchaseLabel, AccountSettings, LabelWorkflow, ConnectExternalCarrier, Onboarding, ShipmentSummary, VoidLabel, ManageExternalCarriers } from "@shipengine/elements";
|
|
5
|
+
export type ElementsSDKOptions = Omit<ElementsProviderProps, "getToken" | "children" | "container">;
|
|
6
|
+
export type ElementProps = {
|
|
7
|
+
accountSettings: AccountSettings.ComponentProps;
|
|
8
|
+
carrierServices: {};
|
|
9
|
+
connectExternalCarrier: ConnectExternalCarrier.ComponentProps;
|
|
10
|
+
labelLayout: {};
|
|
11
|
+
labelWorkFlow: LabelWorkflow.LabelWorkflowProps;
|
|
12
|
+
manageCarriers: {};
|
|
13
|
+
manageExternalCarriers: ManageExternalCarriers.ComponentProps;
|
|
14
|
+
manageFunding: {};
|
|
15
|
+
manageWarehouses: {};
|
|
16
|
+
onboarding: Onboarding.ComponentProps;
|
|
17
|
+
paymentMethodSettings: {};
|
|
18
|
+
purchaseLabel: PurchaseLabel.PurchaseLabelCommonProps;
|
|
19
|
+
shipmentSummary: ShipmentSummary.ComponentProps;
|
|
20
|
+
transactionHistory: {};
|
|
21
|
+
unitSettings: {};
|
|
22
|
+
voidLabel: VoidLabel.ComponentProps;
|
|
7
23
|
};
|
|
8
|
-
type
|
|
9
|
-
type ElementsSDKOptions = Omit<AlchemyProviderProps, "getToken" | "children">;
|
|
24
|
+
export type AvailableElements = keyof ElementProps;
|
|
10
25
|
export declare class ElementsSDK {
|
|
11
26
|
#private;
|
|
12
|
-
|
|
27
|
+
constructor(getToken: ElementsProviderProps["getToken"], options?: ElementsSDKOptions, container?: HTMLElement | string);
|
|
28
|
+
getClient(token: string, config: ShipEngineAPIConfig): {
|
|
13
29
|
readonly token: never;
|
|
14
|
-
readonly accountSettings: Omit<
|
|
30
|
+
readonly accountSettings: Omit<import("@shipengine/js-api").AccountSettingsAPI, "client">;
|
|
15
31
|
readonly accountBillingPlan: Omit<import("@shipengine/js-api/account-billing-plan").AccountBillingPlanAPI, "client">;
|
|
16
|
-
readonly addresses: Omit<
|
|
17
|
-
readonly carriers: Omit<
|
|
18
|
-
readonly connections: Omit<
|
|
19
|
-
readonly customPackages: Omit<
|
|
20
|
-
readonly fundingSources: Omit<
|
|
21
|
-
readonly insurance: Omit<
|
|
22
|
-
readonly labels: Omit<
|
|
23
|
-
readonly orderSources: Omit<
|
|
24
|
-
readonly rateCards: Omit<
|
|
25
|
-
readonly rates: Omit<
|
|
26
|
-
readonly salesOrderShipments: Omit<
|
|
27
|
-
readonly salesOrders: Omit<
|
|
28
|
-
readonly servicePoints: Omit<
|
|
29
|
-
readonly shipments: Omit<
|
|
30
|
-
readonly themes: Omit<
|
|
31
|
-
readonly warehouses: Omit<
|
|
32
|
-
readonly shippingRules: Omit<
|
|
33
|
-
readonly webhooks: Omit<
|
|
34
|
-
readonly sellers: Omit<
|
|
32
|
+
readonly addresses: Omit<import("@shipengine/js-api").AddressesAPI, "client">;
|
|
33
|
+
readonly carriers: Omit<import("@shipengine/js-api").CarriersAPI, "client">;
|
|
34
|
+
readonly connections: Omit<import("@shipengine/js-api").ConnectionsAPI, "client">;
|
|
35
|
+
readonly customPackages: Omit<import("@shipengine/js-api").CustomPackagesAPI, "client">;
|
|
36
|
+
readonly fundingSources: Omit<import("@shipengine/js-api").FundingSourcesAPI, "client">;
|
|
37
|
+
readonly insurance: Omit<import("@shipengine/js-api").InsuranceAPI, "client">;
|
|
38
|
+
readonly labels: Omit<import("@shipengine/js-api").LabelsAPI, "client">;
|
|
39
|
+
readonly orderSources: Omit<import("@shipengine/js-api").OrderSourcesAPI, "client">;
|
|
40
|
+
readonly rateCards: Omit<import("@shipengine/js-api").RateCardsAPI, "client">;
|
|
41
|
+
readonly rates: Omit<import("@shipengine/js-api").RatesAPI, "client">;
|
|
42
|
+
readonly salesOrderShipments: Omit<import("@shipengine/js-api").SalesOrderShipmentsAPI, "client">;
|
|
43
|
+
readonly salesOrders: Omit<import("@shipengine/js-api").SalesOrdersAPI, "client">;
|
|
44
|
+
readonly servicePoints: Omit<import("@shipengine/js-api").ServicePointsAPI, "client">;
|
|
45
|
+
readonly shipments: Omit<import("@shipengine/js-api").ShipmentsAPI, "client">;
|
|
46
|
+
readonly themes: Omit<import("@shipengine/js-api").ThemesAPI, "client">;
|
|
47
|
+
readonly warehouses: Omit<import("@shipengine/js-api").WarehousesAPI, "client">;
|
|
48
|
+
readonly shippingRules: Omit<import("@shipengine/js-api").ShippingRulesAPI, "client">;
|
|
49
|
+
readonly webhooks: Omit<import("@shipengine/js-api").WebhooksAPI, "client">;
|
|
50
|
+
readonly sellers: Omit<import("@shipengine/js-api").SellersAPI, "client">;
|
|
35
51
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
create<Key extends AvailableElements>(type: AvailableElements, props?: any): ShipEngineElement<ElementProps[Key]>;
|
|
53
|
+
destroy(): void;
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated since SDK version 2.0
|
|
56
|
+
*
|
|
57
|
+
* Please use the create method and render the Element using the renderInSidePanel method
|
|
58
|
+
*/
|
|
59
|
+
closeSidePanel(type: AvailableElements): void;
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated since SDK version 2.0
|
|
62
|
+
*
|
|
63
|
+
* Please use the create method and render the Element using the renderInSidePanel method
|
|
64
|
+
*/
|
|
65
|
+
manageAccountSettings(props: {
|
|
66
|
+
elementProps: ElementProps["accountSettings"];
|
|
67
|
+
sidePanelProps: SidePanelSDKProps;
|
|
68
|
+
sidePanelHeaderProps: SidePanelHeaderProps;
|
|
69
|
+
}): void;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated since SDK version 2.0
|
|
72
|
+
*
|
|
73
|
+
* Please use the create method and render the Element using the renderInSidePanel method
|
|
74
|
+
*/
|
|
75
|
+
manageExternalCarriers(props: {
|
|
76
|
+
sidePanelProps: SidePanelSDKProps;
|
|
77
|
+
sidePanelHeaderProps: SidePanelHeaderProps;
|
|
78
|
+
}): void;
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated since SDK version 2.0
|
|
81
|
+
*
|
|
82
|
+
* Please use the create method and render the Element using the renderInSidePanel method
|
|
83
|
+
*/
|
|
84
|
+
onboardUser(props: {
|
|
85
|
+
elementProps: ElementProps["onboarding"];
|
|
86
|
+
sidePanelHeaderProps?: SidePanelHeaderProps;
|
|
87
|
+
sidePanelProps?: SidePanelSDKProps;
|
|
88
|
+
}): void;
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated since SDK version 2.0
|
|
91
|
+
*
|
|
92
|
+
* Please use the create method and render the Element using the renderInSidePanel method
|
|
93
|
+
*/
|
|
94
|
+
labelWorkflow(props: {
|
|
95
|
+
elementProps: ElementProps["labelWorkFlow"];
|
|
96
|
+
sidePanelHeaderProps?: SidePanelHeaderProps;
|
|
97
|
+
sidePanelProps?: SidePanelSDKProps;
|
|
98
|
+
}): void;
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated since SDK version 2.0
|
|
101
|
+
*
|
|
102
|
+
* Please use the create method and render the Element using the renderInSidePanel method
|
|
103
|
+
*/
|
|
104
|
+
purchaseLabel(props: {
|
|
105
|
+
elementProps: ElementProps["purchaseLabel"];
|
|
106
|
+
sidePanelHeaderProps?: SidePanelHeaderProps;
|
|
107
|
+
sidePanelProps?: SidePanelSDKProps;
|
|
108
|
+
}): void;
|
|
109
|
+
/**
|
|
110
|
+
* @deprecated since SDK version 2.0
|
|
111
|
+
*
|
|
112
|
+
* Please use the create method and render the Element using the renderInSidePanel method
|
|
113
|
+
*/
|
|
114
|
+
shipmentSummary(props: {
|
|
115
|
+
elementProps: ElementProps["shipmentSummary"];
|
|
116
|
+
sidePanelHeaderProps?: SidePanelHeaderProps;
|
|
117
|
+
sidePanelProps?: SidePanelSDKProps;
|
|
118
|
+
}): void;
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated since SDK version 2.0
|
|
121
|
+
*
|
|
122
|
+
* Please use the create method and render the Element using the renderInSidePanel method
|
|
123
|
+
*/
|
|
124
|
+
voidLabel(props: {
|
|
125
|
+
elementProps: ElementProps["voidLabel"];
|
|
126
|
+
sidePanelHeaderProps?: SidePanelHeaderProps;
|
|
127
|
+
sidePanelProps?: SidePanelSDKProps;
|
|
128
|
+
}): void;
|
|
49
129
|
}
|
|
50
|
-
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SidePanelHeaderProps, SidePanelSDKProps } from "./elements-root";
|
|
2
|
+
export declare class ShipEngineElement<Props> {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(component: any, id?: string, props?: Props);
|
|
5
|
+
mount(node: HTMLElement | string, props?: Props): void;
|
|
6
|
+
unmount(): void;
|
|
7
|
+
update(props: Props): void;
|
|
8
|
+
renderSidePanel({ elementProps, sidePanelHeaderProps, sidePanelProps, }: {
|
|
9
|
+
elementProps?: Props;
|
|
10
|
+
sidePanelHeaderProps?: SidePanelHeaderProps;
|
|
11
|
+
sidePanelProps?: SidePanelSDKProps;
|
|
12
|
+
}): void;
|
|
13
|
+
closeSidePanel(): void;
|
|
14
|
+
}
|