-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sanity): add telemetry for versions (#7460)
* fix(sanity): issue where the createVersionSuccess was never resolving * feat(sanity): add telemetry when adding version * refactor(sanity): rename bundles to releases telemetry * feat(sanity): add telemetry when creating release * feat(sanity): add telemetry when updating release * feat(sanity): add telemetry when deleting release * feat(sanity): add telemetry when publishing release * feat(sanity): add telemetry when archive and unarchive release * chore(sanity): fix dependencies * feat(sanity): add telemetry when creating a draft * refactor(sanity): add telemetry for tracking drafts and include version * refactor(sanity): update telemetry request for creating release * refactor(sanity): reuse interface for OriginInfo * docs(sanity): clarify unarchive / archive telemetry track
- Loading branch information
Showing
9 changed files
with
155 additions
and
7 deletions.
There are no files selected for viewing
84 changes: 84 additions & 0 deletions
84
packages/sanity/src/core/bundles/__telemetry__/releases.telemetry.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import {defineEvent} from '@sanity/telemetry' | ||
|
||
interface VersionInfo { | ||
/** | ||
* document type that was added | ||
*/ | ||
schemaType: string | ||
|
||
/** | ||
* the origin of the version created (from a draft or from a version) | ||
*/ | ||
documentOrigin: 'draft' | 'version' | ||
} | ||
|
||
export interface OriginInfo { | ||
/** | ||
* determines where the release was created, either from the structure view or the release plugin | ||
*/ | ||
origin: 'structure' | 'release-plugin' | ||
} | ||
|
||
/** | ||
* When a document (version) is successfully added to a release | ||
* @internal | ||
*/ | ||
export const AddedVersion = defineEvent<VersionInfo>({ | ||
name: 'Add version of document to release', | ||
version: 1, | ||
description: 'User added a document to a release', | ||
}) | ||
|
||
/** When a release is successfully created | ||
* @internal | ||
*/ | ||
export const CreatedRelease = defineEvent<OriginInfo>({ | ||
name: 'Create release', | ||
version: 1, | ||
description: 'User created a release', | ||
}) | ||
|
||
/** When a release is successfully updated | ||
* @internal | ||
*/ | ||
export const UpdatedRelease = defineEvent({ | ||
name: 'Update release', | ||
version: 1, | ||
description: 'User updated a release', | ||
}) | ||
|
||
/** When a release is successfully deleted | ||
* @internal | ||
*/ | ||
export const DeletedRelease = defineEvent({ | ||
name: 'Delete release', | ||
version: 1, | ||
description: 'User deleted a release', | ||
}) | ||
|
||
/** When a release is successfully published | ||
* @internal | ||
*/ | ||
export const PublishedRelease = defineEvent({ | ||
name: 'Publish release', | ||
version: 1, | ||
description: 'User published a release', | ||
}) | ||
|
||
/** When a release is successfully archived | ||
* @internal | ||
*/ | ||
export const ArchivedRelease = defineEvent({ | ||
name: 'Archive release', | ||
version: 1, | ||
description: 'User archived a release', | ||
}) | ||
|
||
/** When a release is successfully unarchived | ||
* @internal | ||
*/ | ||
export const UnarchivedRelease = defineEvent({ | ||
name: 'Unarchive release', | ||
version: 1, | ||
description: 'User unarchived a release', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters