@or-sdk/library-source 0.1.0-beta.1912.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # @or-sdk/source
2
+
3
+ ## Installation
4
+
5
+ ```bash
6
+ npm i @or-sdk/source
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ ```typescript
12
+ import { Source } from '@or-sdk/library-source'
13
+ import config from '../config';
14
+
15
+ // With direct api url
16
+ const SourceSdk = new Source({
17
+ token: 'my-account-token-string',
18
+ libraryApiUrl: config.LIBRARY_API_URL
19
+ });
20
+
21
+ // With service discovery (slower)
22
+ const SourceSdk = new Source({
23
+ token: 'my-account-token-string',
24
+ discoveryUrl: 'http://example.library/endpoint'
25
+ });
26
+ ```
@@ -0,0 +1,272 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ 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;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ var __rest = (this && this.__rest) || function (s, e) {
54
+ var t = {};
55
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
56
+ t[p] = s[p];
57
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
58
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
59
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
60
+ t[p[i]] = s[p[i]];
61
+ }
62
+ return t;
63
+ };
64
+ Object.defineProperty(exports, "__esModule", { value: true });
65
+ exports.Source = void 0;
66
+ var base_1 = require("@or-sdk/base");
67
+ var constants_1 = require("./constants");
68
+ var Source = (function (_super) {
69
+ __extends(Source, _super);
70
+ function Source(params) {
71
+ var _this = this;
72
+ var token = params.token, discoveryUrl = params.discoveryUrl, packageType = params.packageType, libraryApiUrl = params.libraryApiUrl;
73
+ _this = _super.call(this, {
74
+ discoveryUrl: discoveryUrl,
75
+ token: token,
76
+ serviceKey: constants_1.SERVICE_KEY,
77
+ serviceUrl: libraryApiUrl,
78
+ useDefaultSerializer: false,
79
+ }) || this;
80
+ _this.packageType = packageType;
81
+ return _this;
82
+ }
83
+ Source.prototype.addProject = function (data, _a) {
84
+ var _b = _a === void 0 ? {} : _a, type = _b.type, signal = _b.signal;
85
+ return __awaiter(this, void 0, void 0, function () {
86
+ var packageType;
87
+ return __generator(this, function (_c) {
88
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
89
+ return [2, this.callApi({
90
+ method: 'POST',
91
+ route: "/api/v1/sources/".concat(packageType),
92
+ signal: signal,
93
+ data: data,
94
+ })];
95
+ });
96
+ });
97
+ };
98
+ Source.prototype.getProjects = function (params, _a) {
99
+ if (params === void 0) { params = {}; }
100
+ var _b = _a === void 0 ? {} : _a, type = _b.type, signal = _b.signal;
101
+ return __awaiter(this, void 0, void 0, function () {
102
+ var packageType;
103
+ return __generator(this, function (_c) {
104
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
105
+ return [2, this.callApi({
106
+ method: 'GET',
107
+ route: "/api/v1/sources/".concat(packageType),
108
+ signal: signal,
109
+ params: params,
110
+ })];
111
+ });
112
+ });
113
+ };
114
+ Source.prototype.getProject = function (_a, _b) {
115
+ var id = _a.id;
116
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
117
+ return __awaiter(this, void 0, void 0, function () {
118
+ var packageType;
119
+ return __generator(this, function (_d) {
120
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
121
+ return [2, this.callApi({
122
+ method: 'GET',
123
+ route: "/api/v1/sources/".concat(packageType, "/").concat(id),
124
+ signal: signal,
125
+ })];
126
+ });
127
+ });
128
+ };
129
+ Source.prototype.patchProjectMeta = function (_a, _b) {
130
+ var id = _a.id, data = __rest(_a, ["id"]);
131
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
132
+ return __awaiter(this, void 0, void 0, function () {
133
+ var packageType;
134
+ return __generator(this, function (_d) {
135
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
136
+ return [2, this.callApi({
137
+ method: 'PATCH',
138
+ route: "/api/v1/sources/".concat(packageType, "/").concat(id, "/meta"),
139
+ data: data,
140
+ signal: signal,
141
+ })];
142
+ });
143
+ });
144
+ };
145
+ Source.prototype.deleteProject = function (_a, _b) {
146
+ var id = _a.id;
147
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
148
+ return __awaiter(this, void 0, void 0, function () {
149
+ var packageType;
150
+ return __generator(this, function (_d) {
151
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
152
+ return [2, this.callApi({
153
+ method: 'DELETE',
154
+ route: "/api/v1/sources/".concat(packageType, "/").concat(id),
155
+ signal: signal,
156
+ })];
157
+ });
158
+ });
159
+ };
160
+ Source.prototype.getBranch = function (_a, _b) {
161
+ var id = _a.id, sourceId = _a.sourceId;
162
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
163
+ return __awaiter(this, void 0, void 0, function () {
164
+ var packageType;
165
+ return __generator(this, function (_d) {
166
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
167
+ return [2, this.callApi({
168
+ method: 'GET',
169
+ route: "/api/v1/sources/".concat(packageType, "/").concat(id, "/source/").concat(sourceId),
170
+ signal: signal,
171
+ })];
172
+ });
173
+ });
174
+ };
175
+ Source.prototype.deleteBranch = function (_a, _b) {
176
+ var id = _a.id, sourceId = _a.sourceId;
177
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
178
+ return __awaiter(this, void 0, void 0, function () {
179
+ var packageType;
180
+ return __generator(this, function (_d) {
181
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
182
+ return [2, this.callApi({
183
+ method: 'DELETE',
184
+ route: "/api/v1/sources/".concat(packageType, "/").concat(id, "/source/").concat(sourceId),
185
+ signal: signal,
186
+ })];
187
+ });
188
+ });
189
+ };
190
+ Source.prototype.patchBranchMeta = function (_a, _b) {
191
+ var id = _a.id, sourceId = _a.sourceId, data = __rest(_a, ["id", "sourceId"]);
192
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
193
+ return __awaiter(this, void 0, void 0, function () {
194
+ var packageType;
195
+ return __generator(this, function (_d) {
196
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
197
+ return [2, this.callApi({
198
+ method: 'PATCH',
199
+ route: "/api/v1/sources/".concat(packageType, "/").concat(id, "/source/").concat(sourceId, "/meta"),
200
+ data: data,
201
+ signal: signal,
202
+ })];
203
+ });
204
+ });
205
+ };
206
+ Source.prototype.forkBranch = function (_a, _b) {
207
+ var id = _a.id, sourceId = _a.sourceId, data = __rest(_a, ["id", "sourceId"]);
208
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
209
+ return __awaiter(this, void 0, void 0, function () {
210
+ var packageType;
211
+ return __generator(this, function (_d) {
212
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
213
+ return [2, this.callApi({
214
+ method: 'POST',
215
+ route: "/api/v1/sources/".concat(packageType, "/").concat(id, "/source/").concat(sourceId, "/fork"),
216
+ data: data,
217
+ signal: signal,
218
+ })];
219
+ });
220
+ });
221
+ };
222
+ Source.prototype.setPublished = function (_a, _b) {
223
+ var id = _a.id, sourceId = _a.sourceId, data = __rest(_a, ["id", "sourceId"]);
224
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
225
+ return __awaiter(this, void 0, void 0, function () {
226
+ var packageType;
227
+ return __generator(this, function (_d) {
228
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
229
+ return [2, this.callApi({
230
+ method: 'POST',
231
+ route: "/api/v1/sources/".concat(packageType, "/").concat(id, "/source/").concat(sourceId, "/published"),
232
+ data: data,
233
+ signal: signal,
234
+ })];
235
+ });
236
+ });
237
+ };
238
+ Source.prototype.getRevision = function (_a, _b) {
239
+ var id = _a.id, sourceId = _a.sourceId, revisionId = _a.revisionId;
240
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
241
+ return __awaiter(this, void 0, void 0, function () {
242
+ var packageType;
243
+ return __generator(this, function (_d) {
244
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
245
+ return [2, this.callApi({
246
+ method: 'GET',
247
+ route: "/api/v1/sources/".concat(packageType, "/").concat(id, "/source/").concat(sourceId, "/revision/").concat(revisionId),
248
+ signal: signal,
249
+ })];
250
+ });
251
+ });
252
+ };
253
+ Source.prototype.addRevision = function (_a, _b) {
254
+ var id = _a.id, sourceId = _a.sourceId, data = __rest(_a, ["id", "sourceId"]);
255
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
256
+ return __awaiter(this, void 0, void 0, function () {
257
+ var packageType;
258
+ return __generator(this, function (_d) {
259
+ packageType = type !== null && type !== void 0 ? type : this.packageType;
260
+ return [2, this.callApi({
261
+ method: 'POST',
262
+ route: "/api/v1/sources/".concat(packageType, "/").concat(id, "/source/").concat(sourceId, "/revision"),
263
+ data: data,
264
+ signal: signal,
265
+ })];
266
+ });
267
+ });
268
+ };
269
+ return Source;
270
+ }(base_1.Base));
271
+ exports.Source = Source;
272
+ //# sourceMappingURL=Source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Source.js","sourceRoot":"","sources":["../../src/Source.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AACpC,yCAA0C;AAoB1C;IAA4B,0BAAI;IAc9B,gBAAY,MAAoB;QAAhC,iBAYC;QAXS,IAAA,KAAK,GAA+C,MAAM,MAArD,EAAE,YAAY,GAAiC,MAAM,aAAvC,EAAE,WAAW,GAAoB,MAAM,YAA1B,EAAE,aAAa,GAAK,MAAM,cAAX,CAAY;gBAEnE,kBAAM;YACJ,YAAY,cAAA;YACZ,KAAK,OAAA;YACL,UAAU,EAAE,uBAAW;YACvB,UAAU,EAAE,aAAa;YACzB,oBAAoB,EAAE,KAAK;SAC5B,CAAC;QAEF,KAAI,CAAC,WAAW,GAAG,WAAW,CAAC;;IACjC,CAAC;IAQK,2BAAU,GAAhB,UACE,IAAyB,EACzB,EAAqC;YAArC,qBAAmC,EAAE,KAAA,EAAnC,IAAI,UAAA,EAAE,MAAM,YAAA;;;;gBAER,WAAW,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,IAAI,CAAC,WAAW,CAAC;gBAC7C,WAAO,IAAI,CAAC,OAAO,CAAC;wBAClB,MAAM,EAAE,MAAM;wBACd,KAAK,EAAE,0BAAmB,WAAW,CAAE;wBACvC,MAAM,QAAA;wBACN,IAAI,MAAA;qBACL,CAAC,EAAC;;;KACJ;IAQK,4BAAW,GAAjB,UACE,MAAW,EACX,EAAqC;QADrC,uBAAA,EAAA,WAAW;YACX,qBAAmC,EAAE,KAAA,EAAnC,IAAI,UAAA,EAAE,MAAM,YAAA;;;;gBAER,WAAW,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,IAAI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,EAAnC,IAAI,UAAA,EAAE,MAAM,YAAA;;;;gBAER,WAAW,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,IAAI,CAAC,WAAW,CAAC;gBAE7C,WAAO,IAAI,CAAC,OAAO,CAAC;wBAClB,MAAM,EAAE,KAAK;wBACb,KAAK,EAAE,0BAAmB,WAAW,cAAI,EAAE,qBAAW,QAAQ,uBAAa,UAAU,CAAE;wBACvF,MAAM,QAAA;qBACP,CAAC,EAAC;;;KACJ;IAQK,4BAAW,GAAjB,UACE,EAAgH,EAChH,EAAqC;QADnC,IAAA,EAAE,QAAA,EAAE,QAAQ,cAAA,EAAK,IAAI,cAAvB,kBAAyB,CAAF;YACvB,qBAAmC,EAAE,KAAA,EAAnC,IAAI,UAAA,EAAE,MAAM,YAAA;;;;gBAER,WAAW,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,IAAI,CAAC,WAAW,CAAC;gBAE7C,WAAO,IAAI,CAAC,OAAO,CAAC;wBAClB,MAAM,EAAE,MAAM;wBACd,KAAK,EAAE,0BAAmB,WAAW,cAAI,EAAE,qBAAW,QAAQ,cAAW;wBACzE,IAAI,MAAA;wBACJ,MAAM,QAAA;qBACP,CAAC,EAAC;;;KACJ;IACH,aAAC;AAAD,CAAC,AArQD,CAA4B,WAAI,GAqQ/B;AArQY,wBAAM"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LIBRARY_API_URL_KEY = exports.LIBRARY_SERVICE_KEY = exports.SERVICE_KEY = void 0;
4
+ exports.SERVICE_KEY = 'library-api';
5
+ exports.LIBRARY_SERVICE_KEY = exports.SERVICE_KEY;
6
+ exports.LIBRARY_API_URL_KEY = 'LIBRARY_API_URL';
7
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,aAAa,CAAC;AAC5B,QAAA,mBAAmB,GAAG,mBAAW,CAAC;AAClC,QAAA,mBAAmB,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,22 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Source = void 0;
18
+ var Source_1 = require("./Source");
19
+ Object.defineProperty(exports, "Source", { enumerable: true, get: function () { return Source_1.Source; } });
20
+ __exportStar(require("./types"), exports);
21
+ __exportStar(require("./constants"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,0CAAwB;AACxB,8CAA4B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,173 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __rest = (this && this.__rest) || function (s, e) {
11
+ var t = {};
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
+ t[p] = s[p];
14
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
+ t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
20
+ };
21
+ import { Base } from '@or-sdk/base';
22
+ import { SERVICE_KEY } from './constants';
23
+ export class Source extends Base {
24
+ constructor(params) {
25
+ const { token, discoveryUrl, packageType, libraryApiUrl } = params;
26
+ super({
27
+ discoveryUrl,
28
+ token,
29
+ serviceKey: SERVICE_KEY,
30
+ serviceUrl: libraryApiUrl,
31
+ useDefaultSerializer: false,
32
+ });
33
+ this.packageType = packageType;
34
+ }
35
+ addProject(data, { type, signal } = {}) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
38
+ return this.callApi({
39
+ method: 'POST',
40
+ route: `/api/v1/sources/${packageType}`,
41
+ signal,
42
+ data,
43
+ });
44
+ });
45
+ }
46
+ getProjects(params = {}, { type, signal } = {}) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
49
+ return this.callApi({
50
+ method: 'GET',
51
+ route: `/api/v1/sources/${packageType}`,
52
+ signal,
53
+ params,
54
+ });
55
+ });
56
+ }
57
+ getProject({ id }, { type, signal } = {}) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
60
+ return this.callApi({
61
+ method: 'GET',
62
+ route: `/api/v1/sources/${packageType}/${id}`,
63
+ signal,
64
+ });
65
+ });
66
+ }
67
+ patchProjectMeta(_a, _b) {
68
+ var { id } = _a, data = __rest(_a, ["id"]);
69
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
72
+ return this.callApi({
73
+ method: 'PATCH',
74
+ route: `/api/v1/sources/${packageType}/${id}/meta`,
75
+ data,
76
+ signal,
77
+ });
78
+ });
79
+ }
80
+ deleteProject({ id }, { type, signal } = {}) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
83
+ return this.callApi({
84
+ method: 'DELETE',
85
+ route: `/api/v1/sources/${packageType}/${id}`,
86
+ signal,
87
+ });
88
+ });
89
+ }
90
+ getBranch({ id, sourceId }, { type, signal } = {}) {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
93
+ return this.callApi({
94
+ method: 'GET',
95
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}`,
96
+ signal,
97
+ });
98
+ });
99
+ }
100
+ deleteBranch({ id, sourceId }, { type, signal } = {}) {
101
+ return __awaiter(this, void 0, void 0, function* () {
102
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
103
+ return this.callApi({
104
+ method: 'DELETE',
105
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}`,
106
+ signal,
107
+ });
108
+ });
109
+ }
110
+ patchBranchMeta(_a, _b) {
111
+ var { id, sourceId } = _a, data = __rest(_a, ["id", "sourceId"]);
112
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
115
+ return this.callApi({
116
+ method: 'PATCH',
117
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/meta`,
118
+ data,
119
+ signal,
120
+ });
121
+ });
122
+ }
123
+ forkBranch(_a, _b) {
124
+ var { id, sourceId } = _a, data = __rest(_a, ["id", "sourceId"]);
125
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
128
+ return this.callApi({
129
+ method: 'POST',
130
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/fork`,
131
+ data,
132
+ signal,
133
+ });
134
+ });
135
+ }
136
+ setPublished(_a, _b) {
137
+ var { id, sourceId } = _a, data = __rest(_a, ["id", "sourceId"]);
138
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
139
+ return __awaiter(this, void 0, void 0, function* () {
140
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
141
+ return this.callApi({
142
+ method: 'POST',
143
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/published`,
144
+ data,
145
+ signal,
146
+ });
147
+ });
148
+ }
149
+ getRevision({ id, sourceId, revisionId }, { type, signal } = {}) {
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
152
+ return this.callApi({
153
+ method: 'GET',
154
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/revision/${revisionId}`,
155
+ signal,
156
+ });
157
+ });
158
+ }
159
+ addRevision(_a, _b) {
160
+ var { id, sourceId } = _a, data = __rest(_a, ["id", "sourceId"]);
161
+ var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
162
+ return __awaiter(this, void 0, void 0, function* () {
163
+ const packageType = type !== null && type !== void 0 ? type : this.packageType;
164
+ return this.callApi({
165
+ method: 'POST',
166
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/revision`,
167
+ data,
168
+ signal,
169
+ });
170
+ });
171
+ }
172
+ }
173
+ //# sourceMappingURL=Source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Source.js","sourceRoot":"","sources":["../../src/Source.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAoB1C,MAAM,OAAO,MAAO,SAAQ,IAAI;IAc9B,YAAY,MAAoB;QAC9B,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;QAEnE,KAAK,CAAC;YACJ,YAAY;YACZ,KAAK;YACL,UAAU,EAAE,WAAW;YACvB,UAAU,EAAE,aAAa;YACzB,oBAAoB,EAAE,KAAK;SAC5B,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAQK,UAAU,CACd,IAAyB,EACzB,EAAE,IAAI,EAAE,MAAM,KAAqB,EAAE;;YAErC,MAAM,WAAW,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,IAAI,CAAC,WAAW,CAAC;YAC7C,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,mBAAmB,WAAW,EAAE;gBACvC,MAAM;gBACN,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;IAQK,WAAW,CACf,MAAM,GAAG,EAAE,EACX,EAAE,IAAI,EAAE,MAAM,KAAqB,EAAE;;YAErC,MAAM,WAAW,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,IAAI,CAAC,WAAW,CAAC;YAE7C,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE,mBAAmB,WAAW,EAAE;gBACvC,MAAM;gBACN,MAAM;aACP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,MAAM,WAAW,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,IAAI,CAAC,WAAW,CAAC;YAE7C,OAAO,IAAI,CAAC,OAAO,CAAC;gBAClB,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,mBAAmB,WAAW,IAAI,EAAE,WAAW,QAAQ,WAAW;gBACzE,IAAI;gBACJ,MAAM;aACP,CAAC,CAAC;;KACJ;CACF"}
@@ -0,0 +1,4 @@
1
+ export const SERVICE_KEY = 'library-api';
2
+ export const LIBRARY_SERVICE_KEY = SERVICE_KEY;
3
+ export const LIBRARY_API_URL_KEY = 'LIBRARY_API_URL';
4
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { Source } from './Source';
2
+ export * from './types';
3
+ export * from './constants';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { Base } from '@or-sdk/base';
2
+ import { SourceConfig, OptionalParams } from './types';
3
+ import { CreateSourceBodyDTO, CreateSourceSourceRevisionBodyDTO, ForkSourceBranchBodyDTO, ForkSourceBranchResponseDTO, GetSourceItemBranchResponseDTO, GetSourceItemResponseDTO, GetSourceRevisionResponseDTO, SetPublishedBodyDTO, SourcesParamUniversalDTO, UpdateMetaBranchBodyLegacyDTO } from '@or-sdk/library-types-v1';
4
+ export declare class Source extends Base {
5
+ private readonly packageType;
6
+ constructor(params: SourceConfig);
7
+ addProject(data: CreateSourceBodyDTO, { type, signal }?: OptionalParams): Promise<GetSourceItemResponseDTO>;
8
+ getProjects(params?: {}, { type, signal }?: OptionalParams): Promise<GetSourceItemResponseDTO[]>;
9
+ getProject({ id }: Pick<SourcesParamUniversalDTO, 'id'>, { type, signal }?: OptionalParams): Promise<GetSourceItemResponseDTO>;
10
+ patchProjectMeta({ id, ...data }: Pick<SourcesParamUniversalDTO, 'id'> & UpdateMetaBranchBodyLegacyDTO, { type, signal }?: OptionalParams): Promise<GetSourceItemResponseDTO>;
11
+ deleteProject({ id }: Pick<SourcesParamUniversalDTO, 'id'>, { type, signal }?: OptionalParams): Promise<unknown>;
12
+ getBranch({ id, sourceId }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'>, { type, signal }?: OptionalParams): Promise<GetSourceItemBranchResponseDTO>;
13
+ deleteBranch({ id, sourceId }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'>, { type, signal }?: OptionalParams): Promise<unknown>;
14
+ patchBranchMeta({ id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & ForkSourceBranchBodyDTO, { type, signal }?: OptionalParams): Promise<GetSourceItemBranchResponseDTO>;
15
+ forkBranch({ id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & ForkSourceBranchBodyDTO, { type, signal }?: OptionalParams): Promise<ForkSourceBranchResponseDTO>;
16
+ setPublished({ id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & SetPublishedBodyDTO, { type, signal }?: OptionalParams): Promise<GetSourceItemBranchResponseDTO>;
17
+ getRevision({ id, sourceId, revisionId }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId' | 'revisionId'>, { type, signal }?: OptionalParams): Promise<GetSourceRevisionResponseDTO>;
18
+ addRevision({ id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & CreateSourceSourceRevisionBodyDTO, { type, signal }?: OptionalParams): Promise<ForkSourceBranchResponseDTO>;
19
+ }
20
+ //# sourceMappingURL=Source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Source.d.ts","sourceRoot":"","sources":["../../src/Source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EACL,YAAY,EACZ,cAAc,EACf,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,mBAAmB,EACnB,iCAAiC,EACjC,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACxB,4BAA4B,EAE5B,mBAAmB,EACnB,wBAAwB,EACxB,6BAA6B,EAC9B,MAAM,0BAA0B,CAAC;AAGlC,qBAAa,MAAO,SAAQ,IAAI;IAC9B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkB;gBAalC,MAAM,EAAE,YAAY;IAoB1B,UAAU,CACd,IAAI,EAAE,mBAAmB,EACzB,EAAE,IAAI,EAAE,MAAM,EAAE,GAAE,cAAmB,GACpC,OAAO,CAAC,wBAAwB,CAAC;IAgB9B,WAAW,CACf,MAAM,KAAK,EACX,EAAE,IAAI,EAAE,MAAM,EAAE,GAAE,cAAmB,GACpC,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAiBhC,UAAU,CACd,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,EAC5C,EAAE,IAAI,EAAE,MAAM,EAAE,GAAE,cAAmB,GACpC,OAAO,CAAC,wBAAwB,CAAC;IAgB9B,gBAAgB,CACpB,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,EAAE,IAAI,CAAC,wBAAwB,EAAE,IAA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AAC,8BAA8B,CAAC;IAiBpC,WAAW,CACf,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,wBAAwB,EAAE,IAAI,GAAG,UAAU,GAAG,YAAY,CAAC,EAC9F,EAAE,IAAI,EAAE,MAAM,EAAE,GAAE,cAAmB,GACpC,OAAO,CAAC,4BAA4B,CAAC;IAgBlC,WAAW,CACf,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,IAAI,CAAC,wBAAwB,EAAE,IAAI,GAAG,UAAU,CAAC,GAAG,iCAAiC,EAChH,EAAE,IAAI,EAAE,MAAM,EAAE,GAAE,cAAmB,GACpC,OAAO,CAAC,2BAA2B,CAAC;CAUxC"}
@@ -0,0 +1,4 @@
1
+ export declare const SERVICE_KEY = "library-api";
2
+ export declare const LIBRARY_SERVICE_KEY = "library-api";
3
+ export declare const LIBRARY_API_URL_KEY = "LIBRARY_API_URL";
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,gBAAgB,CAAC;AACzC,eAAO,MAAM,mBAAmB,gBAAc,CAAC;AAC/C,eAAO,MAAM,mBAAmB,oBAAoB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { Source } from './Source';
2
+ export * from './types';
3
+ export * from './constants';
4
+ export type { PackageTypeEnum } from '@or-sdk/library-types-v1';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Token } from '@or-sdk/base';
2
+ import { PackageTypeEnum } from '@or-sdk/library-types-v1';
3
+ export type SourceConfig = {
4
+ token: Token;
5
+ discoveryUrl?: string;
6
+ libraryApiUrl?: string;
7
+ packageType: PackageTypeEnum;
8
+ };
9
+ export type OptionalParams = {
10
+ type?: PackageTypeEnum;
11
+ signal?: AbortSignal;
12
+ };
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG;IAIzB,KAAK,EAAE,KAAK,CAAC;IAKb,YAAY,CAAC,EAAE,MAAM,CAAC;IAKtB,aAAa,CAAC,EAAE,MAAM,CAAC;IAKvB,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@or-sdk/library-source",
3
+ "version": "0.1.0-beta.1912.0",
4
+ "main": "dist/cjs/index.js",
5
+ "module": "dist/esm/index.js",
6
+ "types": "dist/types/index.d.ts",
7
+ "scripts": {
8
+ "build": "pnpm clean && pnpm build:esm && pnpm build:cjs",
9
+ "build:cjs": "tsc --project tsconfig.json",
10
+ "build:esm": "tsc --project tsconfig.esm.json",
11
+ "build:types": "tsc --project tsconfig.types.json",
12
+ "build:watch": "concurrently -r --hide 1,2 \"pnpm build:watch:cjs\" \"pnpm build:watch:esm\" \"pnpm build:watch:types\"",
13
+ "build:watch:cjs": "tsc --project tsconfig.json -w",
14
+ "build:watch:esm": "tsc --project tsconfig.esm.json -w",
15
+ "build:watch:types": "tsc --project tsconfig.types.json -w",
16
+ "clean": "rm -rf ./dist",
17
+ "dev": "pnpm build:watch:esm"
18
+ },
19
+ "dependencies": {
20
+ "@or-sdk/base": "^0.29.0",
21
+ "@or-sdk/library-types-v1": "6.0.5"
22
+ },
23
+ "devDependencies": {
24
+ "concurrently": "^6.4.0",
25
+ "typescript": "^4.4.4"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ }
30
+ }
package/src/Source.ts ADDED
@@ -0,0 +1,283 @@
1
+ import { Base } from '@or-sdk/base';
2
+ import { SERVICE_KEY } from './constants';
3
+ import {
4
+ SourceConfig,
5
+ OptionalParams,
6
+ } from './types';
7
+ import {
8
+ CreateSourceBodyDTO,
9
+ CreateSourceSourceRevisionBodyDTO,
10
+ ForkSourceBranchBodyDTO,
11
+ ForkSourceBranchResponseDTO,
12
+ GetSourceItemBranchResponseDTO,
13
+ GetSourceItemResponseDTO,
14
+ GetSourceRevisionResponseDTO,
15
+ PackageTypeEnum,
16
+ SetPublishedBodyDTO,
17
+ SourcesParamUniversalDTO,
18
+ UpdateMetaBranchBodyLegacyDTO,
19
+ } from '@or-sdk/library-types-v1';
20
+
21
+
22
+ export class Source extends Base {
23
+ private readonly packageType: PackageTypeEnum;
24
+
25
+ /**
26
+ * ```typescript
27
+ * import { Source } from '@or-sdk/library-source';
28
+ * import config from '../config';
29
+ *
30
+ * const source = new Source({
31
+ * token: 'my-account-token-string',
32
+ * libraryApiUrl: config.LIBRARY_API_URL
33
+ * });
34
+ * ```
35
+ */
36
+ constructor(params: SourceConfig) {
37
+ const { token, discoveryUrl, packageType, libraryApiUrl } = params;
38
+
39
+ super({
40
+ discoveryUrl,
41
+ token,
42
+ serviceKey: SERVICE_KEY,
43
+ serviceUrl: libraryApiUrl,
44
+ useDefaultSerializer: false,
45
+ });
46
+
47
+ this.packageType = packageType;
48
+ }
49
+
50
+ /**
51
+ * Add Project
52
+ * ```typescript
53
+ * const result = await source.addProject(data, { type });
54
+ * ```
55
+ */
56
+ async addProject(
57
+ data: CreateSourceBodyDTO,
58
+ { type, signal }: OptionalParams = {}
59
+ ): Promise<GetSourceItemResponseDTO> {
60
+ const packageType = type ?? this.packageType;
61
+ return this.callApi({
62
+ method: 'POST',
63
+ route: `/api/v1/sources/${packageType}`,
64
+ signal,
65
+ data,
66
+ });
67
+ }
68
+
69
+ /**
70
+ * Get Projects
71
+ * ```typescript
72
+ * const result = await source.addProjects({ type });
73
+ * ```
74
+ */
75
+ async getProjects(
76
+ params = {},
77
+ { type, signal }: OptionalParams = {}
78
+ ): Promise<GetSourceItemResponseDTO[]> {
79
+ const packageType = type ?? this.packageType;
80
+
81
+ return this.callApi({
82
+ method: 'GET',
83
+ route: `/api/v1/sources/${packageType}`,
84
+ signal,
85
+ params,
86
+ });
87
+ }
88
+
89
+ /**
90
+ * Get Project
91
+ * ```typescript
92
+ * const result = await source.getProject({ id },{ type });
93
+ * ```
94
+ */
95
+ async getProject(
96
+ { id }: Pick<SourcesParamUniversalDTO, 'id'>,
97
+ { type, signal }: OptionalParams = {}
98
+ ): Promise<GetSourceItemResponseDTO> {
99
+ const packageType = type ?? this.packageType;
100
+
101
+ return this.callApi({
102
+ method: 'GET',
103
+ route: `/api/v1/sources/${packageType}/${id}`,
104
+ signal,
105
+ });
106
+ }
107
+
108
+ /**
109
+ * Patch Project Meta
110
+ * ```typescript
111
+ * const result = await source.patchProjectMeta(data, { type });
112
+ * ```
113
+ */
114
+ async patchProjectMeta(
115
+ { id, ...data }: Pick<SourcesParamUniversalDTO, 'id'> & UpdateMetaBranchBodyLegacyDTO,
116
+ { type, signal }: OptionalParams = {}
117
+ ): Promise<GetSourceItemResponseDTO> {
118
+ const packageType = type ?? this.packageType;
119
+
120
+ return this.callApi({
121
+ method: 'PATCH',
122
+ route: `/api/v1/sources/${packageType}/${id}/meta`,
123
+ data,
124
+ signal,
125
+ });
126
+ }
127
+
128
+ /**
129
+ * Delete Project
130
+ * ```typescript
131
+ * const result = await source.deleteProject({ id },{ type });
132
+ * ```
133
+ */
134
+ async deleteProject(
135
+ { id }: Pick<SourcesParamUniversalDTO, 'id'>,
136
+ { type, signal }: OptionalParams = {}
137
+ ) {
138
+ const packageType = type ?? this.packageType;
139
+
140
+ return this.callApi({
141
+ method: 'DELETE',
142
+ route: `/api/v1/sources/${packageType}/${id}`,
143
+ signal,
144
+ });
145
+ }
146
+
147
+ /**
148
+ * Get Branches
149
+ * ```typescript
150
+ * const result = await source.getBranch({ id, sourceId },{ type });
151
+ * ```
152
+ */
153
+ async getBranch(
154
+ { id, sourceId }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'>,
155
+ { type, signal }: OptionalParams = {}
156
+ ): Promise<GetSourceItemBranchResponseDTO> {
157
+ const packageType = type ?? this.packageType;
158
+
159
+ return this.callApi({
160
+ method: 'GET',
161
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}`,
162
+ signal,
163
+ });
164
+ }
165
+
166
+ /**
167
+ * Delete Branch
168
+ * ```typescript
169
+ * const result = await source.deleteBranch({ id, sourceId },{ type });
170
+ * ```
171
+ */
172
+ async deleteBranch(
173
+ { id, sourceId }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'>,
174
+ { type, signal }: OptionalParams = {}
175
+ ) {
176
+ const packageType = type ?? this.packageType;
177
+
178
+ return this.callApi({
179
+ method: 'DELETE',
180
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}`,
181
+ signal,
182
+ });
183
+ }
184
+
185
+ /**
186
+ * Patch Branch Meta
187
+ * ```typescript
188
+ * const result = await source.patchBranchMeta({ id, sourceId, ...data },{ type });
189
+ * ```
190
+ */
191
+ async patchBranchMeta(
192
+ { id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & ForkSourceBranchBodyDTO,
193
+ { type, signal }: OptionalParams = {}
194
+ ): Promise<GetSourceItemBranchResponseDTO> {
195
+ const packageType = type ?? this.packageType;
196
+
197
+ return this.callApi({
198
+ method: 'PATCH',
199
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/meta`,
200
+ data,
201
+ signal,
202
+ });
203
+ }
204
+
205
+ /**
206
+ * Fork Branch
207
+ * ```typescript
208
+ * const result = await source.forkBranch({ id, sourceId, ...data },{ type });
209
+ * ```
210
+ */
211
+ async forkBranch(
212
+ { id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & ForkSourceBranchBodyDTO,
213
+ { type, signal }: OptionalParams = {}
214
+ ): Promise<ForkSourceBranchResponseDTO> {
215
+ const packageType = type ?? this.packageType;
216
+
217
+ return this.callApi({
218
+ method: 'POST',
219
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/fork`,
220
+ data,
221
+ signal,
222
+ });
223
+ }
224
+
225
+ /**
226
+ * Set Published
227
+ * ```typescript
228
+ * const result = await source.setPublished({ id, sourceId, version },{ type });
229
+ * ```
230
+ */
231
+ async setPublished(
232
+ { id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & SetPublishedBodyDTO,
233
+ { type, signal }: OptionalParams = {}
234
+ ): Promise<GetSourceItemBranchResponseDTO> {
235
+ const packageType = type ?? this.packageType;
236
+
237
+ return this.callApi({
238
+ method: 'POST',
239
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/published`,
240
+ data,
241
+ signal,
242
+ });
243
+ }
244
+
245
+ /**
246
+ * Get Revision
247
+ * ```typescript
248
+ * const result = await source.getRevision({ id, sourceId, revisionId },{ type });
249
+ * ```
250
+ */
251
+ async getRevision(
252
+ { id, sourceId, revisionId }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId' | 'revisionId'>,
253
+ { type, signal }: OptionalParams = {}
254
+ ): Promise<GetSourceRevisionResponseDTO> {
255
+ const packageType = type ?? this.packageType;
256
+
257
+ return this.callApi({
258
+ method: 'GET',
259
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/revision/${revisionId}`,
260
+ signal,
261
+ });
262
+ }
263
+
264
+ /**
265
+ * Add Revision
266
+ * ```typescript
267
+ * const result = await source.addRevision({ id, sourceId, ...data },{ type });
268
+ * ```
269
+ */
270
+ async addRevision(
271
+ { id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & CreateSourceSourceRevisionBodyDTO,
272
+ { type, signal }: OptionalParams = {}
273
+ ): Promise<ForkSourceBranchResponseDTO> {
274
+ const packageType = type ?? this.packageType;
275
+
276
+ return this.callApi({
277
+ method: 'POST',
278
+ route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/revision`,
279
+ data,
280
+ signal,
281
+ });
282
+ }
283
+ }
@@ -0,0 +1,3 @@
1
+ export const SERVICE_KEY = 'library-api';
2
+ export const LIBRARY_SERVICE_KEY = SERVICE_KEY;
3
+ export const LIBRARY_API_URL_KEY = 'LIBRARY_API_URL';
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ export { Source } from './Source';
2
+ export * from './types';
3
+ export * from './constants';
4
+ export type { PackageTypeEnum } from '@or-sdk/library-types-v1';
package/src/types.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { Token } from '@or-sdk/base';
2
+ import { PackageTypeEnum } from '@or-sdk/library-types-v1';
3
+
4
+ export type SourceConfig = {
5
+ /**
6
+ * token
7
+ */
8
+ token: Token;
9
+
10
+ /**
11
+ * Url of OneReach service discovery api
12
+ */
13
+ discoveryUrl?: string;
14
+
15
+ /**
16
+ * Url of OneReach Library api
17
+ */
18
+ libraryApiUrl?: string;
19
+
20
+ /**
21
+ * Package type
22
+ */
23
+ packageType: PackageTypeEnum;
24
+ };
25
+
26
+ export type OptionalParams = {
27
+ type?: PackageTypeEnum;
28
+ signal?: AbortSignal;
29
+ };
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.esm.json",
3
+ "compilerOptions": {
4
+ "declarationDir": "./dist/types",
5
+ "rootDir": "./src",
6
+ "declaration": true
7
+ }
8
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist/esm",
5
+ "declarationDir": "./dist/types",
6
+ "module": "ES6",
7
+ "target": "es6",
8
+ "rootDir": "./src",
9
+ "declaration": true,
10
+ "declarationMap": true
11
+ }
12
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist/cjs",
5
+ "rootDir": "./src"
6
+ }
7
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "declarationDir": "./dist/types",
5
+ "rootDir": "./src",
6
+ "declaration": true,
7
+ "declarationMap": true,
8
+ "emitDeclarationOnly": true
9
+ }
10
+ }