@shipengine/elements-sdk 1.0.1 → 2.3.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/helper.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { ShipEngineAPIConfig } from "@shipengine/js-api";
2
+ export declare class ElementsHelper {
3
+ #private;
4
+ constructor(config: ShipEngineAPIConfig);
5
+ isSellerOnboarded(): Promise<boolean>;
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements-sdk",
3
- "version": "1.0.1",
3
+ "version": "2.3.1",
4
4
  "types": "./public-sdk.d.ts",
5
5
  "module": "shipengine-elements-sdk.mjs",
6
6
  "peerDependencies": {
package/public-sdk.d.ts CHANGED
@@ -1,7 +1,9 @@
1
+ import { CleanShipengineAPI } from "./utils";
1
2
  import { ShipEngineElement } from "./shipengine-element";
2
3
  import { ShipEngineAPIConfig } from "@shipengine/js-api";
3
4
  import { SidePanelHeaderProps, SidePanelSDKProps } from "./elements-root";
4
5
  import { ElementsProviderProps, PurchaseLabel, AccountSettings, LabelWorkflow, ConnectExternalCarrier, Onboarding, ShipmentSummary, VoidLabel, ManageExternalCarriers } from "@shipengine/elements";
6
+ import { ElementsHelper } from "./helper";
5
7
  export type ElementsSDKOptions = Omit<ElementsProviderProps, "getToken" | "children" | "container">;
6
8
  export type ElementProps = {
7
9
  accountSettings: AccountSettings.ComponentProps;
@@ -25,42 +27,20 @@ export type AvailableElements = keyof ElementProps;
25
27
  export declare class ElementsSDK {
26
28
  #private;
27
29
  constructor(getToken: ElementsProviderProps["getToken"], options?: ElementsSDKOptions, container?: HTMLElement | string);
28
- getClient(token: string, config: ShipEngineAPIConfig): {
29
- readonly token: never;
30
- readonly accountSettings: Omit<import("@shipengine/js-api").AccountSettingsAPI, "client">;
31
- readonly accountBillingPlan: Omit<import("@shipengine/js-api/account-billing-plan").AccountBillingPlanAPI, "client">;
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">;
51
- };
30
+ getClient(token?: string, config?: ShipEngineAPIConfig): CleanShipengineAPI;
31
+ getHelper(config?: ShipEngineAPIConfig): ElementsHelper;
52
32
  create<Key extends AvailableElements>(type: AvailableElements, props?: any): ShipEngineElement<ElementProps[Key]>;
53
33
  destroy(): void;
54
34
  /**
55
35
  * @deprecated since SDK version 2.0
56
36
  *
57
- * Please use the create method and render the Element using the renderInSidePanel method
37
+ * Please use the create method and render the Element using the renderSidePanel method
58
38
  */
59
39
  closeSidePanel(type: AvailableElements): void;
60
40
  /**
61
41
  * @deprecated since SDK version 2.0
62
42
  *
63
- * Please use the create method and render the Element using the renderInSidePanel method
43
+ * Please use the create method and render the Element using the renderSidePanel method
64
44
  */
65
45
  manageAccountSettings(props: {
66
46
  elementProps: ElementProps["accountSettings"];
@@ -70,7 +50,7 @@ export declare class ElementsSDK {
70
50
  /**
71
51
  * @deprecated since SDK version 2.0
72
52
  *
73
- * Please use the create method and render the Element using the renderInSidePanel method
53
+ * Please use the create method and render the Element using the renderSidePanel method
74
54
  */
75
55
  manageExternalCarriers(props: {
76
56
  sidePanelProps: SidePanelSDKProps;
@@ -79,7 +59,7 @@ export declare class ElementsSDK {
79
59
  /**
80
60
  * @deprecated since SDK version 2.0
81
61
  *
82
- * Please use the create method and render the Element using the renderInSidePanel method
62
+ * Please use the create method and render the Element using the renderSidePanel method
83
63
  */
84
64
  onboardUser(props: {
85
65
  elementProps: ElementProps["onboarding"];
@@ -89,7 +69,7 @@ export declare class ElementsSDK {
89
69
  /**
90
70
  * @deprecated since SDK version 2.0
91
71
  *
92
- * Please use the create method and render the Element using the renderInSidePanel method
72
+ * Please use the create method and render the Element using the renderSidePanel method
93
73
  */
94
74
  labelWorkflow(props: {
95
75
  elementProps: ElementProps["labelWorkFlow"];
@@ -99,7 +79,7 @@ export declare class ElementsSDK {
99
79
  /**
100
80
  * @deprecated since SDK version 2.0
101
81
  *
102
- * Please use the create method and render the Element using the renderInSidePanel method
82
+ * Please use the create method and render the Element using the renderSidePanel method
103
83
  */
104
84
  purchaseLabel(props: {
105
85
  elementProps: ElementProps["purchaseLabel"];
@@ -109,7 +89,7 @@ export declare class ElementsSDK {
109
89
  /**
110
90
  * @deprecated since SDK version 2.0
111
91
  *
112
- * Please use the create method and render the Element using the renderInSidePanel method
92
+ * Please use the create method and render the Element using the renderSidePanel method
113
93
  */
114
94
  shipmentSummary(props: {
115
95
  elementProps: ElementProps["shipmentSummary"];
@@ -119,7 +99,7 @@ export declare class ElementsSDK {
119
99
  /**
120
100
  * @deprecated since SDK version 2.0
121
101
  *
122
- * Please use the create method and render the Element using the renderInSidePanel method
102
+ * Please use the create method and render the Element using the renderSidePanel method
123
103
  */
124
104
  voidLabel(props: {
125
105
  elementProps: ElementProps["voidLabel"];