@payloadcms/sdk 4.0.0-canary.1 → 4.0.0-canary.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.
|
@@ -38,10 +38,6 @@ export type UpdateBaseOptions<T extends PayloadTypesShape, TSlug extends Collect
|
|
|
38
38
|
* Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.
|
|
39
39
|
*/
|
|
40
40
|
populate?: PopulateType<T>;
|
|
41
|
-
/**
|
|
42
|
-
* Publish the document / documents with a specific locale.
|
|
43
|
-
*/
|
|
44
|
-
publishSpecificLocale?: string;
|
|
45
41
|
/**
|
|
46
42
|
* Specify [select](https://payloadcms.com/docs/queries/select) to control which fields to include to the result.
|
|
47
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/collections/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAEjB,WAAW,EACX,oBAAoB,EACpB,KAAK,EACN,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,8BAA8B,EAC9B,wBAAwB,EACxB,6BAA6B,EAC9B,MAAM,aAAa,CAAA;AAIpB,MAAM,MAAM,iBAAiB,CAC3B,CAAC,SAAS,iBAAiB,EAC3B,KAAK,SAAS,cAAc,CAAC,CAAC,CAAC,EAC/B,OAAO,SAAS,wBAAwB,CAAC,CAAC,EAAE,KAAK,CAAC,IAChD;IACF;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC,8BAA8B,CAAC,CAAC,EAAE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AS,iBAAiB,EAC3B,KAAK,SAAS,cAAc,CAAC,CAAC,CAAC,EAC/B,OAAO,SAAS,wBAAwB,CAAC,CAAC,EAAE,KAAK,CAAC,IAChD,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;AAE/E,wBAAsB,MAAM,CAC1B,CAAC,SAAS,iBAAiB,EAC3B,KAAK,SAAS,cAAc,CAAC,CAAC,CAAC,EAC/B,OAAO,SAAS,wBAAwB,CAAC,CAAC,EAAE,KAAK,CAAC,EAElD,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,EAClB,OAAO,EAAE,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,EACzC,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CACR,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,6BAA6B,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAC1F,CAuBA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/update.ts"],"sourcesContent":["import type {\n CollectionSlug,\n PayloadTypesShape,\n SelectType,\n TypedLocale,\n UploadCollectionSlug,\n Where,\n} from 'payload'\nimport type { DeepPartial } from 'ts-essentials'\n\nimport type { PayloadSDK } from '../index.js'\nimport type {\n BulkOperationResult,\n PopulateType,\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n TransformCollectionWithSelect,\n} from '../types.js'\n\nimport { resolveFileFromOptions } from '../utilities/resolveFileFromOptions.js'\n\nexport type UpdateBaseOptions<\n T extends PayloadTypesShape,\n TSlug extends CollectionSlug<T>,\n TSelect extends SelectFromCollectionSlug<T, TSlug>,\n> = {\n /**\n * Whether the current update should be marked as from autosave.\n * `versions.drafts.autosave` should be specified.\n */\n autosave?: boolean\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * The document / documents data to update.\n */\n data: DeepPartial<RequiredDataFromCollectionSlug<T, TSlug>>\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * Update documents to a draft.\n */\n draft?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale<T>\n /** File Blob object or URL to the file. Only for upload collections */\n file?: TSlug extends UploadCollectionSlug<T> ? Blob | string : never\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: TypedLocale<T>\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType<T>\n /**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/collections/update.ts"],"sourcesContent":["import type {\n CollectionSlug,\n PayloadTypesShape,\n SelectType,\n TypedLocale,\n UploadCollectionSlug,\n Where,\n} from 'payload'\nimport type { DeepPartial } from 'ts-essentials'\n\nimport type { PayloadSDK } from '../index.js'\nimport type {\n BulkOperationResult,\n PopulateType,\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n TransformCollectionWithSelect,\n} from '../types.js'\n\nimport { resolveFileFromOptions } from '../utilities/resolveFileFromOptions.js'\n\nexport type UpdateBaseOptions<\n T extends PayloadTypesShape,\n TSlug extends CollectionSlug<T>,\n TSelect extends SelectFromCollectionSlug<T, TSlug>,\n> = {\n /**\n * Whether the current update should be marked as from autosave.\n * `versions.drafts.autosave` should be specified.\n */\n autosave?: boolean\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * The document / documents data to update.\n */\n data: DeepPartial<RequiredDataFromCollectionSlug<T, TSlug>>\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * Update documents to a draft.\n */\n draft?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale<T>\n /** File Blob object or URL to the file. Only for upload collections */\n file?: TSlug extends UploadCollectionSlug<T> ? Blob | string : never\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: TypedLocale<T>\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType<T>\n /**\n * Specify [select](https://payloadcms.com/docs/queries/select) to control which fields to include to the result.\n */\n select?: TSelect\n /**\n * When `true`, the operation can target trashed (soft-deleted) documents. No effect unless the collection has `trash` enabled.\n * @default false\n */\n trash?: boolean\n}\n\nexport type UpdateByIDOptions<\n T extends PayloadTypesShape,\n TSlug extends CollectionSlug<T>,\n TSelect extends SelectFromCollectionSlug<T, TSlug>,\n> = {\n id: number | string\n limit?: never\n where?: never\n} & UpdateBaseOptions<T, TSlug, TSelect>\n\nexport type UpdateManyOptions<\n T extends PayloadTypesShape,\n TSlug extends CollectionSlug<T>,\n TSelect extends SelectFromCollectionSlug<T, TSlug>,\n> = {\n id?: never\n limit?: number\n where: Where\n} & UpdateBaseOptions<T, TSlug, TSelect>\n\nexport type UpdateOptions<\n T extends PayloadTypesShape,\n TSlug extends CollectionSlug<T>,\n TSelect extends SelectFromCollectionSlug<T, TSlug>,\n> = UpdateByIDOptions<T, TSlug, TSelect> | UpdateManyOptions<T, TSlug, TSelect>\n\nexport async function update<\n T extends PayloadTypesShape,\n TSlug extends CollectionSlug<T>,\n TSelect extends SelectFromCollectionSlug<T, TSlug>,\n>(\n sdk: PayloadSDK<T>,\n options: UpdateOptions<T, TSlug, TSelect>,\n init?: RequestInit,\n): Promise<\n BulkOperationResult<T, TSlug, TSelect> | TransformCollectionWithSelect<T, TSlug, TSelect>\n> {\n let file: Blob | undefined = undefined\n\n if (options.file) {\n file = await resolveFileFromOptions(options.file)\n }\n\n const response = await sdk.request({\n args: options,\n file,\n init,\n json: options.data,\n method: 'PATCH',\n path: `/${options.collection}${options.id ? `/${options.id}` : ''}`,\n })\n\n const json = await response.json()\n\n if (options.id) {\n return json.doc\n }\n\n return json\n}\n"],"names":["resolveFileFromOptions","update","sdk","options","init","file","undefined","response","request","args","json","data","method","path","collection","id","doc"],"mappings":"AAmBA,SAASA,sBAAsB,QAAQ,yCAAwC;AA+E/E,OAAO,eAAeC,OAKpBC,GAAkB,EAClBC,OAAyC,EACzCC,IAAkB;IAIlB,IAAIC,OAAyBC;IAE7B,IAAIH,QAAQE,IAAI,EAAE;QAChBA,OAAO,MAAML,uBAAuBG,QAAQE,IAAI;IAClD;IAEA,MAAME,WAAW,MAAML,IAAIM,OAAO,CAAC;QACjCC,MAAMN;QACNE;QACAD;QACAM,MAAMP,QAAQQ,IAAI;QAClBC,QAAQ;QACRC,MAAM,CAAC,CAAC,EAAEV,QAAQW,UAAU,GAAGX,QAAQY,EAAE,GAAG,CAAC,CAAC,EAAEZ,QAAQY,EAAE,EAAE,GAAG,IAAI;IACrE;IAEA,MAAML,OAAO,MAAMH,SAASG,IAAI;IAEhC,IAAIP,QAAQY,EAAE,EAAE;QACd,OAAOL,KAAKM,GAAG;IACjB;IAEA,OAAON;AACT"}
|
package/dist/globals/update.d.ts
CHANGED
|
@@ -27,10 +27,6 @@ export type UpdateGlobalOptions<T extends PayloadTypesShape, TSlug extends Globa
|
|
|
27
27
|
* Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.
|
|
28
28
|
*/
|
|
29
29
|
populate?: PopulateType<T>;
|
|
30
|
-
/**
|
|
31
|
-
* Publish the document / documents with a specific locale.
|
|
32
|
-
*/
|
|
33
|
-
publishSpecificLocale?: TypedLocale<T>;
|
|
34
30
|
/**
|
|
35
31
|
* Specify [select](https://payloadcms.com/docs/queries/select) to control which fields to include to the result.
|
|
36
32
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/globals/update.ts"],"names":[],"mappings":"AA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ocale } from 'payload'\nimport type { DeepPartial } from 'ts-essentials'\n\nimport type { PayloadSDK } from '../index.js'\nimport type {\n DataFromGlobalSlug,\n PopulateType,\n SelectFromGlobalSlug,\n TransformGlobalWithSelect,\n} from '../types.js'\n\nexport type UpdateGlobalOptions<\n T extends PayloadTypesShape,\n TSlug extends GlobalSlug<T>,\n TSelect extends SelectFromGlobalSlug<T, TSlug>,\n> = {\n /**\n * The global data to update.\n */\n data: DeepPartial<Omit<DataFromGlobalSlug<T, TSlug>, 'id'>>\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * Update documents to a draft.\n */\n draft?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale<T>\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: 'all' | TypedLocale<T>\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType<T>\n /**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/globals/update.ts"],"sourcesContent":["import type { GlobalSlug, PayloadTypesShape, TypedLocale } from 'payload'\nimport type { DeepPartial } from 'ts-essentials'\n\nimport type { PayloadSDK } from '../index.js'\nimport type {\n DataFromGlobalSlug,\n PopulateType,\n SelectFromGlobalSlug,\n TransformGlobalWithSelect,\n} from '../types.js'\n\nexport type UpdateGlobalOptions<\n T extends PayloadTypesShape,\n TSlug extends GlobalSlug<T>,\n TSelect extends SelectFromGlobalSlug<T, TSlug>,\n> = {\n /**\n * The global data to update.\n */\n data: DeepPartial<Omit<DataFromGlobalSlug<T, TSlug>, 'id'>>\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * Update documents to a draft.\n */\n draft?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale<T>\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: 'all' | TypedLocale<T>\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType<T>\n /**\n * Specify [select](https://payloadcms.com/docs/queries/select) to control which fields to include to the result.\n */\n select?: TSelect\n /**\n * the Global slug to operate against.\n */\n slug: TSlug\n}\n\nexport async function updateGlobal<\n T extends PayloadTypesShape,\n TSlug extends GlobalSlug<T>,\n TSelect extends SelectFromGlobalSlug<T, TSlug>,\n>(\n sdk: PayloadSDK<T>,\n options: UpdateGlobalOptions<T, TSlug, TSelect>,\n init?: RequestInit,\n): Promise<TransformGlobalWithSelect<T, TSlug, TSelect>> {\n const response = await sdk.request({\n args: options,\n init,\n json: options.data,\n method: 'POST',\n path: `/globals/${options.slug}`,\n })\n\n const { result } = await response.json()\n\n return result\n}\n"],"names":["updateGlobal","sdk","options","init","response","request","args","json","data","method","path","slug","result"],"mappings":"AAkDA,OAAO,eAAeA,aAKpBC,GAAkB,EAClBC,OAA+C,EAC/CC,IAAkB;IAElB,MAAMC,WAAW,MAAMH,IAAII,OAAO,CAAC;QACjCC,MAAMJ;QACNC;QACAI,MAAML,QAAQM,IAAI;QAClBC,QAAQ;QACRC,MAAM,CAAC,SAAS,EAAER,QAAQS,IAAI,EAAE;IAClC;IAEA,MAAM,EAAEC,MAAM,EAAE,GAAG,MAAMR,SAASG,IAAI;IAEtC,OAAOK;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/sdk",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.2",
|
|
4
4
|
"description": "The official Payload REST API SDK",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"qs-esm": "8.0.1",
|
|
35
35
|
"ts-essentials": "10.0.3",
|
|
36
|
-
"payload": "4.0.0-canary.
|
|
36
|
+
"payload": "4.0.0-canary.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@payloadcms/eslint-config": "3.28.0"
|