@ogcio/building-blocks-sdk 0.0.5 → 0.0.7
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 +2 -18
- package/dist/client/base-client.d.ts +2 -3
- package/dist/client/base-client.d.ts.map +1 -1
- package/dist/client/base-client.js +0 -3
- package/dist/client/base-client.js.map +1 -1
- package/dist/client/clients/messaging/index.d.ts +1 -1
- package/dist/client/clients/messaging/index.d.ts.map +1 -1
- package/dist/client/clients/payments/index.d.ts +59 -41
- package/dist/client/clients/payments/index.d.ts.map +1 -1
- package/dist/client/clients/payments/schema.d.ts +519 -47
- package/dist/client/clients/payments/schema.d.ts.map +1 -1
- package/dist/client/clients/profile/index.d.ts +1 -1
- package/dist/client/clients/profile/index.d.ts.map +1 -1
- package/dist/client/clients/scheduler/index.d.ts +1 -1
- package/dist/client/clients/scheduler/index.d.ts.map +1 -1
- package/dist/client/clients/upload/index.d.ts +70 -136
- package/dist/client/clients/upload/index.d.ts.map +1 -1
- package/dist/client/clients/upload/index.js +15 -27
- package/dist/client/clients/upload/index.js.map +1 -1
- package/dist/clients-configurations/clients-configuration.json +0 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +9 -12
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +7 -13
- package/src/client/base-client.ts +2 -6
- package/src/client/clients/messaging/index.ts +1 -1
- package/src/client/clients/payments/index.ts +1 -1
- package/src/client/clients/payments/open-api-definition.json +983 -179
- package/src/client/clients/payments/schema.ts +519 -47
- package/src/client/clients/profile/index.ts +1 -1
- package/src/client/clients/scheduler/index.ts +1 -1
- package/src/client/clients/upload/index.ts +24 -46
- package/src/clients-configurations/clients-configuration.json +0 -8
- package/src/index.ts +3 -8
- package/src/types/index.ts +8 -14
- package/.github/dependabot.yaml +0 -12
- package/.husky/pre-commit +0 -2
|
@@ -2,18 +2,31 @@ import { UPLOAD } from "../../../types/index.js";
|
|
|
2
2
|
import BaseClient from "../../base-client.js";
|
|
3
3
|
class Upload extends BaseClient {
|
|
4
4
|
serviceName = UPLOAD;
|
|
5
|
-
getFilesMetadata(
|
|
5
|
+
getFilesMetadata(organizationId) {
|
|
6
6
|
return this.client
|
|
7
7
|
.GET("/api/v1/metadata/", {
|
|
8
8
|
params: {
|
|
9
9
|
query: {
|
|
10
10
|
organizationId,
|
|
11
|
-
userId,
|
|
12
11
|
},
|
|
13
12
|
},
|
|
14
13
|
})
|
|
15
14
|
.then((response) => this.formatResponse(response), (reason) => this.formatError(reason));
|
|
16
15
|
}
|
|
16
|
+
shareFile(fileId, userId) {
|
|
17
|
+
return this.client
|
|
18
|
+
.POST("/api/v1/permissions/", {
|
|
19
|
+
body: { fileId, userId },
|
|
20
|
+
})
|
|
21
|
+
.then((response) => this.formatResponse(response), (reason) => this.formatError(reason));
|
|
22
|
+
}
|
|
23
|
+
removeFileSharing(fileId, userId) {
|
|
24
|
+
return this.client
|
|
25
|
+
.DELETE("/api/v1/permissions/", {
|
|
26
|
+
body: { fileId, userId },
|
|
27
|
+
})
|
|
28
|
+
.then((response) => this.formatResponse(response), (reason) => this.formatError(reason));
|
|
29
|
+
}
|
|
17
30
|
async getFile(id) {
|
|
18
31
|
try {
|
|
19
32
|
const { error, data, response: { headers, status }, } = await this.client.GET("/api/v1/files/{id}", {
|
|
@@ -57,31 +70,6 @@ class Upload extends BaseClient {
|
|
|
57
70
|
})
|
|
58
71
|
.then((response) => this.formatResponse(response), (reason) => this.formatError(reason));
|
|
59
72
|
}
|
|
60
|
-
getFileSharings(id) {
|
|
61
|
-
return this.client
|
|
62
|
-
.GET("/api/v1/permissions/", {
|
|
63
|
-
params: {
|
|
64
|
-
query: {
|
|
65
|
-
fileId: id,
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
})
|
|
69
|
-
.then((response) => this.formatResponse(response), (reason) => this.formatError(reason));
|
|
70
|
-
}
|
|
71
|
-
shareFile(fileId, userId) {
|
|
72
|
-
return this.client
|
|
73
|
-
.POST("/api/v1/permissions/", {
|
|
74
|
-
body: { fileId, userId },
|
|
75
|
-
})
|
|
76
|
-
.then((response) => this.formatResponse(response), (reason) => this.formatError(reason));
|
|
77
|
-
}
|
|
78
|
-
removeFileSharing(fileId, userId) {
|
|
79
|
-
return this.client
|
|
80
|
-
.DELETE("/api/v1/permissions/", {
|
|
81
|
-
body: { fileId, userId },
|
|
82
|
-
})
|
|
83
|
-
.then((response) => this.formatResponse(response), (reason) => this.formatError(reason));
|
|
84
|
-
}
|
|
85
73
|
async uploadFile(file, expirationDate) {
|
|
86
74
|
const { error } = await this.client.POST("/api/v1/files/", {
|
|
87
75
|
body: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client/clients/upload/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAG9C,MAAM,MAAO,SAAQ,UAAiB;IAE1B,WAAW,GAAG,MAAM,CAAC;IAE/B,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client/clients/upload/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAG9C,MAAM,MAAO,SAAQ,UAAiB;IAE1B,WAAW,GAAG,MAAM,CAAC;IAE/B,gBAAgB,CAAC,cAAsB;QACrC,OAAO,IAAI,CAAC,MAAM;aACf,GAAG,CAAC,mBAAmB,EAAE;YACxB,MAAM,EAAE;gBACN,KAAK,EAAE;oBACL,cAAc;iBACf;aACF;SACF,CAAC;aACD,IAAI,CACH,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,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UAAU,CAAC,IAAU,EAAE,cAAuB;QAClD,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzD,IAAI,EAAE;gBACJ,IAAI;gBACJ,cAAc;aACf;YAED,cAAc,EAAE,CAAC,IAAa,EAAE,EAAE;gBAChC,MAAM,OAAO,GAAG,IAA8C,CAAC;gBAC/D,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;gBAChC,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;oBAC3B,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;gBACzD,CAAC;gBACD,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;gBACnC,OAAO,QAAQ,CAAC;YAClB,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;CACF;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"buildingBlocks": [
|
|
3
|
-
{
|
|
4
|
-
"name": "analytics",
|
|
5
|
-
"openApiDefinitionUrl": "",
|
|
6
|
-
"openApiDefinitionFormat": "yaml",
|
|
7
|
-
"updateDefinitions": false,
|
|
8
|
-
"citizenPermissions": [],
|
|
9
|
-
"publicServantPermissions": []
|
|
10
|
-
},
|
|
11
3
|
{
|
|
12
4
|
"name": "messaging",
|
|
13
5
|
"openApiDefinitionUrl": "https://raw.githubusercontent.com/ogcio/life-events/refs/heads/dev/apps/messaging-api/openapi-definition.yml",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { BuildingBlocksSDK } from "./types/index.js";
|
|
2
|
+
export { default as getM2MTokenFn } from "./client/auth/index.js";
|
|
2
3
|
import type { BuildingBlockSDKParams, BuildingBlocksSDK } from "./types/index.js";
|
|
3
4
|
declare const getBuildingBlockSDK: (params: BuildingBlockSDKParams) => BuildingBlocksSDK;
|
|
4
5
|
export default getBuildingBlockSDK;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAE1B,QAAA,MAAM,mBAAmB,WACf,sBAAsB,KAC7B,iBAwBF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { Analytics } from "@ogcio/analytics-sdk";
|
|
2
1
|
import Messaging from "./client/clients/messaging/index.js";
|
|
3
2
|
import Payments from "./client/clients/payments/index.js";
|
|
4
3
|
import Profile from "./client/clients/profile/index.js";
|
|
5
4
|
import Scheduler from "./client/clients/scheduler/index.js";
|
|
6
5
|
import Upload from "./client/clients/upload/index.js";
|
|
6
|
+
export { default as getM2MTokenFn } from "./client/auth/index.js";
|
|
7
7
|
const getBuildingBlockSDK = (params) => {
|
|
8
8
|
const { services, getTokenFn } = params;
|
|
9
9
|
return {
|
|
10
|
-
analytics: new Analytics({
|
|
11
|
-
...services.analytics,
|
|
12
|
-
getTokenFn,
|
|
13
|
-
}),
|
|
14
10
|
messaging: new Messaging({
|
|
15
11
|
...services.messaging,
|
|
16
12
|
getTokenFn,
|
|
@@ -20,7 +16,7 @@ const getBuildingBlockSDK = (params) => {
|
|
|
20
16
|
getTokenFn,
|
|
21
17
|
}),
|
|
22
18
|
profile: new Profile({
|
|
23
|
-
...services.
|
|
19
|
+
...services.payments,
|
|
24
20
|
getTokenFn,
|
|
25
21
|
}),
|
|
26
22
|
scheduler: new Scheduler({
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,qCAAqC,CAAC;AAC5D,OAAO,QAAQ,MAAM,oCAAoC,CAAC;AAC1D,OAAO,OAAO,MAAM,mCAAmC,CAAC;AACxD,OAAO,SAAS,MAAM,qCAAqC,CAAC;AAC5D,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAGtD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAOlE,MAAM,mBAAmB,GAAG,CAC1B,MAA8B,EACX,EAAE;IACrB,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;IACxC,OAAO;QACL,SAAS,EAAE,IAAI,SAAS,CAAC;YACvB,GAAG,QAAQ,CAAC,SAAS;YACrB,UAAU;SACX,CAAC;QACF,QAAQ,EAAE,IAAI,QAAQ,CAAC;YACrB,GAAG,QAAQ,CAAC,QAAQ;YACpB,UAAU;SACX,CAAC;QACF,OAAO,EAAE,IAAI,OAAO,CAAC;YACnB,GAAG,QAAQ,CAAC,QAAQ;YACpB,UAAU;SACX,CAAC;QACF,SAAS,EAAE,IAAI,SAAS,CAAC;YACvB,GAAG,QAAQ,CAAC,SAAS;YACrB,UAAU;SACX,CAAC;QACF,MAAM,EAAE,IAAI,MAAM,CAAC;YACjB,GAAG,QAAQ,CAAC,MAAM;YAClB,UAAU;SACX,CAAC;KACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import type { Analytics } from "@ogcio/analytics-sdk";
|
|
2
1
|
import type Messaging from "../client/clients/messaging/index.js";
|
|
3
2
|
import type Payments from "../client/clients/payments/index.js";
|
|
4
3
|
import type Profile from "../client/clients/profile/index.js";
|
|
5
4
|
import type Scheduler from "../client/clients/scheduler/index.js";
|
|
6
5
|
import type Upload from "../client/clients/upload/index.js";
|
|
7
|
-
export declare const ANALYTICS: "analytics";
|
|
8
6
|
export declare const MESSAGING: "messaging";
|
|
9
7
|
export declare const PAYMENTS: "payments";
|
|
10
8
|
export declare const PROFILE: "profile";
|
|
11
9
|
export declare const SCHEDULER: "scheduler";
|
|
12
10
|
export declare const UPLOAD: "upload";
|
|
13
|
-
export type SERVICE_NAME = typeof
|
|
11
|
+
export type SERVICE_NAME = typeof MESSAGING | typeof PAYMENTS | typeof PROFILE | typeof SCHEDULER | typeof UPLOAD;
|
|
14
12
|
export type TokenFunction = (serviceName: SERVICE_NAME) => Promise<string> | string;
|
|
15
13
|
export type M2MParams = {
|
|
16
14
|
getOrganizationTokenParams?: GetOrganizationTokenParams;
|
|
@@ -24,23 +22,22 @@ export type M2MTokenFnConfig = {
|
|
|
24
22
|
export type SDKClientParams = {
|
|
25
23
|
baseUrl?: string;
|
|
26
24
|
};
|
|
27
|
-
export type
|
|
25
|
+
export type ApiClientParams = SDKClientParams & {
|
|
28
26
|
getTokenFn?: TokenFunction;
|
|
29
27
|
};
|
|
30
28
|
type ServiceClients = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
upload: typeof Upload;
|
|
29
|
+
messaging: Messaging;
|
|
30
|
+
payments: Payments;
|
|
31
|
+
profile: Profile;
|
|
32
|
+
scheduler: Scheduler;
|
|
33
|
+
upload: Upload;
|
|
37
34
|
};
|
|
38
35
|
export type BuildingBlocksSDK = {
|
|
39
|
-
[key in keyof ServiceClients]:
|
|
36
|
+
[key in keyof ServiceClients]: ServiceClients[key];
|
|
40
37
|
};
|
|
41
38
|
export type BuildingBlockSDKParams = {
|
|
42
39
|
services: {
|
|
43
|
-
[key in keyof ServiceClients]?:
|
|
40
|
+
[key in keyof ServiceClients]?: SDKClientParams;
|
|
44
41
|
};
|
|
45
42
|
getTokenFn?: TokenFunction;
|
|
46
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,QAAQ,MAAM,qCAAqC,CAAC;AAChE,OAAO,KAAK,OAAO,MAAM,oCAAoC,CAAC;AAC9D,OAAO,KAAK,SAAS,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,MAAM,MAAM,mCAAmC,CAAC;AAE5D,eAAO,MAAM,SAAS,aAAuB,CAAC;AAC9C,eAAO,MAAM,QAAQ,YAAsB,CAAC;AAC5C,eAAO,MAAM,OAAO,WAAqB,CAAC;AAC1C,eAAO,MAAM,SAAS,aAAuB,CAAC;AAC9C,eAAO,MAAM,MAAM,UAAoB,CAAC;AAExC,MAAM,MAAM,YAAY,GACpB,OAAO,SAAS,GAChB,OAAO,QAAQ,GACf,OAAO,OAAO,GACd,OAAO,SAAS,GAChB,OAAO,MAAM,CAAC;AAElB,MAAM,MAAM,aAAa,GAAG,CAC1B,WAAW,EAAE,YAAY,KACtB,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAE9B,MAAM,MAAM,SAAS,GAAG;IACtB,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;IACxD,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE;SACP,GAAG,IAAI,YAAY,CA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version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,SAAS,GAAG,WAAoB,CAAC;AAC9C,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAmB,CAAC;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG,SAAkB,CAAC;AAC1C,MAAM,CAAC,MAAM,SAAS,GAAG,WAAoB,CAAC;AAC9C,MAAM,CAAC,MAAM,MAAM,GAAG,QAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ogcio/building-blocks-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -8,23 +8,17 @@
|
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
9
|
"build": "rm -rf dist && tsc -p tsconfig.prod.json",
|
|
10
10
|
"clients:update": "node --import=tsx src/cli/index.ts clients:update -c src/clients-configurations/clients-configuration.json",
|
|
11
|
-
"clients:outdated": "node --import=tsx src/cli/index.ts clients:outdated -c src/clients-configurations/clients-configuration.json"
|
|
12
|
-
"check:formatting": "biome format",
|
|
13
|
-
"fix:formatting": "biome format --write",
|
|
14
|
-
"check:linting": "biome lint",
|
|
15
|
-
"fix:linting": "biome lint --write",
|
|
16
|
-
"prepare": "husky || true"
|
|
11
|
+
"clients:outdated": "node --import=tsx src/cli/index.ts clients:outdated -c src/clients-configurations/clients-configuration.json"
|
|
17
12
|
},
|
|
18
13
|
"dependencies": {
|
|
19
|
-
"@ogcio/analytics-sdk": "0.0.1-beta.1",
|
|
20
14
|
"@sinclair/typebox": "^0.33.15",
|
|
21
15
|
"commander": "^12.1.0",
|
|
22
16
|
"http-errors": "^2.0.0",
|
|
23
|
-
"openapi-fetch": "^0.12.
|
|
24
|
-
"openapi-typescript": "^7.4.
|
|
25
|
-
"openapi-typescript-helpers": "^0.0.
|
|
17
|
+
"openapi-fetch": "^0.12.5",
|
|
18
|
+
"openapi-typescript": "^7.4.2",
|
|
19
|
+
"openapi-typescript-helpers": "^0.0.15",
|
|
26
20
|
"safe-stable-stringify": "^2.5.0",
|
|
27
|
-
"yaml": "^2.
|
|
21
|
+
"yaml": "^2.6.0"
|
|
28
22
|
},
|
|
29
23
|
"devDependencies": {
|
|
30
24
|
"@biomejs/biome": "1.9.4",
|
|
@@ -32,7 +26,7 @@
|
|
|
32
26
|
"@types/http-errors": "^2.0.4",
|
|
33
27
|
"commitlint": "^19.5.0",
|
|
34
28
|
"husky": "^9.1.6",
|
|
35
|
-
"tsx": "^4.19.
|
|
29
|
+
"tsx": "^4.19.2",
|
|
36
30
|
"typescript": "^5.6.3"
|
|
37
31
|
},
|
|
38
32
|
"peerDependencies": {
|
|
@@ -3,7 +3,7 @@ import createClient, {
|
|
|
3
3
|
type FetchResponse,
|
|
4
4
|
} from "openapi-fetch";
|
|
5
5
|
import type {
|
|
6
|
-
|
|
6
|
+
ApiClientParams,
|
|
7
7
|
SERVICE_NAME,
|
|
8
8
|
TokenFunction,
|
|
9
9
|
} from "../types/index.js";
|
|
@@ -19,7 +19,7 @@ abstract class BaseClient<T extends {}> {
|
|
|
19
19
|
|
|
20
20
|
protected client: ReturnType<typeof createClient<T>>;
|
|
21
21
|
|
|
22
|
-
constructor({ baseUrl, getTokenFn }:
|
|
22
|
+
constructor({ baseUrl, getTokenFn }: ApiClientParams) {
|
|
23
23
|
this.initialized = false;
|
|
24
24
|
if (baseUrl) {
|
|
25
25
|
this.baseUrl = baseUrl;
|
|
@@ -48,10 +48,6 @@ abstract class BaseClient<T extends {}> {
|
|
|
48
48
|
this.client.use(authMiddleware);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
public deleteToken() {
|
|
52
|
-
this.token = undefined;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
51
|
protected async getToken() {
|
|
56
52
|
if (this.getTokenFn) {
|
|
57
53
|
const token = await this.getTokenFn(this.serviceName as SERVICE_NAME);
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import type { paths } from "./schema.js";
|
|
11
11
|
|
|
12
12
|
class Messaging extends BaseClient<paths> {
|
|
13
|
-
|
|
13
|
+
declare client: ReturnType<typeof createClient<paths>>;
|
|
14
14
|
protected serviceName = MESSAGING;
|
|
15
15
|
|
|
16
16
|
async getMessagesForUser(
|
|
@@ -4,7 +4,7 @@ import BaseClient from "../../base-client.js";
|
|
|
4
4
|
import type { paths } from "./schema.js";
|
|
5
5
|
|
|
6
6
|
class Payments extends BaseClient<paths> {
|
|
7
|
-
|
|
7
|
+
declare client: ReturnType<typeof createClient<paths>>;
|
|
8
8
|
protected serviceName = PAYMENTS;
|
|
9
9
|
|
|
10
10
|
/**
|