@swishapp/sdk 0.52.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.
Files changed (36) hide show
  1. package/README.md +50 -0
  2. package/dist/ajax-api/ajax-api-client.d.ts +81 -0
  3. package/dist/ajax-api/ajax-api-publisher.d.ts +9 -0
  4. package/dist/cache/fetch-cache.d.ts +87 -0
  5. package/dist/dom/dom-utils.d.ts +16 -0
  6. package/dist/events/event-bus.d.ts +7 -0
  7. package/dist/index.d.ts +8 -0
  8. package/dist/state/index.d.ts +4 -0
  9. package/dist/state/item-context-signal.d.ts +11 -0
  10. package/dist/state/item-count-signal.d.ts +7 -0
  11. package/dist/state/item-state-signal.d.ts +19 -0
  12. package/dist/state/swish-query-signals.d.ts +21 -0
  13. package/dist/storefront-api/load-product-card-data.d.ts +15 -0
  14. package/dist/storefront-api/load-product-detail-data.d.ts +15 -0
  15. package/dist/storefront-api/load-product-id.d.ts +11 -0
  16. package/dist/storefront-api/load-product-images.d.ts +20 -0
  17. package/dist/storefront-api/load-product-options.d.ts +13 -0
  18. package/dist/storefront-api/load-product-recommendations.d.ts +17 -0
  19. package/dist/storefront-api/load-selected-variant.d.ts +14 -0
  20. package/dist/storefront-api/queries/fragments.d.ts +7 -0
  21. package/dist/storefront-api/queries/index.d.ts +14 -0
  22. package/dist/storefront-api/storefront-api-client.d.ts +67 -0
  23. package/dist/storefront-api/types/storefront.generated.d.ts +461 -0
  24. package/dist/storefront-api/types/storefront.types.d.ts +8460 -0
  25. package/dist/swish-api/items-batch-loader.d.ts +4 -0
  26. package/dist/swish-api/swish-api-client.d.ts +43 -0
  27. package/dist/swish-api/swish-api-publisher.d.ts +8 -0
  28. package/dist/swish-ui/swish-ui-element.d.ts +9 -0
  29. package/dist/swish-ui/swish-ui-utils.d.ts +112 -0
  30. package/dist/swish.d.ts +124 -0
  31. package/dist/swish.js +403 -0
  32. package/dist/types.d.ts +57 -0
  33. package/dist/utils/shop-bridge.d.ts +26 -0
  34. package/dist/utils/shopify-gid.d.ts +2 -0
  35. package/dist/utils/shopify-url-utils.d.ts +13 -0
  36. package/package.json +60 -0
@@ -0,0 +1,13 @@
1
+ export interface ProductUrlParams {
2
+ productHandle: string;
3
+ variantId: string | undefined;
4
+ }
5
+ export declare const parseProductUrl: (url: string) => {
6
+ productHandle: string;
7
+ variantId: string | undefined;
8
+ } | null;
9
+ export interface ObserveProductUrlArgs {
10
+ source: Location | HTMLAnchorElement;
11
+ onProductUrlChange: (urlParams: ProductUrlParams) => void;
12
+ }
13
+ export declare const observeProductUrl: ({ source, onProductUrlChange, }: ObserveProductUrlArgs) => () => void;
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@swishapp/sdk",
3
+ "version": "0.52.0",
4
+ "description": "JS SDK for Swish.",
5
+ "author": "Swish",
6
+ "license": "UNLICENSED",
7
+ "homepage": "https://developers.swish.app/libraries/sdk",
8
+ "type": "module",
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "scripts": {
13
+ "build": "tsc -p tsconfig.build.json && node esbuild.js",
14
+ "clean": "rimraf dist",
15
+ "test": "echo \"Error: no test specified\" && exit 1",
16
+ "dev": "concurrently 'node esbuild.js --watch' 'tsc -p tsconfig.build.json --watch'",
17
+ "predev": "npm run clean",
18
+ "prepublishOnly": "npm run clean && npm run build",
19
+ "graphql-codegen": "graphql-codegen"
20
+ },
21
+ "dependencies": {
22
+ "@preact/signals-core": "1.12.1",
23
+ "@shopify/storefront-api-client": "1.0.9",
24
+ "@swishapp/api-client": "0.25.0",
25
+ "dataloader": "2.2.3"
26
+ },
27
+ "devDependencies": {
28
+ "@shopify/api-codegen-preset": "1.2.0",
29
+ "concurrently": "9.2.1",
30
+ "esbuild": "0.25.11",
31
+ "graphql-config": "5.1.5",
32
+ "rimraf": "6.0.1",
33
+ "typescript": "5.9.3"
34
+ },
35
+ "main": "./dist/index.js",
36
+ "module": "./dist/index.js",
37
+ "types": "./dist/index.d.ts",
38
+ "exports": {
39
+ ".": {
40
+ "module": {
41
+ "types": "./dist/index.d.ts",
42
+ "default": "./dist/index.js"
43
+ },
44
+ "import": {
45
+ "types": "./dist/index.d.ts",
46
+ "default": "./dist/index.js"
47
+ },
48
+ "default": "./dist/index.js"
49
+ }
50
+ },
51
+ "files": [
52
+ "dist/**/*.*",
53
+ "README.md"
54
+ ],
55
+ "keywords": [
56
+ "swish",
57
+ "shopify",
58
+ "js"
59
+ ]
60
+ }