@teambit/objects 0.0.0-15acf3f9b295a985a00bf4c313c939bf7adc1310

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.
Files changed (121) hide show
  1. package/dist/fixtures/version-model-extended.json +48 -0
  2. package/dist/fixtures/version-model-object.json +87 -0
  3. package/dist/index.d.ts +19 -0
  4. package/dist/index.js +371 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/models/dependencies-graph.d.ts +46 -0
  7. package/dist/models/dependencies-graph.js +105 -0
  8. package/dist/models/dependencies-graph.js.map +1 -0
  9. package/dist/models/detach-heads.d.ts +25 -0
  10. package/dist/models/detach-heads.js +84 -0
  11. package/dist/models/detach-heads.js.map +1 -0
  12. package/dist/models/export-metadata.d.ts +24 -0
  13. package/dist/models/export-metadata.js +76 -0
  14. package/dist/models/export-metadata.js.map +1 -0
  15. package/dist/models/index.d.ts +10 -0
  16. package/dist/models/index.js +125 -0
  17. package/dist/models/index.js.map +1 -0
  18. package/dist/models/lane-history.d.ts +40 -0
  19. package/dist/models/lane-history.js +117 -0
  20. package/dist/models/lane-history.js.map +1 -0
  21. package/dist/models/lane.d.ts +124 -0
  22. package/dist/models/lane.js +461 -0
  23. package/dist/models/lane.js.map +1 -0
  24. package/dist/models/model-component.d.ts +318 -0
  25. package/dist/models/model-component.js +1375 -0
  26. package/dist/models/model-component.js.map +1 -0
  27. package/dist/models/model-component.spec.d.ts +1 -0
  28. package/dist/models/model-component.spec.js +71 -0
  29. package/dist/models/model-component.spec.js.map +1 -0
  30. package/dist/models/scopeMeta.d.ts +20 -0
  31. package/dist/models/scopeMeta.js +71 -0
  32. package/dist/models/scopeMeta.js.map +1 -0
  33. package/dist/models/source.d.ts +10 -0
  34. package/dist/models/source.js +43 -0
  35. package/dist/models/source.js.map +1 -0
  36. package/dist/models/symlink.d.ts +30 -0
  37. package/dist/models/symlink.js +91 -0
  38. package/dist/models/symlink.js.map +1 -0
  39. package/dist/models/version-history.d.ts +59 -0
  40. package/dist/models/version-history.js +287 -0
  41. package/dist/models/version-history.js.map +1 -0
  42. package/dist/models/version.d.ts +284 -0
  43. package/dist/models/version.js +786 -0
  44. package/dist/models/version.js.map +1 -0
  45. package/dist/models/version.spec.d.ts +1 -0
  46. package/dist/models/version.spec.js +340 -0
  47. package/dist/models/version.spec.js.map +1 -0
  48. package/dist/objects/bit-object-list.d.ts +24 -0
  49. package/dist/objects/bit-object-list.js +65 -0
  50. package/dist/objects/bit-object-list.js.map +1 -0
  51. package/dist/objects/index.d.ts +5 -0
  52. package/dist/objects/index.js +60 -0
  53. package/dist/objects/index.js.map +1 -0
  54. package/dist/objects/object-list-to-graph.d.ts +13 -0
  55. package/dist/objects/object-list-to-graph.js +93 -0
  56. package/dist/objects/object-list-to-graph.js.map +1 -0
  57. package/dist/objects/object-list.d.ts +52 -0
  58. package/dist/objects/object-list.js +369 -0
  59. package/dist/objects/object-list.js.map +1 -0
  60. package/dist/objects/object.d.ts +35 -0
  61. package/dist/objects/object.js +190 -0
  62. package/dist/objects/object.js.map +1 -0
  63. package/dist/objects/objects-readable-generator.d.ts +31 -0
  64. package/dist/objects/objects-readable-generator.js +192 -0
  65. package/dist/objects/objects-readable-generator.js.map +1 -0
  66. package/dist/objects/raw-object.d.ts +23 -0
  67. package/dist/objects/raw-object.js +155 -0
  68. package/dist/objects/raw-object.js.map +1 -0
  69. package/dist/objects/ref.d.ts +14 -0
  70. package/dist/objects/ref.js +45 -0
  71. package/dist/objects/ref.js.map +1 -0
  72. package/dist/objects/repository-hooks.d.ts +4 -0
  73. package/dist/objects/repository-hooks.js +56 -0
  74. package/dist/objects/repository-hooks.js.map +1 -0
  75. package/dist/objects/repository.d.ts +149 -0
  76. package/dist/objects/repository.js +847 -0
  77. package/dist/objects/repository.js.map +1 -0
  78. package/dist/objects/scope-index.d.ts +74 -0
  79. package/dist/objects/scope-index.js +256 -0
  80. package/dist/objects/scope-index.js.map +1 -0
  81. package/dist/objects/scope-index.spec.d.ts +1 -0
  82. package/dist/objects/scope-index.spec.js +152 -0
  83. package/dist/objects/scope-index.spec.js.map +1 -0
  84. package/dist/objects.aspect.d.ts +2 -0
  85. package/dist/objects.aspect.js +18 -0
  86. package/dist/objects.aspect.js.map +1 -0
  87. package/dist/objects.main.runtime.d.ts +7 -0
  88. package/dist/objects.main.runtime.js +36 -0
  89. package/dist/objects.main.runtime.js.map +1 -0
  90. package/dist/preview-1752106620913.js +7 -0
  91. package/fixtures/version-model-extended.json +48 -0
  92. package/fixtures/version-model-object.json +87 -0
  93. package/models/dependencies-graph.ts +120 -0
  94. package/models/detach-heads.ts +79 -0
  95. package/models/export-metadata.ts +57 -0
  96. package/models/index.ts +11 -0
  97. package/models/lane-history.ts +106 -0
  98. package/models/lane.ts +367 -0
  99. package/models/model-component.spec.ts +55 -0
  100. package/models/model-component.ts +1387 -0
  101. package/models/scopeMeta.ts +60 -0
  102. package/models/source.ts +32 -0
  103. package/models/symlink.ts +66 -0
  104. package/models/version-history.ts +271 -0
  105. package/models/version.spec.ts +288 -0
  106. package/models/version.ts +826 -0
  107. package/objects/bit-object-list.ts +59 -0
  108. package/objects/index.ts +6 -0
  109. package/objects/object-list-to-graph.ts +69 -0
  110. package/objects/object-list.ts +313 -0
  111. package/objects/object.ts +153 -0
  112. package/objects/objects-readable-generator.ts +167 -0
  113. package/objects/raw-object.ts +142 -0
  114. package/objects/ref.ts +45 -0
  115. package/objects/repository-hooks.ts +42 -0
  116. package/objects/repository.ts +760 -0
  117. package/objects/scope-index.spec.ts +95 -0
  118. package/objects/scope-index.ts +198 -0
  119. package/package.json +97 -0
  120. package/types/asset.d.ts +41 -0
  121. package/types/style.d.ts +42 -0
@@ -0,0 +1,124 @@
1
+ import { ComponentID, ComponentIdList } from '@teambit/component-id';
2
+ import { LaneId } from '@teambit/lane-id';
3
+ import { Scope } from '@teambit/legacy.scope';
4
+ import { BitObject, Ref, Repository } from '../objects';
5
+ export type Log = {
6
+ date: string;
7
+ username?: string;
8
+ email?: string;
9
+ profileImage?: string;
10
+ };
11
+ export type LaneProps = {
12
+ name: string;
13
+ scope: string;
14
+ log: Log;
15
+ components?: LaneComponent[];
16
+ hash: string;
17
+ schema?: string;
18
+ readmeComponent?: LaneReadmeComponent;
19
+ forkedFrom?: LaneId;
20
+ updateDependents?: ComponentID[];
21
+ overrideUpdateDependents?: boolean;
22
+ };
23
+ export type LaneComponent = {
24
+ id: ComponentID;
25
+ head: Ref;
26
+ isDeleted?: boolean;
27
+ };
28
+ export type LaneReadmeComponent = {
29
+ id: ComponentID;
30
+ head: Ref | null;
31
+ };
32
+ export default class Lane extends BitObject {
33
+ name: string;
34
+ scope: string;
35
+ components: LaneComponent[];
36
+ log: Log;
37
+ schema: string;
38
+ readmeComponent?: LaneReadmeComponent;
39
+ forkedFrom?: LaneId;
40
+ _hash: string;
41
+ isNew: boolean;
42
+ hasChanged: boolean;
43
+ /**
44
+ * populated when a user clicks on "update" in the UI. it's a list of components that are dependents on the
45
+ * components in the lane. their dependencies are updated according to the lane.
46
+ * from the CLI perspective, it's added by "bit _snap" and merged by "bit _merge-lane".
47
+ * otherwise, the user is not aware of it. it's not imported to the workspace and the objects are not fetched.
48
+ */
49
+ updateDependents?: ComponentID[];
50
+ private overrideUpdateDependents?;
51
+ constructor(props: LaneProps);
52
+ id(): string;
53
+ hash(): Ref;
54
+ changeName(name: string): void;
55
+ changeScope(scope: string): void;
56
+ refs(): Ref[];
57
+ validateBeforePersisting(str: string): void;
58
+ toObject(): import("lodash").Dictionary<string | boolean | string[] | {
59
+ scope: string;
60
+ name: string;
61
+ } | Log | {
62
+ isDeleted?: true | undefined;
63
+ id: {
64
+ scope: string;
65
+ name: string;
66
+ };
67
+ head: string;
68
+ }[] | {
69
+ id: {
70
+ scope: string;
71
+ name: string;
72
+ };
73
+ head: string | null;
74
+ } | undefined>;
75
+ static from(props: LaneProps): Lane;
76
+ static create(name: string, scope: string, forkedFrom?: LaneId, bitCloudUser?: {
77
+ username?: string;
78
+ email?: string;
79
+ profileImage?: string;
80
+ }): Lane;
81
+ static parse(contents: string, hash: string): Lane;
82
+ toBuffer(pretty?: boolean): Buffer;
83
+ addComponent(component: LaneComponent): void;
84
+ removeComponentFromUpdateDependentsIfExist(componentId: ComponentID): void;
85
+ addComponentToUpdateDependents(componentId: ComponentID): void;
86
+ removeAllUpdateDependents(): void;
87
+ shouldOverrideUpdateDependents(): boolean | undefined;
88
+ /**
89
+ * !!! important !!!
90
+ * this should get called only on a "temp lane", such as running "bit _snap", which the scope gets destroys after the
91
+ * command is done. when _scope exports the lane, this "overrideUpdateDependents" is not saved to the remote-scope.
92
+ *
93
+ * on a user local lane object, this prop should never be true. otherwise, it'll override the remote-scope data.
94
+ */
95
+ setOverrideUpdateDependents(overrideUpdateDependents: boolean): void;
96
+ removeComponent(id: ComponentID): boolean;
97
+ getComponent(id: ComponentID): LaneComponent | undefined;
98
+ getComponentHead(bitId: ComponentID): Ref | null;
99
+ setLaneComponents(laneComponents: LaneComponent[]): void;
100
+ setReadmeComponent(id?: ComponentID): void;
101
+ isFullyMerged(scope: Scope): Promise<boolean>;
102
+ getMergedAndUnmergedIds(scope: Scope): Promise<{
103
+ merged: ComponentID[];
104
+ unmerged: ComponentID[];
105
+ }>;
106
+ /**
107
+ * @deprecated use toComponentIds instead
108
+ */
109
+ toBitIds(): ComponentIdList;
110
+ toComponentIds(): ComponentIdList;
111
+ toComponentIdsIncludeUpdateDependents(): ComponentIdList;
112
+ toLaneId(): LaneId;
113
+ collectObjectsById(repo: Repository): Promise<Array<{
114
+ id: ComponentID;
115
+ objects: BitObject[];
116
+ }>>;
117
+ includeDeletedData(): boolean;
118
+ setSchemaToSupportDeletedData(): void;
119
+ setSchemaToNotSupportDeletedData(): void;
120
+ getCompHeadIncludeUpdateDependents(componentId: ComponentID): Ref | undefined;
121
+ validate(): void;
122
+ isEqual(lane: Lane): boolean;
123
+ clone(): Lane;
124
+ }
@@ -0,0 +1,461 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ function _uuid() {
8
+ const data = require("uuid");
9
+ _uuid = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _semver() {
15
+ const data = require("semver");
16
+ _semver = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _lodash() {
22
+ const data = require("lodash");
23
+ _lodash = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _bitError() {
29
+ const data = require("@teambit/bit-error");
30
+ _bitError = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
35
+ function _componentId() {
36
+ const data = require("@teambit/component-id");
37
+ _componentId = function () {
38
+ return data;
39
+ };
40
+ return data;
41
+ }
42
+ function _componentVersion() {
43
+ const data = require("@teambit/component-version");
44
+ _componentVersion = function () {
45
+ return data;
46
+ };
47
+ return data;
48
+ }
49
+ function _laneId() {
50
+ const data = require("@teambit/lane-id");
51
+ _laneId = function () {
52
+ return data;
53
+ };
54
+ return data;
55
+ }
56
+ function _legacy() {
57
+ const data = require("@teambit/legacy.constants");
58
+ _legacy = function () {
59
+ return data;
60
+ };
61
+ return data;
62
+ }
63
+ function _legacyCli() {
64
+ const data = require("@teambit/legacy.cli.error");
65
+ _legacyCli = function () {
66
+ return data;
67
+ };
68
+ return data;
69
+ }
70
+ function _legacy2() {
71
+ const data = require("@teambit/legacy.logger");
72
+ _legacy2 = function () {
73
+ return data;
74
+ };
75
+ return data;
76
+ }
77
+ function _legacy3() {
78
+ const data = require("@teambit/legacy.utils");
79
+ _legacy3 = function () {
80
+ return data;
81
+ };
82
+ return data;
83
+ }
84
+ function _toolboxCrypto() {
85
+ const data = require("@teambit/toolbox.crypto.sha1");
86
+ _toolboxCrypto = function () {
87
+ return data;
88
+ };
89
+ return data;
90
+ }
91
+ function _component() {
92
+ const data = require("@teambit/component.snap-distance");
93
+ _component = function () {
94
+ return data;
95
+ };
96
+ return data;
97
+ }
98
+ function _objects() {
99
+ const data = require("../objects");
100
+ _objects = function () {
101
+ return data;
102
+ };
103
+ return data;
104
+ }
105
+ function _configStore() {
106
+ const data = require("@teambit/config-store");
107
+ _configStore = function () {
108
+ return data;
109
+ };
110
+ return data;
111
+ }
112
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
113
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
114
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
115
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
116
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
117
+ const OLD_LANE_SCHEMA = '0.0.0';
118
+ const SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA = '1.0.0';
119
+ const CURRENT_LANE_SCHEMA = SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA;
120
+ class Lane extends _objects().BitObject {
121
+ constructor(props) {
122
+ super();
123
+ _defineProperty(this, "name", void 0);
124
+ _defineProperty(this, "scope", void 0);
125
+ _defineProperty(this, "components", void 0);
126
+ _defineProperty(this, "log", void 0);
127
+ _defineProperty(this, "schema", void 0);
128
+ _defineProperty(this, "readmeComponent", void 0);
129
+ _defineProperty(this, "forkedFrom", void 0);
130
+ _defineProperty(this, "_hash", void 0);
131
+ // reason for the underscore prefix is that we already have hash as a method
132
+ _defineProperty(this, "isNew", false);
133
+ // doesn't get saved in the object. only needed for in-memory instance
134
+ _defineProperty(this, "hasChanged", false);
135
+ // doesn't get saved in the object. only needed for in-memory instance
136
+ /**
137
+ * populated when a user clicks on "update" in the UI. it's a list of components that are dependents on the
138
+ * components in the lane. their dependencies are updated according to the lane.
139
+ * from the CLI perspective, it's added by "bit _snap" and merged by "bit _merge-lane".
140
+ * otherwise, the user is not aware of it. it's not imported to the workspace and the objects are not fetched.
141
+ */
142
+ _defineProperty(this, "updateDependents", void 0);
143
+ _defineProperty(this, "overrideUpdateDependents", void 0);
144
+ if (!props.name) throw new TypeError('Lane constructor expects to get a name parameter');
145
+ this.name = props.name;
146
+ this.scope = props.scope;
147
+ this.components = props.components || [];
148
+ this.log = props.log || {
149
+ date: Date.now().toString()
150
+ };
151
+ this._hash = props.hash;
152
+ this.readmeComponent = props.readmeComponent;
153
+ this.forkedFrom = props.forkedFrom;
154
+ this.schema = props.schema || OLD_LANE_SCHEMA;
155
+ this.updateDependents = props.updateDependents;
156
+ this.overrideUpdateDependents = props.overrideUpdateDependents;
157
+ }
158
+ id() {
159
+ return this.scope + _laneId().LANE_REMOTE_DELIMITER + this.name;
160
+ }
161
+ hash() {
162
+ if (!this._hash) {
163
+ throw new Error('hash is missing from a Lane object');
164
+ }
165
+ return new (_objects().Ref)(this._hash);
166
+ }
167
+ changeName(name) {
168
+ this.name = name;
169
+ this.hasChanged = true;
170
+ }
171
+ changeScope(scope) {
172
+ this.scope = scope;
173
+ this.hasChanged = true;
174
+ }
175
+ refs() {
176
+ return this.components.map(c => c.head);
177
+ }
178
+ validateBeforePersisting(str) {
179
+ _legacy2().logger.debug(`validating lane object: ${this.hash().toString()} ${this.id()}`);
180
+ const lane = Lane.parse(str, this.hash().toString());
181
+ lane.validate();
182
+ }
183
+ toObject() {
184
+ const obj = (0, _lodash().pickBy)({
185
+ name: this.name,
186
+ scope: this.scope,
187
+ components: this.components.map(component => _objectSpread({
188
+ id: {
189
+ scope: component.id.scope,
190
+ name: component.id.fullName
191
+ },
192
+ head: component.head.toString()
193
+ }, component.isDeleted && {
194
+ isDeleted: component.isDeleted
195
+ })),
196
+ log: this.log,
197
+ readmeComponent: this.readmeComponent && {
198
+ id: {
199
+ scope: this.readmeComponent.id.scope,
200
+ name: this.readmeComponent.id.fullName
201
+ },
202
+ head: this.readmeComponent.head?.toString() ?? null
203
+ },
204
+ forkedFrom: this.forkedFrom && this.forkedFrom.toObject(),
205
+ schema: this.schema,
206
+ updateDependents: this.updateDependents?.map(c => c.toString()),
207
+ overrideUpdateDependents: this.overrideUpdateDependents
208
+ }, val => !!val);
209
+ return obj;
210
+ }
211
+ static from(props) {
212
+ return new Lane(props);
213
+ }
214
+ static create(name, scope, forkedFrom, bitCloudUser) {
215
+ const log = {
216
+ date: Date.now().toString(),
217
+ username: bitCloudUser?.username || (0, _configStore().getConfig)(_legacy().CFG_USER_NAME_KEY),
218
+ email: bitCloudUser?.email || (0, _configStore().getConfig)(_legacy().CFG_USER_EMAIL_KEY),
219
+ profileImage: bitCloudUser?.profileImage
220
+ };
221
+ const lane = new Lane({
222
+ name,
223
+ scope,
224
+ hash: (0, _toolboxCrypto().sha1)((0, _uuid().v4)()),
225
+ log,
226
+ forkedFrom,
227
+ schema: CURRENT_LANE_SCHEMA
228
+ });
229
+ lane.isNew = true;
230
+ lane.hasChanged = true;
231
+ return lane;
232
+ }
233
+ static parse(contents, hash) {
234
+ const laneObject = JSON.parse(contents);
235
+ return Lane.from({
236
+ name: laneObject.name,
237
+ scope: laneObject.scope,
238
+ log: laneObject.log,
239
+ components: laneObject.components.map(component => ({
240
+ id: _componentId().ComponentID.fromObject({
241
+ scope: component.id.scope,
242
+ name: component.id.name
243
+ }),
244
+ head: new (_objects().Ref)(component.head),
245
+ isDeleted: component.isDeleted
246
+ })),
247
+ readmeComponent: laneObject.readmeComponent && {
248
+ id: _componentId().ComponentID.fromObject({
249
+ scope: laneObject.readmeComponent.id.scope,
250
+ name: laneObject.readmeComponent.id.name
251
+ }),
252
+ head: laneObject.readmeComponent.head && new (_objects().Ref)(laneObject.readmeComponent.head)
253
+ },
254
+ forkedFrom: laneObject.forkedFrom && _laneId().LaneId.from(laneObject.forkedFrom.name, laneObject.forkedFrom.scope),
255
+ updateDependents: laneObject.updateDependents?.map(c => _componentId().ComponentID.fromString(c)),
256
+ overrideUpdateDependents: laneObject.overrideUpdateDependents,
257
+ hash: laneObject.hash || hash,
258
+ schema: laneObject.schema
259
+ });
260
+ }
261
+ toBuffer(pretty) {
262
+ const args = (0, _legacy3().getStringifyArgs)(pretty);
263
+ const obj = this.toObject();
264
+ const str = JSON.stringify(obj, ...args);
265
+ if (this.validateBeforePersist) this.validateBeforePersisting(str);
266
+ return Buffer.from(str);
267
+ }
268
+ addComponent(component) {
269
+ const existsComponent = this.getComponent(component.id);
270
+ if (existsComponent) {
271
+ if (!existsComponent.head.isEqual(component.head)) this.hasChanged = true;
272
+ existsComponent.id = component.id;
273
+ existsComponent.head = component.head;
274
+ existsComponent.isDeleted = component.isDeleted;
275
+ } else {
276
+ _legacy2().logger.debug(`Lane.addComponent, adding component ${component.id.toString()} to lane ${this.id()}`);
277
+ this.components.push(component);
278
+ this.hasChanged = true;
279
+ }
280
+ }
281
+ removeComponentFromUpdateDependentsIfExist(componentId) {
282
+ const updateDependentsList = _componentId().ComponentIdList.fromArray(this.updateDependents || []);
283
+ const exist = updateDependentsList.searchWithoutVersion(componentId);
284
+ if (!exist) return;
285
+ this.updateDependents = updateDependentsList.removeIfExist(exist);
286
+ if (!this.updateDependents.length) this.updateDependents = undefined;
287
+ this.hasChanged = true;
288
+ }
289
+ addComponentToUpdateDependents(componentId) {
290
+ this.removeComponentFromUpdateDependentsIfExist(componentId);
291
+ (this.updateDependents ||= []).push(componentId);
292
+ this.hasChanged = true;
293
+ }
294
+ removeAllUpdateDependents() {
295
+ if (this.updateDependents?.length) return;
296
+ this.updateDependents = undefined;
297
+ this.hasChanged = true;
298
+ }
299
+ shouldOverrideUpdateDependents() {
300
+ return this.overrideUpdateDependents;
301
+ }
302
+ /**
303
+ * !!! important !!!
304
+ * this should get called only on a "temp lane", such as running "bit _snap", which the scope gets destroys after the
305
+ * command is done. when _scope exports the lane, this "overrideUpdateDependents" is not saved to the remote-scope.
306
+ *
307
+ * on a user local lane object, this prop should never be true. otherwise, it'll override the remote-scope data.
308
+ */
309
+ setOverrideUpdateDependents(overrideUpdateDependents) {
310
+ this.overrideUpdateDependents = overrideUpdateDependents;
311
+ this.hasChanged = true;
312
+ }
313
+ removeComponent(id) {
314
+ const existsComponent = this.getComponent(id);
315
+ if (!existsComponent) return false;
316
+ this.components = this.components.filter(c => !c.id.isEqualWithoutVersion(id));
317
+ this.hasChanged = true;
318
+ return true;
319
+ }
320
+ getComponent(id) {
321
+ return this.components.find(c => c.id.isEqualWithoutVersion(id));
322
+ }
323
+ getComponentHead(bitId) {
324
+ const found = this.components.find(c => c.id.isEqual(bitId));
325
+ if (found) return found.head;
326
+ return null;
327
+ }
328
+ setLaneComponents(laneComponents) {
329
+ // this gets called when adding lane-components from other lanes/remotes, so it's better to
330
+ // clone the objects to not change the original data.
331
+ this.components = laneComponents.map(c => ({
332
+ id: c.id.clone(),
333
+ head: c.head.clone()
334
+ }));
335
+ this.hasChanged = true;
336
+ }
337
+ setReadmeComponent(id) {
338
+ const previousReadme = this.readmeComponent;
339
+ if (!id) {
340
+ this.readmeComponent = undefined;
341
+ if (previousReadme) this.hasChanged = true;
342
+ return;
343
+ }
344
+ const readmeComponent = this.getComponent(id);
345
+ if (!readmeComponent) {
346
+ this.readmeComponent = {
347
+ id,
348
+ head: null
349
+ };
350
+ } else {
351
+ this.readmeComponent = readmeComponent;
352
+ }
353
+ if (!previousReadme || !previousReadme.id.isEqual(id) || previousReadme.head?.toString() !== this.readmeComponent.head?.toString()) {
354
+ this.hasChanged = true;
355
+ }
356
+ }
357
+ async isFullyMerged(scope) {
358
+ const {
359
+ unmerged
360
+ } = await this.getMergedAndUnmergedIds(scope);
361
+ return unmerged.length === 0;
362
+ }
363
+ async getMergedAndUnmergedIds(scope) {
364
+ const merged = [];
365
+ const unmerged = [];
366
+ await Promise.all(this.components.map(async component => {
367
+ const modelComponent = await scope.getModelComponentIfExist(component.id);
368
+ if (!modelComponent) {
369
+ unmerged.push(component.id);
370
+ return;
371
+ }
372
+ const startTraverseFrom = modelComponent.getHead() || null; // it's important to have it as null and not as undefined, see hasVersionByRef
373
+ const headExist = await (0, _component().hasVersionByRef)(modelComponent, component.head, scope.objects, startTraverseFrom);
374
+ if (headExist) merged.push(component.id);else unmerged.push(component.id);
375
+ }));
376
+ return {
377
+ merged,
378
+ unmerged
379
+ };
380
+ }
381
+ /**
382
+ * @deprecated use toComponentIds instead
383
+ */
384
+ toBitIds() {
385
+ return this.toComponentIds();
386
+ }
387
+ toComponentIds() {
388
+ return _componentId().ComponentIdList.fromArray(this.components.map(c => c.id.changeVersion(c.head.toString())));
389
+ }
390
+ toComponentIdsIncludeUpdateDependents() {
391
+ return _componentId().ComponentIdList.fromArray(this.toComponentIds().concat(this.updateDependents || []));
392
+ }
393
+ toLaneId() {
394
+ return new (_laneId().LaneId)({
395
+ scope: this.scope,
396
+ name: this.name
397
+ });
398
+ }
399
+ collectObjectsById(repo) {
400
+ return Promise.all(this.components.map(async component => {
401
+ const headVersion = await component.head.load(repo);
402
+ const objects = [headVersion, ...headVersion.collect(repo)];
403
+ return {
404
+ id: component.id,
405
+ objects
406
+ };
407
+ }));
408
+ }
409
+ includeDeletedData() {
410
+ return (0, _semver().gte)(this.schema, SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA);
411
+ }
412
+ setSchemaToSupportDeletedData() {
413
+ this.schema = SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA;
414
+ this.hasChanged = true;
415
+ }
416
+ setSchemaToNotSupportDeletedData() {
417
+ this.schema = OLD_LANE_SCHEMA;
418
+ this.hasChanged = true;
419
+ }
420
+ getCompHeadIncludeUpdateDependents(componentId) {
421
+ const comp = this.getComponent(componentId);
422
+ if (comp) return comp.head;
423
+ const fromUpdateDependents = this.updateDependents?.find(c => c.isEqualWithoutVersion(componentId));
424
+ if (fromUpdateDependents) return _objects().Ref.from(fromUpdateDependents.version);
425
+ return undefined;
426
+ }
427
+ validate() {
428
+ const message = `unable to save Lane object "${this.id()}"`;
429
+ const bitIds = this.toComponentIds();
430
+ this.components.forEach(component => {
431
+ if (bitIds.filterWithoutVersion(component.id).length > 1) {
432
+ throw new (_legacyCli().ValidationError)(`${message}, the following component is duplicated "${component.id.fullName}"`);
433
+ }
434
+ if (!(0, _componentVersion().isSnap)(component.head.hash)) {
435
+ throw new (_legacyCli().ValidationError)(`${message}, lane component ${component.id.toStringWithoutVersion()} head should be a hash, got ${component.head.hash}`);
436
+ }
437
+ });
438
+ if (this.name === _laneId().DEFAULT_LANE) {
439
+ throw new (_bitError().BitError)(`${message}, this name is reserved as the default lane`);
440
+ }
441
+ if (this.name === _legacy().PREVIOUS_DEFAULT_LANE) {
442
+ throw new (_bitError().BitError)(`${message}, this name is reserved as the old default lane`);
443
+ }
444
+ }
445
+ isEqual(lane) {
446
+ if (this.id() !== lane.id()) return false;
447
+ const thisComponents = this.toComponentIds().toStringArray().sort();
448
+ const otherComponents = lane.toComponentIds().toStringArray().sort();
449
+ return (0, _lodash().isEqual)(thisComponents, otherComponents);
450
+ }
451
+ clone() {
452
+ return new Lane(_objectSpread(_objectSpread({}, this), {}, {
453
+ hash: this._hash,
454
+ overrideUpdateDependents: this.overrideUpdateDependents,
455
+ components: (0, _lodash().cloneDeep)(this.components)
456
+ }));
457
+ }
458
+ }
459
+ exports.default = Lane;
460
+
461
+ //# sourceMappingURL=lane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_uuid","data","require","_semver","_lodash","_bitError","_componentId","_componentVersion","_laneId","_legacy","_legacyCli","_legacy2","_legacy3","_toolboxCrypto","_component","_objects","_configStore","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","OLD_LANE_SCHEMA","SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA","CURRENT_LANE_SCHEMA","Lane","BitObject","constructor","props","name","scope","components","log","date","Date","now","toString","_hash","hash","readmeComponent","forkedFrom","schema","updateDependents","overrideUpdateDependents","id","LANE_REMOTE_DELIMITER","Error","Ref","changeName","hasChanged","changeScope","refs","map","c","head","validateBeforePersisting","str","logger","debug","lane","parse","validate","toObject","obj","pickBy","component","fullName","isDeleted","val","from","create","bitCloudUser","username","getConfig","CFG_USER_NAME_KEY","email","CFG_USER_EMAIL_KEY","profileImage","sha1","v4","isNew","contents","laneObject","JSON","ComponentID","fromObject","LaneId","fromString","toBuffer","pretty","args","getStringifyArgs","stringify","validateBeforePersist","Buffer","addComponent","existsComponent","getComponent","isEqual","removeComponentFromUpdateDependentsIfExist","componentId","updateDependentsList","ComponentIdList","fromArray","exist","searchWithoutVersion","removeIfExist","undefined","addComponentToUpdateDependents","removeAllUpdateDependents","shouldOverrideUpdateDependents","setOverrideUpdateDependents","removeComponent","isEqualWithoutVersion","find","getComponentHead","bitId","found","setLaneComponents","laneComponents","clone","setReadmeComponent","previousReadme","isFullyMerged","unmerged","getMergedAndUnmergedIds","merged","Promise","all","modelComponent","getModelComponentIfExist","startTraverseFrom","getHead","headExist","hasVersionByRef","objects","toBitIds","toComponentIds","changeVersion","toComponentIdsIncludeUpdateDependents","concat","toLaneId","collectObjectsById","repo","headVersion","load","collect","includeDeletedData","gte","setSchemaToSupportDeletedData","setSchemaToNotSupportDeletedData","getCompHeadIncludeUpdateDependents","comp","fromUpdateDependents","version","message","bitIds","filterWithoutVersion","ValidationError","isSnap","toStringWithoutVersion","DEFAULT_LANE","BitError","PREVIOUS_DEFAULT_LANE","thisComponents","toStringArray","sort","otherComponents","cloneDeep","exports","default"],"sources":["lane.ts"],"sourcesContent":["import { v4 } from 'uuid';\nimport { gte } from 'semver';\nimport { cloneDeep, isEqual, pickBy } from 'lodash';\nimport { BitError } from '@teambit/bit-error';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { isSnap } from '@teambit/component-version';\nimport { LaneId, DEFAULT_LANE, LANE_REMOTE_DELIMITER } from '@teambit/lane-id';\nimport { Scope } from '@teambit/legacy.scope';\nimport { CFG_USER_EMAIL_KEY, CFG_USER_NAME_KEY, PREVIOUS_DEFAULT_LANE } from '@teambit/legacy.constants';\nimport { ValidationError } from '@teambit/legacy.cli.error';\nimport { logger } from '@teambit/legacy.logger';\nimport { getStringifyArgs } from '@teambit/legacy.utils';\nimport { sha1 } from '@teambit/toolbox.crypto.sha1';\nimport { hasVersionByRef } from '@teambit/component.snap-distance';\nimport { BitObject, Ref, Repository } from '../objects';\nimport Version from './version';\nimport { getConfig } from '@teambit/config-store';\n\nexport type Log = { date: string; username?: string; email?: string; profileImage?: string };\n\nexport type LaneProps = {\n name: string;\n scope: string;\n log: Log;\n components?: LaneComponent[];\n hash: string;\n schema?: string;\n readmeComponent?: LaneReadmeComponent;\n forkedFrom?: LaneId;\n updateDependents?: ComponentID[];\n overrideUpdateDependents?: boolean;\n};\n\nconst OLD_LANE_SCHEMA = '0.0.0';\nconst SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA = '1.0.0';\nconst CURRENT_LANE_SCHEMA = SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA;\n\nexport type LaneComponent = { id: ComponentID; head: Ref; isDeleted?: boolean };\nexport type LaneReadmeComponent = { id: ComponentID; head: Ref | null };\nexport default class Lane extends BitObject {\n name: string;\n scope: string;\n components: LaneComponent[];\n log: Log;\n schema: string;\n readmeComponent?: LaneReadmeComponent;\n forkedFrom?: LaneId;\n _hash: string; // reason for the underscore prefix is that we already have hash as a method\n isNew = false; // doesn't get saved in the object. only needed for in-memory instance\n hasChanged = false; // doesn't get saved in the object. only needed for in-memory instance\n /**\n * populated when a user clicks on \"update\" in the UI. it's a list of components that are dependents on the\n * components in the lane. their dependencies are updated according to the lane.\n * from the CLI perspective, it's added by \"bit _snap\" and merged by \"bit _merge-lane\".\n * otherwise, the user is not aware of it. it's not imported to the workspace and the objects are not fetched.\n */\n updateDependents?: ComponentID[];\n private overrideUpdateDependents?: boolean;\n constructor(props: LaneProps) {\n super();\n if (!props.name) throw new TypeError('Lane constructor expects to get a name parameter');\n this.name = props.name;\n this.scope = props.scope;\n this.components = props.components || [];\n this.log = props.log || { date: Date.now().toString() };\n this._hash = props.hash;\n this.readmeComponent = props.readmeComponent;\n this.forkedFrom = props.forkedFrom;\n this.schema = props.schema || OLD_LANE_SCHEMA;\n this.updateDependents = props.updateDependents;\n this.overrideUpdateDependents = props.overrideUpdateDependents;\n }\n id(): string {\n return this.scope + LANE_REMOTE_DELIMITER + this.name;\n }\n hash(): Ref {\n if (!this._hash) {\n throw new Error('hash is missing from a Lane object');\n }\n return new Ref(this._hash);\n }\n changeName(name: string) {\n this.name = name;\n this.hasChanged = true;\n }\n changeScope(scope: string) {\n this.scope = scope;\n this.hasChanged = true;\n }\n refs(): Ref[] {\n return this.components.map((c) => c.head);\n }\n validateBeforePersisting(str: string) {\n logger.debug(`validating lane object: ${this.hash().toString()} ${this.id()}`);\n const lane = Lane.parse(str, this.hash().toString());\n lane.validate();\n }\n toObject() {\n const obj = pickBy(\n {\n name: this.name,\n scope: this.scope,\n components: this.components.map((component) => ({\n id: { scope: component.id.scope, name: component.id.fullName },\n head: component.head.toString(),\n ...(component.isDeleted && { isDeleted: component.isDeleted }),\n })),\n log: this.log,\n readmeComponent: this.readmeComponent && {\n id: { scope: this.readmeComponent.id.scope, name: this.readmeComponent.id.fullName },\n head: this.readmeComponent.head?.toString() ?? null,\n },\n forkedFrom: this.forkedFrom && this.forkedFrom.toObject(),\n schema: this.schema,\n updateDependents: this.updateDependents?.map((c) => c.toString()),\n overrideUpdateDependents: this.overrideUpdateDependents,\n },\n (val) => !!val\n );\n return obj;\n }\n static from(props: LaneProps): Lane {\n return new Lane(props);\n }\n static create(\n name: string,\n scope: string,\n forkedFrom?: LaneId,\n bitCloudUser?: {\n username?: string;\n email?: string;\n profileImage?: string;\n }\n ) {\n const log = {\n date: Date.now().toString(),\n username: bitCloudUser?.username || getConfig(CFG_USER_NAME_KEY),\n email: bitCloudUser?.email || getConfig(CFG_USER_EMAIL_KEY),\n profileImage: bitCloudUser?.profileImage,\n };\n const lane = new Lane({ name, scope, hash: sha1(v4()), log, forkedFrom, schema: CURRENT_LANE_SCHEMA });\n lane.isNew = true;\n lane.hasChanged = true;\n return lane;\n }\n static parse(contents: string, hash: string): Lane {\n const laneObject = JSON.parse(contents);\n return Lane.from({\n name: laneObject.name,\n scope: laneObject.scope,\n log: laneObject.log,\n components: laneObject.components.map((component) => ({\n id: ComponentID.fromObject({ scope: component.id.scope, name: component.id.name }),\n head: new Ref(component.head),\n isDeleted: component.isDeleted,\n })),\n readmeComponent: laneObject.readmeComponent && {\n id: ComponentID.fromObject({\n scope: laneObject.readmeComponent.id.scope,\n name: laneObject.readmeComponent.id.name,\n }),\n head: laneObject.readmeComponent.head && new Ref(laneObject.readmeComponent.head),\n },\n forkedFrom: laneObject.forkedFrom && LaneId.from(laneObject.forkedFrom.name, laneObject.forkedFrom.scope),\n updateDependents: laneObject.updateDependents?.map((c) => ComponentID.fromString(c)),\n overrideUpdateDependents: laneObject.overrideUpdateDependents,\n hash: laneObject.hash || hash,\n schema: laneObject.schema,\n });\n }\n toBuffer(pretty?: boolean) {\n const args = getStringifyArgs(pretty);\n const obj = this.toObject();\n const str = JSON.stringify(obj, ...args);\n if (this.validateBeforePersist) this.validateBeforePersisting(str);\n return Buffer.from(str);\n }\n addComponent(component: LaneComponent) {\n const existsComponent = this.getComponent(component.id);\n if (existsComponent) {\n if (!existsComponent.head.isEqual(component.head)) this.hasChanged = true;\n existsComponent.id = component.id;\n existsComponent.head = component.head;\n existsComponent.isDeleted = component.isDeleted;\n } else {\n logger.debug(`Lane.addComponent, adding component ${component.id.toString()} to lane ${this.id()}`);\n this.components.push(component);\n this.hasChanged = true;\n }\n }\n removeComponentFromUpdateDependentsIfExist(componentId: ComponentID) {\n const updateDependentsList = ComponentIdList.fromArray(this.updateDependents || []);\n const exist = updateDependentsList.searchWithoutVersion(componentId);\n if (!exist) return;\n this.updateDependents = updateDependentsList.removeIfExist(exist);\n if (!this.updateDependents.length) this.updateDependents = undefined;\n this.hasChanged = true;\n }\n addComponentToUpdateDependents(componentId: ComponentID) {\n this.removeComponentFromUpdateDependentsIfExist(componentId);\n (this.updateDependents ||= []).push(componentId);\n this.hasChanged = true;\n }\n removeAllUpdateDependents() {\n if (this.updateDependents?.length) return;\n this.updateDependents = undefined;\n this.hasChanged = true;\n }\n shouldOverrideUpdateDependents() {\n return this.overrideUpdateDependents;\n }\n /**\n * !!! important !!!\n * this should get called only on a \"temp lane\", such as running \"bit _snap\", which the scope gets destroys after the\n * command is done. when _scope exports the lane, this \"overrideUpdateDependents\" is not saved to the remote-scope.\n *\n * on a user local lane object, this prop should never be true. otherwise, it'll override the remote-scope data.\n */\n setOverrideUpdateDependents(overrideUpdateDependents: boolean) {\n this.overrideUpdateDependents = overrideUpdateDependents;\n this.hasChanged = true;\n }\n\n removeComponent(id: ComponentID): boolean {\n const existsComponent = this.getComponent(id);\n if (!existsComponent) return false;\n this.components = this.components.filter((c) => !c.id.isEqualWithoutVersion(id));\n this.hasChanged = true;\n return true;\n }\n getComponent(id: ComponentID): LaneComponent | undefined {\n return this.components.find((c) => c.id.isEqualWithoutVersion(id));\n }\n getComponentHead(bitId: ComponentID): Ref | null {\n const found = this.components.find((c) => c.id.isEqual(bitId));\n if (found) return found.head;\n return null;\n }\n setLaneComponents(laneComponents: LaneComponent[]) {\n // this gets called when adding lane-components from other lanes/remotes, so it's better to\n // clone the objects to not change the original data.\n this.components = laneComponents.map((c) => ({ id: c.id.clone(), head: c.head.clone() }));\n this.hasChanged = true;\n }\n setReadmeComponent(id?: ComponentID) {\n const previousReadme = this.readmeComponent;\n if (!id) {\n this.readmeComponent = undefined;\n if (previousReadme) this.hasChanged = true;\n return;\n }\n const readmeComponent = this.getComponent(id);\n if (!readmeComponent) {\n this.readmeComponent = { id, head: null };\n } else {\n this.readmeComponent = readmeComponent;\n }\n if (\n !previousReadme ||\n !previousReadme.id.isEqual(id) ||\n previousReadme.head?.toString() !== this.readmeComponent.head?.toString()\n ) {\n this.hasChanged = true;\n }\n }\n\n async isFullyMerged(scope: Scope): Promise<boolean> {\n const { unmerged } = await this.getMergedAndUnmergedIds(scope);\n return unmerged.length === 0;\n }\n async getMergedAndUnmergedIds(scope: Scope): Promise<{ merged: ComponentID[]; unmerged: ComponentID[] }> {\n const merged: ComponentID[] = [];\n const unmerged: ComponentID[] = [];\n await Promise.all(\n this.components.map(async (component) => {\n const modelComponent = await scope.getModelComponentIfExist(component.id);\n if (!modelComponent) {\n unmerged.push(component.id);\n return;\n }\n const startTraverseFrom = modelComponent.getHead() || null; // it's important to have it as null and not as undefined, see hasVersionByRef\n const headExist = await hasVersionByRef(modelComponent, component.head, scope.objects, startTraverseFrom);\n if (headExist) merged.push(component.id);\n else unmerged.push(component.id);\n })\n );\n return { merged, unmerged };\n }\n /**\n * @deprecated use toComponentIds instead\n */\n toBitIds(): ComponentIdList {\n return this.toComponentIds();\n }\n toComponentIds(): ComponentIdList {\n return ComponentIdList.fromArray(this.components.map((c) => c.id.changeVersion(c.head.toString())));\n }\n toComponentIdsIncludeUpdateDependents(): ComponentIdList {\n return ComponentIdList.fromArray(this.toComponentIds().concat(this.updateDependents || []));\n }\n toLaneId() {\n return new LaneId({ scope: this.scope, name: this.name });\n }\n collectObjectsById(repo: Repository): Promise<Array<{ id: ComponentID; objects: BitObject[] }>> {\n return Promise.all(\n this.components.map(async (component) => {\n const headVersion = (await component.head.load(repo)) as Version;\n const objects = [headVersion, ...headVersion.collect(repo)];\n return { id: component.id, objects };\n })\n );\n }\n includeDeletedData(): boolean {\n return gte(this.schema, SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA);\n }\n setSchemaToSupportDeletedData() {\n this.schema = SCHEMA_INCLUDING_DELETED_COMPONENTS_DATA;\n this.hasChanged = true;\n }\n setSchemaToNotSupportDeletedData() {\n this.schema = OLD_LANE_SCHEMA;\n this.hasChanged = true;\n }\n getCompHeadIncludeUpdateDependents(componentId: ComponentID): Ref | undefined {\n const comp = this.getComponent(componentId);\n if (comp) return comp.head;\n const fromUpdateDependents = this.updateDependents?.find((c) => c.isEqualWithoutVersion(componentId));\n if (fromUpdateDependents) return Ref.from(fromUpdateDependents.version);\n return undefined;\n }\n validate() {\n const message = `unable to save Lane object \"${this.id()}\"`;\n const bitIds = this.toComponentIds();\n this.components.forEach((component) => {\n if (bitIds.filterWithoutVersion(component.id).length > 1) {\n throw new ValidationError(`${message}, the following component is duplicated \"${component.id.fullName}\"`);\n }\n if (!isSnap(component.head.hash)) {\n throw new ValidationError(\n `${message}, lane component ${component.id.toStringWithoutVersion()} head should be a hash, got ${\n component.head.hash\n }`\n );\n }\n });\n if (this.name === DEFAULT_LANE) {\n throw new BitError(`${message}, this name is reserved as the default lane`);\n }\n if (this.name === PREVIOUS_DEFAULT_LANE) {\n throw new BitError(`${message}, this name is reserved as the old default lane`);\n }\n }\n isEqual(lane: Lane): boolean {\n if (this.id() !== lane.id()) return false;\n const thisComponents = this.toComponentIds().toStringArray().sort();\n const otherComponents = lane.toComponentIds().toStringArray().sort();\n return isEqual(thisComponents, otherComponents);\n }\n clone() {\n return new Lane({\n ...this,\n hash: this._hash,\n overrideUpdateDependents: this.overrideUpdateDependents,\n components: cloneDeep(this.components),\n });\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA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