@reactionary/magento 0.12.3 → 0.12.5
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.
|
@@ -16,7 +16,14 @@ import {
|
|
|
16
16
|
IdentityMutationRegisterSchema,
|
|
17
17
|
IdentityMutationLoginSchema,
|
|
18
18
|
IdentityMutationLogoutSchema,
|
|
19
|
-
success
|
|
19
|
+
success,
|
|
20
|
+
ExternalLoginRedirectSchema,
|
|
21
|
+
IdentityMutationCompleteExternalLoginSchema,
|
|
22
|
+
IdentityMutationStartExternalLoginSchema,
|
|
23
|
+
IdentityProviderSchema,
|
|
24
|
+
IdentityQueryProvidersSchema,
|
|
25
|
+
PASSWORD_IDENTITY_PROVIDER,
|
|
26
|
+
error
|
|
20
27
|
} from "@reactionary/core";
|
|
21
28
|
import createDebug from "debug";
|
|
22
29
|
const debug = createDebug("reactionary:magento:identity");
|
|
@@ -92,6 +99,15 @@ class MagentoIdentityCapability extends IdentityCapability {
|
|
|
92
99
|
password: payload.password
|
|
93
100
|
});
|
|
94
101
|
}
|
|
102
|
+
async listProviders(_payload) {
|
|
103
|
+
return success([PASSWORD_IDENTITY_PROVIDER]);
|
|
104
|
+
}
|
|
105
|
+
async startExternalLogin(_payload) {
|
|
106
|
+
return error({ type: "InvalidInput", error: "External login is not supported by Magento" });
|
|
107
|
+
}
|
|
108
|
+
async completeExternalLogin(_payload) {
|
|
109
|
+
return error({ type: "InvalidInput", error: "External login is not supported by Magento" });
|
|
110
|
+
}
|
|
95
111
|
}
|
|
96
112
|
__decorateClass([
|
|
97
113
|
Reactionary({
|
|
@@ -117,6 +133,24 @@ __decorateClass([
|
|
|
117
133
|
outputSchema: IdentitySchema
|
|
118
134
|
})
|
|
119
135
|
], MagentoIdentityCapability.prototype, "register", 1);
|
|
136
|
+
__decorateClass([
|
|
137
|
+
Reactionary({
|
|
138
|
+
inputSchema: IdentityQueryProvidersSchema,
|
|
139
|
+
outputSchema: IdentityProviderSchema.array()
|
|
140
|
+
})
|
|
141
|
+
], MagentoIdentityCapability.prototype, "listProviders", 1);
|
|
142
|
+
__decorateClass([
|
|
143
|
+
Reactionary({
|
|
144
|
+
inputSchema: IdentityMutationStartExternalLoginSchema,
|
|
145
|
+
outputSchema: ExternalLoginRedirectSchema
|
|
146
|
+
})
|
|
147
|
+
], MagentoIdentityCapability.prototype, "startExternalLogin", 1);
|
|
148
|
+
__decorateClass([
|
|
149
|
+
Reactionary({
|
|
150
|
+
inputSchema: IdentityMutationCompleteExternalLoginSchema,
|
|
151
|
+
outputSchema: IdentitySchema
|
|
152
|
+
})
|
|
153
|
+
], MagentoIdentityCapability.prototype, "completeExternalLogin", 1);
|
|
120
154
|
export {
|
|
121
155
|
MagentoIdentityCapability
|
|
122
156
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactionary/magento",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "git+https://github.com/Solteq/reactionary.git"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@reactionary/core": "0.12.
|
|
12
|
+
"@reactionary/core": "0.12.5",
|
|
13
13
|
"zod": "4.1.9",
|
|
14
14
|
"debug": "^4.4.3"
|
|
15
15
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Identity, type IdentityMutationLogin, type IdentityMutationLogout, type IdentityMutationRegister, type IdentityQuerySelf, type RequestContext, type Cache, IdentityCapability, type AnonymousIdentity, type Result } from '@reactionary/core';
|
|
1
|
+
import { type Identity, type IdentityMutationLogin, type IdentityMutationLogout, type IdentityMutationRegister, type IdentityQuerySelf, type RequestContext, type Cache, IdentityCapability, type AnonymousIdentity, type Result, type ExternalLoginRedirect, type IdentityConflictError, type IdentityMutationCompleteExternalLogin, type IdentityMutationStartExternalLogin, type IdentityProvider, type IdentityQueryProviders } from '@reactionary/core';
|
|
2
2
|
import type { MagentoClient } from '../core/client.js';
|
|
3
3
|
import type { MagentoConfiguration } from '../schema/configuration.schema.js';
|
|
4
4
|
export declare class MagentoIdentityCapability extends IdentityCapability {
|
|
@@ -10,4 +10,7 @@ export declare class MagentoIdentityCapability extends IdentityCapability {
|
|
|
10
10
|
login(payload: IdentityMutationLogin): Promise<Result<Identity>>;
|
|
11
11
|
logout(_payload: IdentityMutationLogout): Promise<Result<Identity>>;
|
|
12
12
|
register(payload: IdentityMutationRegister): Promise<Result<Identity>>;
|
|
13
|
+
listProviders(_payload: IdentityQueryProviders): Promise<Result<IdentityProvider[]>>;
|
|
14
|
+
startExternalLogin(_payload: IdentityMutationStartExternalLogin): Promise<Result<ExternalLoginRedirect>>;
|
|
15
|
+
completeExternalLogin(_payload: IdentityMutationCompleteExternalLogin): Promise<Result<Identity, IdentityConflictError>>;
|
|
13
16
|
}
|