@onereach/idw-init-account-resources 0.19.4 → 0.19.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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +6 -0
- package/dist/assets/db_migrations/20251218101200-add-new-settings-to-kv.js +91 -0
- package/dist/assets/db_migrations/20251218101200-add-new-settings-to-kv.js.map +1 -0
- package/package.json +1 -1
- package/src/assets/db_migrations/20251218101200-add-new-settings-to-kv.ts +44 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
WARN Issue while reading "/builds/onereach/platform/idw/idw-template/.npmrc". Failed to replace env in config: ${OR_NPM_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @onereach/idw-init-account-resources@0.19.
|
|
3
|
+
> @onereach/idw-init-account-resources@0.19.4 build /builds/onereach/platform/idw/idw-template/packages/level-system/idw-init-account-resources
|
|
4
4
|
> rimraf dist && tsc -b && mkdir dist/assets/skills/documentation && cp -r src/assets/skills/documentation/* dist/assets/skills/documentation
|
|
5
5
|
|
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
var key_value_storage_1 = require("@or-sdk/key-value-storage");
|
|
51
|
+
module.exports = {
|
|
52
|
+
up: function (queryInterface) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
+
var keyValueStorage, settings, updated;
|
|
55
|
+
var _a, _b;
|
|
56
|
+
return __generator(this, function (_c) {
|
|
57
|
+
switch (_c.label) {
|
|
58
|
+
case 0:
|
|
59
|
+
keyValueStorage = new key_value_storage_1.KeyValueStorage({
|
|
60
|
+
discoveryUrl: queryInterface.context.discoveryUrl,
|
|
61
|
+
token: queryInterface.context._orToken,
|
|
62
|
+
});
|
|
63
|
+
return [4, keyValueStorage.getValueByKey('idw-settings', 'all')];
|
|
64
|
+
case 1:
|
|
65
|
+
settings = (_c.sent()).value;
|
|
66
|
+
updated = __assign(__assign({}, settings), { instruction: settings.description, signup: {
|
|
67
|
+
header: ((_a = settings === null || settings === void 0 ? void 0 : settings.signup) === null || _a === void 0 ? void 0 : _a.header) || 'Hello!',
|
|
68
|
+
description: ((_b = settings === null || settings === void 0 ? void 0 : settings.signup) === null || _b === void 0 ? void 0 : _b.description) || 'Let\'s create your account.',
|
|
69
|
+
}, welcomeScreen: {
|
|
70
|
+
title: 'Hi there!',
|
|
71
|
+
description: 'Ask a question or use one of the suggested prompts to get started',
|
|
72
|
+
placeholder: 'Lets get to work! What do you need?',
|
|
73
|
+
suggestions: [
|
|
74
|
+
{
|
|
75
|
+
text: 'How can I add my company\'s knowledge to the IDW?',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
text: 'What are the different ways I can use the IDW?',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
} });
|
|
82
|
+
return [4, keyValueStorage.setValueByKey('idw-settings', 'all', updated)];
|
|
83
|
+
case 2:
|
|
84
|
+
_c.sent();
|
|
85
|
+
return [2];
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=20251218101200-add-new-settings-to-kv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20251218101200-add-new-settings-to-kv.js","sourceRoot":"","sources":["../../../src/assets/db_migrations/20251218101200-add-new-settings-to-kv.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,+DAA4D;AAO5D,MAAM,CAAC,OAAO,GAAG;IACT,EAAE,YAAC,cAAoE;;;;;;;wBACrE,eAAe,GAAG,IAAI,mCAAe,CAAC;4BAC1C,YAAY,EAAE,cAAc,CAAC,OAAO,CAAC,YAAY;4BACjD,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,QAAQ;yBACvC,CAAC,CAAC;wBAGe,WAAM,eAAe,CAAC,aAAa,CAAC,cAAc,EAAE,KAAK,CAAC,EAAA;;wBAAtE,QAAQ,GAAG,CAAC,SAA0D,CAAC,CAAC,KAA4B;wBAEpG,OAAO,yBACR,QAAQ,KACX,WAAW,EAAE,QAAQ,CAAC,WAAW,EACjC,MAAM,EAAE;gCACN,MAAM,EAAE,CAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,0CAAE,MAAM,KAAI,QAAQ;gCAC5C,WAAW,EAAE,CAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,0CAAE,WAAW,KAAI,6BAA6B;6BAC5E,EACD,aAAa,EAAE;gCACb,KAAK,EAAE,WAAW;gCAClB,WAAW,EAAE,mEAAmE;gCAChF,WAAW,EAAE,qCAAqC;gCAClD,WAAW,EAAE;oCACX;wCACE,IAAI,EAAE,mDAAmD;qCAC1D;oCACD;wCACE,IAAI,EAAE,gDAAgD;qCACvD;iCACF;6BACF,GACF,CAAC;wBAEF,WAAM,eAAe,CAAC,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,OAAO,CAAC,EAAA;;wBAAnE,SAAmE,CAAC;;;;;KACrE;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import { KeyValueStorage } from '@or-sdk/key-value-storage';
|
|
4
|
+
import { QueryInterface } from 'sequelize';
|
|
5
|
+
import { MigrationParams } from 'umzug';
|
|
6
|
+
|
|
7
|
+
import { OrMigrationContext } from '../../types';
|
|
8
|
+
|
|
9
|
+
/** @type {import('sequelize-cli').Migration} */
|
|
10
|
+
module.exports = {
|
|
11
|
+
async up(queryInterface: MigrationParams<QueryInterface & OrMigrationContext>) {
|
|
12
|
+
const keyValueStorage = new KeyValueStorage({
|
|
13
|
+
discoveryUrl: queryInterface.context.discoveryUrl,
|
|
14
|
+
token: queryInterface.context._orToken,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line
|
|
18
|
+
const settings = (await keyValueStorage.getValueByKey('idw-settings', 'all')).value as Record<string, any>;
|
|
19
|
+
|
|
20
|
+
const updated = {
|
|
21
|
+
...settings,
|
|
22
|
+
instruction: settings.description,
|
|
23
|
+
signup: {
|
|
24
|
+
header: settings?.signup?.header || 'Hello!',
|
|
25
|
+
description: settings?.signup?.description || 'Let\'s create your account.',
|
|
26
|
+
},
|
|
27
|
+
welcomeScreen: {
|
|
28
|
+
title: 'Hi there!',
|
|
29
|
+
description: 'Ask a question or use one of the suggested prompts to get started',
|
|
30
|
+
placeholder: 'Lets get to work! What do you need?',
|
|
31
|
+
suggestions: [
|
|
32
|
+
{
|
|
33
|
+
text: 'How can I add my company\'s knowledge to the IDW?',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
text: 'What are the different ways I can use the IDW?',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
await keyValueStorage.setValueByKey('idw-settings', 'all', updated);
|
|
43
|
+
},
|
|
44
|
+
};
|