@or-sdk/source 1.2.5 → 1.3.0-beta.1873.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/dist/cjs/Source.js +3 -17
- package/dist/cjs/Source.js.map +1 -1
- package/dist/cjs/constants.js +1 -7
- package/dist/cjs/constants.js.map +1 -1
- package/dist/esm/Source.js +2 -14
- package/dist/esm/Source.js.map +1 -1
- package/dist/esm/constants.js +0 -6
- package/dist/esm/constants.js.map +1 -1
- package/dist/types/Source.d.ts +14 -14
- package/dist/types/Source.d.ts.map +1 -1
- package/dist/types/constants.d.ts +0 -6
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -76
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/Source.ts +51 -48
- package/src/constants.ts +0 -7
- package/src/types.ts +2 -85
package/dist/cjs/Source.js
CHANGED
|
@@ -95,7 +95,8 @@ var Source = (function (_super) {
|
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
97
|
};
|
|
98
|
-
Source.prototype.getProjects = function (
|
|
98
|
+
Source.prototype.getProjects = function (params, _a) {
|
|
99
|
+
if (params === void 0) { params = {}; }
|
|
99
100
|
var _b = _a === void 0 ? {} : _a, type = _b.type, signal = _b.signal;
|
|
100
101
|
return __awaiter(this, void 0, void 0, function () {
|
|
101
102
|
var packageType;
|
|
@@ -105,6 +106,7 @@ var Source = (function (_super) {
|
|
|
105
106
|
method: 'GET',
|
|
106
107
|
route: "/api/v1/sources/".concat(packageType),
|
|
107
108
|
signal: signal,
|
|
109
|
+
params: params,
|
|
108
110
|
})];
|
|
109
111
|
});
|
|
110
112
|
});
|
|
@@ -264,22 +266,6 @@ var Source = (function (_super) {
|
|
|
264
266
|
});
|
|
265
267
|
});
|
|
266
268
|
};
|
|
267
|
-
Source.prototype.setSandbox = function (_a, _b) {
|
|
268
|
-
var id = _a.id, sourceId = _a.sourceId, revisionId = _a.revisionId, data = __rest(_a, ["id", "sourceId", "revisionId"]);
|
|
269
|
-
var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
|
|
270
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
271
|
-
var packageType;
|
|
272
|
-
return __generator(this, function (_d) {
|
|
273
|
-
packageType = type !== null && type !== void 0 ? type : this.packageType;
|
|
274
|
-
return [2, this.callApi({
|
|
275
|
-
method: 'POST',
|
|
276
|
-
route: "/api/v1/sources/".concat(packageType, "/").concat(id, "/source/").concat(sourceId, "/revision/").concat(revisionId, "/sandbox"),
|
|
277
|
-
data: data,
|
|
278
|
-
signal: signal,
|
|
279
|
-
})];
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
};
|
|
283
269
|
return Source;
|
|
284
270
|
}(base_1.Base));
|
|
285
271
|
exports.Source = Source;
|
package/dist/cjs/Source.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Source.js","sourceRoot":"","sources":["../../src/Source.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AACpC,yCAA0C;
|
|
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,GAA6C,MAAM,MAAnD,EAAE,YAAY,GAA+B,MAAM,aAArC,EAAE,WAAW,GAAkB,MAAM,YAAxB,EAAE,WAAW,GAAK,MAAM,YAAX,CAAY;gBAEjE,kBAAM;YACJ,YAAY,cAAA;YACZ,KAAK,OAAA;YACL,UAAU,EAAE,uBAAW;YACvB,UAAU,EAAE,WAAW;YACvB,oBAAoB,EAAE,K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AAC,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"}
|
package/dist/cjs/constants.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.STORE_API_URL_KEY = exports.STORE_SERVICE_KEY = exports.SERVICE_KEY = void 0;
|
|
4
4
|
exports.SERVICE_KEY = 'store-api';
|
|
5
5
|
exports.STORE_SERVICE_KEY = exports.SERVICE_KEY;
|
|
6
6
|
exports.STORE_API_URL_KEY = 'STORE_API_URL';
|
|
7
|
-
exports.PACKAGE_TYPE = {
|
|
8
|
-
STEP: 'STEP',
|
|
9
|
-
STEP_INPUT: 'STEP_INPUT',
|
|
10
|
-
TICKET_INPUT: 'TICKET_INPUT',
|
|
11
|
-
CONTENT_INPUT: 'CONTENT_INPUT',
|
|
12
|
-
};
|
|
13
7
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,WAAW,CAAC;AAC1B,QAAA,iBAAiB,GAAG,mBAAW,CAAC;AAChC,QAAA,iBAAiB,GAAG,eAAe,CAAC
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,WAAW,CAAC;AAC1B,QAAA,iBAAiB,GAAG,mBAAW,CAAC;AAChC,QAAA,iBAAiB,GAAG,eAAe,CAAC"}
|
package/dist/esm/Source.js
CHANGED
|
@@ -43,13 +43,14 @@ export class Source extends Base {
|
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
getProjects(
|
|
46
|
+
getProjects(params = {}, { type, signal } = {}) {
|
|
47
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
48
|
const packageType = type !== null && type !== void 0 ? type : this.packageType;
|
|
49
49
|
return this.callApi({
|
|
50
50
|
method: 'GET',
|
|
51
51
|
route: `/api/v1/sources/${packageType}`,
|
|
52
52
|
signal,
|
|
53
|
+
params,
|
|
53
54
|
});
|
|
54
55
|
});
|
|
55
56
|
}
|
|
@@ -168,18 +169,5 @@ export class Source extends Base {
|
|
|
168
169
|
});
|
|
169
170
|
});
|
|
170
171
|
}
|
|
171
|
-
setSandbox(_a, _b) {
|
|
172
|
-
var { id, sourceId, revisionId } = _a, data = __rest(_a, ["id", "sourceId", "revisionId"]);
|
|
173
|
-
var _c = _b === void 0 ? {} : _b, type = _c.type, signal = _c.signal;
|
|
174
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
-
const packageType = type !== null && type !== void 0 ? type : this.packageType;
|
|
176
|
-
return this.callApi({
|
|
177
|
-
method: 'POST',
|
|
178
|
-
route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/revision/${revisionId}/sandbox`,
|
|
179
|
-
data,
|
|
180
|
-
signal,
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
172
|
}
|
|
185
173
|
//# sourceMappingURL=Source.js.map
|
package/dist/esm/Source.js.map
CHANGED
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"Source.js","sourceRoot":"","sources":["../../src/Source.ts"],"names":[],"m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mBAAmB,WAAW,IAAI,EAAE,WAAW,QAAQ,WAAW;gBACzE,IAAI;gBACJ,MAAM;aACP,CAAC,CAAC;;KACJ;CACF"}
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
export const SERVICE_KEY = 'store-api';
|
|
2
2
|
export const STORE_SERVICE_KEY = SERVICE_KEY;
|
|
3
3
|
export const STORE_API_URL_KEY = 'STORE_API_URL';
|
|
4
|
-
export const PACKAGE_TYPE = {
|
|
5
|
-
STEP: 'STEP',
|
|
6
|
-
STEP_INPUT: 'STEP_INPUT',
|
|
7
|
-
TICKET_INPUT: 'TICKET_INPUT',
|
|
8
|
-
CONTENT_INPUT: 'CONTENT_INPUT',
|
|
9
|
-
};
|
|
10
4
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAC7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAC7C,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC"}
|
package/dist/types/Source.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Base } from '@or-sdk/base';
|
|
2
|
-
import { SourceConfig, OptionalParams
|
|
2
|
+
import { SourceConfig, OptionalParams } from './types';
|
|
3
|
+
import { CreateSourceBodyDTO, CreateSourceSourceRevisionBodyDTO, ForkSourceBranchBodyDTO, ForkSourceBranchResponseDTO, GetSourceItemBranchResponseDTO, GetSourceItemResponseDTO, GetSourceRevisionResponseDTO, SetPublishedBodyDTO, SourcesParamUniversalDTO, UpdateMetaBranchBodyLegacyDTO } from '@or-sdk/library-types-v1';
|
|
3
4
|
export declare class Source extends Base {
|
|
4
5
|
private readonly packageType;
|
|
5
6
|
constructor(params: SourceConfig);
|
|
6
|
-
addProject(data:
|
|
7
|
-
getProjects(
|
|
8
|
-
getProject({ id }: Pick<
|
|
9
|
-
patchProjectMeta({ id, ...data }: Pick<
|
|
10
|
-
deleteProject({ id }: Pick<
|
|
11
|
-
getBranch({ id, sourceId }:
|
|
12
|
-
deleteBranch({ id, sourceId }:
|
|
13
|
-
patchBranchMeta({ id, sourceId, ...data }:
|
|
14
|
-
forkBranch({ id, sourceId, ...data }:
|
|
15
|
-
setPublished({ id, sourceId, ...data }:
|
|
16
|
-
getRevision({ id, sourceId, revisionId }:
|
|
17
|
-
addRevision({ id, sourceId, ...data }:
|
|
18
|
-
setSandbox({ id, sourceId, revisionId, ...data }: UniversalGetParams & VersionData, { type, signal }?: OptionalParams): Promise<unknown>;
|
|
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
19
|
}
|
|
20
20
|
//# sourceMappingURL=Source.d.ts.map
|
|
@@ -1 +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,
|
|
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,iCAAi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+1,4 @@
|
|
|
1
1
|
export declare const SERVICE_KEY = "store-api";
|
|
2
2
|
export declare const STORE_SERVICE_KEY = "store-api";
|
|
3
3
|
export declare const STORE_API_URL_KEY = "STORE_API_URL";
|
|
4
|
-
export declare const PACKAGE_TYPE: {
|
|
5
|
-
readonly STEP: "STEP";
|
|
6
|
-
readonly STEP_INPUT: "STEP_INPUT";
|
|
7
|
-
readonly TICKET_INPUT: "TICKET_INPUT";
|
|
8
|
-
readonly CONTENT_INPUT: "CONTENT_INPUT";
|
|
9
|
-
};
|
|
10
4
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAC7C,eAAO,MAAM,iBAAiB,kBAAkB,CAAC
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,cAAc,CAAC;AACvC,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAC7C,eAAO,MAAM,iBAAiB,kBAAkB,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,88 +1,14 @@
|
|
|
1
1
|
import { Token } from '@or-sdk/base';
|
|
2
|
-
import {
|
|
3
|
-
export type PackageType = ObjectValues<typeof PACKAGE_TYPE>;
|
|
2
|
+
import { PackageTypeEnum } from '@or-sdk/library-types-v1';
|
|
4
3
|
export type SourceConfig = {
|
|
5
4
|
token: Token;
|
|
6
5
|
discoveryUrl?: string;
|
|
7
6
|
storeUrl?: string;
|
|
8
7
|
storeApiUrl?: string;
|
|
9
|
-
packageType:
|
|
10
|
-
};
|
|
11
|
-
export type ObjectValues<T> = T[keyof T];
|
|
12
|
-
export type JSONObject = {
|
|
13
|
-
[key: string]: JSONValue;
|
|
14
|
-
};
|
|
15
|
-
export type JSONArray = JSONValue[];
|
|
16
|
-
export type JSONValue = string | number | boolean | null | JSONObject | JSONArray;
|
|
17
|
-
export type GetParams = {
|
|
18
|
-
id: string;
|
|
19
|
-
sourceId: string;
|
|
20
|
-
};
|
|
21
|
-
export type UniversalGetParams = GetParams & {
|
|
22
|
-
revisionId?: string;
|
|
8
|
+
packageType: PackageTypeEnum;
|
|
23
9
|
};
|
|
24
10
|
export type OptionalParams = {
|
|
25
11
|
type?: string;
|
|
26
12
|
signal?: AbortSignal;
|
|
27
13
|
};
|
|
28
|
-
export type CreateBranchData = {
|
|
29
|
-
id?: string;
|
|
30
|
-
meta: {
|
|
31
|
-
label: string;
|
|
32
|
-
};
|
|
33
|
-
source: {
|
|
34
|
-
data?: {
|
|
35
|
-
helpTextSource?: string;
|
|
36
|
-
hooksSource?: string;
|
|
37
|
-
migrationSource?: string;
|
|
38
|
-
logicSource?: string;
|
|
39
|
-
stepDetails?: JSONObject;
|
|
40
|
-
} | JSONObject;
|
|
41
|
-
meta?: {
|
|
42
|
-
label: string;
|
|
43
|
-
mocks?: JSONObject;
|
|
44
|
-
} | JSONObject;
|
|
45
|
-
packageMeta: {
|
|
46
|
-
categories?: string[];
|
|
47
|
-
description?: string;
|
|
48
|
-
icon?: string;
|
|
49
|
-
iconType?: string;
|
|
50
|
-
id?: string;
|
|
51
|
-
label?: string;
|
|
52
|
-
recommendedSteps?: string[];
|
|
53
|
-
shape?: string;
|
|
54
|
-
tags?: string[];
|
|
55
|
-
version?: string;
|
|
56
|
-
} | JSONObject;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
export type PatchPackageMetaData = {
|
|
60
|
-
meta: {
|
|
61
|
-
label: string;
|
|
62
|
-
};
|
|
63
|
-
} | {
|
|
64
|
-
meta: {
|
|
65
|
-
shared: {
|
|
66
|
-
currentAccount: boolean;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
export type MetaObjectData = {
|
|
71
|
-
meta: JSONObject;
|
|
72
|
-
};
|
|
73
|
-
export type VersionData = {
|
|
74
|
-
version: string;
|
|
75
|
-
};
|
|
76
|
-
export type AddRevisionData = {
|
|
77
|
-
data: JSONObject;
|
|
78
|
-
meta?: JSONObject;
|
|
79
|
-
packageMeta?: JSONObject;
|
|
80
|
-
};
|
|
81
|
-
export type CursorV1 = {
|
|
82
|
-
from: number;
|
|
83
|
-
};
|
|
84
|
-
export type PaginationParams = {
|
|
85
|
-
cursor?: CursorV1;
|
|
86
|
-
size?: number;
|
|
87
|
-
};
|
|
88
14
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +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,
|
|
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,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/source",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0-beta.1873.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"dev": "pnpm build:watch:esm"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@or-sdk/base": "^0.29.0"
|
|
20
|
+
"@or-sdk/base": "^0.29.0",
|
|
21
|
+
"@or-sdk/library-types-v1": "6.0.3-moretypesadd-20230929082347"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"concurrently": "^6.4.0",
|
|
@@ -25,6 +26,5 @@
|
|
|
25
26
|
},
|
|
26
27
|
"publishConfig": {
|
|
27
28
|
"access": "public"
|
|
28
|
-
}
|
|
29
|
-
"gitHead": "ed57ac4477e3585618f9abb6341e2708b1e10a5f"
|
|
29
|
+
}
|
|
30
30
|
}
|
package/src/Source.ts
CHANGED
|
@@ -3,20 +3,24 @@ import { SERVICE_KEY } from './constants';
|
|
|
3
3
|
import {
|
|
4
4
|
SourceConfig,
|
|
5
5
|
OptionalParams,
|
|
6
|
-
PackageType,
|
|
7
|
-
CreateBranchData,
|
|
8
|
-
GetParams,
|
|
9
|
-
UniversalGetParams,
|
|
10
|
-
PatchPackageMetaData,
|
|
11
|
-
MetaObjectData,
|
|
12
|
-
VersionData,
|
|
13
|
-
AddRevisionData,
|
|
14
|
-
PaginationParams,
|
|
15
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';
|
|
16
20
|
|
|
17
21
|
|
|
18
22
|
export class Source extends Base {
|
|
19
|
-
private readonly packageType:
|
|
23
|
+
private readonly packageType: PackageTypeEnum;
|
|
20
24
|
|
|
21
25
|
/**
|
|
22
26
|
* ```typescript
|
|
@@ -49,7 +53,10 @@ export class Source extends Base {
|
|
|
49
53
|
* const result = await source.addProject(data, { type });
|
|
50
54
|
* ```
|
|
51
55
|
*/
|
|
52
|
-
async addProject(
|
|
56
|
+
async addProject(
|
|
57
|
+
data: CreateSourceBodyDTO,
|
|
58
|
+
{ type, signal }: OptionalParams = {}
|
|
59
|
+
): Promise<GetSourceItemResponseDTO> {
|
|
53
60
|
const packageType = type ?? this.packageType;
|
|
54
61
|
return this.callApi({
|
|
55
62
|
method: 'POST',
|
|
@@ -65,13 +72,17 @@ export class Source extends Base {
|
|
|
65
72
|
* const result = await source.addProjects({ type });
|
|
66
73
|
* ```
|
|
67
74
|
*/
|
|
68
|
-
async getProjects(
|
|
75
|
+
async getProjects(
|
|
76
|
+
params = {},
|
|
77
|
+
{ type, signal }: OptionalParams = {}
|
|
78
|
+
): Promise<GetSourceItemResponseDTO[]> {
|
|
69
79
|
const packageType = type ?? this.packageType;
|
|
70
80
|
|
|
71
81
|
return this.callApi({
|
|
72
82
|
method: 'GET',
|
|
73
83
|
route: `/api/v1/sources/${packageType}`,
|
|
74
84
|
signal,
|
|
85
|
+
params,
|
|
75
86
|
});
|
|
76
87
|
}
|
|
77
88
|
|
|
@@ -81,7 +92,10 @@ export class Source extends Base {
|
|
|
81
92
|
* const result = await source.getProject({ id },{ type });
|
|
82
93
|
* ```
|
|
83
94
|
*/
|
|
84
|
-
async getProject(
|
|
95
|
+
async getProject(
|
|
96
|
+
{ id }: Pick<SourcesParamUniversalDTO, 'id'>,
|
|
97
|
+
{ type, signal }: OptionalParams = {}
|
|
98
|
+
): Promise<GetSourceItemResponseDTO> {
|
|
85
99
|
const packageType = type ?? this.packageType;
|
|
86
100
|
|
|
87
101
|
return this.callApi({
|
|
@@ -98,9 +112,9 @@ export class Source extends Base {
|
|
|
98
112
|
* ```
|
|
99
113
|
*/
|
|
100
114
|
async patchProjectMeta(
|
|
101
|
-
{ id, ...data }: Pick<
|
|
115
|
+
{ id, ...data }: Pick<SourcesParamUniversalDTO, 'id'> & UpdateMetaBranchBodyLegacyDTO,
|
|
102
116
|
{ type, signal }: OptionalParams = {}
|
|
103
|
-
) {
|
|
117
|
+
): Promise<GetSourceItemResponseDTO> {
|
|
104
118
|
const packageType = type ?? this.packageType;
|
|
105
119
|
|
|
106
120
|
return this.callApi({
|
|
@@ -117,7 +131,10 @@ export class Source extends Base {
|
|
|
117
131
|
* const result = await source.deleteProject({ id },{ type });
|
|
118
132
|
* ```
|
|
119
133
|
*/
|
|
120
|
-
async deleteProject(
|
|
134
|
+
async deleteProject(
|
|
135
|
+
{ id }: Pick<SourcesParamUniversalDTO, 'id'>,
|
|
136
|
+
{ type, signal }: OptionalParams = {}
|
|
137
|
+
) {
|
|
121
138
|
const packageType = type ?? this.packageType;
|
|
122
139
|
|
|
123
140
|
return this.callApi({
|
|
@@ -133,7 +150,10 @@ export class Source extends Base {
|
|
|
133
150
|
* const result = await source.getBranch({ id, sourceId },{ type });
|
|
134
151
|
* ```
|
|
135
152
|
*/
|
|
136
|
-
async getBranch(
|
|
153
|
+
async getBranch(
|
|
154
|
+
{ id, sourceId }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'>,
|
|
155
|
+
{ type, signal }: OptionalParams = {}
|
|
156
|
+
): Promise<GetSourceItemBranchResponseDTO> {
|
|
137
157
|
const packageType = type ?? this.packageType;
|
|
138
158
|
|
|
139
159
|
return this.callApi({
|
|
@@ -149,7 +169,10 @@ export class Source extends Base {
|
|
|
149
169
|
* const result = await source.deleteBranch({ id, sourceId },{ type });
|
|
150
170
|
* ```
|
|
151
171
|
*/
|
|
152
|
-
async deleteBranch(
|
|
172
|
+
async deleteBranch(
|
|
173
|
+
{ id, sourceId }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'>,
|
|
174
|
+
{ type, signal }: OptionalParams = {}
|
|
175
|
+
) {
|
|
153
176
|
const packageType = type ?? this.packageType;
|
|
154
177
|
|
|
155
178
|
return this.callApi({
|
|
@@ -166,9 +189,9 @@ export class Source extends Base {
|
|
|
166
189
|
* ```
|
|
167
190
|
*/
|
|
168
191
|
async patchBranchMeta(
|
|
169
|
-
{ id, sourceId, ...data }:
|
|
192
|
+
{ id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & ForkSourceBranchBodyDTO,
|
|
170
193
|
{ type, signal }: OptionalParams = {}
|
|
171
|
-
) {
|
|
194
|
+
): Promise<GetSourceItemBranchResponseDTO> {
|
|
172
195
|
const packageType = type ?? this.packageType;
|
|
173
196
|
|
|
174
197
|
return this.callApi({
|
|
@@ -186,9 +209,9 @@ export class Source extends Base {
|
|
|
186
209
|
* ```
|
|
187
210
|
*/
|
|
188
211
|
async forkBranch(
|
|
189
|
-
{ id, sourceId, ...data }:
|
|
212
|
+
{ id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & ForkSourceBranchBodyDTO,
|
|
190
213
|
{ type, signal }: OptionalParams = {}
|
|
191
|
-
) {
|
|
214
|
+
): Promise<ForkSourceBranchResponseDTO> {
|
|
192
215
|
const packageType = type ?? this.packageType;
|
|
193
216
|
|
|
194
217
|
return this.callApi({
|
|
@@ -206,9 +229,9 @@ export class Source extends Base {
|
|
|
206
229
|
* ```
|
|
207
230
|
*/
|
|
208
231
|
async setPublished(
|
|
209
|
-
{ id, sourceId, ...data }:
|
|
232
|
+
{ id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & SetPublishedBodyDTO,
|
|
210
233
|
{ type, signal }: OptionalParams = {}
|
|
211
|
-
) {
|
|
234
|
+
): Promise<GetSourceItemBranchResponseDTO> {
|
|
212
235
|
const packageType = type ?? this.packageType;
|
|
213
236
|
|
|
214
237
|
return this.callApi({
|
|
@@ -226,9 +249,9 @@ export class Source extends Base {
|
|
|
226
249
|
* ```
|
|
227
250
|
*/
|
|
228
251
|
async getRevision(
|
|
229
|
-
{ id, sourceId, revisionId }:
|
|
252
|
+
{ id, sourceId, revisionId }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId' | 'revisionId'>,
|
|
230
253
|
{ type, signal }: OptionalParams = {}
|
|
231
|
-
) {
|
|
254
|
+
): Promise<GetSourceRevisionResponseDTO> {
|
|
232
255
|
const packageType = type ?? this.packageType;
|
|
233
256
|
|
|
234
257
|
return this.callApi({
|
|
@@ -245,9 +268,9 @@ export class Source extends Base {
|
|
|
245
268
|
* ```
|
|
246
269
|
*/
|
|
247
270
|
async addRevision(
|
|
248
|
-
{ id, sourceId, ...data }:
|
|
271
|
+
{ id, sourceId, ...data }: Pick<SourcesParamUniversalDTO, 'id' | 'sourceId'> & CreateSourceSourceRevisionBodyDTO,
|
|
249
272
|
{ type, signal }: OptionalParams = {}
|
|
250
|
-
) {
|
|
273
|
+
): Promise<ForkSourceBranchResponseDTO> {
|
|
251
274
|
const packageType = type ?? this.packageType;
|
|
252
275
|
|
|
253
276
|
return this.callApi({
|
|
@@ -257,24 +280,4 @@ export class Source extends Base {
|
|
|
257
280
|
signal,
|
|
258
281
|
});
|
|
259
282
|
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Set Sandbox
|
|
263
|
-
* ```typescript
|
|
264
|
-
* const result = await source.setSandbox({ id, sourceId, revisionId, ...data },{ type });
|
|
265
|
-
* ```
|
|
266
|
-
*/
|
|
267
|
-
async setSandbox(
|
|
268
|
-
{ id, sourceId, revisionId, ...data }: UniversalGetParams & VersionData,
|
|
269
|
-
{ type, signal }: OptionalParams = {}
|
|
270
|
-
) {
|
|
271
|
-
const packageType = type ?? this.packageType;
|
|
272
|
-
|
|
273
|
-
return this.callApi({
|
|
274
|
-
method: 'POST',
|
|
275
|
-
route: `/api/v1/sources/${packageType}/${id}/source/${sourceId}/revision/${revisionId}/sandbox`,
|
|
276
|
-
data,
|
|
277
|
-
signal,
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
283
|
}
|
package/src/constants.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
export const SERVICE_KEY = 'store-api';
|
|
2
2
|
export const STORE_SERVICE_KEY = SERVICE_KEY;
|
|
3
3
|
export const STORE_API_URL_KEY = 'STORE_API_URL';
|
|
4
|
-
|
|
5
|
-
export const PACKAGE_TYPE = {
|
|
6
|
-
STEP: 'STEP',
|
|
7
|
-
STEP_INPUT: 'STEP_INPUT',
|
|
8
|
-
TICKET_INPUT: 'TICKET_INPUT',
|
|
9
|
-
CONTENT_INPUT: 'CONTENT_INPUT',
|
|
10
|
-
} as const;
|
package/src/types.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Token } from '@or-sdk/base';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export type PackageType = ObjectValues<typeof PACKAGE_TYPE>;
|
|
2
|
+
import { PackageTypeEnum } from '@or-sdk/library-types-v1';
|
|
5
3
|
|
|
6
4
|
export type SourceConfig = {
|
|
7
5
|
/**
|
|
@@ -27,91 +25,10 @@ export type SourceConfig = {
|
|
|
27
25
|
/**
|
|
28
26
|
* Package type
|
|
29
27
|
*/
|
|
30
|
-
packageType:
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type ObjectValues<T> = T[keyof T];
|
|
34
|
-
export type JSONObject = { [key: string]: JSONValue; };
|
|
35
|
-
export type JSONArray = JSONValue[];
|
|
36
|
-
export type JSONValue = string | number | boolean | null | JSONObject | JSONArray;
|
|
37
|
-
|
|
38
|
-
export type GetParams = {
|
|
39
|
-
id: string;
|
|
40
|
-
sourceId: string;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type UniversalGetParams = GetParams & {
|
|
44
|
-
revisionId?: string;
|
|
28
|
+
packageType: PackageTypeEnum;
|
|
45
29
|
};
|
|
46
30
|
|
|
47
31
|
export type OptionalParams = {
|
|
48
32
|
type?: string;
|
|
49
33
|
signal?: AbortSignal;
|
|
50
34
|
};
|
|
51
|
-
|
|
52
|
-
export type CreateBranchData = {
|
|
53
|
-
id?: string;
|
|
54
|
-
meta: {
|
|
55
|
-
label: string;
|
|
56
|
-
};
|
|
57
|
-
source: {
|
|
58
|
-
data?: {
|
|
59
|
-
helpTextSource?: string;
|
|
60
|
-
hooksSource?: string;
|
|
61
|
-
migrationSource?: string;
|
|
62
|
-
logicSource?: string;
|
|
63
|
-
stepDetails?: JSONObject;
|
|
64
|
-
} | JSONObject;
|
|
65
|
-
meta?: {
|
|
66
|
-
label: string;
|
|
67
|
-
mocks?: JSONObject;
|
|
68
|
-
} | JSONObject;
|
|
69
|
-
packageMeta: {
|
|
70
|
-
categories?: string[];
|
|
71
|
-
description?: string;
|
|
72
|
-
icon?: string;
|
|
73
|
-
iconType?: string;
|
|
74
|
-
id?: string;
|
|
75
|
-
label?: string;
|
|
76
|
-
recommendedSteps?: string[];
|
|
77
|
-
shape?: string;
|
|
78
|
-
tags?: string[];
|
|
79
|
-
version?: string;
|
|
80
|
-
} | JSONObject;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export type PatchPackageMetaData = {
|
|
85
|
-
meta: {
|
|
86
|
-
label: string;
|
|
87
|
-
};
|
|
88
|
-
} | {
|
|
89
|
-
meta: {
|
|
90
|
-
shared: {
|
|
91
|
-
currentAccount: boolean;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export type MetaObjectData = {
|
|
97
|
-
meta: JSONObject;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export type VersionData = {
|
|
101
|
-
version: string;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export type AddRevisionData = {
|
|
105
|
-
data: JSONObject;
|
|
106
|
-
meta?: JSONObject;
|
|
107
|
-
packageMeta?: JSONObject;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export type CursorV1 = {
|
|
111
|
-
from: number;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export type PaginationParams = {
|
|
115
|
-
cursor?: CursorV1;
|
|
116
|
-
size?: number;
|
|
117
|
-
};
|