@usehercules/sdk 1.9.0 → 1.10.0
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/CHANGELOG.md +11 -0
- package/package.json +1 -1
- package/resources/beta/beta.d.mts +4 -0
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +4 -0
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +4 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +4 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/commerce/commerce.d.mts +16 -11
- package/resources/beta/commerce/commerce.d.mts.map +1 -1
- package/resources/beta/commerce/commerce.d.ts +16 -11
- package/resources/beta/commerce/commerce.d.ts.map +1 -1
- package/resources/beta/commerce/commerce.js.map +1 -1
- package/resources/beta/commerce/commerce.mjs.map +1 -1
- package/resources/beta/commerce/products/products.d.mts +103 -126
- package/resources/beta/commerce/products/products.d.mts.map +1 -1
- package/resources/beta/commerce/products/products.d.ts +103 -126
- package/resources/beta/commerce/products/products.d.ts.map +1 -1
- package/resources/beta/commerce/products/products.js.map +1 -1
- package/resources/beta/commerce/products/products.mjs.map +1 -1
- package/resources/beta/commerce/products/resources.d.mts +16 -19
- package/resources/beta/commerce/products/resources.d.mts.map +1 -1
- package/resources/beta/commerce/products/resources.d.ts +16 -19
- package/resources/beta/commerce/products/resources.d.ts.map +1 -1
- package/resources/beta/commerce/products/variants.d.mts +0 -75
- package/resources/beta/commerce/products/variants.d.mts.map +1 -1
- package/resources/beta/commerce/products/variants.d.ts +0 -75
- package/resources/beta/commerce/products/variants.d.ts.map +1 -1
- package/resources/beta/content/assets.d.mts +226 -0
- package/resources/beta/content/assets.d.mts.map +1 -0
- package/resources/beta/content/assets.d.ts +226 -0
- package/resources/beta/content/assets.d.ts.map +1 -0
- package/resources/beta/content/assets.js +56 -0
- package/resources/beta/content/assets.js.map +1 -0
- package/resources/beta/content/assets.mjs +52 -0
- package/resources/beta/content/assets.mjs.map +1 -0
- package/resources/beta/content/content.d.mts +26 -0
- package/resources/beta/content/content.d.mts.map +1 -0
- package/resources/beta/content/content.d.ts +26 -0
- package/resources/beta/content/content.d.ts.map +1 -0
- package/resources/beta/content/content.js +33 -0
- package/resources/beta/content/content.js.map +1 -0
- package/resources/beta/content/content.mjs +28 -0
- package/resources/beta/content/content.mjs.map +1 -0
- package/resources/beta/content/entries.d.mts +266 -0
- package/resources/beta/content/entries.d.mts.map +1 -0
- package/resources/beta/content/entries.d.ts +266 -0
- package/resources/beta/content/entries.d.ts.map +1 -0
- package/resources/beta/content/entries.js +63 -0
- package/resources/beta/content/entries.js.map +1 -0
- package/resources/beta/content/entries.mjs +59 -0
- package/resources/beta/content/entries.mjs.map +1 -0
- package/resources/beta/content/index.d.mts +7 -0
- package/resources/beta/content/index.d.mts.map +1 -0
- package/resources/beta/content/index.d.ts +7 -0
- package/resources/beta/content/index.d.ts.map +1 -0
- package/resources/beta/content/index.js +17 -0
- package/resources/beta/content/index.js.map +1 -0
- package/resources/beta/content/index.mjs +8 -0
- package/resources/beta/content/index.mjs.map +1 -0
- package/resources/beta/content/locales.d.mts +116 -0
- package/resources/beta/content/locales.d.mts.map +1 -0
- package/resources/beta/content/locales.d.ts +116 -0
- package/resources/beta/content/locales.d.ts.map +1 -0
- package/resources/beta/content/locales.js +49 -0
- package/resources/beta/content/locales.js.map +1 -0
- package/resources/beta/content/locales.mjs +45 -0
- package/resources/beta/content/locales.mjs.map +1 -0
- package/resources/beta/content/models/fields.d.mts +186 -0
- package/resources/beta/content/models/fields.d.mts.map +1 -0
- package/resources/beta/content/models/fields.d.ts +186 -0
- package/resources/beta/content/models/fields.d.ts.map +1 -0
- package/resources/beta/content/models/fields.js +37 -0
- package/resources/beta/content/models/fields.js.map +1 -0
- package/resources/beta/content/models/fields.mjs +33 -0
- package/resources/beta/content/models/fields.mjs.map +1 -0
- package/resources/beta/content/models/index.d.mts +3 -0
- package/resources/beta/content/models/index.d.mts.map +1 -0
- package/resources/beta/content/models/index.d.ts +3 -0
- package/resources/beta/content/models/index.d.ts.map +1 -0
- package/resources/beta/content/models/index.js +9 -0
- package/resources/beta/content/models/index.js.map +1 -0
- package/resources/beta/content/models/index.mjs +4 -0
- package/resources/beta/content/models/index.mjs.map +1 -0
- package/resources/beta/content/models/models.d.mts +296 -0
- package/resources/beta/content/models/models.d.mts.map +1 -0
- package/resources/beta/content/models/models.d.ts +296 -0
- package/resources/beta/content/models/models.d.ts.map +1 -0
- package/resources/beta/content/models/models.js +54 -0
- package/resources/beta/content/models/models.js.map +1 -0
- package/resources/beta/content/models/models.mjs +49 -0
- package/resources/beta/content/models/models.mjs.map +1 -0
- package/resources/beta/content/models.d.mts +2 -0
- package/resources/beta/content/models.d.mts.map +1 -0
- package/resources/beta/content/models.d.ts +2 -0
- package/resources/beta/content/models.d.ts.map +1 -0
- package/resources/beta/content/models.js +6 -0
- package/resources/beta/content/models.js.map +1 -0
- package/resources/beta/content/models.mjs +3 -0
- package/resources/beta/content/models.mjs.map +1 -0
- package/resources/beta/content/releases/index.d.mts +3 -0
- package/resources/beta/content/releases/index.d.mts.map +1 -0
- package/resources/beta/content/releases/index.d.ts +3 -0
- package/resources/beta/content/releases/index.d.ts.map +1 -0
- package/resources/beta/content/releases/index.js +9 -0
- package/resources/beta/content/releases/index.js.map +1 -0
- package/resources/beta/content/releases/index.mjs +4 -0
- package/resources/beta/content/releases/index.mjs.map +1 -0
- package/resources/beta/content/releases/items.d.mts +39 -0
- package/resources/beta/content/releases/items.d.mts.map +1 -0
- package/resources/beta/content/releases/items.d.ts +39 -0
- package/resources/beta/content/releases/items.d.ts.map +1 -0
- package/resources/beta/content/releases/items.js +28 -0
- package/resources/beta/content/releases/items.js.map +1 -0
- package/resources/beta/content/releases/items.mjs +24 -0
- package/resources/beta/content/releases/items.mjs.map +1 -0
- package/resources/beta/content/releases/releases.d.mts +151 -0
- package/resources/beta/content/releases/releases.d.mts.map +1 -0
- package/resources/beta/content/releases/releases.d.ts +151 -0
- package/resources/beta/content/releases/releases.d.ts.map +1 -0
- package/resources/beta/content/releases/releases.js +69 -0
- package/resources/beta/content/releases/releases.js.map +1 -0
- package/resources/beta/content/releases/releases.mjs +64 -0
- package/resources/beta/content/releases/releases.mjs.map +1 -0
- package/resources/beta/content/releases.d.mts +2 -0
- package/resources/beta/content/releases.d.mts.map +1 -0
- package/resources/beta/content/releases.d.ts +2 -0
- package/resources/beta/content/releases.d.ts.map +1 -0
- package/resources/beta/content/releases.js +6 -0
- package/resources/beta/content/releases.js.map +1 -0
- package/resources/beta/content/releases.mjs +3 -0
- package/resources/beta/content/releases.mjs.map +1 -0
- package/resources/beta/content.d.mts +2 -0
- package/resources/beta/content.d.mts.map +1 -0
- package/resources/beta/content.d.ts +2 -0
- package/resources/beta/content.d.ts.map +1 -0
- package/resources/beta/content.js +6 -0
- package/resources/beta/content.js.map +1 -0
- package/resources/beta/content.mjs +3 -0
- package/resources/beta/content.mjs.map +1 -0
- package/resources/beta/index.d.mts +1 -0
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -0
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +3 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -0
- package/resources/beta/index.mjs.map +1 -1
- package/src/resources/beta/beta.ts +6 -0
- package/src/resources/beta/commerce/commerce.ts +18 -12
- package/src/resources/beta/commerce/products/products.ts +114 -144
- package/src/resources/beta/commerce/products/resources.ts +16 -19
- package/src/resources/beta/commerce/products/variants.ts +0 -90
- package/src/resources/beta/content/assets.ts +299 -0
- package/src/resources/beta/content/content.ts +117 -0
- package/src/resources/beta/content/entries.ts +347 -0
- package/src/resources/beta/content/index.ts +47 -0
- package/src/resources/beta/content/locales.ts +169 -0
- package/src/resources/beta/content/models/fields.ts +276 -0
- package/src/resources/beta/content/models/index.ts +12 -0
- package/src/resources/beta/content/models/models.ts +436 -0
- package/src/resources/beta/content/models.ts +3 -0
- package/src/resources/beta/content/releases/index.ts +13 -0
- package/src/resources/beta/content/releases/items.ts +57 -0
- package/src/resources/beta/content/releases/releases.ts +220 -0
- package/src/resources/beta/content/releases.ts +3 -0
- package/src/resources/beta/content.ts +3 -0
- package/src/resources/beta/index.ts +1 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Content = void 0;
|
|
5
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const AssetsAPI = tslib_1.__importStar(require("./assets.js"));
|
|
8
|
+
const assets_1 = require("./assets.js");
|
|
9
|
+
const EntriesAPI = tslib_1.__importStar(require("./entries.js"));
|
|
10
|
+
const entries_1 = require("./entries.js");
|
|
11
|
+
const LocalesAPI = tslib_1.__importStar(require("./locales.js"));
|
|
12
|
+
const locales_1 = require("./locales.js");
|
|
13
|
+
const ModelsAPI = tslib_1.__importStar(require("./models/models.js"));
|
|
14
|
+
const models_1 = require("./models/models.js");
|
|
15
|
+
const ReleasesAPI = tslib_1.__importStar(require("./releases/releases.js"));
|
|
16
|
+
const releases_1 = require("./releases/releases.js");
|
|
17
|
+
class Content extends resource_1.APIResource {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.models = new ModelsAPI.Models(this._client);
|
|
21
|
+
this.entries = new EntriesAPI.Entries(this._client);
|
|
22
|
+
this.assets = new AssetsAPI.Assets(this._client);
|
|
23
|
+
this.locales = new LocalesAPI.Locales(this._client);
|
|
24
|
+
this.releases = new ReleasesAPI.Releases(this._client);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.Content = Content;
|
|
28
|
+
Content.Models = models_1.Models;
|
|
29
|
+
Content.Entries = entries_1.Entries;
|
|
30
|
+
Content.Assets = assets_1.Assets;
|
|
31
|
+
Content.Locales = locales_1.Locales;
|
|
32
|
+
Content.Releases = releases_1.Releases;
|
|
33
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../../src/resources/beta/content/content.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,+DAAsC;AACtC,wCAOkB;AAClB,iEAAwC;AACxC,0CAQmB;AACnB,iEAAwC;AACxC,0CAOmB;AACnB,sEAA6C;AAC7C,+CAQyB;AACzB,4EAAmD;AACnD,qDAS6B;AAE7B,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC;CAAA;AAND,0BAMC;AAED,OAAO,CAAC,MAAM,GAAG,eAAM,CAAC;AACxB,OAAO,CAAC,OAAO,GAAG,iBAAO,CAAC;AAC1B,OAAO,CAAC,MAAM,GAAG,eAAM,CAAC;AACxB,OAAO,CAAC,OAAO,GAAG,iBAAO,CAAC;AAC1B,OAAO,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import * as AssetsAPI from "./assets.mjs";
|
|
4
|
+
import { Assets, } from "./assets.mjs";
|
|
5
|
+
import * as EntriesAPI from "./entries.mjs";
|
|
6
|
+
import { Entries, } from "./entries.mjs";
|
|
7
|
+
import * as LocalesAPI from "./locales.mjs";
|
|
8
|
+
import { Locales, } from "./locales.mjs";
|
|
9
|
+
import * as ModelsAPI from "./models/models.mjs";
|
|
10
|
+
import { Models, } from "./models/models.mjs";
|
|
11
|
+
import * as ReleasesAPI from "./releases/releases.mjs";
|
|
12
|
+
import { Releases, } from "./releases/releases.mjs";
|
|
13
|
+
export class Content extends APIResource {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.models = new ModelsAPI.Models(this._client);
|
|
17
|
+
this.entries = new EntriesAPI.Entries(this._client);
|
|
18
|
+
this.assets = new AssetsAPI.Assets(this._client);
|
|
19
|
+
this.locales = new LocalesAPI.Locales(this._client);
|
|
20
|
+
this.releases = new ReleasesAPI.Releases(this._client);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
Content.Models = Models;
|
|
24
|
+
Content.Entries = Entries;
|
|
25
|
+
Content.Assets = Assets;
|
|
26
|
+
Content.Locales = Locales;
|
|
27
|
+
Content.Releases = Releases;
|
|
28
|
+
//# sourceMappingURL=content.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.mjs","sourceRoot":"","sources":["../../../src/resources/beta/content/content.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EAKL,MAAM,GAEP;OACM,KAAK,UAAU;OACf,EACL,OAAO,GAOR;OACM,KAAK,UAAU;OACf,EAKL,OAAO,GAER;OACM,KAAK,SAAS;OACd,EAML,MAAM,GAEP;OACM,KAAK,WAAW;OAChB,EAOL,QAAQ,GAET;AAED,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9D,YAAO,GAAuB,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC;CAAA;AAED,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;AACxB,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;AAC1B,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;AACxB,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;AAC1B,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.mjs";
|
|
3
|
+
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.mjs";
|
|
5
|
+
export declare class Entries extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new content entry for a given model. Entries start as drafts by
|
|
8
|
+
* default. Use the publish endpoint to make entries publicly accessible.
|
|
9
|
+
*/
|
|
10
|
+
create(body: EntryCreateParams, options?: RequestOptions): APIPromise<Entry>;
|
|
11
|
+
/**
|
|
12
|
+
* Updates an existing content entry. Supports partial updates - only specified
|
|
13
|
+
* fields are modified. Use the version parameter for optimistic locking to prevent
|
|
14
|
+
* concurrent update conflicts.
|
|
15
|
+
*/
|
|
16
|
+
update(entryID: string, body?: EntryUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Entry>;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves a paginated list of content entries. Supports filtering by model,
|
|
19
|
+
* status, locale, and custom field queries. Use the 'where' parameter for
|
|
20
|
+
* field-based filtering with operators like $eq, $contains, $gt, etc.
|
|
21
|
+
*/
|
|
22
|
+
list(query?: EntryListParams | null | undefined, options?: RequestOptions): PagePromise<EntriesCursorIDPage, Entry>;
|
|
23
|
+
/**
|
|
24
|
+
* Archives a content entry, hiding it from the API and public access. The entry
|
|
25
|
+
* data is preserved and can be restored later.
|
|
26
|
+
*/
|
|
27
|
+
archive(entryID: string, options?: RequestOptions): APIPromise<Entry>;
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a content entry by ID. Optionally specify a locale to get localized
|
|
30
|
+
* field values with fallback resolution.
|
|
31
|
+
*/
|
|
32
|
+
get(entryID: string, options?: RequestOptions): APIPromise<Entry>;
|
|
33
|
+
/**
|
|
34
|
+
* Publishes a content entry, making it publicly accessible. Optionally schedule
|
|
35
|
+
* publishing for a future time. Publishing validates that all required fields have
|
|
36
|
+
* values.
|
|
37
|
+
*/
|
|
38
|
+
publish(entryID: string, body?: EntryPublishParams | null | undefined, options?: RequestOptions): APIPromise<Entry>;
|
|
39
|
+
/**
|
|
40
|
+
* Unpublishes a content entry, reverting it to draft status. The entry will no
|
|
41
|
+
* longer be publicly accessible but all data is preserved.
|
|
42
|
+
*/
|
|
43
|
+
unpublish(entryID: string, options?: RequestOptions): APIPromise<Entry>;
|
|
44
|
+
}
|
|
45
|
+
export type EntriesCursorIDPage = CursorIDPage<Entry>;
|
|
46
|
+
/**
|
|
47
|
+
* A content entry containing field values based on its model schema. Entries can
|
|
48
|
+
* be drafts, published, or archived.
|
|
49
|
+
*/
|
|
50
|
+
export interface Entry {
|
|
51
|
+
/**
|
|
52
|
+
* Unique identifier for the topic subscription
|
|
53
|
+
*/
|
|
54
|
+
id: string;
|
|
55
|
+
/**
|
|
56
|
+
* Timestamp when the entry was created
|
|
57
|
+
*/
|
|
58
|
+
created: string;
|
|
59
|
+
/**
|
|
60
|
+
* Field values. For localized fields: { fieldApiId: { locale: value } }. For
|
|
61
|
+
* non-localized: { fieldApiId: value }
|
|
62
|
+
*/
|
|
63
|
+
fields: {
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Primary locale for this entry
|
|
68
|
+
*/
|
|
69
|
+
locale: string;
|
|
70
|
+
/**
|
|
71
|
+
* ID of the content model this entry belongs to
|
|
72
|
+
*/
|
|
73
|
+
model_id: string;
|
|
74
|
+
/**
|
|
75
|
+
* Publishing status: draft, published, or archived
|
|
76
|
+
*/
|
|
77
|
+
status: 'draft' | 'published' | 'archived';
|
|
78
|
+
/**
|
|
79
|
+
* Timestamp when the entry was last updated
|
|
80
|
+
*/
|
|
81
|
+
updated: string;
|
|
82
|
+
/**
|
|
83
|
+
* Version number for optimistic locking
|
|
84
|
+
*/
|
|
85
|
+
version: number;
|
|
86
|
+
/**
|
|
87
|
+
* Timestamp when first published
|
|
88
|
+
*/
|
|
89
|
+
first_published_at?: string | null;
|
|
90
|
+
/**
|
|
91
|
+
* API ID of the content model (included when populated)
|
|
92
|
+
*/
|
|
93
|
+
model_api_id?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Timestamp when last published
|
|
96
|
+
*/
|
|
97
|
+
published_at?: string | null;
|
|
98
|
+
/**
|
|
99
|
+
* Scheduled publish time
|
|
100
|
+
*/
|
|
101
|
+
scheduled_publish_at?: string | null;
|
|
102
|
+
/**
|
|
103
|
+
* Scheduled unpublish time
|
|
104
|
+
*/
|
|
105
|
+
scheduled_unpublish_at?: string | null;
|
|
106
|
+
}
|
|
107
|
+
export interface EntryCreateParams {
|
|
108
|
+
/**
|
|
109
|
+
* API ID of the content model (e.g., 'blogPost')
|
|
110
|
+
*/
|
|
111
|
+
model: string;
|
|
112
|
+
/**
|
|
113
|
+
* Optional custom ID for the entry. Must start with 'ce\_'. If not provided, one
|
|
114
|
+
* will be generated.
|
|
115
|
+
*/
|
|
116
|
+
id?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Field values. For localized fields: { fieldApiId: { locale: value } }. For
|
|
119
|
+
* non-localized: { fieldApiId: value }
|
|
120
|
+
*/
|
|
121
|
+
fields?: {
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Primary locale for this entry
|
|
126
|
+
*/
|
|
127
|
+
locale?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Initial status (default: draft)
|
|
130
|
+
*/
|
|
131
|
+
status?: 'draft' | 'published' | 'archived';
|
|
132
|
+
}
|
|
133
|
+
export interface EntryUpdateParams {
|
|
134
|
+
/**
|
|
135
|
+
* Field values to update. Supports partial updates - only specified fields are
|
|
136
|
+
* changed.
|
|
137
|
+
*/
|
|
138
|
+
fields?: {
|
|
139
|
+
[key: string]: unknown;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Primary locale
|
|
143
|
+
*/
|
|
144
|
+
locale?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Expected version for optimistic locking. Update fails if version mismatch.
|
|
147
|
+
*/
|
|
148
|
+
version?: number;
|
|
149
|
+
}
|
|
150
|
+
export interface EntryListParams extends CursorIDPageParams {
|
|
151
|
+
/**
|
|
152
|
+
* Filter by creation date
|
|
153
|
+
*/
|
|
154
|
+
created?: EntryListParams.Created;
|
|
155
|
+
/**
|
|
156
|
+
* Depth for populating reference fields (0-3)
|
|
157
|
+
*/
|
|
158
|
+
include_depth?: number;
|
|
159
|
+
/**
|
|
160
|
+
* Filter by primary locale
|
|
161
|
+
*/
|
|
162
|
+
locale?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Filter by content model API ID (e.g., 'blogPost')
|
|
165
|
+
*/
|
|
166
|
+
model?: string;
|
|
167
|
+
/**
|
|
168
|
+
* JSON-encoded sort order. Example: {"field":"publishedAt","direction":"desc"}
|
|
169
|
+
*/
|
|
170
|
+
order_by?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Filter by publish date
|
|
173
|
+
*/
|
|
174
|
+
published?: EntryListParams.Published;
|
|
175
|
+
/**
|
|
176
|
+
* Full-text search across text fields
|
|
177
|
+
*/
|
|
178
|
+
query?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Filter by status
|
|
181
|
+
*/
|
|
182
|
+
status?: 'draft' | 'published' | 'archived';
|
|
183
|
+
/**
|
|
184
|
+
* Filter by update date
|
|
185
|
+
*/
|
|
186
|
+
updated?: EntryListParams.Updated;
|
|
187
|
+
/**
|
|
188
|
+
* JSON-encoded field filters. Example: {"title":{"$contains":"hello"}}
|
|
189
|
+
*/
|
|
190
|
+
where?: string;
|
|
191
|
+
}
|
|
192
|
+
export declare namespace EntryListParams {
|
|
193
|
+
/**
|
|
194
|
+
* Filter by creation date
|
|
195
|
+
*/
|
|
196
|
+
interface Created {
|
|
197
|
+
/**
|
|
198
|
+
* Greater than (Unix timestamp in seconds)
|
|
199
|
+
*/
|
|
200
|
+
gt?: number;
|
|
201
|
+
/**
|
|
202
|
+
* Greater than or equal (Unix timestamp in seconds)
|
|
203
|
+
*/
|
|
204
|
+
gte?: number;
|
|
205
|
+
/**
|
|
206
|
+
* Less than (Unix timestamp in seconds)
|
|
207
|
+
*/
|
|
208
|
+
lt?: number;
|
|
209
|
+
/**
|
|
210
|
+
* Less than or equal (Unix timestamp in seconds)
|
|
211
|
+
*/
|
|
212
|
+
lte?: number;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Filter by publish date
|
|
216
|
+
*/
|
|
217
|
+
interface Published {
|
|
218
|
+
/**
|
|
219
|
+
* Greater than (Unix timestamp in seconds)
|
|
220
|
+
*/
|
|
221
|
+
gt?: number;
|
|
222
|
+
/**
|
|
223
|
+
* Greater than or equal (Unix timestamp in seconds)
|
|
224
|
+
*/
|
|
225
|
+
gte?: number;
|
|
226
|
+
/**
|
|
227
|
+
* Less than (Unix timestamp in seconds)
|
|
228
|
+
*/
|
|
229
|
+
lt?: number;
|
|
230
|
+
/**
|
|
231
|
+
* Less than or equal (Unix timestamp in seconds)
|
|
232
|
+
*/
|
|
233
|
+
lte?: number;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Filter by update date
|
|
237
|
+
*/
|
|
238
|
+
interface Updated {
|
|
239
|
+
/**
|
|
240
|
+
* Greater than (Unix timestamp in seconds)
|
|
241
|
+
*/
|
|
242
|
+
gt?: number;
|
|
243
|
+
/**
|
|
244
|
+
* Greater than or equal (Unix timestamp in seconds)
|
|
245
|
+
*/
|
|
246
|
+
gte?: number;
|
|
247
|
+
/**
|
|
248
|
+
* Less than (Unix timestamp in seconds)
|
|
249
|
+
*/
|
|
250
|
+
lt?: number;
|
|
251
|
+
/**
|
|
252
|
+
* Less than or equal (Unix timestamp in seconds)
|
|
253
|
+
*/
|
|
254
|
+
lte?: number;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
export interface EntryPublishParams {
|
|
258
|
+
/**
|
|
259
|
+
* Schedule publish for a future time instead of publishing immediately
|
|
260
|
+
*/
|
|
261
|
+
scheduled_at?: string;
|
|
262
|
+
}
|
|
263
|
+
export declare namespace Entries {
|
|
264
|
+
export { type Entry as Entry, type EntriesCursorIDPage as EntriesCursorIDPage, type EntryCreateParams as EntryCreateParams, type EntryUpdateParams as EntryUpdateParams, type EntryListParams as EntryListParams, type EntryPublishParams as EntryPublishParams, };
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=entries.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entries.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/content/entries.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAA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EZ;;WAEG;QACH,GAAG,CAAC,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../../core/api-promise.js";
|
|
3
|
+
import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../../../internal/request-options.js";
|
|
5
|
+
export declare class Entries extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new content entry for a given model. Entries start as drafts by
|
|
8
|
+
* default. Use the publish endpoint to make entries publicly accessible.
|
|
9
|
+
*/
|
|
10
|
+
create(body: EntryCreateParams, options?: RequestOptions): APIPromise<Entry>;
|
|
11
|
+
/**
|
|
12
|
+
* Updates an existing content entry. Supports partial updates - only specified
|
|
13
|
+
* fields are modified. Use the version parameter for optimistic locking to prevent
|
|
14
|
+
* concurrent update conflicts.
|
|
15
|
+
*/
|
|
16
|
+
update(entryID: string, body?: EntryUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Entry>;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves a paginated list of content entries. Supports filtering by model,
|
|
19
|
+
* status, locale, and custom field queries. Use the 'where' parameter for
|
|
20
|
+
* field-based filtering with operators like $eq, $contains, $gt, etc.
|
|
21
|
+
*/
|
|
22
|
+
list(query?: EntryListParams | null | undefined, options?: RequestOptions): PagePromise<EntriesCursorIDPage, Entry>;
|
|
23
|
+
/**
|
|
24
|
+
* Archives a content entry, hiding it from the API and public access. The entry
|
|
25
|
+
* data is preserved and can be restored later.
|
|
26
|
+
*/
|
|
27
|
+
archive(entryID: string, options?: RequestOptions): APIPromise<Entry>;
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a content entry by ID. Optionally specify a locale to get localized
|
|
30
|
+
* field values with fallback resolution.
|
|
31
|
+
*/
|
|
32
|
+
get(entryID: string, options?: RequestOptions): APIPromise<Entry>;
|
|
33
|
+
/**
|
|
34
|
+
* Publishes a content entry, making it publicly accessible. Optionally schedule
|
|
35
|
+
* publishing for a future time. Publishing validates that all required fields have
|
|
36
|
+
* values.
|
|
37
|
+
*/
|
|
38
|
+
publish(entryID: string, body?: EntryPublishParams | null | undefined, options?: RequestOptions): APIPromise<Entry>;
|
|
39
|
+
/**
|
|
40
|
+
* Unpublishes a content entry, reverting it to draft status. The entry will no
|
|
41
|
+
* longer be publicly accessible but all data is preserved.
|
|
42
|
+
*/
|
|
43
|
+
unpublish(entryID: string, options?: RequestOptions): APIPromise<Entry>;
|
|
44
|
+
}
|
|
45
|
+
export type EntriesCursorIDPage = CursorIDPage<Entry>;
|
|
46
|
+
/**
|
|
47
|
+
* A content entry containing field values based on its model schema. Entries can
|
|
48
|
+
* be drafts, published, or archived.
|
|
49
|
+
*/
|
|
50
|
+
export interface Entry {
|
|
51
|
+
/**
|
|
52
|
+
* Unique identifier for the topic subscription
|
|
53
|
+
*/
|
|
54
|
+
id: string;
|
|
55
|
+
/**
|
|
56
|
+
* Timestamp when the entry was created
|
|
57
|
+
*/
|
|
58
|
+
created: string;
|
|
59
|
+
/**
|
|
60
|
+
* Field values. For localized fields: { fieldApiId: { locale: value } }. For
|
|
61
|
+
* non-localized: { fieldApiId: value }
|
|
62
|
+
*/
|
|
63
|
+
fields: {
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Primary locale for this entry
|
|
68
|
+
*/
|
|
69
|
+
locale: string;
|
|
70
|
+
/**
|
|
71
|
+
* ID of the content model this entry belongs to
|
|
72
|
+
*/
|
|
73
|
+
model_id: string;
|
|
74
|
+
/**
|
|
75
|
+
* Publishing status: draft, published, or archived
|
|
76
|
+
*/
|
|
77
|
+
status: 'draft' | 'published' | 'archived';
|
|
78
|
+
/**
|
|
79
|
+
* Timestamp when the entry was last updated
|
|
80
|
+
*/
|
|
81
|
+
updated: string;
|
|
82
|
+
/**
|
|
83
|
+
* Version number for optimistic locking
|
|
84
|
+
*/
|
|
85
|
+
version: number;
|
|
86
|
+
/**
|
|
87
|
+
* Timestamp when first published
|
|
88
|
+
*/
|
|
89
|
+
first_published_at?: string | null;
|
|
90
|
+
/**
|
|
91
|
+
* API ID of the content model (included when populated)
|
|
92
|
+
*/
|
|
93
|
+
model_api_id?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Timestamp when last published
|
|
96
|
+
*/
|
|
97
|
+
published_at?: string | null;
|
|
98
|
+
/**
|
|
99
|
+
* Scheduled publish time
|
|
100
|
+
*/
|
|
101
|
+
scheduled_publish_at?: string | null;
|
|
102
|
+
/**
|
|
103
|
+
* Scheduled unpublish time
|
|
104
|
+
*/
|
|
105
|
+
scheduled_unpublish_at?: string | null;
|
|
106
|
+
}
|
|
107
|
+
export interface EntryCreateParams {
|
|
108
|
+
/**
|
|
109
|
+
* API ID of the content model (e.g., 'blogPost')
|
|
110
|
+
*/
|
|
111
|
+
model: string;
|
|
112
|
+
/**
|
|
113
|
+
* Optional custom ID for the entry. Must start with 'ce\_'. If not provided, one
|
|
114
|
+
* will be generated.
|
|
115
|
+
*/
|
|
116
|
+
id?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Field values. For localized fields: { fieldApiId: { locale: value } }. For
|
|
119
|
+
* non-localized: { fieldApiId: value }
|
|
120
|
+
*/
|
|
121
|
+
fields?: {
|
|
122
|
+
[key: string]: unknown;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Primary locale for this entry
|
|
126
|
+
*/
|
|
127
|
+
locale?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Initial status (default: draft)
|
|
130
|
+
*/
|
|
131
|
+
status?: 'draft' | 'published' | 'archived';
|
|
132
|
+
}
|
|
133
|
+
export interface EntryUpdateParams {
|
|
134
|
+
/**
|
|
135
|
+
* Field values to update. Supports partial updates - only specified fields are
|
|
136
|
+
* changed.
|
|
137
|
+
*/
|
|
138
|
+
fields?: {
|
|
139
|
+
[key: string]: unknown;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Primary locale
|
|
143
|
+
*/
|
|
144
|
+
locale?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Expected version for optimistic locking. Update fails if version mismatch.
|
|
147
|
+
*/
|
|
148
|
+
version?: number;
|
|
149
|
+
}
|
|
150
|
+
export interface EntryListParams extends CursorIDPageParams {
|
|
151
|
+
/**
|
|
152
|
+
* Filter by creation date
|
|
153
|
+
*/
|
|
154
|
+
created?: EntryListParams.Created;
|
|
155
|
+
/**
|
|
156
|
+
* Depth for populating reference fields (0-3)
|
|
157
|
+
*/
|
|
158
|
+
include_depth?: number;
|
|
159
|
+
/**
|
|
160
|
+
* Filter by primary locale
|
|
161
|
+
*/
|
|
162
|
+
locale?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Filter by content model API ID (e.g., 'blogPost')
|
|
165
|
+
*/
|
|
166
|
+
model?: string;
|
|
167
|
+
/**
|
|
168
|
+
* JSON-encoded sort order. Example: {"field":"publishedAt","direction":"desc"}
|
|
169
|
+
*/
|
|
170
|
+
order_by?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Filter by publish date
|
|
173
|
+
*/
|
|
174
|
+
published?: EntryListParams.Published;
|
|
175
|
+
/**
|
|
176
|
+
* Full-text search across text fields
|
|
177
|
+
*/
|
|
178
|
+
query?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Filter by status
|
|
181
|
+
*/
|
|
182
|
+
status?: 'draft' | 'published' | 'archived';
|
|
183
|
+
/**
|
|
184
|
+
* Filter by update date
|
|
185
|
+
*/
|
|
186
|
+
updated?: EntryListParams.Updated;
|
|
187
|
+
/**
|
|
188
|
+
* JSON-encoded field filters. Example: {"title":{"$contains":"hello"}}
|
|
189
|
+
*/
|
|
190
|
+
where?: string;
|
|
191
|
+
}
|
|
192
|
+
export declare namespace EntryListParams {
|
|
193
|
+
/**
|
|
194
|
+
* Filter by creation date
|
|
195
|
+
*/
|
|
196
|
+
interface Created {
|
|
197
|
+
/**
|
|
198
|
+
* Greater than (Unix timestamp in seconds)
|
|
199
|
+
*/
|
|
200
|
+
gt?: number;
|
|
201
|
+
/**
|
|
202
|
+
* Greater than or equal (Unix timestamp in seconds)
|
|
203
|
+
*/
|
|
204
|
+
gte?: number;
|
|
205
|
+
/**
|
|
206
|
+
* Less than (Unix timestamp in seconds)
|
|
207
|
+
*/
|
|
208
|
+
lt?: number;
|
|
209
|
+
/**
|
|
210
|
+
* Less than or equal (Unix timestamp in seconds)
|
|
211
|
+
*/
|
|
212
|
+
lte?: number;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Filter by publish date
|
|
216
|
+
*/
|
|
217
|
+
interface Published {
|
|
218
|
+
/**
|
|
219
|
+
* Greater than (Unix timestamp in seconds)
|
|
220
|
+
*/
|
|
221
|
+
gt?: number;
|
|
222
|
+
/**
|
|
223
|
+
* Greater than or equal (Unix timestamp in seconds)
|
|
224
|
+
*/
|
|
225
|
+
gte?: number;
|
|
226
|
+
/**
|
|
227
|
+
* Less than (Unix timestamp in seconds)
|
|
228
|
+
*/
|
|
229
|
+
lt?: number;
|
|
230
|
+
/**
|
|
231
|
+
* Less than or equal (Unix timestamp in seconds)
|
|
232
|
+
*/
|
|
233
|
+
lte?: number;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Filter by update date
|
|
237
|
+
*/
|
|
238
|
+
interface Updated {
|
|
239
|
+
/**
|
|
240
|
+
* Greater than (Unix timestamp in seconds)
|
|
241
|
+
*/
|
|
242
|
+
gt?: number;
|
|
243
|
+
/**
|
|
244
|
+
* Greater than or equal (Unix timestamp in seconds)
|
|
245
|
+
*/
|
|
246
|
+
gte?: number;
|
|
247
|
+
/**
|
|
248
|
+
* Less than (Unix timestamp in seconds)
|
|
249
|
+
*/
|
|
250
|
+
lt?: number;
|
|
251
|
+
/**
|
|
252
|
+
* Less than or equal (Unix timestamp in seconds)
|
|
253
|
+
*/
|
|
254
|
+
lte?: number;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
export interface EntryPublishParams {
|
|
258
|
+
/**
|
|
259
|
+
* Schedule publish for a future time instead of publishing immediately
|
|
260
|
+
*/
|
|
261
|
+
scheduled_at?: string;
|
|
262
|
+
}
|
|
263
|
+
export declare namespace Entries {
|
|
264
|
+
export { type Entry as Entry, type EntriesCursorIDPage as EntriesCursorIDPage, type EntryCreateParams as EntryCreateParams, type EntryUpdateParams as EntryUpdateParams, type EntryListParams as EntryListParams, type EntryPublishParams as EntryPublishParams, };
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/content/entries.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OACtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;IAI5E;;;;OAIG;IACH,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,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C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Entries = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../../../core/pagination.js");
|
|
7
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
8
|
+
class Entries extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new content entry for a given model. Entries start as drafts by
|
|
11
|
+
* default. Use the publish endpoint to make entries publicly accessible.
|
|
12
|
+
*/
|
|
13
|
+
create(body, options) {
|
|
14
|
+
return this._client.post('/v1/content/entries', { body, ...options });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Updates an existing content entry. Supports partial updates - only specified
|
|
18
|
+
* fields are modified. Use the version parameter for optimistic locking to prevent
|
|
19
|
+
* concurrent update conflicts.
|
|
20
|
+
*/
|
|
21
|
+
update(entryID, body = {}, options) {
|
|
22
|
+
return this._client.patch((0, path_1.path) `/v1/content/entries/${entryID}`, { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves a paginated list of content entries. Supports filtering by model,
|
|
26
|
+
* status, locale, and custom field queries. Use the 'where' parameter for
|
|
27
|
+
* field-based filtering with operators like $eq, $contains, $gt, etc.
|
|
28
|
+
*/
|
|
29
|
+
list(query = {}, options) {
|
|
30
|
+
return this._client.getAPIList('/v1/content/entries', (pagination_1.CursorIDPage), { query, ...options });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Archives a content entry, hiding it from the API and public access. The entry
|
|
34
|
+
* data is preserved and can be restored later.
|
|
35
|
+
*/
|
|
36
|
+
archive(entryID, options) {
|
|
37
|
+
return this._client.delete((0, path_1.path) `/v1/content/entries/${entryID}`, options);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves a content entry by ID. Optionally specify a locale to get localized
|
|
41
|
+
* field values with fallback resolution.
|
|
42
|
+
*/
|
|
43
|
+
get(entryID, options) {
|
|
44
|
+
return this._client.get((0, path_1.path) `/v1/content/entries/${entryID}`, options);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Publishes a content entry, making it publicly accessible. Optionally schedule
|
|
48
|
+
* publishing for a future time. Publishing validates that all required fields have
|
|
49
|
+
* values.
|
|
50
|
+
*/
|
|
51
|
+
publish(entryID, body = {}, options) {
|
|
52
|
+
return this._client.post((0, path_1.path) `/v1/content/entries/${entryID}/publish`, { body, ...options });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Unpublishes a content entry, reverting it to draft status. The entry will no
|
|
56
|
+
* longer be publicly accessible but all data is preserved.
|
|
57
|
+
*/
|
|
58
|
+
unpublish(entryID, options) {
|
|
59
|
+
return this._client.post((0, path_1.path) `/v1/content/entries/${entryID}/unpublish`, options);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.Entries = Entries;
|
|
63
|
+
//# sourceMappingURL=entries.js.map
|