@swishapp/api-client 0.41.0 → 0.43.0-unstable.20260305130147
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/README.md +55 -0
- package/dist/{client.d.ts → 2026-01/client.d.ts} +19 -8
- package/dist/2026-01/index.d.ts +3 -0
- package/dist/2026-01/index.js +7 -0
- package/dist/{openapi → 2026-01/openapi}/client/index.d.ts +2 -1
- package/dist/{openapi → 2026-01/openapi}/client/types.gen.d.ts +2 -9
- package/dist/{openapi → 2026-01/openapi}/client/utils.gen.d.ts +1 -1
- package/dist/{openapi → 2026-01/openapi}/core/bodySerializer.gen.d.ts +12 -4
- package/dist/{openapi → 2026-01/openapi}/core/params.gen.d.ts +10 -0
- package/dist/2026-01/openapi/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/2026-01/openapi/index.d.ts +2 -0
- package/dist/{openapi → 2026-01/openapi}/sdk.gen.d.ts +14 -4
- package/dist/{openapi → 2026-01/openapi}/types.gen.d.ts +775 -20
- package/dist/{types.d.ts → 2026-01/types.d.ts} +1 -2
- package/dist/2026-04/client.d.ts +143 -0
- package/dist/2026-04/index.d.ts +3 -0
- package/dist/2026-04/index.js +7 -0
- package/dist/2026-04/openapi/client/client.gen.d.ts +2 -0
- package/dist/2026-04/openapi/client/index.d.ts +8 -0
- package/dist/2026-04/openapi/client/types.gen.d.ts +117 -0
- package/dist/2026-04/openapi/client/utils.gen.d.ts +33 -0
- package/dist/2026-04/openapi/client.gen.d.ts +12 -0
- package/dist/2026-04/openapi/core/auth.gen.d.ts +18 -0
- package/dist/2026-04/openapi/core/bodySerializer.gen.d.ts +25 -0
- package/dist/2026-04/openapi/core/params.gen.d.ts +43 -0
- package/dist/2026-04/openapi/core/pathSerializer.gen.d.ts +33 -0
- package/dist/2026-04/openapi/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/2026-04/openapi/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/2026-04/openapi/core/types.gen.d.ts +78 -0
- package/dist/2026-04/openapi/core/utils.gen.d.ts +19 -0
- package/dist/2026-04/openapi/index.d.ts +2 -0
- package/dist/2026-04/openapi/sdk.gen.d.ts +279 -0
- package/dist/2026-04/openapi/types.gen.d.ts +4502 -0
- package/dist/2026-04/types.d.ts +57 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +6 -4
- package/dist/unstable/client.d.ts +143 -0
- package/dist/unstable/index.d.ts +3 -0
- package/dist/unstable/index.js +7 -0
- package/dist/unstable/openapi/client/client.gen.d.ts +2 -0
- package/dist/unstable/openapi/client/index.d.ts +8 -0
- package/dist/unstable/openapi/client/types.gen.d.ts +117 -0
- package/dist/unstable/openapi/client/utils.gen.d.ts +33 -0
- package/dist/unstable/openapi/client.gen.d.ts +12 -0
- package/dist/unstable/openapi/core/auth.gen.d.ts +18 -0
- package/dist/unstable/openapi/core/bodySerializer.gen.d.ts +25 -0
- package/dist/unstable/openapi/core/params.gen.d.ts +43 -0
- package/dist/unstable/openapi/core/pathSerializer.gen.d.ts +33 -0
- package/dist/unstable/openapi/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/unstable/openapi/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/unstable/openapi/core/types.gen.d.ts +78 -0
- package/dist/unstable/openapi/core/utils.gen.d.ts +19 -0
- package/dist/unstable/openapi/index.d.ts +2 -0
- package/dist/unstable/openapi/sdk.gen.d.ts +279 -0
- package/dist/unstable/openapi/types.gen.d.ts +4502 -0
- package/dist/unstable/types.d.ts +57 -0
- package/package.json +52 -22
- package/dist/openapi/index.d.ts +0 -2
- /package/dist/{openapi → 2026-01/openapi}/client/client.gen.d.ts +0 -0
- /package/dist/{openapi → 2026-01/openapi}/client.gen.d.ts +0 -0
- /package/dist/{openapi → 2026-01/openapi}/core/auth.gen.d.ts +0 -0
- /package/dist/{openapi → 2026-01/openapi}/core/pathSerializer.gen.d.ts +0 -0
- /package/dist/{openapi → 2026-01/openapi}/core/serverSentEvents.gen.d.ts +0 -0
- /package/dist/{openapi → 2026-01/openapi}/core/types.gen.d.ts +0 -0
- /package/dist/{openapi → 2026-01/openapi}/core/utils.gen.d.ts +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { SwishClient } from "./client";
|
|
2
|
+
import type { Client, ClientOptions, Config } from "./openapi/client";
|
|
3
|
+
import type { PageInfo } from "./openapi/types.gen";
|
|
4
|
+
export interface SwishClientOptions {
|
|
5
|
+
authToken?: string;
|
|
6
|
+
config?: SwishClientConfig;
|
|
7
|
+
requestInterceptor?: Parameters<Client["interceptors"]["request"]["use"]>[0];
|
|
8
|
+
responseInterceptor?: Parameters<Client["interceptors"]["response"]["use"]>[0];
|
|
9
|
+
}
|
|
10
|
+
export type SwishClientConfig = Config<ClientOptions>;
|
|
11
|
+
export type ListItemsResponse = Awaited<ReturnType<SwishClient["items"]["list"]>>;
|
|
12
|
+
export type CreateItemResponse = Awaited<ReturnType<SwishClient["items"]["create"]>>;
|
|
13
|
+
export type DeleteItemsResponse = Awaited<ReturnType<SwishClient["items"]["delete"]>>;
|
|
14
|
+
export type DeleteItemByIdResponse = Awaited<ReturnType<SwishClient["items"]["deleteById"]>>;
|
|
15
|
+
export type FindItemByIdResponse = Awaited<ReturnType<SwishClient["items"]["findById"]>>;
|
|
16
|
+
export type UpdateItemByIdResponse = Awaited<ReturnType<SwishClient["items"]["updateById"]>>;
|
|
17
|
+
export type CountItemsResponse = Awaited<ReturnType<SwishClient["items"]["count"]>>;
|
|
18
|
+
export type ListListsResponse = Awaited<ReturnType<SwishClient["lists"]["list"]>>;
|
|
19
|
+
export type FindListByIdResponse = Awaited<ReturnType<SwishClient["lists"]["findById"]>>;
|
|
20
|
+
export type CreateListResponse = Awaited<ReturnType<SwishClient["lists"]["create"]>>;
|
|
21
|
+
export type DeleteListByIdResponse = Awaited<ReturnType<SwishClient["lists"]["deleteById"]>>;
|
|
22
|
+
export type UpdateListByIdResponse = Awaited<ReturnType<SwishClient["lists"]["updateById"]>>;
|
|
23
|
+
export type OrderItemsResponse = Awaited<ReturnType<SwishClient["lists"]["orderItems"]>>;
|
|
24
|
+
export type AddItemsToListResponse = Awaited<ReturnType<SwishClient["lists"]["addItemsToList"]>>;
|
|
25
|
+
export type RemoveItemFromListResponse = Awaited<ReturnType<SwishClient["lists"]["removeItemFromList"]>>;
|
|
26
|
+
export type SetListsByIdResponse = Awaited<ReturnType<SwishClient["items"]["setListsById"]>>;
|
|
27
|
+
export type CreateProfileTokenResponse = Awaited<ReturnType<SwishClient["profiles"]["createToken"]>>;
|
|
28
|
+
export type IdentifyProfileResponse = Awaited<ReturnType<SwishClient["profiles"]["identify"]>>;
|
|
29
|
+
export interface ApiError {
|
|
30
|
+
error: string;
|
|
31
|
+
message: string;
|
|
32
|
+
requestId: string;
|
|
33
|
+
statusCode: number;
|
|
34
|
+
}
|
|
35
|
+
export interface ApiErrorResponse {
|
|
36
|
+
error: ApiError;
|
|
37
|
+
}
|
|
38
|
+
export type ApiResponse<TData> = {
|
|
39
|
+
data: TData | null;
|
|
40
|
+
} | {
|
|
41
|
+
error: ApiError;
|
|
42
|
+
};
|
|
43
|
+
export type PaginatedApiResponse<TData> = {
|
|
44
|
+
data: TData[];
|
|
45
|
+
pageInfo: PageInfo;
|
|
46
|
+
} | {
|
|
47
|
+
error: ApiError;
|
|
48
|
+
};
|
|
49
|
+
export type ApiRequestResponse<TData> = Promise<{
|
|
50
|
+
data?: {
|
|
51
|
+
data?: TData;
|
|
52
|
+
pageInfo?: PageInfo;
|
|
53
|
+
} | void;
|
|
54
|
+
error?: {
|
|
55
|
+
error: ApiError;
|
|
56
|
+
};
|
|
57
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swishapp/api-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.43.0-unstable.20260305130147",
|
|
4
4
|
"description": "A lightweight JS client for the Swish REST API.",
|
|
5
5
|
"homepage": "https://developers.swish.app/libraries/api-client",
|
|
6
6
|
"type": "module",
|
|
@@ -18,35 +18,65 @@
|
|
|
18
18
|
"default": "./dist/index.js"
|
|
19
19
|
},
|
|
20
20
|
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./2026-01": {
|
|
23
|
+
"module": {
|
|
24
|
+
"types": "./dist/2026-01/index.d.ts",
|
|
25
|
+
"default": "./dist/2026-01/index.js"
|
|
26
|
+
},
|
|
27
|
+
"import": {
|
|
28
|
+
"types": "./dist/2026-01/index.d.ts",
|
|
29
|
+
"default": "./dist/2026-01/index.js"
|
|
30
|
+
},
|
|
31
|
+
"default": "./dist/2026-01/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./2026-04": {
|
|
34
|
+
"module": {
|
|
35
|
+
"types": "./dist/2026-04/index.d.ts",
|
|
36
|
+
"default": "./dist/2026-04/index.js"
|
|
37
|
+
},
|
|
38
|
+
"import": {
|
|
39
|
+
"types": "./dist/2026-04/index.d.ts",
|
|
40
|
+
"default": "./dist/2026-04/index.js"
|
|
41
|
+
},
|
|
42
|
+
"default": "./dist/2026-04/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./unstable": {
|
|
45
|
+
"module": {
|
|
46
|
+
"types": "./dist/unstable/index.d.ts",
|
|
47
|
+
"default": "./dist/unstable/index.js"
|
|
48
|
+
},
|
|
49
|
+
"import": {
|
|
50
|
+
"types": "./dist/unstable/index.d.ts",
|
|
51
|
+
"default": "./dist/unstable/index.js"
|
|
52
|
+
},
|
|
53
|
+
"default": "./dist/unstable/index.js"
|
|
21
54
|
}
|
|
22
55
|
},
|
|
23
56
|
"files": [
|
|
24
57
|
"dist/**/*.*",
|
|
25
58
|
"README.md"
|
|
26
59
|
],
|
|
27
|
-
"
|
|
28
|
-
"generate": "openapi-ts",
|
|
29
|
-
"test": "jest",
|
|
30
|
-
"test:watch": "jest --watch",
|
|
31
|
-
"build": "rimraf dist && node esbuild.js && tsc -p tsconfig.build.json",
|
|
32
|
-
"dev": "rimraf dist && node esbuild.js --watch && tsc -p tsconfig.build.json --watch",
|
|
33
|
-
"prepublishOnly": "npm run build",
|
|
34
|
-
"lint": "eslint src --ext .ts",
|
|
35
|
-
"clean": "rimraf dist"
|
|
36
|
-
},
|
|
60
|
+
"sideEffects": false,
|
|
37
61
|
"publishConfig": {
|
|
38
62
|
"access": "public"
|
|
39
63
|
},
|
|
40
|
-
"dependencies": {
|
|
41
|
-
"@hey-api/client-fetch": "0.13.1"
|
|
42
|
-
},
|
|
43
64
|
"devDependencies": {
|
|
44
|
-
"@hey-api/openapi-ts": "0.
|
|
45
|
-
"@types/jest": "
|
|
46
|
-
"esbuild": "0.
|
|
47
|
-
"jest": "
|
|
48
|
-
"rimraf": "
|
|
49
|
-
"ts-jest": "29.
|
|
50
|
-
"ts-node": "10.9.2"
|
|
65
|
+
"@hey-api/openapi-ts": "^0.92.3",
|
|
66
|
+
"@types/jest": "^30.0.0",
|
|
67
|
+
"esbuild": "^0.27.2",
|
|
68
|
+
"jest": "^30.2.0",
|
|
69
|
+
"rimraf": "^6.1.2",
|
|
70
|
+
"ts-jest": "^29.4.6",
|
|
71
|
+
"ts-node": "^10.9.2",
|
|
72
|
+
"typescript": "^5.9.3"
|
|
73
|
+
},
|
|
74
|
+
"scripts": {
|
|
75
|
+
"generate": "openapi-ts",
|
|
76
|
+
"test": "jest --passWithNoTests",
|
|
77
|
+
"test:watch": "jest --watch",
|
|
78
|
+
"build": "rimraf dist && tsc -p tsconfig.build.json && node scripts/build-all.js",
|
|
79
|
+
"dev": "rimraf dist && tsc -p tsconfig.build.json --watch && node scripts/build-all.js",
|
|
80
|
+
"clean": "rimraf dist"
|
|
51
81
|
}
|
|
52
|
-
}
|
|
82
|
+
}
|
package/dist/openapi/index.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|