@scpdemo/test-sdk-card 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.
Files changed (38) hide show
  1. package/README.md +31 -0
  2. package/dist/index.cjs +304 -0
  3. package/dist/index.js +269 -0
  4. package/dist/tsconfig.build.tsbuildinfo +1 -0
  5. package/dist/types/components/ScPrefixWidgetWrapper.d.ts +5 -0
  6. package/dist/types/components/ScPrefixWidgetWrapper.d.ts.map +1 -0
  7. package/dist/types/components/ScPrefixWidgetWrapper.js +5 -0
  8. package/dist/types/hooks/useScPrefixSdk.d.ts +16 -0
  9. package/dist/types/hooks/useScPrefixSdk.d.ts.map +1 -0
  10. package/dist/types/hooks/useScPrefixSdk.js +47 -0
  11. package/dist/types/index.d.ts +4 -0
  12. package/dist/types/index.d.ts.map +1 -0
  13. package/dist/types/index.js +2 -0
  14. package/dist/types/lib/api/client.d.ts +8 -0
  15. package/dist/types/lib/api/client.d.ts.map +1 -0
  16. package/dist/types/lib/api/client.js +15 -0
  17. package/dist/types/lib/components/Widget.d.ts +6 -0
  18. package/dist/types/lib/components/Widget.d.ts.map +1 -0
  19. package/dist/types/lib/components/Widget.js +54 -0
  20. package/dist/types/lib/config.d.ts +12 -0
  21. package/dist/types/lib/config.d.ts.map +1 -0
  22. package/dist/types/lib/config.js +38 -0
  23. package/dist/types/lib/index.d.ts +10 -0
  24. package/dist/types/lib/index.d.ts.map +1 -0
  25. package/dist/types/lib/index.js +32 -0
  26. package/dist/types/lib/storage/local-storage.d.ts +9 -0
  27. package/dist/types/lib/storage/local-storage.d.ts.map +1 -0
  28. package/dist/types/lib/storage/local-storage.js +35 -0
  29. package/dist/types/lib/styles/base.d.ts +2 -0
  30. package/dist/types/lib/styles/base.d.ts.map +1 -0
  31. package/dist/types/lib/styles/base.js +80 -0
  32. package/dist/types/lib/types/index.d.ts +23 -0
  33. package/dist/types/lib/types/index.d.ts.map +1 -0
  34. package/dist/types/lib/types/index.js +1 -0
  35. package/dist/types/lib/utils/http-client.d.ts +8 -0
  36. package/dist/types/lib/utils/http-client.d.ts.map +1 -0
  37. package/dist/types/lib/utils/http-client.js +21 -0
  38. package/package.json +65 -0
@@ -0,0 +1,21 @@
1
+ import axios from "axios";
2
+ export class ScPrefixHttpClient {
3
+ client;
4
+ constructor(baseURL, apiKey) {
5
+ this.client = axios.create({
6
+ baseURL,
7
+ headers: {
8
+ "Content-Type": "application/json",
9
+ Authorization: `Bearer ${apiKey}`,
10
+ },
11
+ });
12
+ }
13
+ async get(url, config) {
14
+ const response = await this.client.get(url, config);
15
+ return response.data;
16
+ }
17
+ async post(url, body, config) {
18
+ const response = await this.client.post(url, body, config);
19
+ return response.data;
20
+ }
21
+ }
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@scpdemo/test-sdk-card",
3
+ "version": "1.0.1",
4
+ "description": "React hook + iframe wrapper for the Scallop card SDK",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "dist/index.cjs",
8
+ "module": "dist/index.js",
9
+ "types": "dist/types/index.d.ts",
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "README.md"
16
+ ],
17
+ "keywords": [
18
+ "react",
19
+ "sdk",
20
+ "scallop",
21
+ "card",
22
+ "widget",
23
+ "fintech",
24
+ "payment"
25
+ ],
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/your-username/scallop-card-sdk.git",
29
+ "directory": "sdk/packages/react-wrapper"
30
+ },
31
+ "homepage": "https://github.com/your-username/scallop-card-sdk#readme",
32
+ "bugs": {
33
+ "url": "https://github.com/your-username/scallop-card-sdk/issues"
34
+ },
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/types/index.d.ts",
38
+ "import": "./dist/index.js",
39
+ "require": "./dist/index.cjs"
40
+ }
41
+ },
42
+ "scripts": {
43
+ "build": "tsup src/index.ts --format cjs,esm --external react,react-dom,axios && tsc -p tsconfig.build.json",
44
+ "dev": "tsup src/index.ts --format cjs,esm --external react,react-dom,axios --watch",
45
+ "start": "vite --config vite.config.ts --open --port 5173",
46
+ "lint": "eslint src --ext .ts,.tsx",
47
+ "test": "vitest run"
48
+ },
49
+ "peerDependencies": {
50
+ "react": "^18.3.0"
51
+ },
52
+ "dependencies": {
53
+ "@scallop-card/sdk-core": "workspace:^",
54
+ "axios": "^1.6.0"
55
+ },
56
+ "devDependencies": {
57
+ "@vitejs/plugin-react": "^4.3.1",
58
+ "@types/react": "18.3.8",
59
+ "@types/react-dom": "18.3.0",
60
+ "react": "18.3.1",
61
+ "react-dom": "18.3.1",
62
+ "tslib": "2.8.0",
63
+ "vite": "5.4.8"
64
+ }
65
+ }