@ogcio/building-blocks-sdk 0.0.7 → 0.0.9
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/.github/dependabot.yaml +12 -0
- package/.husky/pre-commit +2 -0
- package/README.md +24 -2
- package/dist/client/auth/index.d.ts +1 -2
- package/dist/client/auth/index.d.ts.map +1 -1
- package/dist/client/auth/index.js +1 -2
- package/dist/client/auth/index.js.map +1 -1
- package/dist/client/base-client.d.ts +4 -3
- package/dist/client/base-client.d.ts.map +1 -1
- package/dist/client/base-client.js +4 -0
- package/dist/client/base-client.js.map +1 -1
- package/dist/client/clients/messaging/index.d.ts +399 -56
- package/dist/client/clients/messaging/index.d.ts.map +1 -1
- package/dist/client/clients/payments/index.d.ts +93 -3
- package/dist/client/clients/payments/index.d.ts.map +1 -1
- package/dist/client/clients/payments/index.js +11 -0
- package/dist/client/clients/payments/index.js.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 +185 -51
- package/dist/client/clients/upload/index.d.ts.map +1 -1
- package/dist/client/clients/upload/index.js +27 -15
- package/dist/client/clients/upload/index.js.map +1 -1
- package/dist/clients-configurations/clients-configuration.json +8 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +12 -9
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +8 -2
- package/src/client/auth/index.ts +3 -3
- package/src/client/base-client.ts +8 -3
- package/src/client/clients/messaging/index.ts +1 -1
- package/src/client/clients/payments/index.ts +18 -1
- 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 +46 -24
- package/src/clients-configurations/clients-configuration.json +8 -0
- package/src/index.ts +9 -3
- package/src/types/index.ts +14 -8
|
@@ -2,31 +2,18 @@ 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(organizationId) {
|
|
5
|
+
getFilesMetadata({ organizationId, userId, }) {
|
|
6
6
|
return this.client
|
|
7
7
|
.GET("/api/v1/metadata/", {
|
|
8
8
|
params: {
|
|
9
9
|
query: {
|
|
10
10
|
organizationId,
|
|
11
|
+
userId,
|
|
11
12
|
},
|
|
12
13
|
},
|
|
13
14
|
})
|
|
14
15
|
.then((response) => this.formatResponse(response), (reason) => this.formatError(reason));
|
|
15
16
|
}
|
|
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
|
-
}
|
|
30
17
|
async getFile(id) {
|
|
31
18
|
try {
|
|
32
19
|
const { error, data, response: { headers, status }, } = await this.client.GET("/api/v1/files/{id}", {
|
|
@@ -70,6 +57,31 @@ class Upload extends BaseClient {
|
|
|
70
57
|
})
|
|
71
58
|
.then((response) => this.formatResponse(response), (reason) => this.formatError(reason));
|
|
72
59
|
}
|
|
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
|
+
}
|
|
73
85
|
async uploadFile(file, expirationDate) {
|
|
74
86
|
const { error } = await this.client.POST("/api/v1/files/", {
|
|
75
87
|
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,EACf,cAAc,EACd,MAAM,GAIP;QACC,OAAO,IAAI,CAAC,MAAM;aACf,GAAG,CAAC,mBAAmB,EAAE;YACxB,MAAM,EAAE;gBACN,KAA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": "",
|
|
6
|
+
"openApiDefinitionFormat": "yaml",
|
|
7
|
+
"updateDefinitions": false,
|
|
8
|
+
"citizenPermissions": [],
|
|
9
|
+
"publicServantPermissions": []
|
|
10
|
+
},
|
|
3
11
|
{
|
|
4
12
|
"name": "messaging",
|
|
5
13
|
"openApiDefinitionUrl": "https://raw.githubusercontent.com/ogcio/life-events/refs/heads/dev/apps/messaging-api/openapi-definition.yml",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { BuildingBlocksSDK } from "./types/index.js";
|
|
2
|
-
export {
|
|
2
|
+
export { getM2MTokenFn } from "./client/auth/index.js";
|
|
3
3
|
import type { BuildingBlockSDKParams, BuildingBlocksSDK } from "./types/index.js";
|
|
4
4
|
declare const getBuildingBlockSDK: (params: BuildingBlockSDKParams) => BuildingBlocksSDK;
|
|
5
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":"AAOA,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EAElB,MAAM,kBAAkB,CAAC;AAE1B,QAAA,MAAM,mBAAmB,WACf,sBAAsB,KAC7B,iBA4BF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { Analytics } from "@ogcio/analytics-sdk";
|
|
1
2
|
import Messaging from "./client/clients/messaging/index.js";
|
|
2
3
|
import Payments from "./client/clients/payments/index.js";
|
|
3
4
|
import Profile from "./client/clients/profile/index.js";
|
|
4
5
|
import Scheduler from "./client/clients/scheduler/index.js";
|
|
5
6
|
import Upload from "./client/clients/upload/index.js";
|
|
6
|
-
export {
|
|
7
|
+
export { getM2MTokenFn } from "./client/auth/index.js";
|
|
7
8
|
const getBuildingBlockSDK = (params) => {
|
|
8
9
|
const { services, getTokenFn } = params;
|
|
9
10
|
return {
|
|
11
|
+
analytics: new Analytics({
|
|
12
|
+
...services.analytics,
|
|
13
|
+
getTokenFn,
|
|
14
|
+
}),
|
|
10
15
|
messaging: new Messaging({
|
|
11
16
|
...services.messaging,
|
|
12
17
|
getTokenFn,
|
|
@@ -16,7 +21,7 @@ const getBuildingBlockSDK = (params) => {
|
|
|
16
21
|
getTokenFn,
|
|
17
22
|
}),
|
|
18
23
|
profile: new Profile({
|
|
19
|
-
...services.
|
|
24
|
+
...services.profile,
|
|
20
25
|
getTokenFn,
|
|
21
26
|
}),
|
|
22
27
|
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,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;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,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;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAQvD,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,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,OAAO;YACnB,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,14 +1,16 @@
|
|
|
1
|
+
import type { Analytics } from "@ogcio/analytics-sdk";
|
|
1
2
|
import type Messaging from "../client/clients/messaging/index.js";
|
|
2
3
|
import type Payments from "../client/clients/payments/index.js";
|
|
3
4
|
import type Profile from "../client/clients/profile/index.js";
|
|
4
5
|
import type Scheduler from "../client/clients/scheduler/index.js";
|
|
5
6
|
import type Upload from "../client/clients/upload/index.js";
|
|
7
|
+
export declare const ANALYTICS: "analytics";
|
|
6
8
|
export declare const MESSAGING: "messaging";
|
|
7
9
|
export declare const PAYMENTS: "payments";
|
|
8
10
|
export declare const PROFILE: "profile";
|
|
9
11
|
export declare const SCHEDULER: "scheduler";
|
|
10
12
|
export declare const UPLOAD: "upload";
|
|
11
|
-
export type SERVICE_NAME = typeof MESSAGING | typeof PAYMENTS | typeof PROFILE | typeof SCHEDULER | typeof UPLOAD;
|
|
13
|
+
export type SERVICE_NAME = typeof ANALYTICS | typeof MESSAGING | typeof PAYMENTS | typeof PROFILE | typeof SCHEDULER | typeof UPLOAD;
|
|
12
14
|
export type TokenFunction = (serviceName: SERVICE_NAME) => Promise<string> | string;
|
|
13
15
|
export type M2MParams = {
|
|
14
16
|
getOrganizationTokenParams?: GetOrganizationTokenParams;
|
|
@@ -22,22 +24,23 @@ export type M2MTokenFnConfig = {
|
|
|
22
24
|
export type SDKClientParams = {
|
|
23
25
|
baseUrl?: string;
|
|
24
26
|
};
|
|
25
|
-
export type
|
|
27
|
+
export type BaseApiClientParams = SDKClientParams & {
|
|
26
28
|
getTokenFn?: TokenFunction;
|
|
27
29
|
};
|
|
28
30
|
type ServiceClients = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
analytics: typeof Analytics;
|
|
32
|
+
messaging: typeof Messaging;
|
|
33
|
+
payments: typeof Payments;
|
|
34
|
+
profile: typeof Profile;
|
|
35
|
+
scheduler: typeof Scheduler;
|
|
36
|
+
upload: typeof Upload;
|
|
34
37
|
};
|
|
35
38
|
export type BuildingBlocksSDK = {
|
|
36
|
-
[key in keyof ServiceClients]: ServiceClients[key]
|
|
39
|
+
[key in keyof ServiceClients]: InstanceType<ServiceClients[key]>;
|
|
37
40
|
};
|
|
38
41
|
export type BuildingBlockSDKParams = {
|
|
39
42
|
services: {
|
|
40
|
-
[key in keyof ServiceClients]?:
|
|
43
|
+
[key in keyof ServiceClients]?: ConstructorParameters<ServiceClients[key]>[0];
|
|
41
44
|
};
|
|
42
45
|
getTokenFn?: TokenFunction;
|
|
43
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MA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ACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;KAC7B,GAAG,IAAI,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE;SACP,GAAG,IAAI,MAAM,cAAc,CAAC,CAAC,EAAE,qBAAqB,CACnD,cAAc,CAAC,GAAG,CAAC,CACpB,CAAC,CAAC,CAAC;KACL,CAAC;IACF,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,kBAAkB;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IACpE,cAAc,EAAE,MAAM,CAAC;CACxB"}
|
package/dist/types/index.js
CHANGED
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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":"AAOA,MAAM,CAAC,MAAM,SAAS,GAAG,WAAoB,CAAC;AAC9C,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.9",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -8,9 +8,15 @@
|
|
|
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"
|
|
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"
|
|
12
17
|
},
|
|
13
18
|
"dependencies": {
|
|
19
|
+
"@ogcio/analytics-sdk": "0.0.1-beta.1",
|
|
14
20
|
"@sinclair/typebox": "^0.33.15",
|
|
15
21
|
"commander": "^12.1.0",
|
|
16
22
|
"http-errors": "^2.0.0",
|
package/src/client/auth/index.ts
CHANGED
|
@@ -89,7 +89,9 @@ const importUserScopes = async () => {
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
const getM2MTokenFn = (
|
|
92
|
+
export const getM2MTokenFn = (
|
|
93
|
+
m2mTokenConfig: M2MTokenFnConfig,
|
|
94
|
+
): TokenFunction => {
|
|
93
95
|
const { services } = m2mTokenConfig;
|
|
94
96
|
|
|
95
97
|
const tokenFn = (serviceName: SERVICE_NAME) => {
|
|
@@ -127,5 +129,3 @@ const getM2MTokenFn = (m2mTokenConfig: M2MTokenFnConfig): TokenFunction => {
|
|
|
127
129
|
};
|
|
128
130
|
return tokenFn;
|
|
129
131
|
};
|
|
130
|
-
|
|
131
|
-
export default getM2MTokenFn;
|
|
@@ -3,7 +3,7 @@ import createClient, {
|
|
|
3
3
|
type FetchResponse,
|
|
4
4
|
} from "openapi-fetch";
|
|
5
5
|
import type {
|
|
6
|
-
|
|
6
|
+
BaseApiClientParams,
|
|
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 }: BaseApiClientParams) {
|
|
23
23
|
this.initialized = false;
|
|
24
24
|
if (baseUrl) {
|
|
25
25
|
this.baseUrl = baseUrl;
|
|
@@ -48,6 +48,10 @@ abstract class BaseClient<T extends {}> {
|
|
|
48
48
|
this.client.use(authMiddleware);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
public deleteToken() {
|
|
52
|
+
this.token = undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
protected async getToken() {
|
|
52
56
|
if (this.getTokenFn) {
|
|
53
57
|
const token = await this.getTokenFn(this.serviceName as SERVICE_NAME);
|
|
@@ -61,7 +65,8 @@ abstract class BaseClient<T extends {}> {
|
|
|
61
65
|
return this.initialized;
|
|
62
66
|
}
|
|
63
67
|
|
|
64
|
-
|
|
68
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
69
|
+
protected formatResponse<G extends Record<string | number, any>, O>(
|
|
65
70
|
response: FetchResponse<G, O, "application/json">,
|
|
66
71
|
): DataResponseValue<G, O> {
|
|
67
72
|
let outputData = undefined;
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import type { paths } from "./schema.js";
|
|
11
11
|
|
|
12
12
|
class Messaging extends BaseClient<paths> {
|
|
13
|
-
declare client: ReturnType<typeof createClient<paths>>;
|
|
13
|
+
protected 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
|
-
declare client: ReturnType<typeof createClient<paths>>;
|
|
7
|
+
protected declare client: ReturnType<typeof createClient<paths>>;
|
|
8
8
|
protected serviceName = PAYMENTS;
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -344,6 +344,23 @@ class Payments extends BaseClient<paths> {
|
|
|
344
344
|
(reason) => this.formatError(reason),
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
|
+
|
|
348
|
+
async getRedirectToken(
|
|
349
|
+
transactionId: paths["/api/v1/transactions/{transactionId}/token"]["get"]["parameters"]["path"]["transactionId"],
|
|
350
|
+
) {
|
|
351
|
+
return this.client
|
|
352
|
+
.GET("/api/v1/transactions/{transactionId}/token", {
|
|
353
|
+
params: {
|
|
354
|
+
path: {
|
|
355
|
+
transactionId,
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
})
|
|
359
|
+
.then(
|
|
360
|
+
(response) => this.formatResponse(response),
|
|
361
|
+
(reason) => this.formatError(reason),
|
|
362
|
+
);
|
|
363
|
+
}
|
|
347
364
|
}
|
|
348
365
|
|
|
349
366
|
export default Payments;
|
|
@@ -4,7 +4,7 @@ import BaseClient from "../../base-client.js";
|
|
|
4
4
|
import type { paths } from "./schema.js";
|
|
5
5
|
|
|
6
6
|
class Profile extends BaseClient<paths> {
|
|
7
|
-
declare client: ReturnType<typeof createClient<paths>>;
|
|
7
|
+
protected declare client: ReturnType<typeof createClient<paths>>;
|
|
8
8
|
protected serviceName = PROFILE;
|
|
9
9
|
|
|
10
10
|
async getAddresses() {
|
|
@@ -4,7 +4,7 @@ import BaseClient from "../../base-client.js";
|
|
|
4
4
|
import type { paths } from "./schema.js";
|
|
5
5
|
|
|
6
6
|
class Scheduler extends BaseClient<paths> {
|
|
7
|
-
declare client: ReturnType<typeof createClient<paths>>;
|
|
7
|
+
protected declare client: ReturnType<typeof createClient<paths>>;
|
|
8
8
|
protected serviceName = SCHEDULER;
|
|
9
9
|
|
|
10
10
|
async scheduleTasks(
|
|
@@ -4,15 +4,22 @@ import BaseClient from "../../base-client.js";
|
|
|
4
4
|
import type { paths } from "./schema.js";
|
|
5
5
|
|
|
6
6
|
class Upload extends BaseClient<paths> {
|
|
7
|
-
declare client: ReturnType<typeof createClient<paths>>;
|
|
7
|
+
protected declare client: ReturnType<typeof createClient<paths>>;
|
|
8
8
|
protected serviceName = UPLOAD;
|
|
9
9
|
|
|
10
|
-
getFilesMetadata(
|
|
10
|
+
getFilesMetadata({
|
|
11
|
+
organizationId,
|
|
12
|
+
userId,
|
|
13
|
+
}: {
|
|
14
|
+
organizationId?: string;
|
|
15
|
+
userId?: string;
|
|
16
|
+
}) {
|
|
11
17
|
return this.client
|
|
12
18
|
.GET("/api/v1/metadata/", {
|
|
13
19
|
params: {
|
|
14
20
|
query: {
|
|
15
21
|
organizationId,
|
|
22
|
+
userId,
|
|
16
23
|
},
|
|
17
24
|
},
|
|
18
25
|
})
|
|
@@ -22,28 +29,6 @@ class Upload extends BaseClient<paths> {
|
|
|
22
29
|
);
|
|
23
30
|
}
|
|
24
31
|
|
|
25
|
-
shareFile(fileId: string, userId: string) {
|
|
26
|
-
return this.client
|
|
27
|
-
.POST("/api/v1/permissions/", {
|
|
28
|
-
body: { fileId, userId },
|
|
29
|
-
})
|
|
30
|
-
.then(
|
|
31
|
-
(response) => this.formatResponse(response),
|
|
32
|
-
(reason) => this.formatError(reason),
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
removeFileSharing(fileId: string, userId: string) {
|
|
37
|
-
return this.client
|
|
38
|
-
.DELETE("/api/v1/permissions/", {
|
|
39
|
-
body: { fileId, userId },
|
|
40
|
-
})
|
|
41
|
-
.then(
|
|
42
|
-
(response) => this.formatResponse(response),
|
|
43
|
-
(reason) => this.formatError(reason),
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
32
|
async getFile(id: string) {
|
|
48
33
|
try {
|
|
49
34
|
const {
|
|
@@ -104,6 +89,43 @@ class Upload extends BaseClient<paths> {
|
|
|
104
89
|
);
|
|
105
90
|
}
|
|
106
91
|
|
|
92
|
+
getFileSharings(id: string) {
|
|
93
|
+
return this.client
|
|
94
|
+
.GET("/api/v1/permissions/", {
|
|
95
|
+
params: {
|
|
96
|
+
query: {
|
|
97
|
+
fileId: id,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
})
|
|
101
|
+
.then(
|
|
102
|
+
(response) => this.formatResponse(response),
|
|
103
|
+
(reason) => this.formatError(reason),
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
shareFile(fileId: string, userId: string) {
|
|
108
|
+
return this.client
|
|
109
|
+
.POST("/api/v1/permissions/", {
|
|
110
|
+
body: { fileId, userId },
|
|
111
|
+
})
|
|
112
|
+
.then(
|
|
113
|
+
(response) => this.formatResponse(response),
|
|
114
|
+
(reason) => this.formatError(reason),
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
removeFileSharing(fileId: string, userId: string) {
|
|
119
|
+
return this.client
|
|
120
|
+
.DELETE("/api/v1/permissions/", {
|
|
121
|
+
body: { fileId, userId },
|
|
122
|
+
})
|
|
123
|
+
.then(
|
|
124
|
+
(response) => this.formatResponse(response),
|
|
125
|
+
(reason) => this.formatError(reason),
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
107
129
|
async uploadFile(file: File, expirationDate?: string) {
|
|
108
130
|
const { error } = await this.client.POST("/api/v1/files/", {
|
|
109
131
|
body: {
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"buildingBlocks": [
|
|
3
|
+
{
|
|
4
|
+
"name": "analytics",
|
|
5
|
+
"openApiDefinitionUrl": "",
|
|
6
|
+
"openApiDefinitionFormat": "yaml",
|
|
7
|
+
"updateDefinitions": false,
|
|
8
|
+
"citizenPermissions": [],
|
|
9
|
+
"publicServantPermissions": []
|
|
10
|
+
},
|
|
3
11
|
{
|
|
4
12
|
"name": "messaging",
|
|
5
13
|
"openApiDefinitionUrl": "https://raw.githubusercontent.com/ogcio/life-events/refs/heads/dev/apps/messaging-api/openapi-definition.yml",
|
package/src/index.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import { Analytics } from "@ogcio/analytics-sdk";
|
|
2
|
+
|
|
1
3
|
import Messaging from "./client/clients/messaging/index.js";
|
|
2
4
|
import Payments from "./client/clients/payments/index.js";
|
|
3
5
|
import Profile from "./client/clients/profile/index.js";
|
|
4
6
|
import Scheduler from "./client/clients/scheduler/index.js";
|
|
5
7
|
import Upload from "./client/clients/upload/index.js";
|
|
6
|
-
|
|
7
8
|
export type { BuildingBlocksSDK } from "./types/index.js";
|
|
8
|
-
export {
|
|
9
|
+
export { getM2MTokenFn } from "./client/auth/index.js";
|
|
9
10
|
|
|
10
11
|
import type {
|
|
11
12
|
BuildingBlockSDKParams,
|
|
12
13
|
BuildingBlocksSDK,
|
|
14
|
+
TokenFunction,
|
|
13
15
|
} from "./types/index.js";
|
|
14
16
|
|
|
15
17
|
const getBuildingBlockSDK = (
|
|
@@ -17,6 +19,10 @@ const getBuildingBlockSDK = (
|
|
|
17
19
|
): BuildingBlocksSDK => {
|
|
18
20
|
const { services, getTokenFn } = params;
|
|
19
21
|
return {
|
|
22
|
+
analytics: new Analytics({
|
|
23
|
+
...services.analytics,
|
|
24
|
+
getTokenFn,
|
|
25
|
+
}),
|
|
20
26
|
messaging: new Messaging({
|
|
21
27
|
...services.messaging,
|
|
22
28
|
getTokenFn,
|
|
@@ -26,7 +32,7 @@ const getBuildingBlockSDK = (
|
|
|
26
32
|
getTokenFn,
|
|
27
33
|
}),
|
|
28
34
|
profile: new Profile({
|
|
29
|
-
...services.
|
|
35
|
+
...services.profile,
|
|
30
36
|
getTokenFn,
|
|
31
37
|
}),
|
|
32
38
|
scheduler: new Scheduler({
|
package/src/types/index.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { Analytics } from "@ogcio/analytics-sdk";
|
|
1
2
|
import type Messaging from "../client/clients/messaging/index.js";
|
|
2
3
|
import type Payments from "../client/clients/payments/index.js";
|
|
3
4
|
import type Profile from "../client/clients/profile/index.js";
|
|
4
5
|
import type Scheduler from "../client/clients/scheduler/index.js";
|
|
5
6
|
import type Upload from "../client/clients/upload/index.js";
|
|
6
7
|
|
|
8
|
+
export const ANALYTICS = "analytics" as const;
|
|
7
9
|
export const MESSAGING = "messaging" as const;
|
|
8
10
|
export const PAYMENTS = "payments" as const;
|
|
9
11
|
export const PROFILE = "profile" as const;
|
|
@@ -11,6 +13,7 @@ export const SCHEDULER = "scheduler" as const;
|
|
|
11
13
|
export const UPLOAD = "upload" as const;
|
|
12
14
|
|
|
13
15
|
export type SERVICE_NAME =
|
|
16
|
+
| typeof ANALYTICS
|
|
14
17
|
| typeof MESSAGING
|
|
15
18
|
| typeof PAYMENTS
|
|
16
19
|
| typeof PROFILE
|
|
@@ -36,25 +39,28 @@ export type SDKClientParams = {
|
|
|
36
39
|
baseUrl?: string;
|
|
37
40
|
};
|
|
38
41
|
|
|
39
|
-
export type
|
|
42
|
+
export type BaseApiClientParams = SDKClientParams & {
|
|
40
43
|
getTokenFn?: TokenFunction;
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
type ServiceClients = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
analytics: typeof Analytics;
|
|
48
|
+
messaging: typeof Messaging;
|
|
49
|
+
payments: typeof Payments;
|
|
50
|
+
profile: typeof Profile;
|
|
51
|
+
scheduler: typeof Scheduler;
|
|
52
|
+
upload: typeof Upload;
|
|
49
53
|
};
|
|
50
54
|
|
|
51
55
|
export type BuildingBlocksSDK = {
|
|
52
|
-
[key in keyof ServiceClients]: ServiceClients[key]
|
|
56
|
+
[key in keyof ServiceClients]: InstanceType<ServiceClients[key]>;
|
|
53
57
|
};
|
|
54
58
|
|
|
55
59
|
export type BuildingBlockSDKParams = {
|
|
56
60
|
services: {
|
|
57
|
-
[key in keyof ServiceClients]?:
|
|
61
|
+
[key in keyof ServiceClients]?: ConstructorParameters<
|
|
62
|
+
ServiceClients[key]
|
|
63
|
+
>[0];
|
|
58
64
|
};
|
|
59
65
|
getTokenFn?: TokenFunction;
|
|
60
66
|
};
|