@slicemachine/manager 0.24.15-alpha.xru-doc-link-menu.1 → 0.24.15-alpha.xru-e2e-tests-logged-in.2
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/_node_modules/@amplitude/analytics-core/_node_modules/tslib/tslib.es6.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/_node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/debug.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-node/_node_modules/tslib/tslib.es6.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-node/_node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/analytics-node/lib/esm/transports/http.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-core/dist/experiment-core.esm.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-core/dist/experiment-core.esm.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-service.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment-service.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/assignment/assignment.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/cookie.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/cookie.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/cache.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/cache.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.cjs +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.js +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/client.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/fetcher.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/fetcher.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/poller.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/local/poller.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/remote/client.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/remote/client.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/transport/http.js.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/backoff.cjs.map +1 -1
- package/dist/_node_modules/@amplitude/experiment-node-server/dist/src/util/backoff.js.map +1 -1
- package/dist/_node_modules/@msgpack/msgpack/dist.es5_esm/Decoder.cjs.map +1 -1
- package/dist/_node_modules/@msgpack/msgpack/dist.es5_esm/Decoder.js.map +1 -1
- package/dist/_node_modules/cross-spawn/index.cjs +1 -1
- package/dist/_node_modules/cross-spawn/index.js +1 -1
- package/dist/_node_modules/cross-spawn/lib/enoent.cjs.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/enoent.js.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/parse.cjs.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/parse.js.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/util/escape.cjs.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/util/escape.js.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/util/readShebang.cjs.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/util/readShebang.js.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/util/resolveCommand.cjs.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/util/resolveCommand.js.map +1 -1
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +1 -1
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +1 -1
- package/dist/_node_modules/execa/index.cjs +2 -2
- package/dist/_node_modules/execa/index.cjs.map +1 -1
- package/dist/_node_modules/execa/index.js +2 -2
- package/dist/_node_modules/execa/index.js.map +1 -1
- package/dist/_node_modules/execa/lib/command.cjs.map +1 -1
- package/dist/_node_modules/execa/lib/command.js.map +1 -1
- package/dist/_node_modules/execa/lib/error.cjs.map +1 -1
- package/dist/_node_modules/execa/lib/error.js.map +1 -1
- package/dist/_node_modules/execa/lib/kill.cjs.map +1 -1
- package/dist/_node_modules/execa/lib/kill.js.map +1 -1
- package/dist/_node_modules/execa/lib/promise.cjs +2 -2
- package/dist/_node_modules/execa/lib/promise.cjs.map +1 -1
- package/dist/_node_modules/execa/lib/promise.js +2 -2
- package/dist/_node_modules/execa/lib/promise.js.map +1 -1
- package/dist/_node_modules/execa/lib/stdio.cjs.map +1 -1
- package/dist/_node_modules/execa/lib/stdio.js.map +1 -1
- package/dist/_node_modules/execa/lib/stream.cjs.map +1 -1
- package/dist/_node_modules/execa/lib/stream.js.map +1 -1
- package/dist/_node_modules/execa/lib/verbose.cjs.map +1 -1
- package/dist/_node_modules/execa/lib/verbose.js.map +1 -1
- package/dist/_node_modules/fetch-blob/file.cjs.map +1 -1
- package/dist/_node_modules/fetch-blob/file.js.map +1 -1
- package/dist/_node_modules/fetch-blob/index.cjs.map +1 -1
- package/dist/_node_modules/fetch-blob/index.js.map +1 -1
- package/dist/_node_modules/fetch-blob/streams.cjs.map +1 -1
- package/dist/_node_modules/fetch-blob/streams.js.map +1 -1
- package/dist/_node_modules/file-type/core.cjs.map +1 -1
- package/dist/_node_modules/file-type/core.js.map +1 -1
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +1 -1
- package/dist/_node_modules/formdata-polyfill/esm.min.js.map +1 -1
- package/dist/_node_modules/get-port/index.cjs.map +1 -1
- package/dist/_node_modules/get-port/index.js.map +1 -1
- package/dist/_node_modules/get-stream/index.cjs.map +1 -1
- package/dist/_node_modules/get-stream/index.js.map +1 -1
- package/dist/_node_modules/human-signals/build/src/realtime.cjs.map +1 -1
- package/dist/_node_modules/human-signals/build/src/realtime.js.map +1 -1
- package/dist/_node_modules/isexe/index.cjs.map +1 -1
- package/dist/_node_modules/isexe/index.js.map +1 -1
- package/dist/_node_modules/mimic-fn/index.cjs.map +1 -1
- package/dist/_node_modules/mimic-fn/index.js.map +1 -1
- package/dist/_node_modules/node-domexception/index.cjs.map +1 -1
- package/dist/_node_modules/node-domexception/index.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/body.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/body.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/headers.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/headers.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/index.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/index.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/request.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/request.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/is.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +1 -1
- package/dist/_node_modules/npm-run-path/_node_modules/path-key/index.cjs.map +1 -0
- package/dist/_node_modules/npm-run-path/_node_modules/path-key/index.js.map +1 -0
- package/dist/_node_modules/{execa/_node_modules/npm-run-path → npm-run-path}/index.cjs +1 -1
- package/dist/_node_modules/npm-run-path/index.cjs.map +1 -0
- package/dist/_node_modules/{execa/_node_modules/npm-run-path → npm-run-path}/index.js +1 -1
- package/dist/_node_modules/npm-run-path/index.js.map +1 -0
- package/dist/_node_modules/{execa/_node_modules/onetime → onetime}/index.cjs +1 -1
- package/dist/_node_modules/onetime/index.cjs.map +1 -0
- package/dist/_node_modules/{execa/_node_modules/onetime → onetime}/index.js +1 -1
- package/dist/_node_modules/onetime/index.js.map +1 -0
- package/dist/_node_modules/p-limit/index.cjs.map +1 -1
- package/dist/_node_modules/p-limit/index.js.map +1 -1
- package/dist/_node_modules/r19/dist/handleRPCRequest.cjs.map +1 -1
- package/dist/_node_modules/r19/dist/handleRPCRequest.js.map +1 -1
- package/dist/_node_modules/shebang-command/index.cjs.map +1 -1
- package/dist/_node_modules/shebang-command/index.js.map +1 -1
- package/dist/_node_modules/signal-exit/index.cjs.map +1 -1
- package/dist/_node_modules/signal-exit/index.js.map +1 -1
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +1 -1
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -1
- package/dist/_node_modules/which/which.cjs.map +1 -1
- package/dist/_node_modules/which/which.js.map +1 -1
- package/dist/_node_modules/zod/lib/index.cjs.map +1 -1
- package/dist/_node_modules/zod/lib/index.js.map +1 -1
- package/dist/_virtual/_commonjsHelpers.cjs +1 -4
- package/dist/_virtual/_commonjsHelpers.cjs.map +1 -1
- package/dist/_virtual/_commonjsHelpers.js +1 -4
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/_virtual/index2.cjs +4 -3
- package/dist/_virtual/index2.cjs.map +1 -1
- package/dist/_virtual/index2.js +4 -2
- package/dist/_virtual/index2.js.map +1 -1
- package/dist/_virtual/index3.cjs +3 -4
- package/dist/_virtual/index3.cjs.map +1 -1
- package/dist/_virtual/index3.js +2 -4
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/auth/PrismicAuthManager.cjs.map +1 -1
- package/dist/auth/PrismicAuthManager.js.map +1 -1
- package/dist/auth/createPrismicAuthManagerMiddleware.cjs.map +1 -1
- package/dist/auth/createPrismicAuthManagerMiddleware.js.map +1 -1
- package/dist/constants/API_ENDPOINTS.cjs.map +1 -1
- package/dist/constants/API_ENDPOINTS.js.map +1 -1
- package/dist/constants/API_TOKENS.cjs.map +1 -1
- package/dist/constants/API_TOKENS.js.map +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/getEnvironmentInfo.cjs.map +1 -1
- package/dist/getEnvironmentInfo.js.map +1 -1
- package/dist/lib/DecodeError.cjs.map +1 -1
- package/dist/lib/DecodeError.js.map +1 -1
- package/dist/lib/buildPrismicRepositoryAPIEndpoint.cjs.map +1 -1
- package/dist/lib/buildPrismicRepositoryAPIEndpoint.js.map +1 -1
- package/dist/lib/fetchGitHubReleaseBodyForRelease.cjs.map +1 -1
- package/dist/lib/fetchGitHubReleaseBodyForRelease.js.map +1 -1
- package/dist/lib/fetchNPMPackageVersions.cjs.map +1 -1
- package/dist/lib/fetchNPMPackageVersions.js.map +1 -1
- package/dist/lib/installDependencies.cjs.map +1 -1
- package/dist/lib/installDependencies.js.map +1 -1
- package/dist/lib/locateFileUpward.cjs.map +1 -1
- package/dist/lib/locateFileUpward.js.map +1 -1
- package/dist/lib/prismicrc.cjs.map +1 -1
- package/dist/lib/prismicrc.js.map +1 -1
- package/dist/managers/SliceMachineManager.cjs.map +1 -1
- package/dist/managers/SliceMachineManager.js.map +1 -1
- package/dist/managers/customTypes/CustomTypesManager.cjs +213 -4
- package/dist/managers/customTypes/CustomTypesManager.cjs.map +1 -1
- package/dist/managers/customTypes/CustomTypesManager.d.ts +130 -11
- package/dist/managers/customTypes/CustomTypesManager.js +215 -6
- package/dist/managers/customTypes/CustomTypesManager.js.map +1 -1
- package/dist/managers/git/GitManager.cjs.map +1 -1
- package/dist/managers/git/GitManager.js.map +1 -1
- package/dist/managers/git/buildGitRepoSpecifier.cjs.map +1 -1
- package/dist/managers/git/buildGitRepoSpecifier.js.map +1 -1
- package/dist/managers/prismicRepository/PrismicRepositoryManager.cjs.map +1 -1
- package/dist/managers/prismicRepository/PrismicRepositoryManager.js.map +1 -1
- package/dist/managers/project/ProjectManager.cjs.map +1 -1
- package/dist/managers/project/ProjectManager.js.map +1 -1
- package/dist/managers/screenshots/ScreenshotsManager.cjs.map +1 -1
- package/dist/managers/screenshots/ScreenshotsManager.js.map +1 -1
- package/dist/managers/sliceTemplateLibrary/SliceTemplateLibraryManager.cjs.map +1 -1
- package/dist/managers/sliceTemplateLibrary/SliceTemplateLibraryManager.js.map +1 -1
- package/dist/managers/slices/SlicesManager.cjs.map +1 -1
- package/dist/managers/slices/SlicesManager.js.map +1 -1
- package/dist/managers/telemetry/TelemetryManager.cjs.map +1 -1
- package/dist/managers/telemetry/TelemetryManager.js.map +1 -1
- package/dist/managers/telemetry/types.cjs +6 -4
- package/dist/managers/telemetry/types.cjs.map +1 -1
- package/dist/managers/telemetry/types.d.ts +7 -6
- package/dist/managers/telemetry/types.js +6 -4
- package/dist/managers/telemetry/types.js.map +1 -1
- package/dist/managers/versions/VersionsManager.cjs.map +1 -1
- package/dist/managers/versions/VersionsManager.js.map +1 -1
- package/package.json +5 -5
- package/src/managers/customTypes/CustomTypesManager.ts +365 -6
- package/src/managers/telemetry/types.ts +17 -12
- package/dist/_node_modules/execa/_node_modules/npm-run-path/index.cjs.map +0 -1
- package/dist/_node_modules/execa/_node_modules/npm-run-path/index.js.map +0 -1
- package/dist/_node_modules/execa/_node_modules/onetime/index.cjs.map +0 -1
- package/dist/_node_modules/execa/_node_modules/onetime/index.js.map +0 -1
- package/dist/_node_modules/execa/_node_modules/path-key/index.cjs.map +0 -1
- package/dist/_node_modules/execa/_node_modules/path-key/index.js.map +0 -1
- /package/dist/_node_modules/{execa → npm-run-path}/_node_modules/path-key/index.cjs +0 -0
- /package/dist/_node_modules/{execa → npm-run-path}/_node_modules/path-key/index.js +0 -0
@@ -2,7 +2,13 @@ import * as t from "io-ts";
|
|
2
2
|
import * as prismicCustomTypesClient from "@prismicio/custom-types-client";
|
3
3
|
import {
|
4
4
|
CustomType,
|
5
|
+
Group,
|
6
|
+
NestableWidget,
|
7
|
+
NestedGroup,
|
5
8
|
SharedSlice,
|
9
|
+
UID,
|
10
|
+
traverseCustomType,
|
11
|
+
traverseSharedSlice,
|
6
12
|
} from "@prismicio/types-internal/lib/customtypes";
|
7
13
|
import {
|
8
14
|
CallHookReturnType,
|
@@ -82,6 +88,25 @@ type CustomTypesMachineManagerDeleteCustomTypeReturnType = {
|
|
82
88
|
errors: (DecodeError | HookError)[];
|
83
89
|
};
|
84
90
|
|
91
|
+
type CustomTypesMachineManagerUpdateCustomTypeReturnType = {
|
92
|
+
errors: (DecodeError | HookError)[];
|
93
|
+
};
|
94
|
+
|
95
|
+
type CustomTypeFieldIdChangedMeta = {
|
96
|
+
previousPath: string[];
|
97
|
+
newPath: string[];
|
98
|
+
};
|
99
|
+
|
100
|
+
type CrCustomType =
|
101
|
+
| string
|
102
|
+
| { id: string; fields?: readonly CrCustomTypeNestedCr[] };
|
103
|
+
type CrCustomTypeNestedCr =
|
104
|
+
| string
|
105
|
+
| { id: string; customtypes: readonly CrCustomTypeFieldLeaf[] };
|
106
|
+
type CrCustomTypeFieldLeaf =
|
107
|
+
| string
|
108
|
+
| { id: string; fields?: readonly string[] };
|
109
|
+
|
85
110
|
export class CustomTypesManager extends BaseManager {
|
86
111
|
async readCustomTypeLibrary(): Promise<SliceMachineManagerReadCustomTypeLibraryReturnType> {
|
87
112
|
assertPluginsInitialized(this.sliceMachinePluginRunner);
|
@@ -167,19 +192,159 @@ export class CustomTypesManager extends BaseManager {
|
|
167
192
|
};
|
168
193
|
}
|
169
194
|
|
195
|
+
/**
|
196
|
+
* Update the Content Relationship API IDs for all existing custom types and
|
197
|
+
* slices. The change is determined by properties inside the `updateMeta`
|
198
|
+
* property.
|
199
|
+
*/
|
200
|
+
private async updateContentRelationships(
|
201
|
+
args: { model: CustomType } & CustomTypeFieldIdChangedMeta,
|
202
|
+
): Promise<
|
203
|
+
OnlyHookErrors<CallHookReturnType<CustomTypeUpdateHook>> & {
|
204
|
+
rollback?: () => Promise<void>;
|
205
|
+
}
|
206
|
+
> {
|
207
|
+
assertPluginsInitialized(this.sliceMachinePluginRunner);
|
208
|
+
|
209
|
+
const { model } = args;
|
210
|
+
let { newPath, previousPath } = args;
|
211
|
+
|
212
|
+
if (previousPath.join(".") !== newPath.join(".")) {
|
213
|
+
previousPath = [model.id, ...previousPath];
|
214
|
+
newPath = [model.id, ...newPath];
|
215
|
+
|
216
|
+
const crUpdates: {
|
217
|
+
updatePromise: Promise<{ errors: HookError[] }>;
|
218
|
+
rollback: () => void;
|
219
|
+
}[] = [];
|
220
|
+
|
221
|
+
// Find existing content relationships that link to the renamed field id in
|
222
|
+
// any custom type and update them to use the new one.
|
223
|
+
const customTypes = await this.readAllCustomTypes();
|
224
|
+
|
225
|
+
updateCustomTypeContentRelationships({
|
226
|
+
models: customTypes.models,
|
227
|
+
onUpdate: ({ previousModel, model: updatedModel }) => {
|
228
|
+
assertPluginsInitialized(this.sliceMachinePluginRunner);
|
229
|
+
|
230
|
+
crUpdates.push({
|
231
|
+
updatePromise: this.sliceMachinePluginRunner?.callHook(
|
232
|
+
"custom-type:update",
|
233
|
+
{ model: updatedModel },
|
234
|
+
),
|
235
|
+
rollback: () => {
|
236
|
+
this.sliceMachinePluginRunner?.callHook("custom-type:update", {
|
237
|
+
model: previousModel,
|
238
|
+
});
|
239
|
+
},
|
240
|
+
});
|
241
|
+
},
|
242
|
+
previousPath,
|
243
|
+
newPath,
|
244
|
+
});
|
245
|
+
|
246
|
+
// Find existing slice with content relationships that link to the renamed
|
247
|
+
// field id in all libraries and update them to use the new one.
|
248
|
+
const { libraries } = await this.slices.readAllSliceLibraries();
|
249
|
+
|
250
|
+
for (const library of libraries) {
|
251
|
+
const slices = await this.slices.readAllSlicesForLibrary({
|
252
|
+
libraryID: library.libraryID,
|
253
|
+
});
|
254
|
+
|
255
|
+
updateSharedSliceContentRelationships({
|
256
|
+
models: slices.models,
|
257
|
+
onUpdate: ({ previousModel, model: updatedModel }) => {
|
258
|
+
assertPluginsInitialized(this.sliceMachinePluginRunner);
|
259
|
+
|
260
|
+
crUpdates.push({
|
261
|
+
updatePromise: this.sliceMachinePluginRunner?.callHook(
|
262
|
+
"slice:update",
|
263
|
+
{ libraryID: library.libraryID, model: updatedModel },
|
264
|
+
),
|
265
|
+
rollback: () => {
|
266
|
+
this.sliceMachinePluginRunner?.callHook("slice:update", {
|
267
|
+
libraryID: library.libraryID,
|
268
|
+
model: previousModel,
|
269
|
+
});
|
270
|
+
},
|
271
|
+
});
|
272
|
+
},
|
273
|
+
previousPath,
|
274
|
+
newPath,
|
275
|
+
});
|
276
|
+
}
|
277
|
+
|
278
|
+
// Process all the Content Relationship updates at once.
|
279
|
+
const crUpdatesResult = await Promise.all(
|
280
|
+
crUpdates.map((update) => update.updatePromise),
|
281
|
+
);
|
282
|
+
|
283
|
+
if (crUpdatesResult.some((result) => result.errors.length > 0)) {
|
284
|
+
return {
|
285
|
+
errors: crUpdatesResult.flatMap((result) => result.errors),
|
286
|
+
rollback: async () => {
|
287
|
+
await Promise.all(crUpdates.map((update) => update.rollback()));
|
288
|
+
},
|
289
|
+
};
|
290
|
+
}
|
291
|
+
}
|
292
|
+
|
293
|
+
return { errors: [] };
|
294
|
+
}
|
295
|
+
|
170
296
|
async updateCustomType(
|
171
297
|
args: CustomTypeUpdateHookData,
|
172
|
-
): Promise<
|
298
|
+
): Promise<CustomTypesMachineManagerUpdateCustomTypeReturnType> {
|
173
299
|
assertPluginsInitialized(this.sliceMachinePluginRunner);
|
300
|
+
const { model } = args;
|
301
|
+
const { fieldIdChanged } = args.updateMeta ?? {};
|
174
302
|
|
175
|
-
|
303
|
+
let previousCustomType: CustomType | undefined;
|
304
|
+
|
305
|
+
if (fieldIdChanged) {
|
306
|
+
const customTypeRead = await this.readCustomType({ id: model.id });
|
307
|
+
|
308
|
+
if (customTypeRead.errors.length > 0) {
|
309
|
+
return { errors: customTypeRead.errors };
|
310
|
+
}
|
311
|
+
if (!customTypeRead.model) {
|
312
|
+
throw new Error(
|
313
|
+
`readCustomType succeeded reading custom type ${model.id} but model is undefined.`,
|
314
|
+
);
|
315
|
+
}
|
316
|
+
|
317
|
+
previousCustomType = customTypeRead.model;
|
318
|
+
}
|
319
|
+
|
320
|
+
const customTypeUpdateResult = await this.sliceMachinePluginRunner.callHook(
|
176
321
|
"custom-type:update",
|
177
|
-
|
322
|
+
{ model },
|
178
323
|
);
|
179
324
|
|
180
|
-
|
181
|
-
errors:
|
182
|
-
}
|
325
|
+
if (customTypeUpdateResult.errors.length > 0) {
|
326
|
+
return { errors: customTypeUpdateResult.errors };
|
327
|
+
}
|
328
|
+
|
329
|
+
if (previousCustomType && fieldIdChanged) {
|
330
|
+
const crUpdateResult = await this.updateContentRelationships({
|
331
|
+
...fieldIdChanged,
|
332
|
+
model: previousCustomType,
|
333
|
+
});
|
334
|
+
|
335
|
+
if (crUpdateResult.errors.length > 0) {
|
336
|
+
// put the previous custom type back
|
337
|
+
await this.sliceMachinePluginRunner?.callHook("custom-type:update", {
|
338
|
+
model: previousCustomType,
|
339
|
+
});
|
340
|
+
// revert the content relationships updates
|
341
|
+
await crUpdateResult.rollback?.();
|
342
|
+
|
343
|
+
return { errors: crUpdateResult.errors };
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
return { errors: [] };
|
183
348
|
}
|
184
349
|
|
185
350
|
async renameCustomType(
|
@@ -393,3 +558,197 @@ const InferSliceResponse = z.object({
|
|
393
558
|
}),
|
394
559
|
langSmithUrl: z.string().url().optional(),
|
395
560
|
});
|
561
|
+
|
562
|
+
function updateCRCustomType(
|
563
|
+
args: { customType: CrCustomType } & CustomTypeFieldIdChangedMeta,
|
564
|
+
): CrCustomType {
|
565
|
+
const [previousCustomTypeId, previousFieldId] = args.previousPath;
|
566
|
+
const [newCustomTypeId, newFieldId] = args.newPath;
|
567
|
+
|
568
|
+
if (!previousCustomTypeId || !newCustomTypeId) {
|
569
|
+
throw new Error(
|
570
|
+
"Could not find a customtype id in previousPath and/or newPath, which should not be possible.",
|
571
|
+
);
|
572
|
+
}
|
573
|
+
|
574
|
+
if (!previousFieldId || !newFieldId) {
|
575
|
+
throw new Error(
|
576
|
+
"Could not find a field id in previousPath and/or newPath, which should not be possible.",
|
577
|
+
);
|
578
|
+
}
|
579
|
+
|
580
|
+
const customType = shallowCloneIfObject(args.customType);
|
581
|
+
|
582
|
+
if (typeof customType === "string" || !customType.fields) {
|
583
|
+
return customType;
|
584
|
+
}
|
585
|
+
|
586
|
+
const matchedCustomTypeId = customType.id === previousCustomTypeId;
|
587
|
+
|
588
|
+
const newFields = customType.fields.map((fieldArg) => {
|
589
|
+
const customTypeField = shallowCloneIfObject(fieldArg);
|
590
|
+
|
591
|
+
if (typeof customTypeField === "string") {
|
592
|
+
if (
|
593
|
+
matchedCustomTypeId &&
|
594
|
+
customTypeField === previousFieldId &&
|
595
|
+
customTypeField !== newFieldId
|
596
|
+
) {
|
597
|
+
// We have reached a field id that matches the id that was renamed,
|
598
|
+
// so we update it new one. The field is a string, so return the new
|
599
|
+
// id.
|
600
|
+
return newFieldId;
|
601
|
+
}
|
602
|
+
|
603
|
+
return customTypeField;
|
604
|
+
}
|
605
|
+
|
606
|
+
if (
|
607
|
+
matchedCustomTypeId &&
|
608
|
+
customTypeField.id === previousFieldId &&
|
609
|
+
customTypeField.id !== newFieldId
|
610
|
+
) {
|
611
|
+
// We have reached a field id that matches the id that was renamed,
|
612
|
+
// so we update it new one.
|
613
|
+
// Since field is not a string, we don't exit, as we might have
|
614
|
+
// something to update further down in customtypes.
|
615
|
+
customTypeField.id = newFieldId;
|
616
|
+
}
|
617
|
+
|
618
|
+
return {
|
619
|
+
...customTypeField,
|
620
|
+
customtypes: customTypeField.customtypes.map((customTypeArg) => {
|
621
|
+
const nestedCustomType = shallowCloneIfObject(customTypeArg);
|
622
|
+
|
623
|
+
if (
|
624
|
+
typeof nestedCustomType === "string" ||
|
625
|
+
!nestedCustomType.fields ||
|
626
|
+
// Since we are on the last level, if we don't start matching right
|
627
|
+
// at the custom type id, we can return exit early because it's not
|
628
|
+
// a match.
|
629
|
+
nestedCustomType.id !== previousCustomTypeId
|
630
|
+
) {
|
631
|
+
return nestedCustomType;
|
632
|
+
}
|
633
|
+
|
634
|
+
return {
|
635
|
+
...nestedCustomType,
|
636
|
+
fields: nestedCustomType.fields.map((fieldArg) => {
|
637
|
+
const nestedCustomTypeField = shallowCloneIfObject(fieldArg);
|
638
|
+
|
639
|
+
if (
|
640
|
+
nestedCustomTypeField === previousFieldId &&
|
641
|
+
nestedCustomTypeField !== newFieldId
|
642
|
+
) {
|
643
|
+
// Matches the previous id, so we update it and return because
|
644
|
+
// it's the last level.
|
645
|
+
return newFieldId;
|
646
|
+
}
|
647
|
+
|
648
|
+
return nestedCustomTypeField;
|
649
|
+
}),
|
650
|
+
};
|
651
|
+
}),
|
652
|
+
};
|
653
|
+
});
|
654
|
+
|
655
|
+
return { ...customType, fields: newFields };
|
656
|
+
}
|
657
|
+
|
658
|
+
/**
|
659
|
+
* Update the Content Relationship API IDs of a single field. The change is
|
660
|
+
* determined by the `previousPath` and `newPath` properties.
|
661
|
+
*/
|
662
|
+
function updateFieldContentRelationships<
|
663
|
+
T extends UID | NestableWidget | Group | NestedGroup,
|
664
|
+
>(args: { field: T } & CustomTypeFieldIdChangedMeta): T {
|
665
|
+
const { field, ...updateMeta } = args;
|
666
|
+
if (
|
667
|
+
field.type !== "Link" ||
|
668
|
+
field.config?.select !== "document" ||
|
669
|
+
!field.config?.customtypes
|
670
|
+
) {
|
671
|
+
// not a content relationship field
|
672
|
+
return field;
|
673
|
+
}
|
674
|
+
|
675
|
+
const newCustomTypes = field.config.customtypes.map((customType) => {
|
676
|
+
return updateCRCustomType({ customType, ...updateMeta });
|
677
|
+
});
|
678
|
+
|
679
|
+
return {
|
680
|
+
...field,
|
681
|
+
config: { ...field.config, customtypes: newCustomTypes },
|
682
|
+
};
|
683
|
+
}
|
684
|
+
|
685
|
+
export function updateCustomTypeContentRelationships(
|
686
|
+
args: {
|
687
|
+
models: { model: CustomType }[];
|
688
|
+
onUpdate: (model: { previousModel: CustomType; model: CustomType }) => void;
|
689
|
+
} & CustomTypeFieldIdChangedMeta,
|
690
|
+
): void {
|
691
|
+
const { models, previousPath, newPath, onUpdate } = args;
|
692
|
+
|
693
|
+
for (const { model: customType } of models) {
|
694
|
+
const updatedCustomType = traverseCustomType({
|
695
|
+
customType,
|
696
|
+
onField: ({ field }) => {
|
697
|
+
return updateFieldContentRelationships({
|
698
|
+
field,
|
699
|
+
previousPath,
|
700
|
+
newPath,
|
701
|
+
});
|
702
|
+
},
|
703
|
+
});
|
704
|
+
|
705
|
+
if (!isEqualModel(customType, updatedCustomType)) {
|
706
|
+
onUpdate({ model: updatedCustomType, previousModel: customType });
|
707
|
+
}
|
708
|
+
}
|
709
|
+
}
|
710
|
+
|
711
|
+
export function updateSharedSliceContentRelationships(
|
712
|
+
args: {
|
713
|
+
models: { model: SharedSlice }[];
|
714
|
+
onUpdate: (model: {
|
715
|
+
previousModel: SharedSlice;
|
716
|
+
model: SharedSlice;
|
717
|
+
}) => void;
|
718
|
+
} & CustomTypeFieldIdChangedMeta,
|
719
|
+
): void {
|
720
|
+
const { models, previousPath, newPath, onUpdate } = args;
|
721
|
+
|
722
|
+
for (const { model: slice } of models) {
|
723
|
+
const updateSlice = traverseSharedSlice({
|
724
|
+
path: ["."],
|
725
|
+
slice,
|
726
|
+
onField: ({ field }) => {
|
727
|
+
return updateFieldContentRelationships({
|
728
|
+
field,
|
729
|
+
previousPath,
|
730
|
+
newPath,
|
731
|
+
});
|
732
|
+
},
|
733
|
+
});
|
734
|
+
|
735
|
+
if (!isEqualModel(slice, updateSlice)) {
|
736
|
+
onUpdate({ model: updateSlice, previousModel: slice });
|
737
|
+
}
|
738
|
+
}
|
739
|
+
}
|
740
|
+
|
741
|
+
function isEqualModel<T extends CustomType | SharedSlice>(
|
742
|
+
modelA: T,
|
743
|
+
modelB: T,
|
744
|
+
): boolean {
|
745
|
+
return JSON.stringify(modelA) === JSON.stringify(modelB);
|
746
|
+
}
|
747
|
+
|
748
|
+
function shallowCloneIfObject<T>(value: T): T {
|
749
|
+
if (typeof value === "object") {
|
750
|
+
return { ...value };
|
751
|
+
}
|
752
|
+
|
753
|
+
return value;
|
754
|
+
}
|
@@ -35,6 +35,8 @@ export const SegmentEventType = {
|
|
35
35
|
devCollab_setUpWorkflowOpened: "dev-collab:set-up-workflow-opened",
|
36
36
|
devCollab_workflowStubDisplayed: "dev-collab:workflow-stub-displayed",
|
37
37
|
sliceMachine_start: "slice-machine:start",
|
38
|
+
sliceLibrary_beta_modalOpened: "slice-library:beta:modal-opened",
|
39
|
+
sliceLibrary_beta_codeOpened: "slice-library:beta:code-opened",
|
38
40
|
postPush_emptyStateCtaClicked: "post-push:empty-state-cta-clicked",
|
39
41
|
postPush_toastCtaClicked: "post-push:toast-cta-clicked",
|
40
42
|
experiment_exposure: "experiment:exposure",
|
@@ -43,7 +45,6 @@ export const SegmentEventType = {
|
|
43
45
|
sharedOnboarding_completed: "shared-onboarding:completed",
|
44
46
|
sharedOnboarding_tutorial: "shared-onboarding:follow-tutorial",
|
45
47
|
sliceGenerationFeedback: "slice-generation-feedback",
|
46
|
-
navigation_documentationLinkClicked: "navigation:documentation-link-clicked",
|
47
48
|
} as const;
|
48
49
|
type SegmentEventTypes =
|
49
50
|
(typeof SegmentEventType)[keyof typeof SegmentEventType];
|
@@ -87,6 +88,10 @@ export const HumanSegmentEventType = {
|
|
87
88
|
[SegmentEventType.devCollab_workflowStubDisplayed]:
|
88
89
|
"SliceMachine Dev Collab Workflow Stub Displayed",
|
89
90
|
[SegmentEventType.sliceMachine_start]: "SliceMachine Start",
|
91
|
+
[SegmentEventType.sliceLibrary_beta_modalOpened]:
|
92
|
+
"SliceMachine Slice Library [BETA] CTA modal displayed",
|
93
|
+
[SegmentEventType.sliceLibrary_beta_codeOpened]:
|
94
|
+
"SliceMachine Slice Library [BETA] CTA example code opened",
|
90
95
|
[SegmentEventType.postPush_emptyStateCtaClicked]:
|
91
96
|
"SliceMachine Post Push Empty State CTA Clicked",
|
92
97
|
[SegmentEventType.postPush_toastCtaClicked]:
|
@@ -101,8 +106,6 @@ export const HumanSegmentEventType = {
|
|
101
106
|
[SegmentEventType.sharedOnboarding_tutorial]:
|
102
107
|
"Prismic Onboarding Guide Follow Tutorial",
|
103
108
|
[SegmentEventType.sliceGenerationFeedback]: "Slice Generation Feedback",
|
104
|
-
[SegmentEventType.navigation_documentationLinkClicked]:
|
105
|
-
"SliceMachine Documentation Link Clicked",
|
106
109
|
} as const;
|
107
110
|
|
108
111
|
export type HumanSegmentEventTypes =
|
@@ -372,6 +375,14 @@ type SliceMachineStart = SegmentEvent<
|
|
372
375
|
}
|
373
376
|
>;
|
374
377
|
|
378
|
+
type SliceLibraryBetaModalOpened = SegmentEvent<
|
379
|
+
typeof SegmentEventType.sliceLibrary_beta_modalOpened
|
380
|
+
>;
|
381
|
+
|
382
|
+
type SliceLibraryBetaCodeOpened = SegmentEvent<
|
383
|
+
typeof SegmentEventType.sliceLibrary_beta_codeOpened
|
384
|
+
>;
|
385
|
+
|
375
386
|
type OnboardingCommonPayload = { stepId: string; stepTitle: string };
|
376
387
|
type SharedOnboardingProperties<T = Record<string, string>> = T & {
|
377
388
|
source: "SliceMachine";
|
@@ -420,13 +431,6 @@ type SliceGenerationFeedback = SegmentEvent<
|
|
420
431
|
}
|
421
432
|
>;
|
422
433
|
|
423
|
-
type NavigationDocumentationLinkClicked = SegmentEvent<
|
424
|
-
typeof SegmentEventType.navigation_documentationLinkClicked,
|
425
|
-
{
|
426
|
-
framework: string;
|
427
|
-
}
|
428
|
-
>;
|
429
|
-
|
430
434
|
export type SegmentEvents =
|
431
435
|
| CommandInitStartSegmentEvent
|
432
436
|
| CommandInitIdentifySegmentEvent
|
@@ -457,6 +461,8 @@ export type SegmentEvents =
|
|
457
461
|
| DevCollabSetUpWorkflowOpened
|
458
462
|
| DevCollabWorkflowStubDisplayed
|
459
463
|
| SliceMachineStart
|
464
|
+
| SliceLibraryBetaModalOpened
|
465
|
+
| SliceLibraryBetaCodeOpened
|
460
466
|
| SliceMachineSharedOnboardingStepOpened
|
461
467
|
| SliceMachineSharedOnboardingStepCompleted
|
462
468
|
| SliceMachineSharedOnboardingCompleted
|
@@ -464,5 +470,4 @@ export type SegmentEvents =
|
|
464
470
|
| SliceMachinePostPushEmptyStateCtaClicked
|
465
471
|
| SliceMachinePostPushToastCtaClicked
|
466
472
|
| SliceMachineExperimentExposure
|
467
|
-
| SliceGenerationFeedback
|
468
|
-
| NavigationDocumentationLinkClicked;
|
473
|
+
| SliceGenerationFeedback;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../../node_modules/execa/node_modules/npm-run-path/index.js"],"sourcesContent":["import process from 'node:process';\nimport path from 'node:path';\nimport url from 'node:url';\nimport pathKey from 'path-key';\n\nexport function npmRunPath(options = {}) {\n\tconst {\n\t\tcwd = process.cwd(),\n\t\tpath: path_ = process.env[pathKey()],\n\t\texecPath = process.execPath,\n\t} = options;\n\n\tlet previous;\n\tconst cwdString = cwd instanceof URL ? url.fileURLToPath(cwd) : cwd;\n\tlet cwdPath = path.resolve(cwdString);\n\tconst result = [];\n\n\twhile (previous !== cwdPath) {\n\t\tresult.push(path.join(cwdPath, 'node_modules/.bin'));\n\t\tprevious = cwdPath;\n\t\tcwdPath = path.resolve(cwdPath, '..');\n\t}\n\n\t// Ensure the running `node` binary is used.\n\tresult.push(path.resolve(cwdString, execPath, '..'));\n\n\treturn [...result, path_].join(path.delimiter);\n}\n\nexport function npmRunPathEnv({env = process.env, ...options} = {}) {\n\tenv = {...env};\n\n\tconst path = pathKey({env});\n\toptions.path = env[path];\n\tenv[path] = npmRunPath(options);\n\n\treturn env;\n}\n"],"names":["pathKey","path"],"mappings":";;;;;;AAKO,SAAS,WAAW,UAAU,IAAI;AACxC,QAAM;AAAA,IACL,MAAM,QAAQ,IAAK;AAAA,IACnB,MAAM,QAAQ,QAAQ,IAAIA,MAAO,CAAE;AAAA,IACnC,WAAW,QAAQ;AAAA,EACnB,IAAG;AAEJ,MAAI;AACJ,QAAM,YAAY,eAAe,MAAM,IAAI,cAAc,GAAG,IAAI;AAChE,MAAI,UAAU,KAAK,QAAQ,SAAS;AACpC,QAAM,SAAS,CAAA;AAEf,SAAO,aAAa,SAAS;AAC5B,WAAO,KAAK,KAAK,KAAK,SAAS,mBAAmB,CAAC;AACnD,eAAW;AACX,cAAU,KAAK,QAAQ,SAAS,IAAI;AAAA,EACpC;AAGD,SAAO,KAAK,KAAK,QAAQ,WAAW,UAAU,IAAI,CAAC;AAEnD,SAAO,CAAC,GAAG,QAAQ,KAAK,EAAE,KAAK,KAAK,SAAS;AAC9C;AAEO,SAAS,cAAc,EAAC,MAAM,QAAQ,KAAK,GAAG,QAAO,IAAI,IAAI;AACnE,QAAM,EAAC,GAAG,IAAG;AAEb,QAAMC,QAAOD,MAAQ,EAAC,IAAG,CAAC;AAC1B,UAAQ,OAAO,IAAIC,KAAI;AACvB,MAAIA,KAAI,IAAI,WAAW,OAAO;AAE9B,SAAO;AACR;;;","x_google_ignoreList":[0]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../node_modules/execa/node_modules/npm-run-path/index.js"],"sourcesContent":["import process from 'node:process';\nimport path from 'node:path';\nimport url from 'node:url';\nimport pathKey from 'path-key';\n\nexport function npmRunPath(options = {}) {\n\tconst {\n\t\tcwd = process.cwd(),\n\t\tpath: path_ = process.env[pathKey()],\n\t\texecPath = process.execPath,\n\t} = options;\n\n\tlet previous;\n\tconst cwdString = cwd instanceof URL ? url.fileURLToPath(cwd) : cwd;\n\tlet cwdPath = path.resolve(cwdString);\n\tconst result = [];\n\n\twhile (previous !== cwdPath) {\n\t\tresult.push(path.join(cwdPath, 'node_modules/.bin'));\n\t\tprevious = cwdPath;\n\t\tcwdPath = path.resolve(cwdPath, '..');\n\t}\n\n\t// Ensure the running `node` binary is used.\n\tresult.push(path.resolve(cwdString, execPath, '..'));\n\n\treturn [...result, path_].join(path.delimiter);\n}\n\nexport function npmRunPathEnv({env = process.env, ...options} = {}) {\n\tenv = {...env};\n\n\tconst path = pathKey({env});\n\toptions.path = env[path];\n\tenv[path] = npmRunPath(options);\n\n\treturn env;\n}\n"],"names":["path"],"mappings":";;;;AAKO,SAAS,WAAW,UAAU,IAAI;AACxC,QAAM;AAAA,IACL,MAAM,QAAQ,IAAK;AAAA,IACnB,MAAM,QAAQ,QAAQ,IAAI,QAAO,CAAE;AAAA,IACnC,WAAW,QAAQ;AAAA,EACnB,IAAG;AAEJ,MAAI;AACJ,QAAM,YAAY,eAAe,MAAM,IAAI,cAAc,GAAG,IAAI;AAChE,MAAI,UAAUA,cAAK,QAAQ,SAAS;AACpC,QAAM,SAAS,CAAA;AAEf,SAAO,aAAa,SAAS;AAC5B,WAAO,KAAKA,cAAK,KAAK,SAAS,mBAAmB,CAAC;AACnD,eAAW;AACX,cAAUA,cAAK,QAAQ,SAAS,IAAI;AAAA,EACpC;AAGD,SAAO,KAAKA,cAAK,QAAQ,WAAW,UAAU,IAAI,CAAC;AAEnD,SAAO,CAAC,GAAG,QAAQ,KAAK,EAAE,KAAKA,cAAK,SAAS;AAC9C;AAEO,SAAS,cAAc,EAAC,MAAM,QAAQ,KAAK,GAAG,QAAO,IAAI,IAAI;AACnE,QAAM,EAAC,GAAG,IAAG;AAEb,QAAM,OAAO,QAAQ,EAAC,IAAG,CAAC;AAC1B,UAAQ,OAAO,IAAI,IAAI;AACvB,MAAI,IAAI,IAAI,WAAW,OAAO;AAE9B,SAAO;AACR;","x_google_ignoreList":[0]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../../node_modules/execa/node_modules/onetime/index.js"],"sourcesContent":["import mimicFunction from 'mimic-fn';\n\nconst calledFunctions = new WeakMap();\n\nconst onetime = (function_, options = {}) => {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError('Expected a function');\n\t}\n\n\tlet returnValue;\n\tlet callCount = 0;\n\tconst functionName = function_.displayName || function_.name || '<anonymous>';\n\n\tconst onetime = function (...arguments_) {\n\t\tcalledFunctions.set(onetime, ++callCount);\n\n\t\tif (callCount === 1) {\n\t\t\treturnValue = function_.apply(this, arguments_);\n\t\t\tfunction_ = null;\n\t\t} else if (options.throw === true) {\n\t\t\tthrow new Error(`Function \\`${functionName}\\` can only be called once`);\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tmimicFunction(onetime, function_);\n\tcalledFunctions.set(onetime, callCount);\n\n\treturn onetime;\n};\n\nonetime.callCount = function_ => {\n\tif (!calledFunctions.has(function_)) {\n\t\tthrow new Error(`The given function \\`${function_.name}\\` is not wrapped by the \\`onetime\\` package`);\n\t}\n\n\treturn calledFunctions.get(function_);\n};\n\nexport default onetime;\n"],"names":["onetime","mimicFunction"],"mappings":";;AAEA,MAAM,kBAAkB,oBAAI;AAEvB,MAAC,UAAU,CAAC,WAAW,UAAU,OAAO;AAC5C,MAAI,OAAO,cAAc,YAAY;AACpC,UAAM,IAAI,UAAU,qBAAqB;AAAA,EACzC;AAED,MAAI;AACJ,MAAI,YAAY;AAChB,QAAM,eAAe,UAAU,eAAe,UAAU,QAAQ;AAEhE,QAAMA,WAAU,YAAa,YAAY;AACxC,oBAAgB,IAAIA,UAAS,EAAE,SAAS;AAExC,QAAI,cAAc,GAAG;AACpB,oBAAc,UAAU,MAAM,MAAM,UAAU;AAC9C,kBAAY;AAAA,IACf,WAAa,QAAQ,UAAU,MAAM;AAClC,YAAM,IAAI,MAAM,cAAc,wCAAwC;AAAA,IACtE;AAED,WAAO;AAAA,EACT;AAECC,QAAcD,UAAS,SAAS;AAChC,kBAAgB,IAAIA,UAAS,SAAS;AAEtC,SAAOA;AACR;AAEA,QAAQ,YAAY,eAAa;AAChC,MAAI,CAAC,gBAAgB,IAAI,SAAS,GAAG;AACpC,UAAM,IAAI,MAAM,wBAAwB,UAAU,kDAAkD;AAAA,EACpG;AAED,SAAO,gBAAgB,IAAI,SAAS;AACrC;;","x_google_ignoreList":[0]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../node_modules/execa/node_modules/onetime/index.js"],"sourcesContent":["import mimicFunction from 'mimic-fn';\n\nconst calledFunctions = new WeakMap();\n\nconst onetime = (function_, options = {}) => {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError('Expected a function');\n\t}\n\n\tlet returnValue;\n\tlet callCount = 0;\n\tconst functionName = function_.displayName || function_.name || '<anonymous>';\n\n\tconst onetime = function (...arguments_) {\n\t\tcalledFunctions.set(onetime, ++callCount);\n\n\t\tif (callCount === 1) {\n\t\t\treturnValue = function_.apply(this, arguments_);\n\t\t\tfunction_ = null;\n\t\t} else if (options.throw === true) {\n\t\t\tthrow new Error(`Function \\`${functionName}\\` can only be called once`);\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tmimicFunction(onetime, function_);\n\tcalledFunctions.set(onetime, callCount);\n\n\treturn onetime;\n};\n\nonetime.callCount = function_ => {\n\tif (!calledFunctions.has(function_)) {\n\t\tthrow new Error(`The given function \\`${function_.name}\\` is not wrapped by the \\`onetime\\` package`);\n\t}\n\n\treturn calledFunctions.get(function_);\n};\n\nexport default onetime;\n"],"names":["onetime"],"mappings":";AAEA,MAAM,kBAAkB,oBAAI;AAEvB,MAAC,UAAU,CAAC,WAAW,UAAU,OAAO;AAC5C,MAAI,OAAO,cAAc,YAAY;AACpC,UAAM,IAAI,UAAU,qBAAqB;AAAA,EACzC;AAED,MAAI;AACJ,MAAI,YAAY;AAChB,QAAM,eAAe,UAAU,eAAe,UAAU,QAAQ;AAEhE,QAAMA,WAAU,YAAa,YAAY;AACxC,oBAAgB,IAAIA,UAAS,EAAE,SAAS;AAExC,QAAI,cAAc,GAAG;AACpB,oBAAc,UAAU,MAAM,MAAM,UAAU;AAC9C,kBAAY;AAAA,IACf,WAAa,QAAQ,UAAU,MAAM;AAClC,YAAM,IAAI,MAAM,cAAc,wCAAwC;AAAA,IACtE;AAED,WAAO;AAAA,EACT;AAEC,gBAAcA,UAAS,SAAS;AAChC,kBAAgB,IAAIA,UAAS,SAAS;AAEtC,SAAOA;AACR;AAEA,QAAQ,YAAY,eAAa;AAChC,MAAI,CAAC,gBAAgB,IAAI,SAAS,GAAG;AACpC,UAAM,IAAI,MAAM,wBAAwB,UAAU,kDAAkD;AAAA,EACpG;AAED,SAAO,gBAAgB,IAAI,SAAS;AACrC;","x_google_ignoreList":[0]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../../node_modules/execa/node_modules/path-key/index.js"],"sourcesContent":["export default function pathKey(options = {}) {\n\tconst {\n\t\tenv = process.env,\n\t\tplatform = process.platform\n\t} = options;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(env).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n}\n"],"names":[],"mappings":";AAAe,SAAS,QAAQ,UAAU,IAAI;AAC7C,QAAM;AAAA,IACL,MAAM,QAAQ;AAAA,IACd,WAAW,QAAQ;AAAA,EACnB,IAAG;AAEJ,MAAI,aAAa,SAAS;AACzB,WAAO;AAAA,EACP;AAED,SAAO,OAAO,KAAK,GAAG,EAAE,QAAO,EAAG,KAAK,SAAO,IAAI,YAAW,MAAO,MAAM,KAAK;AAChF;;","x_google_ignoreList":[0]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../node_modules/execa/node_modules/path-key/index.js"],"sourcesContent":["export default function pathKey(options = {}) {\n\tconst {\n\t\tenv = process.env,\n\t\tplatform = process.platform\n\t} = options;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(env).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n}\n"],"names":[],"mappings":"AAAe,SAAS,QAAQ,UAAU,IAAI;AAC7C,QAAM;AAAA,IACL,MAAM,QAAQ;AAAA,IACd,WAAW,QAAQ;AAAA,EACnB,IAAG;AAEJ,MAAI,aAAa,SAAS;AACzB,WAAO;AAAA,EACP;AAED,SAAO,OAAO,KAAK,GAAG,EAAE,QAAO,EAAG,KAAK,SAAO,IAAI,YAAW,MAAO,MAAM,KAAK;AAChF;","x_google_ignoreList":[0]}
|
File without changes
|
File without changes
|