gt-sanity 4.0.10 → 4.0.12
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/index.d.ts +5 -1
- package/dist/index.js +322 -118
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/adapter/api.test.ts +255 -0
- package/src/adapter/api.ts +292 -0
- package/src/adapter/core.ts +9 -4
- package/src/adapter/createTask.ts +3 -3
- package/src/adapter/getTranslation.ts +2 -2
- package/src/adapter/getTranslationTask.ts +2 -2
- package/src/components/TranslationsProvider.tsx +2 -2
- package/src/configuration/baseDocumentLevelConfig/documentLevelPatch.test.ts +101 -0
- package/src/configuration/baseDocumentLevelConfig/documentLevelPatch.ts +22 -21
- package/src/configuration/baseDocumentLevelConfig/index.ts +2 -2
- package/src/configuration/baseFieldLevelConfig.ts +10 -13
- package/src/configuration/utils/findLatestDraft.ts +5 -2
- package/src/configuration/utils/requireSourceDocument.ts +56 -0
- package/src/translation/__tests__/captureExistingTranslations.test.ts +2 -0
- package/src/translation/__tests__/initProject.test.ts +6 -6
- package/src/translation/captureExistingTranslations.ts +3 -3
- package/src/translation/checkTranslationStatus.ts +2 -2
- package/src/translation/createJobs.ts +4 -4
- package/src/translation/downloadTranslations.ts +2 -2
- package/src/translation/initProject.ts +4 -4
- package/src/translation/uploadFiles.ts +3 -3
- package/src/translation/uploadTranslations.ts +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -175,10 +175,14 @@ declare type FieldMatcher = {
|
|
|
175
175
|
}[];
|
|
176
176
|
};
|
|
177
177
|
|
|
178
|
+
/**
|
|
179
|
+
* Resolves the draft for a document id, falling back to the published copy.
|
|
180
|
+
* Returns `undefined` when neither exists.
|
|
181
|
+
*/
|
|
178
182
|
export declare const findLatestDraft: (
|
|
179
183
|
documentId: string,
|
|
180
184
|
client: SanityClient,
|
|
181
|
-
) => Promise<SanityDocument>;
|
|
185
|
+
) => Promise<SanityDocument | undefined>;
|
|
182
186
|
|
|
183
187
|
declare const gt: GT;
|
|
184
188
|
|