@chevre/domain 22.10.0 → 22.11.0-alpha.0
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.
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as mongoose from 'mongoose';
|
|
3
|
+
|
|
4
|
+
import { chevre } from '../../../../lib/index';
|
|
5
|
+
|
|
6
|
+
const ADMIN_AUTH_ENDPOINT = process.env.ADMIN_AUTH_ENDPOINT;
|
|
7
|
+
|
|
8
|
+
async function main() {
|
|
9
|
+
if (typeof ADMIN_AUTH_ENDPOINT !== 'string') {
|
|
10
|
+
throw new Error('ADMIN_AUTH_ENDPOINT undfined');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
14
|
+
|
|
15
|
+
const adminIdentityService = await (await (await chevre.loadAdminAuth()).loadChevreAuth({
|
|
16
|
+
endpoint: ADMIN_AUTH_ENDPOINT
|
|
17
|
+
})).createIdentityInstance();
|
|
18
|
+
|
|
19
|
+
const identities = await adminIdentityService.projectIdentityFields(
|
|
20
|
+
{
|
|
21
|
+
about: { id: { $eq: '36jneiog293vb2c7u9e5p4rn7r' } }
|
|
22
|
+
// identifier: { $eq: IDENTIFIER }
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
console.log('docs:', identities);
|
|
26
|
+
console.log(identities.length, 'docs found');
|
|
27
|
+
|
|
28
|
+
const { id } = await adminIdentityService.createIdentity({
|
|
29
|
+
clientId: 'xxx',
|
|
30
|
+
clientSecret: 'xxx',
|
|
31
|
+
iss: ['xxx']
|
|
32
|
+
});
|
|
33
|
+
console.log('saved.', id);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
main()
|
|
37
|
+
.then()
|
|
38
|
+
.catch(console.error);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadChevreAuth = exports.auth = void 0;
|
|
4
|
+
const sdk_1 = require("@cinerino/sdk");
|
|
5
|
+
Object.defineProperty(exports, "auth", { enumerable: true, get: function () { return sdk_1.auth; } });
|
|
6
|
+
Object.defineProperty(exports, "loadChevreAuth", { enumerable: true, get: function () { return sdk_1.loadChevreAuth; } });
|
package/lib/chevre/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type * as COAService from '@motionpicture/coa-service';
|
|
5
5
|
import type * as GMOService from '@motionpicture/gmo-service';
|
|
6
|
+
import type * as AdminAuth from './adminAuth';
|
|
6
7
|
import type * as Pecorinoapi from './pecorinoapi';
|
|
7
8
|
import { credentials } from './credentials';
|
|
8
9
|
import * as errorHandler from './errorHandler';
|
|
@@ -12,6 +13,7 @@ import * as repository from './repository';
|
|
|
12
13
|
import * as service from './service';
|
|
13
14
|
import * as settings from './settings';
|
|
14
15
|
export { credentials, errorHandler, eventEmitter, factory, repository, service, settings };
|
|
16
|
+
export declare function loadAdminAuth(): Promise<typeof AdminAuth>;
|
|
15
17
|
export declare function loadPecorinoapi(): Promise<typeof Pecorinoapi>;
|
|
16
18
|
export type COA = typeof COAService;
|
|
17
19
|
export declare function loadCOA(): Promise<typeof COAService>;
|
package/lib/chevre/index.js
CHANGED
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.settings = exports.service = exports.repository = exports.factory = exports.eventEmitter = exports.errorHandler = exports.credentials = void 0;
|
|
13
|
+
exports.loadAdminAuth = loadAdminAuth;
|
|
13
14
|
exports.loadPecorinoapi = loadPecorinoapi;
|
|
14
15
|
exports.loadCOA = loadCOA;
|
|
15
16
|
exports.loadGMO = loadGMO;
|
|
@@ -27,6 +28,15 @@ const service = require("./service");
|
|
|
27
28
|
exports.service = service;
|
|
28
29
|
const settings = require("./settings");
|
|
29
30
|
exports.settings = settings;
|
|
31
|
+
let adminAuth;
|
|
32
|
+
function loadAdminAuth() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (adminAuth === undefined) {
|
|
35
|
+
adminAuth = yield Promise.resolve().then(() => require('./adminAuth'));
|
|
36
|
+
}
|
|
37
|
+
return adminAuth;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
30
40
|
let pecorinoapi;
|
|
31
41
|
function loadPecorinoapi() {
|
|
32
42
|
return __awaiter(this, void 0, void 0, function* () {
|
package/package.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "4.395.0-alpha.
|
|
15
|
-
"@cinerino/sdk": "
|
|
14
|
+
"@chevre/factory": "4.395.0-alpha.1",
|
|
15
|
+
"@cinerino/sdk": "11.0.0-alpha.1",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.3.0",
|
|
18
18
|
"@sendgrid/client": "8.1.4",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"postversion": "git push origin --tags",
|
|
114
114
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
115
115
|
},
|
|
116
|
-
"version": "22.
|
|
116
|
+
"version": "22.11.0-alpha.0"
|
|
117
117
|
}
|