@paakd/api 0.0.8 → 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/dist/gen/src/proto/auth/v1/authentication_service_paakd.d.ts +106 -0
- package/dist/gen/src/proto/auth/v1/authentication_service_paakd.d.ts.map +1 -0
- package/dist/gen/src/proto/auth/v1/authentication_service_paakd.js +151 -0
- package/dist/gen/src/proto/auth/v1/authentication_service_pb.d.ts +52 -0
- package/dist/gen/src/proto/auth/v1/authentication_service_pb.d.ts.map +1 -0
- package/dist/gen/src/proto/auth/v1/authentication_service_pb.js +22 -0
- package/dist/gen/src/proto/auth/v1/authorization_service_paakd.d.ts +163 -0
- package/dist/gen/src/proto/auth/v1/authorization_service_paakd.d.ts.map +1 -0
- package/dist/gen/src/proto/auth/v1/authorization_service_paakd.js +214 -0
- package/dist/gen/src/proto/auth/v1/{service_pb.d.ts → authorization_service_pb.d.ts} +13 -54
- package/dist/gen/src/proto/auth/v1/authorization_service_pb.d.ts.map +1 -0
- package/dist/gen/src/proto/auth/v1/authorization_service_pb.js +22 -0
- package/dist/gen/src/proto/auth/v1/entities/auth_pb.d.ts +1 -14
- package/dist/gen/src/proto/auth/v1/entities/auth_pb.d.ts.map +1 -1
- package/dist/gen/src/proto/auth/v1/entities/auth_pb.js +1 -1
- package/dist/gen/src/proto/customers/v1/service_paakd.d.ts +183 -0
- package/dist/gen/src/proto/customers/v1/service_paakd.d.ts.map +1 -0
- package/dist/gen/src/proto/customers/v1/service_paakd.js +235 -0
- package/dist/gen/src/proto/files/v1/service_paakd.d.ts +87 -0
- package/dist/gen/src/proto/files/v1/service_paakd.d.ts.map +1 -0
- package/dist/gen/src/proto/files/v1/service_paakd.js +130 -0
- package/dist/gen/src/proto/products/v1/service_paakd.d.ts +722 -0
- package/dist/gen/src/proto/products/v1/service_paakd.d.ts.map +1 -0
- package/dist/gen/src/proto/products/v1/service_paakd.js +823 -0
- package/dist/gen/src/proto/promotions/v1/service_paakd.d.ts +144 -0
- package/dist/gen/src/proto/promotions/v1/service_paakd.d.ts.map +1 -0
- package/dist/gen/src/proto/promotions/v1/service_paakd.js +193 -0
- package/dist/gen/src/proto/promotions/v1/service_pb.js +1 -1
- package/dist/gen/src/proto/stocknodes/v1/service_paakd.d.ts +144 -0
- package/dist/gen/src/proto/stocknodes/v1/service_paakd.d.ts.map +1 -0
- package/dist/gen/src/proto/stocknodes/v1/service_paakd.js +193 -0
- package/dist/src/gen.d.ts +2 -0
- package/dist/src/gen.d.ts.map +1 -0
- package/dist/src/gen.js +72 -0
- package/dist/src/index.d.ts +25 -814
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -35
- package/package.json +9 -6
- package/dist/gen/src/proto/auth/v1/service_pb.d.ts.map +0 -1
- package/dist/gen/src/proto/auth/v1/service_pb.js +0 -22
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { GetConfigProp } from '@paakd/config';
|
|
2
|
+
import { Code } from '@connectrpc/connect';
|
|
3
|
+
import type { LoginRequest, RegisterRequest, TokenRefreshRequest, ValidateOTPRequest, VerifyEmailRequest } from './entities/auth_pb';
|
|
4
|
+
export declare const createAuthenticationServiceAPIClient: ({ conf, headers, jwt, debug, }: {
|
|
5
|
+
conf: GetConfigProp;
|
|
6
|
+
headers?: Record<string, string | null>;
|
|
7
|
+
jwt?: string;
|
|
8
|
+
debug?: boolean;
|
|
9
|
+
}) => Promise<{
|
|
10
|
+
login: ({ $typeName, $unknown, ...payload }: {
|
|
11
|
+
$typeName?: string;
|
|
12
|
+
$unknown?: unknown;
|
|
13
|
+
} & Partial<Omit<LoginRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("./entities/auth_pb").LoginResponse, never> | import("neverthrow").Err<never, {
|
|
14
|
+
readonly reason: {};
|
|
15
|
+
readonly code: Code;
|
|
16
|
+
readonly details: ({
|
|
17
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
18
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
19
|
+
} | {
|
|
20
|
+
type: string;
|
|
21
|
+
value: Uint8Array;
|
|
22
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
23
|
+
})[];
|
|
24
|
+
}> | import("neverthrow").Err<never, {
|
|
25
|
+
readonly reason: "Failed to Login";
|
|
26
|
+
readonly code: Code.Unknown;
|
|
27
|
+
readonly details: readonly [];
|
|
28
|
+
}>>;
|
|
29
|
+
refreshToken: ({ $typeName, $unknown, ...payload }: {
|
|
30
|
+
$typeName?: string;
|
|
31
|
+
$unknown?: unknown;
|
|
32
|
+
} & Partial<Omit<TokenRefreshRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("./entities/auth_pb").LoginResponse, never> | import("neverthrow").Err<never, {
|
|
33
|
+
readonly reason: {};
|
|
34
|
+
readonly code: Code;
|
|
35
|
+
readonly details: ({
|
|
36
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
37
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
38
|
+
} | {
|
|
39
|
+
type: string;
|
|
40
|
+
value: Uint8Array;
|
|
41
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
42
|
+
})[];
|
|
43
|
+
}> | import("neverthrow").Err<never, {
|
|
44
|
+
readonly reason: "Failed to RefreshToken";
|
|
45
|
+
readonly code: Code.Unknown;
|
|
46
|
+
readonly details: readonly [];
|
|
47
|
+
}>>;
|
|
48
|
+
verifyEmail: ({ $typeName, $unknown, ...payload }: {
|
|
49
|
+
$typeName?: string;
|
|
50
|
+
$unknown?: unknown;
|
|
51
|
+
} & Partial<Omit<VerifyEmailRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("./entities/auth_pb").VerifyEmailResponse, never> | import("neverthrow").Err<never, {
|
|
52
|
+
readonly reason: {};
|
|
53
|
+
readonly code: Code;
|
|
54
|
+
readonly details: ({
|
|
55
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
56
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
57
|
+
} | {
|
|
58
|
+
type: string;
|
|
59
|
+
value: Uint8Array;
|
|
60
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
61
|
+
})[];
|
|
62
|
+
}> | import("neverthrow").Err<never, {
|
|
63
|
+
readonly reason: "Failed to VerifyEmail";
|
|
64
|
+
readonly code: Code.Unknown;
|
|
65
|
+
readonly details: readonly [];
|
|
66
|
+
}>>;
|
|
67
|
+
validateOTP: ({ $typeName, $unknown, ...payload }: {
|
|
68
|
+
$typeName?: string;
|
|
69
|
+
$unknown?: unknown;
|
|
70
|
+
} & Partial<Omit<ValidateOTPRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("@bufbuild/protobuf").Message<"ValidateOTPResponse">, never> | import("neverthrow").Err<never, {
|
|
71
|
+
readonly reason: {};
|
|
72
|
+
readonly code: Code;
|
|
73
|
+
readonly details: ({
|
|
74
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
75
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
76
|
+
} | {
|
|
77
|
+
type: string;
|
|
78
|
+
value: Uint8Array;
|
|
79
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
80
|
+
})[];
|
|
81
|
+
}> | import("neverthrow").Err<never, {
|
|
82
|
+
readonly reason: "Failed to ValidateOTP";
|
|
83
|
+
readonly code: Code.Unknown;
|
|
84
|
+
readonly details: readonly [];
|
|
85
|
+
}>>;
|
|
86
|
+
register: ({ $typeName, $unknown, ...payload }: {
|
|
87
|
+
$typeName?: string;
|
|
88
|
+
$unknown?: unknown;
|
|
89
|
+
} & Partial<Omit<RegisterRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("@bufbuild/protobuf").Message<"RegisterResponse">, never> | import("neverthrow").Err<never, {
|
|
90
|
+
readonly reason: {};
|
|
91
|
+
readonly code: Code;
|
|
92
|
+
readonly details: ({
|
|
93
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
94
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
95
|
+
} | {
|
|
96
|
+
type: string;
|
|
97
|
+
value: Uint8Array;
|
|
98
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
99
|
+
})[];
|
|
100
|
+
}> | import("neverthrow").Err<never, {
|
|
101
|
+
readonly reason: "Failed to Register";
|
|
102
|
+
readonly code: Code.Unknown;
|
|
103
|
+
readonly details: readonly [];
|
|
104
|
+
}>>;
|
|
105
|
+
}>;
|
|
106
|
+
//# sourceMappingURL=authentication_service_paakd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication_service_paakd.d.ts","sourceRoot":"","sources":["../../../../../../gen/src/proto/auth/v1/authentication_service_paakd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,eAAe,CAAA;AAQhE,OAAO,EAAE,IAAI,EAA8B,MAAM,qBAAqB,CAAA;AAEtE,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,oBAAoB,CAAA;AAG3B,eAAO,MAAM,oCAAoC,GAAU,gCAKxD;IACD,IAAI,EAAE,aAAa,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAA;IACvC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;iDAgBI;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;wDAsBtD;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;uDAsB7D;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;uDAsB5D;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;oDAsB5D;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;EAyB7D,CAAA"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.createAuthenticationServiceAPIClient = void 0;
|
|
24
|
+
const config_1 = require("@paakd/config");
|
|
25
|
+
const core_1 = require("@paakd/core");
|
|
26
|
+
const connect_node_1 = require("@connectrpc/connect-node");
|
|
27
|
+
const interceptors_1 = require("../../../../../src/interceptors");
|
|
28
|
+
const connect_1 = require("@connectrpc/connect");
|
|
29
|
+
const authentication_service_pb_1 = require("./authentication_service_pb");
|
|
30
|
+
const neverthrow_1 = require("neverthrow");
|
|
31
|
+
const createAuthenticationServiceAPIClient = (_a) => __awaiter(void 0, [_a], void 0, function* ({ conf, headers = {}, jwt = '', debug = false, }) {
|
|
32
|
+
const c = yield (0, config_1.getCheckoutConfig)(conf);
|
|
33
|
+
const h = yield (0, core_1.getRequestHeaders)(conf);
|
|
34
|
+
const t = (0, connect_node_1.createGrpcTransport)({
|
|
35
|
+
baseUrl: c.enterpriseURL,
|
|
36
|
+
interceptors: [
|
|
37
|
+
(0, interceptors_1.createHeadersInterceptor)(Object.assign(Object.assign({}, h), headers)),
|
|
38
|
+
(0, interceptors_1.createAuthenticationInterceptor)(c),
|
|
39
|
+
(0, interceptors_1.createCustomerAuthenticationInterceptor)(jwt, debug),
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
const AuthenticationServicePaakd = (0, connect_1.createClient)(authentication_service_pb_1.AuthenticationService, t);
|
|
43
|
+
const login = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
+
var { $typeName = '', $unknown = '' } = _a, payload = __rest(_a, ["$typeName", "$unknown"]);
|
|
45
|
+
try {
|
|
46
|
+
return (0, neverthrow_1.okAsync)(yield AuthenticationServicePaakd.login(payload));
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
if (error instanceof connect_1.ConnectError) {
|
|
50
|
+
return (0, neverthrow_1.err)({
|
|
51
|
+
reason: error.cause || error.rawMessage,
|
|
52
|
+
code: error.code,
|
|
53
|
+
details: error.details,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return (0, neverthrow_1.err)({
|
|
57
|
+
reason: 'Failed to Login',
|
|
58
|
+
code: connect_1.Code.Unknown,
|
|
59
|
+
details: [],
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const refreshToken = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
+
var { $typeName = '', $unknown = '' } = _a, payload = __rest(_a, ["$typeName", "$unknown"]);
|
|
65
|
+
try {
|
|
66
|
+
return (0, neverthrow_1.okAsync)(yield AuthenticationServicePaakd.refreshToken(payload));
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (error instanceof connect_1.ConnectError) {
|
|
70
|
+
return (0, neverthrow_1.err)({
|
|
71
|
+
reason: error.cause || error.rawMessage,
|
|
72
|
+
code: error.code,
|
|
73
|
+
details: error.details,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return (0, neverthrow_1.err)({
|
|
77
|
+
reason: 'Failed to RefreshToken',
|
|
78
|
+
code: connect_1.Code.Unknown,
|
|
79
|
+
details: [],
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const verifyEmail = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
84
|
+
var { $typeName = '', $unknown = '' } = _a, payload = __rest(_a, ["$typeName", "$unknown"]);
|
|
85
|
+
try {
|
|
86
|
+
return (0, neverthrow_1.okAsync)(yield AuthenticationServicePaakd.verifyEmail(payload));
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (error instanceof connect_1.ConnectError) {
|
|
90
|
+
return (0, neverthrow_1.err)({
|
|
91
|
+
reason: error.cause || error.rawMessage,
|
|
92
|
+
code: error.code,
|
|
93
|
+
details: error.details,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return (0, neverthrow_1.err)({
|
|
97
|
+
reason: 'Failed to VerifyEmail',
|
|
98
|
+
code: connect_1.Code.Unknown,
|
|
99
|
+
details: [],
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
const validateOTP = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
104
|
+
var { $typeName = '', $unknown = '' } = _a, payload = __rest(_a, ["$typeName", "$unknown"]);
|
|
105
|
+
try {
|
|
106
|
+
return (0, neverthrow_1.okAsync)(yield AuthenticationServicePaakd.validateOTP(payload));
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
if (error instanceof connect_1.ConnectError) {
|
|
110
|
+
return (0, neverthrow_1.err)({
|
|
111
|
+
reason: error.cause || error.rawMessage,
|
|
112
|
+
code: error.code,
|
|
113
|
+
details: error.details,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return (0, neverthrow_1.err)({
|
|
117
|
+
reason: 'Failed to ValidateOTP',
|
|
118
|
+
code: connect_1.Code.Unknown,
|
|
119
|
+
details: [],
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
const register = (_a) => __awaiter(void 0, void 0, void 0, function* () {
|
|
124
|
+
var { $typeName = '', $unknown = '' } = _a, payload = __rest(_a, ["$typeName", "$unknown"]);
|
|
125
|
+
try {
|
|
126
|
+
return (0, neverthrow_1.okAsync)(yield AuthenticationServicePaakd.register(payload));
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
if (error instanceof connect_1.ConnectError) {
|
|
130
|
+
return (0, neverthrow_1.err)({
|
|
131
|
+
reason: error.cause || error.rawMessage,
|
|
132
|
+
code: error.code,
|
|
133
|
+
details: error.details,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return (0, neverthrow_1.err)({
|
|
137
|
+
reason: 'Failed to Register',
|
|
138
|
+
code: connect_1.Code.Unknown,
|
|
139
|
+
details: [],
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
return {
|
|
144
|
+
login,
|
|
145
|
+
refreshToken,
|
|
146
|
+
verifyEmail,
|
|
147
|
+
validateOTP,
|
|
148
|
+
register,
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
exports.createAuthenticationServiceAPIClient = createAuthenticationServiceAPIClient;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { GenFile, GenService } from '@bufbuild/protobuf/codegenv2';
|
|
2
|
+
import type { LoginRequestSchema, LoginResponseSchema, RegisterRequestSchema, RegisterResponseSchema, TokenRefreshRequestSchema, ValidateOTPRequestSchema, ValidateOTPResponseSchema, VerifyEmailRequestSchema, VerifyEmailResponseSchema } from './entities/auth_pb';
|
|
3
|
+
/**
|
|
4
|
+
* Describes the file src/proto/auth/v1/authentication_service.proto.
|
|
5
|
+
*/
|
|
6
|
+
export declare const file_src_proto_auth_v1_authentication_service: GenFile;
|
|
7
|
+
/**
|
|
8
|
+
* @generated from service apps.enterprise.interfaces.rpc.auth.v1.AuthenticationService
|
|
9
|
+
*/
|
|
10
|
+
export declare const AuthenticationService: GenService<{
|
|
11
|
+
/**
|
|
12
|
+
* @generated from rpc apps.enterprise.interfaces.rpc.auth.v1.AuthenticationService.Login
|
|
13
|
+
*/
|
|
14
|
+
login: {
|
|
15
|
+
methodKind: 'unary';
|
|
16
|
+
input: typeof LoginRequestSchema;
|
|
17
|
+
output: typeof LoginResponseSchema;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* @generated from rpc apps.enterprise.interfaces.rpc.auth.v1.AuthenticationService.RefreshToken
|
|
21
|
+
*/
|
|
22
|
+
refreshToken: {
|
|
23
|
+
methodKind: 'unary';
|
|
24
|
+
input: typeof TokenRefreshRequestSchema;
|
|
25
|
+
output: typeof LoginResponseSchema;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @generated from rpc apps.enterprise.interfaces.rpc.auth.v1.AuthenticationService.VerifyEmail
|
|
29
|
+
*/
|
|
30
|
+
verifyEmail: {
|
|
31
|
+
methodKind: 'unary';
|
|
32
|
+
input: typeof VerifyEmailRequestSchema;
|
|
33
|
+
output: typeof VerifyEmailResponseSchema;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* @generated from rpc apps.enterprise.interfaces.rpc.auth.v1.AuthenticationService.ValidateOTP
|
|
37
|
+
*/
|
|
38
|
+
validateOTP: {
|
|
39
|
+
methodKind: 'unary';
|
|
40
|
+
input: typeof ValidateOTPRequestSchema;
|
|
41
|
+
output: typeof ValidateOTPResponseSchema;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* @generated from rpc apps.enterprise.interfaces.rpc.auth.v1.AuthenticationService.Register
|
|
45
|
+
*/
|
|
46
|
+
register: {
|
|
47
|
+
methodKind: 'unary';
|
|
48
|
+
input: typeof RegisterRequestSchema;
|
|
49
|
+
output: typeof RegisterResponseSchema;
|
|
50
|
+
};
|
|
51
|
+
}>;
|
|
52
|
+
//# sourceMappingURL=authentication_service_pb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication_service_pb.d.ts","sourceRoot":"","sources":["../../../../../../gen/src/proto/auth/v1/authentication_service_pb.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAGvE,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,oBAAoB,CAAA;AAG3B;;GAEG;AACH,eAAO,MAAM,6CAA6C,EAAE,OAQzD,CAAA;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,UAAU,CAAC;IAC7C;;OAEG;IACH,KAAK,EAAE;QACL,UAAU,EAAE,OAAO,CAAA;QACnB,KAAK,EAAE,OAAO,kBAAkB,CAAA;QAChC,MAAM,EAAE,OAAO,mBAAmB,CAAA;KACnC,CAAA;IACD;;OAEG;IACH,YAAY,EAAE;QACZ,UAAU,EAAE,OAAO,CAAA;QACnB,KAAK,EAAE,OAAO,yBAAyB,CAAA;QACvC,MAAM,EAAE,OAAO,mBAAmB,CAAA;KACnC,CAAA;IACD;;OAEG;IACH,WAAW,EAAE;QACX,UAAU,EAAE,OAAO,CAAA;QACnB,KAAK,EAAE,OAAO,wBAAwB,CAAA;QACtC,MAAM,EAAE,OAAO,yBAAyB,CAAA;KACzC,CAAA;IACD;;OAEG;IACH,WAAW,EAAE;QACX,UAAU,EAAE,OAAO,CAAA;QACnB,KAAK,EAAE,OAAO,wBAAwB,CAAA;QACtC,MAAM,EAAE,OAAO,yBAAyB,CAAA;KACzC,CAAA;IACD;;OAEG;IACH,QAAQ,EAAE;QACR,UAAU,EAAE,OAAO,CAAA;QACnB,KAAK,EAAE,OAAO,qBAAqB,CAAA;QACnC,MAAM,EAAE,OAAO,sBAAsB,CAAA;KACtC,CAAA;CACF,CAA+E,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @generated by protoc-gen-es v2.10.1 with parameter "target=ts"
|
|
3
|
+
// @generated from file src/proto/auth/v1/authentication_service.proto (package apps.enterprise.interfaces.rpc.auth.v1, syntax proto3)
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AuthenticationService = exports.file_src_proto_auth_v1_authentication_service = void 0;
|
|
7
|
+
const codegenv2_1 = require("@bufbuild/protobuf/codegenv2");
|
|
8
|
+
const policy_pb_1 = require("./entities/policy_pb");
|
|
9
|
+
const auth_pb_1 = require("./entities/auth_pb");
|
|
10
|
+
/**
|
|
11
|
+
* Describes the file src/proto/auth/v1/authentication_service.proto.
|
|
12
|
+
*/
|
|
13
|
+
exports.file_src_proto_auth_v1_authentication_service =
|
|
14
|
+
/*@__PURE__*/
|
|
15
|
+
(0, codegenv2_1.fileDesc)('Ci5zcmMvcHJvdG8vYXV0aC92MS9hdXRoZW50aWNhdGlvbl9zZXJ2aWNlLnByb3RvEiZhcHBzLmVudGVycHJpc2UuaW50ZXJmYWNlcy5ycGMuYXV0aC52MTKkAgoVQXV0aGVudGljYXRpb25TZXJ2aWNlEigKBUxvZ2luEg0uTG9naW5SZXF1ZXN0Gg4uTG9naW5SZXNwb25zZSIAEjYKDFJlZnJlc2hUb2tlbhIULlRva2VuUmVmcmVzaFJlcXVlc3QaDi5Mb2dpblJlc3BvbnNlIgASOgoLVmVyaWZ5RW1haWwSEy5WZXJpZnlFbWFpbFJlcXVlc3QaFC5WZXJpZnlFbWFpbFJlc3BvbnNlIgASOgoLVmFsaWRhdGVPVFASEy5WYWxpZGF0ZU9UUFJlcXVlc3QaFC5WYWxpZGF0ZU9UUFJlc3BvbnNlIgASMQoIUmVnaXN0ZXISEC5SZWdpc3RlclJlcXVlc3QaES5SZWdpc3RlclJlc3BvbnNlIgBCvAIKKmNvbS5hcHBzLmVudGVycHJpc2UuaW50ZXJmYWNlcy5ycGMuYXV0aC52MUIaQXV0aGVudGljYXRpb25TZXJ2aWNlUHJvdG9QAVozcGFha2QuY29tL3BhY2thZ2VzL2FwaS9nZW4vc3JjL3Byb3RvL2F1dGgvdjE7YXV0aHYxogIFQUVJUkGqAiZBcHBzLkVudGVycHJpc2UuSW50ZXJmYWNlcy5ScGMuQXV0aC5WMcoCJkFwcHNcRW50ZXJwcmlzZVxJbnRlcmZhY2VzXFJwY1xBdXRoXFYx4gIyQXBwc1xFbnRlcnByaXNlXEludGVyZmFjZXNcUnBjXEF1dGhcVjFcR1BCTWV0YWRhdGHqAitBcHBzOjpFbnRlcnByaXNlOjpJbnRlcmZhY2VzOjpScGM6OkF1dGg6OlYxYgZwcm90bzM', [
|
|
16
|
+
policy_pb_1.file_src_proto_auth_v1_entities_policy,
|
|
17
|
+
auth_pb_1.file_src_proto_auth_v1_entities_auth,
|
|
18
|
+
]);
|
|
19
|
+
/**
|
|
20
|
+
* @generated from service apps.enterprise.interfaces.rpc.auth.v1.AuthenticationService
|
|
21
|
+
*/
|
|
22
|
+
exports.AuthenticationService = (0, codegenv2_1.serviceDesc)(exports.file_src_proto_auth_v1_authentication_service, 0);
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { GetConfigProp } from '@paakd/config';
|
|
2
|
+
import { Code } from '@connectrpc/connect';
|
|
3
|
+
import type { ChangePoliciesRequest, ChangePolicyRequest, FilteredPolicyRequest, PolicyEmptyRequest, RemoveFilteredPolicyRequest, SavePolicyRequest } from './entities/policy_pb';
|
|
4
|
+
export declare const createAuthorizationServiceAPIClient: ({ conf, headers, jwt, debug, }: {
|
|
5
|
+
conf: GetConfigProp;
|
|
6
|
+
headers?: Record<string, string | null>;
|
|
7
|
+
jwt?: string;
|
|
8
|
+
debug?: boolean;
|
|
9
|
+
}) => Promise<{
|
|
10
|
+
getPolicies: ({ $typeName, $unknown, ...payload }: {
|
|
11
|
+
$typeName?: string;
|
|
12
|
+
$unknown?: unknown;
|
|
13
|
+
} & Partial<Omit<PolicyEmptyRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("./entities/policy_pb").GetPoliciesResponse, never> | import("neverthrow").Err<never, {
|
|
14
|
+
readonly reason: {};
|
|
15
|
+
readonly code: Code;
|
|
16
|
+
readonly details: ({
|
|
17
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
18
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
19
|
+
} | {
|
|
20
|
+
type: string;
|
|
21
|
+
value: Uint8Array;
|
|
22
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
23
|
+
})[];
|
|
24
|
+
}> | import("neverthrow").Err<never, {
|
|
25
|
+
readonly reason: "Failed to GetPolicies";
|
|
26
|
+
readonly code: Code.Unknown;
|
|
27
|
+
readonly details: readonly [];
|
|
28
|
+
}>>;
|
|
29
|
+
savePolicies: ({ $typeName, $unknown, ...payload }: {
|
|
30
|
+
$typeName?: string;
|
|
31
|
+
$unknown?: unknown;
|
|
32
|
+
} & Partial<Omit<SavePolicyRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("@bufbuild/protobuf").Message<"PolicyEmptyResponse">, never> | import("neverthrow").Err<never, {
|
|
33
|
+
readonly reason: {};
|
|
34
|
+
readonly code: Code;
|
|
35
|
+
readonly details: ({
|
|
36
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
37
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
38
|
+
} | {
|
|
39
|
+
type: string;
|
|
40
|
+
value: Uint8Array;
|
|
41
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
42
|
+
})[];
|
|
43
|
+
}> | import("neverthrow").Err<never, {
|
|
44
|
+
readonly reason: "Failed to SavePolicies";
|
|
45
|
+
readonly code: Code.Unknown;
|
|
46
|
+
readonly details: readonly [];
|
|
47
|
+
}>>;
|
|
48
|
+
addPolicy: ({ $typeName, $unknown, ...payload }: {
|
|
49
|
+
$typeName?: string;
|
|
50
|
+
$unknown?: unknown;
|
|
51
|
+
} & Partial<Omit<ChangePolicyRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("@bufbuild/protobuf").Message<"PolicyEmptyResponse">, never> | import("neverthrow").Err<never, {
|
|
52
|
+
readonly reason: {};
|
|
53
|
+
readonly code: Code;
|
|
54
|
+
readonly details: ({
|
|
55
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
56
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
57
|
+
} | {
|
|
58
|
+
type: string;
|
|
59
|
+
value: Uint8Array;
|
|
60
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
61
|
+
})[];
|
|
62
|
+
}> | import("neverthrow").Err<never, {
|
|
63
|
+
readonly reason: "Failed to AddPolicy";
|
|
64
|
+
readonly code: Code.Unknown;
|
|
65
|
+
readonly details: readonly [];
|
|
66
|
+
}>>;
|
|
67
|
+
removePolicy: ({ $typeName, $unknown, ...payload }: {
|
|
68
|
+
$typeName?: string;
|
|
69
|
+
$unknown?: unknown;
|
|
70
|
+
} & Partial<Omit<ChangePolicyRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("@bufbuild/protobuf").Message<"PolicyEmptyResponse">, never> | import("neverthrow").Err<never, {
|
|
71
|
+
readonly reason: {};
|
|
72
|
+
readonly code: Code;
|
|
73
|
+
readonly details: ({
|
|
74
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
75
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
76
|
+
} | {
|
|
77
|
+
type: string;
|
|
78
|
+
value: Uint8Array;
|
|
79
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
80
|
+
})[];
|
|
81
|
+
}> | import("neverthrow").Err<never, {
|
|
82
|
+
readonly reason: "Failed to RemovePolicy";
|
|
83
|
+
readonly code: Code.Unknown;
|
|
84
|
+
readonly details: readonly [];
|
|
85
|
+
}>>;
|
|
86
|
+
addPolicies: ({ $typeName, $unknown, ...payload }: {
|
|
87
|
+
$typeName?: string;
|
|
88
|
+
$unknown?: unknown;
|
|
89
|
+
} & Partial<Omit<ChangePoliciesRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("@bufbuild/protobuf").Message<"PolicyEmptyResponse">, never> | import("neverthrow").Err<never, {
|
|
90
|
+
readonly reason: {};
|
|
91
|
+
readonly code: Code;
|
|
92
|
+
readonly details: ({
|
|
93
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
94
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
95
|
+
} | {
|
|
96
|
+
type: string;
|
|
97
|
+
value: Uint8Array;
|
|
98
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
99
|
+
})[];
|
|
100
|
+
}> | import("neverthrow").Err<never, {
|
|
101
|
+
readonly reason: "Failed to AddPolicies";
|
|
102
|
+
readonly code: Code.Unknown;
|
|
103
|
+
readonly details: readonly [];
|
|
104
|
+
}>>;
|
|
105
|
+
removePolicies: ({ $typeName, $unknown, ...payload }: {
|
|
106
|
+
$typeName?: string;
|
|
107
|
+
$unknown?: unknown;
|
|
108
|
+
} & Partial<Omit<ChangePoliciesRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("@bufbuild/protobuf").Message<"PolicyEmptyResponse">, never> | import("neverthrow").Err<never, {
|
|
109
|
+
readonly reason: {};
|
|
110
|
+
readonly code: Code;
|
|
111
|
+
readonly details: ({
|
|
112
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
113
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
114
|
+
} | {
|
|
115
|
+
type: string;
|
|
116
|
+
value: Uint8Array;
|
|
117
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
118
|
+
})[];
|
|
119
|
+
}> | import("neverthrow").Err<never, {
|
|
120
|
+
readonly reason: "Failed to RemovePolicies";
|
|
121
|
+
readonly code: Code.Unknown;
|
|
122
|
+
readonly details: readonly [];
|
|
123
|
+
}>>;
|
|
124
|
+
getFilteredPolicy: ({ $typeName, $unknown, ...payload }: {
|
|
125
|
+
$typeName?: string;
|
|
126
|
+
$unknown?: unknown;
|
|
127
|
+
} & Partial<Omit<FilteredPolicyRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("./entities/policy_pb").GetPoliciesResponse, never> | import("neverthrow").Err<never, {
|
|
128
|
+
readonly reason: {};
|
|
129
|
+
readonly code: Code;
|
|
130
|
+
readonly details: ({
|
|
131
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
132
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
133
|
+
} | {
|
|
134
|
+
type: string;
|
|
135
|
+
value: Uint8Array;
|
|
136
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
137
|
+
})[];
|
|
138
|
+
}> | import("neverthrow").Err<never, {
|
|
139
|
+
readonly reason: "Failed to GetFilteredPolicy";
|
|
140
|
+
readonly code: Code.Unknown;
|
|
141
|
+
readonly details: readonly [];
|
|
142
|
+
}>>;
|
|
143
|
+
removeFilteredPolicy: ({ $typeName, $unknown, ...payload }: {
|
|
144
|
+
$typeName?: string;
|
|
145
|
+
$unknown?: unknown;
|
|
146
|
+
} & Partial<Omit<RemoveFilteredPolicyRequest, "$typeName" | "$unknown">>) => Promise<import("neverthrow").Result<import("@bufbuild/protobuf").Message<"PolicyEmptyResponse">, never> | import("neverthrow").Err<never, {
|
|
147
|
+
readonly reason: {};
|
|
148
|
+
readonly code: Code;
|
|
149
|
+
readonly details: ({
|
|
150
|
+
desc: import("@bufbuild/protobuf").DescMessage;
|
|
151
|
+
value: import("@bufbuild/protobuf").MessageInitShape<import("@bufbuild/protobuf").DescMessage>;
|
|
152
|
+
} | {
|
|
153
|
+
type: string;
|
|
154
|
+
value: Uint8Array;
|
|
155
|
+
debug?: import("@bufbuild/protobuf").JsonValue;
|
|
156
|
+
})[];
|
|
157
|
+
}> | import("neverthrow").Err<never, {
|
|
158
|
+
readonly reason: "Failed to RemoveFilteredPolicy";
|
|
159
|
+
readonly code: Code.Unknown;
|
|
160
|
+
readonly details: readonly [];
|
|
161
|
+
}>>;
|
|
162
|
+
}>;
|
|
163
|
+
//# sourceMappingURL=authorization_service_paakd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization_service_paakd.d.ts","sourceRoot":"","sources":["../../../../../../gen/src/proto/auth/v1/authorization_service_paakd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,eAAe,CAAA;AAQhE,OAAO,EAAE,IAAI,EAA8B,MAAM,qBAAqB,CAAA;AAEtE,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,2BAA2B,EAC3B,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAG7B,eAAO,MAAM,mCAAmC,GAAU,gCAKvD;IACD,IAAI,EAAE,aAAa,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAA;IACvC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;uDAgBI;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;wDAsB5D;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;qDAsB3D;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;wDAsB7D;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;uDAsB7D;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;0DAsB/D;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;6DAsB/D;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;gEAsB/D;QACD,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,GAAG,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;;;;;;;;;;;;;;;;EA8BzE,CAAA"}
|