@credibledata/cred-cli 0.1.4 → 0.1.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/.prettierignore +2 -1
- package/README.md +0 -2
- package/bun.lock +182 -283
- package/dist/client/api.js +796 -111
- package/dist/client/api.js.map +1 -1
- package/dist/clientconfiguration.js +55 -13
- package/dist/clientconfiguration.js.map +1 -1
- package/dist/clientconfiguration.spec.js +305 -16
- package/dist/clientconfiguration.spec.js.map +1 -1
- package/dist/commands/add.js +6 -3
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/connection/createconnections.js +18 -3
- package/dist/commands/connection/createconnections.js.map +1 -1
- package/dist/commands/connection/createconnections.spec.js +219 -0
- package/dist/commands/connection/createconnections.spec.js.map +1 -0
- package/dist/commands/connection/deleteconnection.spec.js +130 -0
- package/dist/commands/connection/deleteconnection.spec.js.map +1 -0
- package/dist/commands/connection/listconnections.js +9 -3
- package/dist/commands/connection/listconnections.js.map +1 -1
- package/dist/commands/connection/listconnections.spec.js +117 -0
- package/dist/commands/connection/listconnections.spec.js.map +1 -0
- package/dist/commands/group/addmember.js +2 -0
- package/dist/commands/group/addmember.js.map +1 -1
- package/dist/commands/group/addmember.spec.js +148 -0
- package/dist/commands/group/addmember.spec.js.map +1 -0
- package/dist/commands/group/creategroup.spec.js +122 -0
- package/dist/commands/group/creategroup.spec.js.map +1 -0
- package/dist/commands/group/deletegroup.spec.js +104 -0
- package/dist/commands/group/deletegroup.spec.js.map +1 -0
- package/dist/commands/group/getgroup.spec.js +111 -0
- package/dist/commands/group/getgroup.spec.js.map +1 -0
- package/dist/commands/group/listgroups.spec.js +118 -0
- package/dist/commands/group/listgroups.spec.js.map +1 -0
- package/dist/commands/group/removemember.js +1 -0
- package/dist/commands/group/removemember.js.map +1 -1
- package/dist/commands/group/removemember.spec.js +138 -0
- package/dist/commands/group/removemember.spec.js.map +1 -0
- package/dist/commands/groupaccesstoken/createToken.js +6 -2
- package/dist/commands/groupaccesstoken/createToken.js.map +1 -1
- package/dist/commands/groupaccesstoken/createToken.spec.js +127 -0
- package/dist/commands/groupaccesstoken/createToken.spec.js.map +1 -0
- package/dist/commands/groupaccesstoken/deleteToken.js.map +1 -1
- package/dist/commands/groupaccesstoken/deleteToken.spec.js +103 -0
- package/dist/commands/groupaccesstoken/deleteToken.spec.js.map +1 -0
- package/dist/commands/groupaccesstoken/groupContainer.js.map +1 -1
- package/dist/commands/groupaccesstoken/listTokens.js.map +1 -1
- package/dist/commands/groupaccesstoken/listTokens.spec.js +115 -0
- package/dist/commands/groupaccesstoken/listTokens.spec.js.map +1 -0
- package/dist/commands/list.js +10 -3
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/misc/login.js +146 -22
- package/dist/commands/misc/login.js.map +1 -1
- package/dist/commands/misc/login.spec.js +111 -6
- package/dist/commands/misc/login.spec.js.map +1 -1
- package/dist/commands/misc/logout.spec.js +30 -0
- package/dist/commands/misc/logout.spec.js.map +1 -0
- package/dist/commands/misc/loopbackOAuth.js +110 -0
- package/dist/commands/misc/loopbackOAuth.js.map +1 -0
- package/dist/commands/misc/set-access-token.js.map +1 -1
- package/dist/commands/misc/set-access-token.spec.js +65 -0
- package/dist/commands/misc/set-access-token.spec.js.map +1 -0
- package/dist/commands/package/deletepackage.spec.js +136 -0
- package/dist/commands/package/deletepackage.spec.js.map +1 -0
- package/dist/commands/package/listpackages.js +10 -5
- package/dist/commands/package/listpackages.js.map +1 -1
- package/dist/commands/package/listpackages.spec.js +129 -0
- package/dist/commands/package/listpackages.spec.js.map +1 -0
- package/dist/commands/package/publish.js +23 -0
- package/dist/commands/package/publish.js.map +1 -1
- package/dist/commands/package/publish.spec.js +511 -0
- package/dist/commands/package/publish.spec.js.map +1 -0
- package/dist/commands/package/updatepackage.spec.js +50 -0
- package/dist/commands/package/updatepackage.spec.js.map +1 -1
- package/dist/commands/project/createproject.js +11 -1
- package/dist/commands/project/createproject.js.map +1 -1
- package/dist/commands/project/createproject.spec.js +154 -0
- package/dist/commands/project/createproject.spec.js.map +1 -0
- package/dist/commands/project/deleteproject.spec.js +106 -0
- package/dist/commands/project/deleteproject.spec.js.map +1 -0
- package/dist/commands/project/getproject.spec.js +99 -0
- package/dist/commands/project/getproject.spec.js.map +1 -0
- package/dist/commands/project/listprojects.js +13 -7
- package/dist/commands/project/listprojects.js.map +1 -1
- package/dist/commands/project/listprojects.spec.js +111 -0
- package/dist/commands/project/listprojects.spec.js.map +1 -0
- package/dist/commands/project/setproject.spec.js +58 -0
- package/dist/commands/project/setproject.spec.js.map +1 -0
- package/dist/commands/project/updateproject.js +68 -0
- package/dist/commands/project/updateproject.js.map +1 -0
- package/dist/commands/project/updateproject.spec.js +129 -0
- package/dist/commands/project/updateproject.spec.js.map +1 -0
- package/dist/commands/rm.js.map +1 -1
- package/dist/commands/update.js +13 -0
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/version/listversions.spec.js +121 -0
- package/dist/commands/version/listversions.spec.js.map +1 -0
- package/dist/common/UserGroupId.spec.js +92 -0
- package/dist/common/UserGroupId.spec.js.map +1 -0
- package/dist/constants.js +49 -13
- package/dist/constants.js.map +1 -1
- package/dist/index.js +40 -18
- package/dist/index.js.map +1 -1
- package/dist/logger.spec.js +125 -0
- package/dist/logger.spec.js.map +1 -0
- package/dist/polyfills/file.polyfill.js.map +1 -1
- package/dist/utils.js +59 -0
- package/dist/utils.js.map +1 -1
- package/dist/utils.spec.js +158 -0
- package/dist/utils.spec.js.map +1 -0
- package/docker/Dockerfile.ci +11 -3
- package/eslint.config.mjs +45 -0
- package/generate-client.sh +3 -0
- package/package.json +24 -16
- package/src/client/.openapi-generator/FILES +1 -0
- package/src/client/api.ts +1347 -161
- package/src/clientconfiguration.spec.ts +394 -20
- package/src/clientconfiguration.ts +74 -15
- package/src/commands/add.ts +15 -6
- package/src/commands/connection/createconnections.spec.ts +403 -0
- package/src/commands/connection/createconnections.ts +30 -5
- package/src/commands/connection/deleteconnection.spec.ts +189 -0
- package/src/commands/connection/listconnections.spec.ts +132 -0
- package/src/commands/connection/listconnections.ts +22 -3
- package/src/commands/group/addmember.spec.ts +257 -0
- package/src/commands/group/addmember.ts +2 -0
- package/src/commands/group/creategroup.spec.ts +146 -0
- package/src/commands/group/deletegroup.spec.ts +120 -0
- package/src/commands/group/getgroup.spec.ts +129 -0
- package/src/commands/group/listgroups.spec.ts +137 -0
- package/src/commands/group/removemember.spec.ts +224 -0
- package/src/commands/group/removemember.ts +1 -0
- package/src/commands/groupaccesstoken/createToken.spec.ts +211 -0
- package/src/commands/groupaccesstoken/createToken.ts +55 -51
- package/src/commands/groupaccesstoken/deleteToken.spec.ts +147 -0
- package/src/commands/groupaccesstoken/deleteToken.ts +16 -11
- package/src/commands/groupaccesstoken/groupContainer.ts +51 -51
- package/src/commands/groupaccesstoken/listTokens.spec.ts +147 -0
- package/src/commands/groupaccesstoken/listTokens.ts +16 -11
- package/src/commands/list.ts +50 -9
- package/src/commands/misc/login.spec.ts +91 -6
- package/src/commands/misc/login.ts +208 -25
- package/src/commands/misc/logout.spec.ts +32 -0
- package/src/commands/misc/loopbackOAuth.ts +127 -0
- package/src/commands/misc/set-access-token.spec.ts +95 -0
- package/src/commands/misc/set-access-token.ts +16 -16
- package/src/commands/package/deletepackage.spec.ts +164 -0
- package/src/commands/package/listpackages.spec.ts +147 -0
- package/src/commands/package/listpackages.ts +28 -5
- package/src/commands/package/publish.spec.ts +597 -0
- package/src/commands/package/publish.ts +32 -0
- package/src/commands/package/updatepackage.spec.ts +98 -0
- package/src/commands/project/createproject.spec.ts +247 -0
- package/src/commands/project/createproject.ts +12 -1
- package/src/commands/project/deleteproject.spec.ts +123 -0
- package/src/commands/project/getproject.spec.ts +109 -0
- package/src/commands/project/listprojects.spec.ts +121 -0
- package/src/commands/project/listprojects.ts +33 -7
- package/src/commands/project/setproject.spec.ts +63 -0
- package/src/commands/project/updateproject.spec.ts +217 -0
- package/src/commands/project/updateproject.ts +82 -0
- package/src/commands/rm.ts +1 -6
- package/src/commands/update.ts +24 -1
- package/src/commands/version/listversions.spec.ts +138 -0
- package/src/common/UserGroupId.spec.ts +117 -0
- package/src/constants.ts +59 -13
- package/src/index.ts +46 -20
- package/src/logger.spec.ts +158 -0
- package/src/polyfills/file.polyfill.ts +1 -0
- package/src/utils.spec.ts +135 -0
- package/src/utils.ts +81 -0
- package/tsconfig.json +15 -18
- package/.eslintrc +0 -33
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
const axios_1 = __importDefault(require("axios"));
|
|
49
|
+
const chai_1 = require("chai");
|
|
50
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
51
|
+
const sinon_1 = __importDefault(require("sinon"));
|
|
52
|
+
const loggerModule = __importStar(require("./logger"));
|
|
53
|
+
const utils_1 = require("./utils");
|
|
54
|
+
describe("utils", () => {
|
|
55
|
+
let sandbox;
|
|
56
|
+
let loggerStub;
|
|
57
|
+
let logAxiosErrorStub;
|
|
58
|
+
beforeEach(() => {
|
|
59
|
+
sandbox = sinon_1.default.createSandbox();
|
|
60
|
+
loggerStub = sandbox.stub(loggerModule.logger);
|
|
61
|
+
logAxiosErrorStub = sandbox.stub(loggerModule, "logAxiosError");
|
|
62
|
+
});
|
|
63
|
+
afterEach(() => {
|
|
64
|
+
sandbox.restore();
|
|
65
|
+
});
|
|
66
|
+
describe("sleep", () => {
|
|
67
|
+
it("should wait for the specified time", function () {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
this.timeout(100);
|
|
70
|
+
const start = Date.now();
|
|
71
|
+
yield (0, utils_1.sleep)(50);
|
|
72
|
+
const elapsed = Date.now() - start;
|
|
73
|
+
(0, chai_1.expect)(elapsed).to.be.at.least(45);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
describe("prettifyJson", () => {
|
|
78
|
+
it("should format JSON with 2-space indentation", () => {
|
|
79
|
+
const obj = { name: "test", value: 123 };
|
|
80
|
+
const result = (0, utils_1.prettifyJson)(obj);
|
|
81
|
+
(0, chai_1.expect)(result).to.equal('{\n "name": "test",\n "value": 123\n}');
|
|
82
|
+
});
|
|
83
|
+
it("should handle empty objects", () => {
|
|
84
|
+
const result = (0, utils_1.prettifyJson)({});
|
|
85
|
+
(0, chai_1.expect)(result).to.equal("{}");
|
|
86
|
+
});
|
|
87
|
+
it("should handle nested objects", () => {
|
|
88
|
+
const obj = { nested: { key: "value" } };
|
|
89
|
+
const result = (0, utils_1.prettifyJson)(obj);
|
|
90
|
+
(0, chai_1.expect)(result).to.include("nested");
|
|
91
|
+
(0, chai_1.expect)(result).to.include("key");
|
|
92
|
+
(0, chai_1.expect)(result).to.include("value");
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
describe("printOutError", () => {
|
|
96
|
+
it("should handle axios errors", () => {
|
|
97
|
+
const axiosError = {
|
|
98
|
+
isAxiosError: true,
|
|
99
|
+
response: {
|
|
100
|
+
status: 404,
|
|
101
|
+
data: { message: "Not found" },
|
|
102
|
+
},
|
|
103
|
+
config: {},
|
|
104
|
+
name: "AxiosError",
|
|
105
|
+
message: "Request failed",
|
|
106
|
+
};
|
|
107
|
+
sandbox.stub(axios_1.default, "isAxiosError").returns(true);
|
|
108
|
+
(0, utils_1.printOutError)(axiosError, false);
|
|
109
|
+
(0, chai_1.expect)(logAxiosErrorStub.calledOnce).to.be.true;
|
|
110
|
+
(0, chai_1.expect)(logAxiosErrorStub.firstCall.args[0]).to.equal(axiosError);
|
|
111
|
+
(0, chai_1.expect)(logAxiosErrorStub.firstCall.args[1]).to.equal(false);
|
|
112
|
+
});
|
|
113
|
+
it("should handle non-axios errors", () => {
|
|
114
|
+
const error = new Error("Generic error");
|
|
115
|
+
sandbox.stub(axios_1.default, "isAxiosError").returns(false);
|
|
116
|
+
(0, utils_1.printOutError)(error, false);
|
|
117
|
+
(0, chai_1.expect)(loggerStub.error.calledOnce).to.be.true;
|
|
118
|
+
(0, chai_1.expect)(loggerStub.error.calledWith(sinon_1.default.match("Unexpected error"))).to
|
|
119
|
+
.be.true;
|
|
120
|
+
// Check that error was passed as second argument (Winston accepts Error objects)
|
|
121
|
+
const errorCall = loggerStub.error.getCall(0);
|
|
122
|
+
(0, chai_1.expect)(errorCall.args.length).to.be.at.least(2);
|
|
123
|
+
(0, chai_1.expect)(errorCall.args[1]).to.equal(error);
|
|
124
|
+
});
|
|
125
|
+
it("should log debug info when debug is true", () => {
|
|
126
|
+
const error = new Error("Test error");
|
|
127
|
+
sandbox.stub(axios_1.default, "isAxiosError").returns(false);
|
|
128
|
+
(0, utils_1.printOutError)(error, true);
|
|
129
|
+
(0, chai_1.expect)(loggerStub.debug.calledWith(error)).to.be.true;
|
|
130
|
+
});
|
|
131
|
+
it("should not log debug info when debug is false", () => {
|
|
132
|
+
const error = new Error("Test error");
|
|
133
|
+
sandbox.stub(axios_1.default, "isAxiosError").returns(false);
|
|
134
|
+
(0, utils_1.printOutError)(error, false);
|
|
135
|
+
(0, chai_1.expect)(loggerStub.debug.called).to.be.false;
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
describe("getConfirmation", () => {
|
|
139
|
+
it("should return true when user confirms", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
140
|
+
const promptStub = sandbox
|
|
141
|
+
.stub(inquirer_1.default, "prompt")
|
|
142
|
+
.resolves({ confirm: true });
|
|
143
|
+
const result = yield (0, utils_1.getConfirmation)("Are you sure?");
|
|
144
|
+
(0, chai_1.expect)(result).to.be.true;
|
|
145
|
+
(0, chai_1.expect)(promptStub.calledOnce).to.be.true;
|
|
146
|
+
(0, chai_1.expect)(promptStub.firstCall.args[0][0].message).to.equal("Are you sure?");
|
|
147
|
+
}));
|
|
148
|
+
it("should return false when user denies", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
149
|
+
const promptStub = sandbox
|
|
150
|
+
.stub(inquirer_1.default, "prompt")
|
|
151
|
+
.resolves({ confirm: false });
|
|
152
|
+
const result = yield (0, utils_1.getConfirmation)("Are you sure?");
|
|
153
|
+
(0, chai_1.expect)(result).to.be.false;
|
|
154
|
+
(0, chai_1.expect)(promptStub.calledOnce).to.be.true;
|
|
155
|
+
}));
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
//# sourceMappingURL=utils.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.spec.js","sourceRoot":"","sources":["../src/utils.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAC1B,+BAA8B;AAC9B,wDAAgC;AAChC,kDAA0B;AAC1B,uDAAyC;AACzC,mCAA8E;AAE9E,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACpB,IAAI,OAA2B,CAAC;IAChC,IAAI,UAAkE,CAAC;IACvE,IAAI,iBAAkC,CAAC;IAEvC,UAAU,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,eAAK,CAAC,aAAa,EAAE,CAAC;QAChC,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC/C,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACZ,OAAO,CAAC,OA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AAM,GAAG,MAAM,IAAA,uBAAe,EAAC,eAAe,CAAC,CAAC;YAEtD,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;YAC3B,IAAA,aAAM,EAAC,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QAC5C,CAAC,CAAA,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACN,CAAC,CAAC,CAAC"}
|
package/docker/Dockerfile.ci
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
FROM node:20-alpine
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
RUN apk add libc6-compat
|
|
3
|
+
# System dependencies (rarely changes - almost always cached)
|
|
4
|
+
RUN apk add --no-cache bash libc6-compat openjdk21-jre-headless
|
|
5
5
|
|
|
6
6
|
WORKDIR /usr/src/app
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
# Copy dependency files and install (cached unless deps change)
|
|
9
|
+
COPY cli/package.json cli/package-lock.json /usr/src/app/cli/
|
|
8
10
|
WORKDIR /usr/src/app/cli
|
|
11
|
+
RUN npm install
|
|
12
|
+
|
|
13
|
+
# Copy source and APIs (changes per PR but only this layer rebuilds)
|
|
14
|
+
COPY cli /usr/src/app/cli
|
|
15
|
+
COPY apis /usr/src/app/apis
|
|
9
16
|
|
|
17
|
+
WORKDIR /usr/src/app/cli
|
|
10
18
|
CMD [ "tail", "-f", "/dev/null" ]
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import eslint from "@eslint/js";
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
|
+
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
|
|
4
|
+
import globals from "globals";
|
|
5
|
+
import tseslint from "typescript-eslint";
|
|
6
|
+
|
|
7
|
+
export default tseslint.config(
|
|
8
|
+
{
|
|
9
|
+
ignores: [
|
|
10
|
+
"dist/**",
|
|
11
|
+
"node_modules/**",
|
|
12
|
+
// OpenAPI output from ./generate-client.sh — not authored here
|
|
13
|
+
"src/client/**",
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
eslint.configs.recommended,
|
|
17
|
+
...tseslint.configs.recommended,
|
|
18
|
+
{
|
|
19
|
+
files: ["**/*.ts"],
|
|
20
|
+
languageOptions: {
|
|
21
|
+
globals: globals.node,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
eslintPluginPrettierRecommended,
|
|
25
|
+
eslintConfigPrettier,
|
|
26
|
+
{
|
|
27
|
+
rules: {
|
|
28
|
+
"@typescript-eslint/no-unused-expressions": "off",
|
|
29
|
+
"@typescript-eslint/no-unused-vars": [
|
|
30
|
+
"error",
|
|
31
|
+
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
|
32
|
+
],
|
|
33
|
+
"no-constant-condition": "off",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
files: ["**/*.spec.ts", "mocha.setup.ts"],
|
|
38
|
+
rules: {
|
|
39
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
40
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
41
|
+
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
42
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
);
|
package/generate-client.sh
CHANGED
|
@@ -16,6 +16,9 @@ Connection_allOf_snowflakeConnection=ConnectionSnowflakeConnection,\
|
|
|
16
16
|
Connection_allOf_trinoConnection=ConnectionTrinoConnection,\
|
|
17
17
|
Connection_allOf_duckdbConnection=ConnectionDuckdbConnection,\
|
|
18
18
|
Connection_allOf_motherduckConnection=ConnectionMotherduckConnection,\
|
|
19
|
+
Connection_allOf_duckdbConnection_gcsConnection=ConnectionGcsConnection,\
|
|
20
|
+
Connection_allOf_duckdbConnection_s3Connection=ConnectionS3Connection,\
|
|
21
|
+
Connection_allOf_duckdbConnection_attachedDatabases=ConnectionAllOfDuckdbConnectionAttachedDatabases,\
|
|
19
22
|
createOrUpdatePackage_request=CreateOrUpdatePackageRequest,\
|
|
20
23
|
updateWorkspace_request=UpdateWorkspaceRequest,\
|
|
21
24
|
getGroupMembers_200_response=GetGroupMembersResponse,\
|
package/package.json
CHANGED
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@credibledata/cred-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "A cli for Credible's package management.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=20"
|
|
8
|
+
},
|
|
6
9
|
"scripts": {
|
|
7
10
|
"dev": "npm link && npx tsc --watch",
|
|
8
11
|
"test": "mocha --exit",
|
|
9
12
|
"format": "prettier --write src",
|
|
10
|
-
"
|
|
13
|
+
"format:check": "prettier --check src",
|
|
14
|
+
"lint": "eslint . --fix",
|
|
15
|
+
"lint:ci": "eslint . --max-warnings 0",
|
|
16
|
+
"typecheck": "tsc --noEmit",
|
|
17
|
+
"verify": "npm run format:check && npm run lint:ci && npm run typecheck && npm run test",
|
|
11
18
|
"build": "npx tsc",
|
|
12
19
|
"clean": "rimraf -g **/node_modules **/dist",
|
|
13
20
|
"generate-types": "npm run generate-client",
|
|
14
|
-
"install-globally": "npm install --quiet
|
|
21
|
+
"install-globally": "npm install --quiet && npm run generate-types && npm run build && npm -g i . && node dist/index.js --cleanup && node dist/index.js --install",
|
|
15
22
|
"generate-client": "./generate-client.sh"
|
|
16
23
|
},
|
|
17
24
|
"author": "",
|
|
18
25
|
"license": "ISC",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"registry": "https://registry.npmjs.org/"
|
|
29
|
+
},
|
|
19
30
|
"dependencies": {
|
|
20
31
|
"archiver": "^7.0.1",
|
|
21
32
|
"axios": "^1.7.4",
|
|
@@ -23,7 +34,7 @@
|
|
|
23
34
|
"commander": "^12.1.0",
|
|
24
35
|
"figlet": "^1.7.0",
|
|
25
36
|
"formdata-node": "^4.4.1",
|
|
26
|
-
"inquirer": "^
|
|
37
|
+
"inquirer": "^8.2.6",
|
|
27
38
|
"jwt-decode": "^4.0.0",
|
|
28
39
|
"kleur": "^4.1.5",
|
|
29
40
|
"omelette": "^0.4.17",
|
|
@@ -32,36 +43,33 @@
|
|
|
32
43
|
"winston": "^3.17.0"
|
|
33
44
|
},
|
|
34
45
|
"bin": {
|
|
35
|
-
"cred": "
|
|
46
|
+
"cred": "dist/index.js"
|
|
36
47
|
},
|
|
37
48
|
"outDir": "./dist",
|
|
38
49
|
"devDependencies": {
|
|
50
|
+
"@eslint/js": "^9.39.2",
|
|
39
51
|
"@openapitools/openapi-generator-cli": "^2.13.5",
|
|
40
52
|
"@types/archiver": "^6.0.2",
|
|
41
53
|
"@types/chai": "^4.3.5",
|
|
42
54
|
"@types/chai-as-promised": "^7.1.5",
|
|
43
|
-
"@types/chalk": "^2.2.4",
|
|
44
55
|
"@types/figlet": "^1.5.8",
|
|
45
|
-
"@types/inquirer": "^
|
|
56
|
+
"@types/inquirer": "^8.2.10",
|
|
46
57
|
"@types/mocha": "^10.0.1",
|
|
47
58
|
"@types/node": "^20.14.2",
|
|
48
59
|
"@types/omelette": "^0.4.5",
|
|
49
60
|
"@types/sinon": "^17.0.3",
|
|
50
|
-
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
|
51
|
-
"@typescript-eslint/parser": "^8.0.1",
|
|
52
61
|
"chai": "^4.3.7",
|
|
53
62
|
"chai-as-promised": "^7.1.1",
|
|
54
|
-
"eslint": "^
|
|
63
|
+
"eslint": "^9.39.2",
|
|
55
64
|
"eslint-config-prettier": "^9.1.0",
|
|
56
65
|
"eslint-plugin-prettier": "^5.2.1",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"eslint-plugin-storybook": "^0.8.0",
|
|
60
|
-
"mocha": "^10.2.0",
|
|
66
|
+
"globals": "^16.0.0",
|
|
67
|
+
"mocha": "^11.7.5",
|
|
61
68
|
"prettier": "^3.3.3",
|
|
62
69
|
"rimraf": "^5.0.1",
|
|
63
|
-
"sinon": "^
|
|
70
|
+
"sinon": "^21.1.1",
|
|
64
71
|
"ts-node": "^10.9.1",
|
|
65
|
-
"typescript": "^5.4.5"
|
|
72
|
+
"typescript": "^5.4.5",
|
|
73
|
+
"typescript-eslint": "^8.0.1"
|
|
66
74
|
}
|
|
67
75
|
}
|