@swishapp/sdk 0.60.0-beta.1 → 0.60.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.d.ts +9 -0
- package/dist/intents/intent-handler.d.ts +3 -3
- package/dist/intents/intent-hook.d.ts +5 -5
- package/dist/intents/intents.d.ts +5 -18
- package/dist/state/index.d.ts +0 -1
- package/dist/storefront-api/load-product-card-data.d.ts +2 -4
- package/dist/storefront-api/load-product-detail-data.d.ts +2 -4
- package/dist/storefront-api/load-product-images.d.ts +1 -4
- package/dist/storefront-api/load-product-options.d.ts +1 -4
- package/dist/storefront-api/load-product-recommendations.d.ts +2 -4
- package/dist/storefront-api/load-save-intent-data.d.ts +7 -8
- package/dist/storefront-api/load-selected-variant.d.ts +2 -4
- package/dist/storefront-api/storefront-api-client.d.ts +9 -12
- package/dist/swish-api/swish-api-client.d.ts +11 -1
- package/dist/swish-ui/swish-ui-element.d.ts +1 -3
- package/dist/swish-ui/swish-ui-utils.d.ts +2 -2
- package/dist/swish.d.ts +12 -20
- package/dist/swish.js +58 -58
- package/dist/types.d.ts +16 -13
- package/dist/utils/shop-bridge.d.ts +2 -4
- package/package.json +10 -10
package/dist/types.d.ts
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import type { SwishClientConfig } from "@swishapp/api-client";
|
|
2
|
-
import type { IntentOptions } from "./intents/intents";
|
|
3
|
-
import type { StorefrontApiOptions } from "./storefront-api/storefront-api-client";
|
|
4
|
-
import { CountryCode, LanguageCode } from "./storefront-api/types/storefront.types";
|
|
5
2
|
import type { SwishApp } from "./swish";
|
|
6
|
-
|
|
3
|
+
import type { StorefrontConfig } from "./storefront-api/storefront-api-client";
|
|
4
|
+
import { SwishApiConfig } from "./swish-api/swish-api-client";
|
|
5
|
+
export interface SwishAppOptions {
|
|
6
|
+
loadProfile?: SwishApiConfig["loadProfile"];
|
|
7
|
+
storeProfile?: SwishApiConfig["storeProfile"];
|
|
8
|
+
deleteProfile?: SwishApiConfig["deleteProfile"];
|
|
9
|
+
loadAuthToken?: SwishApiConfig["loadAuthToken"];
|
|
10
|
+
storeAuthToken?: SwishApiConfig["storeAuthToken"];
|
|
11
|
+
deleteAuthToken?: SwishApiConfig["deleteAuthToken"];
|
|
7
12
|
proxy: {
|
|
8
13
|
baseUrl: string;
|
|
9
14
|
};
|
|
10
|
-
storefrontApi: StorefrontApiOptions;
|
|
11
|
-
storefrontContext: StorefrontContext;
|
|
12
15
|
swishApi?: SwishClientConfig & {
|
|
13
16
|
version?: string;
|
|
14
17
|
};
|
|
15
|
-
|
|
18
|
+
ui?: SwishUiOptions;
|
|
19
|
+
storefront: StorefrontConfig;
|
|
16
20
|
}
|
|
17
21
|
export interface SwishUiOptions {
|
|
18
|
-
baseUrl
|
|
22
|
+
baseUrl: string;
|
|
19
23
|
version: string;
|
|
20
|
-
intents?: IntentOptions;
|
|
21
24
|
}
|
|
22
25
|
export interface SwishUiManifest {
|
|
23
26
|
scripts: Record<string, string>;
|
|
@@ -34,7 +37,7 @@ export interface SwishUiElementSpec {
|
|
|
34
37
|
script: string;
|
|
35
38
|
template: string;
|
|
36
39
|
}
|
|
37
|
-
export interface
|
|
40
|
+
export interface SwishEmbedData {
|
|
38
41
|
customer: {
|
|
39
42
|
id: string | null;
|
|
40
43
|
email: string | null;
|
|
@@ -43,9 +46,9 @@ export interface StorefrontContext {
|
|
|
43
46
|
b2b: boolean | null;
|
|
44
47
|
};
|
|
45
48
|
localization: {
|
|
46
|
-
country:
|
|
47
|
-
language:
|
|
48
|
-
market:
|
|
49
|
+
country: string;
|
|
50
|
+
language: string;
|
|
51
|
+
market: number;
|
|
49
52
|
};
|
|
50
53
|
routes: {
|
|
51
54
|
accountUrl: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
get swish(): import("../swish").SwishApp | undefined;
|
|
1
|
+
export declare class ShopBridge extends HTMLElement {
|
|
2
|
+
readonly swish: import("..").SwishApp;
|
|
4
3
|
private readonly emailInput;
|
|
5
4
|
private readonly shopModalObserver;
|
|
6
5
|
constructor();
|
|
@@ -28,4 +27,3 @@ declare global {
|
|
|
28
27
|
};
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swishapp/sdk",
|
|
3
|
-
"version": "0.60.0
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "JS SDK for Swish.",
|
|
5
5
|
"author": "Swish",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@preact/signals-core": "1.12.1",
|
|
23
23
|
"@shopify/storefront-api-client": "1.0.9",
|
|
24
|
-
"@swishapp/api-client": "0.
|
|
24
|
+
"@swishapp/api-client": "0.27.0",
|
|
25
25
|
"dataloader": "2.2.3",
|
|
26
26
|
"valibot": "1.1.0"
|
|
27
27
|
},
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
"rimraf": "6.0.1",
|
|
34
34
|
"typescript": "5.9.3"
|
|
35
35
|
},
|
|
36
|
-
"main": "./dist/
|
|
37
|
-
"module": "./dist/
|
|
38
|
-
"types": "./dist/
|
|
36
|
+
"main": "./dist/index.js",
|
|
37
|
+
"module": "./dist/index.js",
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
39
|
"exports": {
|
|
40
40
|
".": {
|
|
41
41
|
"module": {
|
|
42
|
-
"types": "./dist/
|
|
43
|
-
"default": "./dist/
|
|
42
|
+
"types": "./dist/index.d.ts",
|
|
43
|
+
"default": "./dist/index.js"
|
|
44
44
|
},
|
|
45
45
|
"import": {
|
|
46
|
-
"types": "./dist/
|
|
47
|
-
"default": "./dist/
|
|
46
|
+
"types": "./dist/index.d.ts",
|
|
47
|
+
"default": "./dist/index.js"
|
|
48
48
|
},
|
|
49
|
-
"default": "./dist/
|
|
49
|
+
"default": "./dist/index.js"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"files": [
|