@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/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
- export interface SwishOptions {
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
- swishUi?: SwishUiOptions;
18
+ ui?: SwishUiOptions;
19
+ storefront: StorefrontConfig;
16
20
  }
17
21
  export interface SwishUiOptions {
18
- baseUrl?: string;
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 StorefrontContext {
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: CountryCode;
47
- language: LanguageCode;
48
- market: string;
49
+ country: string;
50
+ language: string;
51
+ market: number;
49
52
  };
50
53
  routes: {
51
54
  accountUrl: string;
@@ -1,6 +1,5 @@
1
- declare const BaseElement: typeof HTMLElement;
2
- export declare class ShopBridge extends BaseElement {
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-beta.1",
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.26.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/swish.js",
37
- "module": "./dist/swish.js",
38
- "types": "./dist/swish.d.ts",
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/swish.d.ts",
43
- "default": "./dist/swish.js"
42
+ "types": "./dist/index.d.ts",
43
+ "default": "./dist/index.js"
44
44
  },
45
45
  "import": {
46
- "types": "./dist/swish.d.ts",
47
- "default": "./dist/swish.js"
46
+ "types": "./dist/index.d.ts",
47
+ "default": "./dist/index.js"
48
48
  },
49
- "default": "./dist/swish.js"
49
+ "default": "./dist/index.js"
50
50
  }
51
51
  },
52
52
  "files": [