@restorecommerce/facade 0.1.42 → 0.2.1
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/CHANGELOG.md +51 -0
- package/copy-hbs.sh +6 -0
- package/debug-run.ts +2 -1
- package/dist/gql/protos/graphql.d.ts +1 -1
- package/dist/gql/protos/graphql.js +38 -14
- package/dist/gql/protos/registry.d.ts +5 -0
- package/dist/gql/protos/registry.js +73 -12
- package/dist/gql/protos/utils.d.ts +21 -0
- package/dist/gql/protos/utils.js +88 -1
- package/dist/index.d.ts +1 -0
- package/dist/interfaces.d.ts +1 -0
- package/dist/modules/identity/gql/schema.generated.d.ts +26 -20
- package/dist/modules/identity/gql/types.js +2 -1
- package/dist/modules/identity/grpc/index.d.ts +2 -0
- package/dist/modules/identity/grpc/index.js +2 -0
- package/dist/modules/identity/index.js +6 -2
- package/dist/modules/identity/interfaces.d.ts +1 -0
- package/dist/modules/identity/oauth/oauth.d.ts +11 -0
- package/dist/modules/identity/oauth/oauth.js +137 -0
- package/dist/modules/identity/oauth/views/account.hbs +23 -0
- package/dist/modules/identity/oauth/views/layout.hbs +34 -0
- package/dist/modules/identity/oauth/views/login.hbs +27 -0
- package/dist/modules/identity/oauth/views/register.hbs +134 -0
- package/dist/modules/identity/oidc/router.d.ts +2 -2
- package/dist/modules/identity/oidc/router.js +4 -4
- package/dist/modules/identity/oidc/views/consent.hbs +49 -0
- package/dist/modules/identity/oidc/views/layout.hbs +79 -0
- package/dist/modules/identity/oidc/views/login.hbs +62 -0
- package/dist/modules/resource/gql/schema.generated.d.ts +3 -6
- package/package.json +15 -10
@@ -0,0 +1,49 @@
|
|
1
|
+
<style>
|
2
|
+
</style>
|
3
|
+
{{!-- <div class="login-client-image">
|
4
|
+
<% if (client.logoUri) { %><img src="<%= client.logoUri %>"><% } %>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<ul>
|
8
|
+
<% if ([details.scopes.accepted, details.scopes.rejected, details.claims.accepted, details.claims.rejected].every(({ length }) => length === 0)) { %>
|
9
|
+
<li>this is a new authorization</li>
|
10
|
+
<% } %>
|
11
|
+
|
12
|
+
<% if ([details.scopes.new, details.claims.new].every(({ length }) => length === 0)) { %>
|
13
|
+
<li>the client is asking you to confirm previously given authorization</li>
|
14
|
+
<% } %>
|
15
|
+
|
16
|
+
<% newScopes = new Set(details.scopes.new); newScopes.delete('openid'); newScopes.delete('offline_access') %>
|
17
|
+
<% if (newScopes.size) { %>
|
18
|
+
<li>scopes:</li>
|
19
|
+
<ul>
|
20
|
+
<% newScopes.forEach((scope) => { %>
|
21
|
+
<li><%= scope %></li>
|
22
|
+
<% }) %>
|
23
|
+
</ul>
|
24
|
+
<% } %>
|
25
|
+
|
26
|
+
<% newClaims = new Set(details.claims.new); ['sub', 'sid', 'auth_time', 'acr', 'amr', 'iss'].forEach(Set.prototype.delete.bind(newClaims)) %>
|
27
|
+
<% if (newClaims.size) { %>
|
28
|
+
<li>claims:</li>
|
29
|
+
<ul>
|
30
|
+
<% newClaims.forEach((claim) => { %>
|
31
|
+
<li><%= claim %></li>
|
32
|
+
<% }) %>
|
33
|
+
</ul>
|
34
|
+
<% } %>
|
35
|
+
|
36
|
+
<% if (params.scope && params.scope.includes('offline_access')) { %>
|
37
|
+
<li>
|
38
|
+
the client is asking to have offline access to this authorization
|
39
|
+
<% if (!details.scopes.new.includes('offline_access')) { %>
|
40
|
+
(which you've previously granted)
|
41
|
+
<% } %>
|
42
|
+
</li>
|
43
|
+
<% } %>
|
44
|
+
|
45
|
+
</ul>
|
46
|
+
--}}
|
47
|
+
<form autocomplete="off" action="/interaction/{{ uid }}/confirm" method="post">
|
48
|
+
<button autofocus type="submit" class="login login-submit">Continue</button>
|
49
|
+
</form>
|
@@ -0,0 +1,79 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html >
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
6
|
+
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
7
|
+
<title>{{title}}</title>
|
8
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@vcl/vcl@2/dist/index.css">
|
9
|
+
<style>
|
10
|
+
.app {
|
11
|
+
height: 100vh;
|
12
|
+
max-width: 100%;
|
13
|
+
}
|
14
|
+
.debug summary {
|
15
|
+
font-weight: bold;
|
16
|
+
}
|
17
|
+
.debug .debug-content {
|
18
|
+
display: none;
|
19
|
+
}
|
20
|
+
.debug .debug-content.visible {
|
21
|
+
display: block;
|
22
|
+
}
|
23
|
+
</style>
|
24
|
+
</head>
|
25
|
+
<body>
|
26
|
+
<div class="app col">
|
27
|
+
<main class="flex col">
|
28
|
+
<div class="flex">
|
29
|
+
{{{ body }}}
|
30
|
+
</div>
|
31
|
+
{{#if dev }}
|
32
|
+
{{#if dbg }}
|
33
|
+
|
34
|
+
<div class="debug col align-items-center">
|
35
|
+
<summary class="" style="cursor: pointer;">(Click to expand) DEBUG information</summary>
|
36
|
+
<div class="debug-content">
|
37
|
+
<div>
|
38
|
+
<h2>uid</h2>
|
39
|
+
<p>{{ uid }}</p>
|
40
|
+
</div>
|
41
|
+
{{#if dbg.session}}
|
42
|
+
<div>
|
43
|
+
<h3>Session</h3>
|
44
|
+
<p>{{{ json dbg.session }}}</p>
|
45
|
+
</div>
|
46
|
+
{{/if}}
|
47
|
+
|
48
|
+
{{#if dbg.params}}
|
49
|
+
<div>
|
50
|
+
<h3>Params</h3>
|
51
|
+
<p>{{{ json dbg.params }}}</p>
|
52
|
+
</div>
|
53
|
+
{{/if}}
|
54
|
+
{{#if dbg.prompt}}
|
55
|
+
<div>
|
56
|
+
<h3>Prompt</h3>
|
57
|
+
<p>{{{ json dbg.prompt }}}</p>
|
58
|
+
</div>
|
59
|
+
{{/if}}
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
<script>
|
63
|
+
const sumEl = document.querySelector('.debug > summary');
|
64
|
+
const debugContentEl = document.querySelector('.debug-content');
|
65
|
+
sumEl.addEventListener('click', () => {
|
66
|
+
if (debugContentEl.classList.contains('visible')) {
|
67
|
+
debugContentEl.classList.remove('visible');
|
68
|
+
} else {
|
69
|
+
debugContentEl.classList.add('visible');
|
70
|
+
}
|
71
|
+
});
|
72
|
+
</script>
|
73
|
+
{{/if}}
|
74
|
+
{{/if}}
|
75
|
+
</main>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
</body>
|
79
|
+
</html>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<style>
|
2
|
+
.rc-login {
|
3
|
+
height: 100%;
|
4
|
+
background-color: #00adef;
|
5
|
+
}
|
6
|
+
|
7
|
+
.rc-login-form {
|
8
|
+
width: 815px;
|
9
|
+
box-sizing: border-box;
|
10
|
+
border-radius: .3rem;
|
11
|
+
background: #fff;
|
12
|
+
padding: 1rem;
|
13
|
+
}
|
14
|
+
</style>
|
15
|
+
|
16
|
+
<div class="rc-login flex col justify-center">
|
17
|
+
<div class="self-center justify-center rc-login-form scale110p">
|
18
|
+
<h2>{{title}}</h2>
|
19
|
+
<div class="row rc-login-form-inner">
|
20
|
+
<div class="w-45p gutter-margin-t-b">
|
21
|
+
<form class="form m-0 ng-pristine ng-invalid ng-touched" autocomplete="off" action="/interaction/{{ uid}}/login" method="post">
|
22
|
+
<div class="form-control-group embedded-input-field-label">
|
23
|
+
<label for="identifier" class="form-control-label">
|
24
|
+
E-Mail or Username
|
25
|
+
</label>
|
26
|
+
<div class="input-field {{#if error}}error{{/if}}">
|
27
|
+
<input value="testuser" id="identifier" name="identifier" type="text">
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<div class="form-control-group embedded-input-field-label">
|
31
|
+
<label for="password" class="form-control-label">
|
32
|
+
Password
|
33
|
+
</label>
|
34
|
+
<div class="input-field {{#if error}}error{{/if}}">
|
35
|
+
<input value="testpassword" name="password" name="password" type="text">
|
36
|
+
</div>
|
37
|
+
{{#if error}}
|
38
|
+
<div class="form-control-hint error">{{error.message}}</div>
|
39
|
+
{{/if}}
|
40
|
+
</div>
|
41
|
+
<div class="row justify-between">
|
42
|
+
<button type="button" class="button half-transparent"> Forgot your password? </button>
|
43
|
+
<button type="submit" class="button emphasized"> Log in </button>
|
44
|
+
</div>
|
45
|
+
</form>
|
46
|
+
</div>
|
47
|
+
<div class="w-10p divider divider-vertical row center justify-center rc-login-form-divider-v">
|
48
|
+
<div class="divider-rule"></div>
|
49
|
+
<div class="icogram divider-element">
|
50
|
+
<div class="text">or</div>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
<div class="w-45p col justify-center gutter-margin-t-b">
|
54
|
+
<a href="https://todo" class="col justify-center">
|
55
|
+
<button type="button" class="button emphasized">
|
56
|
+
Create an Account
|
57
|
+
</button>
|
58
|
+
</a>
|
59
|
+
</div>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
</div>
|
@@ -442,9 +442,9 @@ export declare type IoRestorecommerceLocationLocation = {
|
|
442
442
|
description?: Maybe<Scalars['String']>;
|
443
443
|
organizationId?: Maybe<Scalars['String']>;
|
444
444
|
parentId?: Maybe<Scalars['String']>;
|
445
|
-
childrenIds?: Maybe<Array<Scalars['String']>>;
|
446
445
|
addressId?: Maybe<Scalars['String']>;
|
447
446
|
data?: Maybe<GoogleProtobufAny>;
|
447
|
+
type?: Maybe<Scalars['String']>;
|
448
448
|
};
|
449
449
|
export declare type GoogleProtobufAny = {
|
450
450
|
__typename?: 'GoogleProtobufAny';
|
@@ -479,7 +479,6 @@ export declare type IoRestorecommerceOrganizationOrganization = {
|
|
479
479
|
meta?: Maybe<IoRestorecommerceMetaMeta>;
|
480
480
|
addressId?: Maybe<Scalars['String']>;
|
481
481
|
parentId?: Maybe<Scalars['String']>;
|
482
|
-
childrenIds?: Maybe<Array<Scalars['String']>>;
|
483
482
|
contactPointIds?: Maybe<Array<Scalars['String']>>;
|
484
483
|
website?: Maybe<Scalars['String']>;
|
485
484
|
email?: Maybe<Scalars['String']>;
|
@@ -860,9 +859,9 @@ export declare type IIoRestorecommerceLocationLocation = {
|
|
860
859
|
description?: Maybe<Scalars['String']>;
|
861
860
|
organizationId?: Maybe<Scalars['String']>;
|
862
861
|
parentId?: Maybe<Scalars['String']>;
|
863
|
-
childrenIds?: Maybe<Array<Scalars['String']>>;
|
864
862
|
addressId?: Maybe<Scalars['String']>;
|
865
863
|
data?: Maybe<IGoogleProtobufAny>;
|
864
|
+
type?: Maybe<Scalars['String']>;
|
866
865
|
};
|
867
866
|
export declare type ResourceOrganizationMutation = {
|
868
867
|
__typename?: 'ResourceOrganizationMutation';
|
@@ -885,7 +884,6 @@ export declare type IIoRestorecommerceOrganizationOrganization = {
|
|
885
884
|
meta?: Maybe<IIoRestorecommerceMetaMeta>;
|
886
885
|
addressId?: Maybe<Scalars['String']>;
|
887
886
|
parentId?: Maybe<Scalars['String']>;
|
888
|
-
childrenIds?: Maybe<Array<Scalars['String']>>;
|
889
887
|
contactPointIds?: Maybe<Array<Scalars['String']>>;
|
890
888
|
website?: Maybe<Scalars['String']>;
|
891
889
|
email?: Maybe<Scalars['String']>;
|
@@ -1636,9 +1634,9 @@ export declare type IoRestorecommerceLocationLocationResolvers<ContextType = Res
|
|
1636
1634
|
description?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
1637
1635
|
organizationId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
1638
1636
|
parentId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
1639
|
-
childrenIds?: Resolver<Maybe<Array<ResolversTypes['String']>>, ParentType, ContextType>;
|
1640
1637
|
addressId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
1641
1638
|
data?: Resolver<Maybe<ResolversTypes['GoogleProtobufAny']>, ParentType, ContextType>;
|
1639
|
+
type?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
1642
1640
|
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
1643
1641
|
}>;
|
1644
1642
|
export declare type GoogleProtobufAnyResolvers<ContextType = ResourceContext, ParentType extends ResolversParentTypes['GoogleProtobufAny'] = ResolversParentTypes['GoogleProtobufAny']> = ResolversObject<{
|
@@ -1673,7 +1671,6 @@ export declare type IoRestorecommerceOrganizationOrganizationResolvers<ContextTy
|
|
1673
1671
|
meta?: Resolver<Maybe<ResolversTypes['IoRestorecommerceMetaMeta']>, ParentType, ContextType>;
|
1674
1672
|
addressId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
1675
1673
|
parentId?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
1676
|
-
childrenIds?: Resolver<Maybe<Array<ResolversTypes['String']>>, ParentType, ContextType>;
|
1677
1674
|
contactPointIds?: Resolver<Maybe<Array<ResolversTypes['String']>>, ParentType, ContextType>;
|
1678
1675
|
website?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
1679
1676
|
email?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@restorecommerce/facade",
|
3
|
-
"version": "0.1
|
3
|
+
"version": "0.2.1",
|
4
4
|
"description": "Facade for Restorecommerce microservices",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"typings": "dist/index.d.ts",
|
@@ -24,13 +24,14 @@
|
|
24
24
|
"@cloudnative/health": "^2.1.2",
|
25
25
|
"@grpc/grpc-js": "^1.2.12",
|
26
26
|
"@grpc/proto-loader": "^0.6.0",
|
27
|
-
"@restorecommerce/grpc-client": "^0.
|
28
|
-
"@restorecommerce/kafka-client": "^0.
|
29
|
-
"@restorecommerce/logger": "^0.
|
30
|
-
"@restorecommerce/rc-grpc-clients": "^0.
|
31
|
-
"@restorecommerce/service-config": "^0.4.
|
27
|
+
"@restorecommerce/grpc-client": "^0.3.1",
|
28
|
+
"@restorecommerce/kafka-client": "^0.3.1",
|
29
|
+
"@restorecommerce/logger": "^0.12.1",
|
30
|
+
"@restorecommerce/rc-grpc-clients": "^0.4.1",
|
31
|
+
"@restorecommerce/service-config": "^0.4.25",
|
32
32
|
"apollo-server-koa": "^2.21.2",
|
33
33
|
"debug": "^4.3.1",
|
34
|
+
"googleapis": "^92.0.0",
|
34
35
|
"handlebars": "^4.7.7",
|
35
36
|
"koa": "^2.13.1",
|
36
37
|
"koa-body": "^4.2.0",
|
@@ -39,6 +40,8 @@
|
|
39
40
|
"koa-router": "^10.0.0",
|
40
41
|
"lodash": "^4.17.21",
|
41
42
|
"lru-cache": "^6.0.0",
|
43
|
+
"node-fetch": "^2.6.7",
|
44
|
+
"oauth": "^0.9.15",
|
42
45
|
"oidc-provider": "^7.2.0",
|
43
46
|
"querystring": "^0.2.1",
|
44
47
|
"request-ip": "^2.1.3",
|
@@ -46,7 +49,7 @@
|
|
46
49
|
"ts-proto-descriptors": "^1.2.0",
|
47
50
|
"useragent": "^2.3.0",
|
48
51
|
"uuid": "^8.3.2",
|
49
|
-
"winston": "^3.
|
52
|
+
"winston": "^3.4.0"
|
50
53
|
},
|
51
54
|
"devDependencies": {
|
52
55
|
"@graphql-codegen/core": "^1.17.9",
|
@@ -63,6 +66,7 @@
|
|
63
66
|
"@types/lodash": "^4.14.177",
|
64
67
|
"@types/lru-cache": "^5.1.0",
|
65
68
|
"@types/node": "^14.14.35",
|
69
|
+
"@types/oauth": "^0.9.1",
|
66
70
|
"@types/oidc-provider": "^7.1.1",
|
67
71
|
"@types/request-ip": "^0.0.35",
|
68
72
|
"@types/supertest": "^2.0.10",
|
@@ -81,7 +85,7 @@
|
|
81
85
|
"typescript": "^4.2.3"
|
82
86
|
},
|
83
87
|
"scripts": {
|
84
|
-
"build": "npm-run-all build:clean generate build:compile build:codegen:clean build:codegen:compile",
|
88
|
+
"build": "npm-run-all build:clean generate build:compile build:codegen:clean build:codegen:compile copyhbs",
|
85
89
|
"build:clean": "rimraf -rf ./dist",
|
86
90
|
"build:compile": "tsc -p tsconfig.lib.json",
|
87
91
|
"build:codegen:clean": "rimraf -rf ./codegen",
|
@@ -93,7 +97,8 @@
|
|
93
97
|
"dev:serve": "TS_NODE_PROJECT=tsconfig.test.json nodemon -e ts,hbs -w ./tests -w ./src -x node --inspect=7000 -r ts-node/register tests/server.ts",
|
94
98
|
"generate": "ts-node --project tsconfig.generate.json -r tsconfig-paths/register generate.ts",
|
95
99
|
"prepublishOnly": "npm run build",
|
96
|
-
"debug-run": "ts-node --project tsconfig.debug.json debug-run.ts"
|
100
|
+
"debug-run": "ts-node --project tsconfig.debug.json debug-run.ts",
|
101
|
+
"copyhbs": "sh copy-hbs.sh"
|
97
102
|
},
|
98
103
|
"engines": {
|
99
104
|
"node": ">= 12.18.0"
|
@@ -101,5 +106,5 @@
|
|
101
106
|
"publishConfig": {
|
102
107
|
"access": "public"
|
103
108
|
},
|
104
|
-
"gitHead": "
|
109
|
+
"gitHead": "e97bbfe2fe8166dfe1cd47ae60bce54347a4f1c9"
|
105
110
|
}
|