influship 0.2.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 +62 -0
- package/LICENSE +201 -0
- package/README.md +372 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +198 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +198 -0
- package/client.d.ts.map +1 -0
- package/client.js +469 -0
- package/client.js.map +1 -0
- package/client.mjs +465 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +86 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +80 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +138 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/brand-safety.d.mts +234 -0
- package/resources/brand-safety.d.mts.map +1 -0
- package/resources/brand-safety.d.ts +234 -0
- package/resources/brand-safety.d.ts.map +1 -0
- package/resources/brand-safety.js +75 -0
- package/resources/brand-safety.js.map +1 -0
- package/resources/brand-safety.mjs +71 -0
- package/resources/brand-safety.mjs.map +1 -0
- package/resources/creators.d.mts +364 -0
- package/resources/creators.d.mts.map +1 -0
- package/resources/creators.d.ts +364 -0
- package/resources/creators.d.ts.map +1 -0
- package/resources/creators.js +119 -0
- package/resources/creators.js.map +1 -0
- package/resources/creators.mjs +115 -0
- package/resources/creators.mjs.map +1 -0
- package/resources/health.d.mts +17 -0
- package/resources/health.d.mts.map +1 -0
- package/resources/health.d.ts +17 -0
- package/resources/health.d.ts.map +1 -0
- package/resources/health.js +15 -0
- package/resources/health.js.map +1 -0
- package/resources/health.mjs +11 -0
- package/resources/health.mjs.map +1 -0
- package/resources/index.d.mts +9 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +9 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +21 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +10 -0
- package/resources/index.mjs.map +1 -0
- package/resources/lookalike.d.mts +142 -0
- package/resources/lookalike.d.mts.map +1 -0
- package/resources/lookalike.d.ts +142 -0
- package/resources/lookalike.d.ts.map +1 -0
- package/resources/lookalike.js +28 -0
- package/resources/lookalike.js.map +1 -0
- package/resources/lookalike.mjs +24 -0
- package/resources/lookalike.mjs.map +1 -0
- package/resources/match.d.mts +90 -0
- package/resources/match.d.mts.map +1 -0
- package/resources/match.d.ts +90 -0
- package/resources/match.d.ts.map +1 -0
- package/resources/match.js +22 -0
- package/resources/match.js.map +1 -0
- package/resources/match.mjs +18 -0
- package/resources/match.mjs.map +1 -0
- package/resources/posts.d.mts +284 -0
- package/resources/posts.d.mts.map +1 -0
- package/resources/posts.d.ts +284 -0
- package/resources/posts.d.ts.map +1 -0
- package/resources/posts.js +55 -0
- package/resources/posts.js.map +1 -0
- package/resources/posts.mjs +51 -0
- package/resources/posts.mjs.map +1 -0
- package/resources/profiles.d.mts +99 -0
- package/resources/profiles.d.mts.map +1 -0
- package/resources/profiles.d.ts +99 -0
- package/resources/profiles.d.ts.map +1 -0
- package/resources/profiles.js +69 -0
- package/resources/profiles.js.map +1 -0
- package/resources/profiles.mjs +65 -0
- package/resources/profiles.mjs.map +1 -0
- package/resources/search.d.mts +189 -0
- package/resources/search.d.mts.map +1 -0
- package/resources/search.d.ts +189 -0
- package/resources/search.d.ts.map +1 -0
- package/resources/search.js +33 -0
- package/resources/search.js.map +1 -0
- package/resources/search.mjs +29 -0
- package/resources/search.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +845 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +127 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/brand-safety.ts +304 -0
- package/src/resources/creators.ts +450 -0
- package/src/resources/health.ts +24 -0
- package/src/resources/index.ts +62 -0
- package/src/resources/lookalike.ts +186 -0
- package/src/resources/match.ts +115 -0
- package/src/resources/posts.ts +347 -0
- package/src/resources/profiles.ts +114 -0
- package/src/resources/search.ts +234 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
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.Match = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
class Match extends resource_1.APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Evaluate how well creators align with campaign requirements using AI-powered
|
|
9
|
+
* analysis.
|
|
10
|
+
*
|
|
11
|
+
* Provide creator references and campaign description to receive match scores
|
|
12
|
+
* (0-100), AI decisions (good/neutral/avoid), explanations, and supporting
|
|
13
|
+
* evidence.
|
|
14
|
+
*
|
|
15
|
+
* **Pricing**: 0.1 credits per creator analyzed
|
|
16
|
+
*/
|
|
17
|
+
analyze(body, options) {
|
|
18
|
+
return this._client.post('/v1/match', { body, ...options });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.Match = Match;
|
|
22
|
+
//# sourceMappingURL=match.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.js","sourceRoot":"","sources":["../src/resources/match.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;OASG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF;AAdD,sBAcC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
export class Match extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Evaluate how well creators align with campaign requirements using AI-powered
|
|
6
|
+
* analysis.
|
|
7
|
+
*
|
|
8
|
+
* Provide creator references and campaign description to receive match scores
|
|
9
|
+
* (0-100), AI decisions (good/neutral/avoid), explanations, and supporting
|
|
10
|
+
* evidence.
|
|
11
|
+
*
|
|
12
|
+
* **Pricing**: 0.1 credits per creator analyzed
|
|
13
|
+
*/
|
|
14
|
+
analyze(body, options) {
|
|
15
|
+
return this._client.post('/v1/match', { body, ...options });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=match.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match.mjs","sourceRoot":"","sources":["../src/resources/match.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAKtB,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;OASG;IACH,OAAO,CAAC,IAAwB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import * as BrandSafetyAPI from "./brand-safety.mjs";
|
|
3
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
+
export declare class Posts extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Analyze a social media post for engagement metrics, content insights, and brand
|
|
8
|
+
* safety.
|
|
9
|
+
*
|
|
10
|
+
* Provide post via URL or post_id+platform. Optionally include AI analysis and/or
|
|
11
|
+
* brand safety features.
|
|
12
|
+
*
|
|
13
|
+
* **Pricing**:
|
|
14
|
+
*
|
|
15
|
+
* - Base: 1.0 credit per post
|
|
16
|
+
* - AI Analysis feature: +0.5 credits (includes summary and transcript)
|
|
17
|
+
* - Brand Safety feature: +0.5 credits (includes rating and risk flags)
|
|
18
|
+
* - **Example**: 1 post with both features = 1.0 + 0.5 + 0.5 = 2.0 credits
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const postAnalysis = await client.posts.analyze({
|
|
23
|
+
* url: 'https://example.com',
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
analyze(body: PostAnalyzeParams, options?: RequestOptions): APIPromise<PostAnalysis>;
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve posts for a specific creator using cursor-based pagination.
|
|
30
|
+
*
|
|
31
|
+
* This endpoint allows you to fetch posts from a creator's social media accounts
|
|
32
|
+
* with optional analysis features and date filtering.
|
|
33
|
+
*
|
|
34
|
+
* **Pricing**:
|
|
35
|
+
*
|
|
36
|
+
* - Base: 0.01 credits per post returned
|
|
37
|
+
* - The more posts you request, the more you pay
|
|
38
|
+
* - Use the `limit` parameter to control costs
|
|
39
|
+
* - **Example**: 25 posts = 0.25 credits
|
|
40
|
+
* - **Example**: 100 posts = 1.0 credit
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response = await client.posts.listByCreator();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
listByCreator(query?: PostListByCreatorParams | null | undefined, options?: RequestOptions): APIPromise<PostListByCreatorResponse>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* AI-powered content analysis. Only present when `ai_analysis` feature is
|
|
51
|
+
* requested.
|
|
52
|
+
*/
|
|
53
|
+
export interface AIAnalysis {
|
|
54
|
+
/**
|
|
55
|
+
* AI-generated summary describing key themes, topics, and messaging.
|
|
56
|
+
*/
|
|
57
|
+
summary: string;
|
|
58
|
+
/**
|
|
59
|
+
* Transcription of spoken words in video. null for photo posts or videos without
|
|
60
|
+
* speech.
|
|
61
|
+
*/
|
|
62
|
+
transcript?: string | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Cursor-based pagination metadata. Use this to navigate through paginated results
|
|
66
|
+
* efficiently.
|
|
67
|
+
*/
|
|
68
|
+
export interface CursorPagination {
|
|
69
|
+
/**
|
|
70
|
+
* Indicates whether more results are available.
|
|
71
|
+
*
|
|
72
|
+
* - `true`: Additional pages exist, use the `cursor` to fetch them
|
|
73
|
+
* - `false`: This is the last page of results
|
|
74
|
+
*/
|
|
75
|
+
has_more: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Opaque base64-encoded cursor string for fetching the next page. Pass this value
|
|
78
|
+
* as the `cursor` query parameter in your next request. null when `has_more` is
|
|
79
|
+
* false (no more pages available). Do not attempt to decode or construct cursor
|
|
80
|
+
* values manually.
|
|
81
|
+
*/
|
|
82
|
+
cursor?: string | null;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Analysis result for a single social media post
|
|
86
|
+
*/
|
|
87
|
+
export interface PostAnalysis {
|
|
88
|
+
/**
|
|
89
|
+
* Internal post ID
|
|
90
|
+
*/
|
|
91
|
+
id: string;
|
|
92
|
+
/**
|
|
93
|
+
* Creator information for a post
|
|
94
|
+
*/
|
|
95
|
+
creator: PostAnalysis.Creator;
|
|
96
|
+
/**
|
|
97
|
+
* Whether this post contains video content. true for video posts and reels, false
|
|
98
|
+
* for photo posts.
|
|
99
|
+
*/
|
|
100
|
+
is_video: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* URL of the primary media file (image or video). For carousel posts, this is the
|
|
103
|
+
* first item.
|
|
104
|
+
*/
|
|
105
|
+
media_url: string;
|
|
106
|
+
/**
|
|
107
|
+
* Social media platform
|
|
108
|
+
*/
|
|
109
|
+
platform: 'instagram' | 'tiktok';
|
|
110
|
+
/**
|
|
111
|
+
* Platform-specific unique identifier for this post. Format varies by platform
|
|
112
|
+
* (Instagram: numeric ID, TikTok: alphanumeric).
|
|
113
|
+
*/
|
|
114
|
+
platform_post_id: string;
|
|
115
|
+
/**
|
|
116
|
+
* ISO 8601 timestamp when the post was originally published.
|
|
117
|
+
*/
|
|
118
|
+
posted_at: string;
|
|
119
|
+
/**
|
|
120
|
+
* Alt text or accessibility caption describing the media. Useful for understanding
|
|
121
|
+
* image content. null if unavailable.
|
|
122
|
+
*/
|
|
123
|
+
accessibility_caption?: string | null;
|
|
124
|
+
/**
|
|
125
|
+
* AI-powered content analysis. Only present when `ai_analysis` feature is
|
|
126
|
+
* requested.
|
|
127
|
+
*/
|
|
128
|
+
ai_analysis?: AIAnalysis;
|
|
129
|
+
/**
|
|
130
|
+
* Brand safety analysis results
|
|
131
|
+
*/
|
|
132
|
+
brand_safety?: BrandSafetyAPI.BrandSafetyAnalysis;
|
|
133
|
+
/**
|
|
134
|
+
* Post caption text written by the creator. null if no caption was provided.
|
|
135
|
+
*/
|
|
136
|
+
caption?: string | null;
|
|
137
|
+
/**
|
|
138
|
+
* Total comments on post. null if unavailable.
|
|
139
|
+
*/
|
|
140
|
+
comments_count?: number | null;
|
|
141
|
+
/**
|
|
142
|
+
* Total likes on post. null if platform hides like counts or data unavailable.
|
|
143
|
+
*/
|
|
144
|
+
likes_count?: number | null;
|
|
145
|
+
/**
|
|
146
|
+
* Array of all media URLs in this post. Contains multiple items for carousel
|
|
147
|
+
* posts, single item for regular posts.
|
|
148
|
+
*/
|
|
149
|
+
media_urls?: Array<string>;
|
|
150
|
+
/**
|
|
151
|
+
* ISO 8601 timestamp when we last scraped/updated this post's data. Metrics are
|
|
152
|
+
* accurate as of this time.
|
|
153
|
+
*/
|
|
154
|
+
scraped_at?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Instagram shortcode used in post URLs (instagram.com/p/{shortcode}). Only
|
|
157
|
+
* present for Instagram posts, null for other platforms.
|
|
158
|
+
*/
|
|
159
|
+
shortcode?: string | null;
|
|
160
|
+
/**
|
|
161
|
+
* Thumbnail image URL for video posts. Only present when is_video is true, null
|
|
162
|
+
* for photo posts.
|
|
163
|
+
*/
|
|
164
|
+
thumbnail_url?: string | null;
|
|
165
|
+
/**
|
|
166
|
+
* Video length in seconds. null for photo posts.
|
|
167
|
+
*/
|
|
168
|
+
video_duration_seconds?: number | null;
|
|
169
|
+
/**
|
|
170
|
+
* Video view count. null for photo posts or if unavailable.
|
|
171
|
+
*/
|
|
172
|
+
video_view_count?: number | null;
|
|
173
|
+
}
|
|
174
|
+
export declare namespace PostAnalysis {
|
|
175
|
+
/**
|
|
176
|
+
* Creator information for a post
|
|
177
|
+
*/
|
|
178
|
+
interface Creator {
|
|
179
|
+
/**
|
|
180
|
+
* Creator UUID
|
|
181
|
+
*/
|
|
182
|
+
id: string;
|
|
183
|
+
/**
|
|
184
|
+
* Social media platform
|
|
185
|
+
*/
|
|
186
|
+
platform: 'instagram' | 'tiktok';
|
|
187
|
+
/**
|
|
188
|
+
* Social media username
|
|
189
|
+
*/
|
|
190
|
+
username: string;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Response for getting posts by creator
|
|
195
|
+
*/
|
|
196
|
+
export interface PostListByCreatorResponse {
|
|
197
|
+
/**
|
|
198
|
+
* Cursor-based pagination metadata. Use this to navigate through paginated results
|
|
199
|
+
* efficiently.
|
|
200
|
+
*/
|
|
201
|
+
pagination: CursorPagination;
|
|
202
|
+
/**
|
|
203
|
+
* Array of posts
|
|
204
|
+
*/
|
|
205
|
+
posts: Array<PostAnalysis>;
|
|
206
|
+
}
|
|
207
|
+
export type PostAnalyzeParams = PostAnalyzeParams.Variant0 | PostAnalyzeParams.Variant1;
|
|
208
|
+
export declare namespace PostAnalyzeParams {
|
|
209
|
+
interface Variant0 {
|
|
210
|
+
/**
|
|
211
|
+
* Public URL of the post to analyze
|
|
212
|
+
*/
|
|
213
|
+
url: string;
|
|
214
|
+
/**
|
|
215
|
+
* Analysis features to include
|
|
216
|
+
*/
|
|
217
|
+
features?: Array<'ai_analysis' | 'brand_safety'>;
|
|
218
|
+
/**
|
|
219
|
+
* Social media platform (required when using post_id)
|
|
220
|
+
*/
|
|
221
|
+
platform?: 'instagram' | 'tiktok';
|
|
222
|
+
/**
|
|
223
|
+
* Platform-specific post ID
|
|
224
|
+
*/
|
|
225
|
+
post_id?: string;
|
|
226
|
+
}
|
|
227
|
+
interface Variant1 {
|
|
228
|
+
/**
|
|
229
|
+
* Social media platform
|
|
230
|
+
*/
|
|
231
|
+
platform: 'instagram' | 'tiktok';
|
|
232
|
+
/**
|
|
233
|
+
* Platform-specific post ID
|
|
234
|
+
*/
|
|
235
|
+
post_id: string;
|
|
236
|
+
/**
|
|
237
|
+
* Analysis features to include
|
|
238
|
+
*/
|
|
239
|
+
features?: Array<'ai_analysis' | 'brand_safety'>;
|
|
240
|
+
/**
|
|
241
|
+
* Public URL of the post to analyze
|
|
242
|
+
*/
|
|
243
|
+
url?: string;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
export interface PostListByCreatorParams {
|
|
247
|
+
/**
|
|
248
|
+
* Creator UUID
|
|
249
|
+
*/
|
|
250
|
+
creator_id?: string;
|
|
251
|
+
/**
|
|
252
|
+
* Opaque pagination cursor from previous response. Do not construct manually.
|
|
253
|
+
*/
|
|
254
|
+
cursor?: string;
|
|
255
|
+
/**
|
|
256
|
+
* Start date for filtering posts (ISO 8601)
|
|
257
|
+
*/
|
|
258
|
+
date_from?: string;
|
|
259
|
+
/**
|
|
260
|
+
* End date for filtering posts (ISO 8601)
|
|
261
|
+
*/
|
|
262
|
+
date_to?: string;
|
|
263
|
+
/**
|
|
264
|
+
* Optional analysis features. `ai_analysis` adds summary/transcript.
|
|
265
|
+
* `brand_safety` adds rating/flags. Each feature has additional cost.
|
|
266
|
+
*/
|
|
267
|
+
features?: Array<'ai_analysis' | 'brand_safety'>;
|
|
268
|
+
/**
|
|
269
|
+
* Number of posts per page. Min 1, max 100, default 25.
|
|
270
|
+
*/
|
|
271
|
+
limit?: number;
|
|
272
|
+
/**
|
|
273
|
+
* Social media platform
|
|
274
|
+
*/
|
|
275
|
+
platform?: 'instagram' | 'tiktok';
|
|
276
|
+
/**
|
|
277
|
+
* Social media username
|
|
278
|
+
*/
|
|
279
|
+
username?: string;
|
|
280
|
+
}
|
|
281
|
+
export declare namespace Posts {
|
|
282
|
+
export { type AIAnalysis as AIAnalysis, type CursorPagination as CursorPagination, type PostAnalysis as PostAnalysis, type PostListByCreatorResponse as PostListByCreatorResponse, type PostAnalyzeParams as PostAnalyzeParams, type PostListByCreatorParams as PostListByCreatorParams, };
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=posts.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.d.mts","sourceRoot":"","sources":["../src/resources/posts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC;IAIpF;;;;;;;;;;;;;;;;;;OAkBG;IACH,aAAa,CACX,KAAK,GAAE,uBAAuB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,yBAAyB,CAAC;CAGzC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,QAAQ,EAAE,OAAO,CAAC;IAEl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,GAAG,cAAc,CAAC,CAAC;IAEjD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import * as BrandSafetyAPI from "./brand-safety.js";
|
|
3
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
export declare class Posts extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Analyze a social media post for engagement metrics, content insights, and brand
|
|
8
|
+
* safety.
|
|
9
|
+
*
|
|
10
|
+
* Provide post via URL or post_id+platform. Optionally include AI analysis and/or
|
|
11
|
+
* brand safety features.
|
|
12
|
+
*
|
|
13
|
+
* **Pricing**:
|
|
14
|
+
*
|
|
15
|
+
* - Base: 1.0 credit per post
|
|
16
|
+
* - AI Analysis feature: +0.5 credits (includes summary and transcript)
|
|
17
|
+
* - Brand Safety feature: +0.5 credits (includes rating and risk flags)
|
|
18
|
+
* - **Example**: 1 post with both features = 1.0 + 0.5 + 0.5 = 2.0 credits
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const postAnalysis = await client.posts.analyze({
|
|
23
|
+
* url: 'https://example.com',
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
analyze(body: PostAnalyzeParams, options?: RequestOptions): APIPromise<PostAnalysis>;
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve posts for a specific creator using cursor-based pagination.
|
|
30
|
+
*
|
|
31
|
+
* This endpoint allows you to fetch posts from a creator's social media accounts
|
|
32
|
+
* with optional analysis features and date filtering.
|
|
33
|
+
*
|
|
34
|
+
* **Pricing**:
|
|
35
|
+
*
|
|
36
|
+
* - Base: 0.01 credits per post returned
|
|
37
|
+
* - The more posts you request, the more you pay
|
|
38
|
+
* - Use the `limit` parameter to control costs
|
|
39
|
+
* - **Example**: 25 posts = 0.25 credits
|
|
40
|
+
* - **Example**: 100 posts = 1.0 credit
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response = await client.posts.listByCreator();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
listByCreator(query?: PostListByCreatorParams | null | undefined, options?: RequestOptions): APIPromise<PostListByCreatorResponse>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* AI-powered content analysis. Only present when `ai_analysis` feature is
|
|
51
|
+
* requested.
|
|
52
|
+
*/
|
|
53
|
+
export interface AIAnalysis {
|
|
54
|
+
/**
|
|
55
|
+
* AI-generated summary describing key themes, topics, and messaging.
|
|
56
|
+
*/
|
|
57
|
+
summary: string;
|
|
58
|
+
/**
|
|
59
|
+
* Transcription of spoken words in video. null for photo posts or videos without
|
|
60
|
+
* speech.
|
|
61
|
+
*/
|
|
62
|
+
transcript?: string | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Cursor-based pagination metadata. Use this to navigate through paginated results
|
|
66
|
+
* efficiently.
|
|
67
|
+
*/
|
|
68
|
+
export interface CursorPagination {
|
|
69
|
+
/**
|
|
70
|
+
* Indicates whether more results are available.
|
|
71
|
+
*
|
|
72
|
+
* - `true`: Additional pages exist, use the `cursor` to fetch them
|
|
73
|
+
* - `false`: This is the last page of results
|
|
74
|
+
*/
|
|
75
|
+
has_more: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Opaque base64-encoded cursor string for fetching the next page. Pass this value
|
|
78
|
+
* as the `cursor` query parameter in your next request. null when `has_more` is
|
|
79
|
+
* false (no more pages available). Do not attempt to decode or construct cursor
|
|
80
|
+
* values manually.
|
|
81
|
+
*/
|
|
82
|
+
cursor?: string | null;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Analysis result for a single social media post
|
|
86
|
+
*/
|
|
87
|
+
export interface PostAnalysis {
|
|
88
|
+
/**
|
|
89
|
+
* Internal post ID
|
|
90
|
+
*/
|
|
91
|
+
id: string;
|
|
92
|
+
/**
|
|
93
|
+
* Creator information for a post
|
|
94
|
+
*/
|
|
95
|
+
creator: PostAnalysis.Creator;
|
|
96
|
+
/**
|
|
97
|
+
* Whether this post contains video content. true for video posts and reels, false
|
|
98
|
+
* for photo posts.
|
|
99
|
+
*/
|
|
100
|
+
is_video: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* URL of the primary media file (image or video). For carousel posts, this is the
|
|
103
|
+
* first item.
|
|
104
|
+
*/
|
|
105
|
+
media_url: string;
|
|
106
|
+
/**
|
|
107
|
+
* Social media platform
|
|
108
|
+
*/
|
|
109
|
+
platform: 'instagram' | 'tiktok';
|
|
110
|
+
/**
|
|
111
|
+
* Platform-specific unique identifier for this post. Format varies by platform
|
|
112
|
+
* (Instagram: numeric ID, TikTok: alphanumeric).
|
|
113
|
+
*/
|
|
114
|
+
platform_post_id: string;
|
|
115
|
+
/**
|
|
116
|
+
* ISO 8601 timestamp when the post was originally published.
|
|
117
|
+
*/
|
|
118
|
+
posted_at: string;
|
|
119
|
+
/**
|
|
120
|
+
* Alt text or accessibility caption describing the media. Useful for understanding
|
|
121
|
+
* image content. null if unavailable.
|
|
122
|
+
*/
|
|
123
|
+
accessibility_caption?: string | null;
|
|
124
|
+
/**
|
|
125
|
+
* AI-powered content analysis. Only present when `ai_analysis` feature is
|
|
126
|
+
* requested.
|
|
127
|
+
*/
|
|
128
|
+
ai_analysis?: AIAnalysis;
|
|
129
|
+
/**
|
|
130
|
+
* Brand safety analysis results
|
|
131
|
+
*/
|
|
132
|
+
brand_safety?: BrandSafetyAPI.BrandSafetyAnalysis;
|
|
133
|
+
/**
|
|
134
|
+
* Post caption text written by the creator. null if no caption was provided.
|
|
135
|
+
*/
|
|
136
|
+
caption?: string | null;
|
|
137
|
+
/**
|
|
138
|
+
* Total comments on post. null if unavailable.
|
|
139
|
+
*/
|
|
140
|
+
comments_count?: number | null;
|
|
141
|
+
/**
|
|
142
|
+
* Total likes on post. null if platform hides like counts or data unavailable.
|
|
143
|
+
*/
|
|
144
|
+
likes_count?: number | null;
|
|
145
|
+
/**
|
|
146
|
+
* Array of all media URLs in this post. Contains multiple items for carousel
|
|
147
|
+
* posts, single item for regular posts.
|
|
148
|
+
*/
|
|
149
|
+
media_urls?: Array<string>;
|
|
150
|
+
/**
|
|
151
|
+
* ISO 8601 timestamp when we last scraped/updated this post's data. Metrics are
|
|
152
|
+
* accurate as of this time.
|
|
153
|
+
*/
|
|
154
|
+
scraped_at?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Instagram shortcode used in post URLs (instagram.com/p/{shortcode}). Only
|
|
157
|
+
* present for Instagram posts, null for other platforms.
|
|
158
|
+
*/
|
|
159
|
+
shortcode?: string | null;
|
|
160
|
+
/**
|
|
161
|
+
* Thumbnail image URL for video posts. Only present when is_video is true, null
|
|
162
|
+
* for photo posts.
|
|
163
|
+
*/
|
|
164
|
+
thumbnail_url?: string | null;
|
|
165
|
+
/**
|
|
166
|
+
* Video length in seconds. null for photo posts.
|
|
167
|
+
*/
|
|
168
|
+
video_duration_seconds?: number | null;
|
|
169
|
+
/**
|
|
170
|
+
* Video view count. null for photo posts or if unavailable.
|
|
171
|
+
*/
|
|
172
|
+
video_view_count?: number | null;
|
|
173
|
+
}
|
|
174
|
+
export declare namespace PostAnalysis {
|
|
175
|
+
/**
|
|
176
|
+
* Creator information for a post
|
|
177
|
+
*/
|
|
178
|
+
interface Creator {
|
|
179
|
+
/**
|
|
180
|
+
* Creator UUID
|
|
181
|
+
*/
|
|
182
|
+
id: string;
|
|
183
|
+
/**
|
|
184
|
+
* Social media platform
|
|
185
|
+
*/
|
|
186
|
+
platform: 'instagram' | 'tiktok';
|
|
187
|
+
/**
|
|
188
|
+
* Social media username
|
|
189
|
+
*/
|
|
190
|
+
username: string;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Response for getting posts by creator
|
|
195
|
+
*/
|
|
196
|
+
export interface PostListByCreatorResponse {
|
|
197
|
+
/**
|
|
198
|
+
* Cursor-based pagination metadata. Use this to navigate through paginated results
|
|
199
|
+
* efficiently.
|
|
200
|
+
*/
|
|
201
|
+
pagination: CursorPagination;
|
|
202
|
+
/**
|
|
203
|
+
* Array of posts
|
|
204
|
+
*/
|
|
205
|
+
posts: Array<PostAnalysis>;
|
|
206
|
+
}
|
|
207
|
+
export type PostAnalyzeParams = PostAnalyzeParams.Variant0 | PostAnalyzeParams.Variant1;
|
|
208
|
+
export declare namespace PostAnalyzeParams {
|
|
209
|
+
interface Variant0 {
|
|
210
|
+
/**
|
|
211
|
+
* Public URL of the post to analyze
|
|
212
|
+
*/
|
|
213
|
+
url: string;
|
|
214
|
+
/**
|
|
215
|
+
* Analysis features to include
|
|
216
|
+
*/
|
|
217
|
+
features?: Array<'ai_analysis' | 'brand_safety'>;
|
|
218
|
+
/**
|
|
219
|
+
* Social media platform (required when using post_id)
|
|
220
|
+
*/
|
|
221
|
+
platform?: 'instagram' | 'tiktok';
|
|
222
|
+
/**
|
|
223
|
+
* Platform-specific post ID
|
|
224
|
+
*/
|
|
225
|
+
post_id?: string;
|
|
226
|
+
}
|
|
227
|
+
interface Variant1 {
|
|
228
|
+
/**
|
|
229
|
+
* Social media platform
|
|
230
|
+
*/
|
|
231
|
+
platform: 'instagram' | 'tiktok';
|
|
232
|
+
/**
|
|
233
|
+
* Platform-specific post ID
|
|
234
|
+
*/
|
|
235
|
+
post_id: string;
|
|
236
|
+
/**
|
|
237
|
+
* Analysis features to include
|
|
238
|
+
*/
|
|
239
|
+
features?: Array<'ai_analysis' | 'brand_safety'>;
|
|
240
|
+
/**
|
|
241
|
+
* Public URL of the post to analyze
|
|
242
|
+
*/
|
|
243
|
+
url?: string;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
export interface PostListByCreatorParams {
|
|
247
|
+
/**
|
|
248
|
+
* Creator UUID
|
|
249
|
+
*/
|
|
250
|
+
creator_id?: string;
|
|
251
|
+
/**
|
|
252
|
+
* Opaque pagination cursor from previous response. Do not construct manually.
|
|
253
|
+
*/
|
|
254
|
+
cursor?: string;
|
|
255
|
+
/**
|
|
256
|
+
* Start date for filtering posts (ISO 8601)
|
|
257
|
+
*/
|
|
258
|
+
date_from?: string;
|
|
259
|
+
/**
|
|
260
|
+
* End date for filtering posts (ISO 8601)
|
|
261
|
+
*/
|
|
262
|
+
date_to?: string;
|
|
263
|
+
/**
|
|
264
|
+
* Optional analysis features. `ai_analysis` adds summary/transcript.
|
|
265
|
+
* `brand_safety` adds rating/flags. Each feature has additional cost.
|
|
266
|
+
*/
|
|
267
|
+
features?: Array<'ai_analysis' | 'brand_safety'>;
|
|
268
|
+
/**
|
|
269
|
+
* Number of posts per page. Min 1, max 100, default 25.
|
|
270
|
+
*/
|
|
271
|
+
limit?: number;
|
|
272
|
+
/**
|
|
273
|
+
* Social media platform
|
|
274
|
+
*/
|
|
275
|
+
platform?: 'instagram' | 'tiktok';
|
|
276
|
+
/**
|
|
277
|
+
* Social media username
|
|
278
|
+
*/
|
|
279
|
+
username?: string;
|
|
280
|
+
}
|
|
281
|
+
export declare namespace Posts {
|
|
282
|
+
export { type AIAnalysis as AIAnalysis, type CursorPagination as CursorPagination, type PostAnalysis as PostAnalysis, type PostListByCreatorResponse as PostListByCreatorResponse, type PostAnalyzeParams as PostAnalyzeParams, type PostListByCreatorParams as PostListByCreatorParams, };
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=posts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../src/resources/posts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,YAAY,CAAC;IAIpF;;;;;;;;;;;;;;;;;;OAkBG;IACH,aAAa,CACX,KAAK,GAAE,uBAAuB,GAAG,IAAI,GAAG,SAAc,EACtD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,yBAAyB,CAAC;CAGzC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC;IAE9B;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,WAAW,GAAG,QAAQ,CAAC;IAEjC;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEz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B,IAAI,iBAAiB,EAC3C,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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.Posts = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
class Posts extends resource_1.APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Analyze a social media post for engagement metrics, content insights, and brand
|
|
9
|
+
* safety.
|
|
10
|
+
*
|
|
11
|
+
* Provide post via URL or post_id+platform. Optionally include AI analysis and/or
|
|
12
|
+
* brand safety features.
|
|
13
|
+
*
|
|
14
|
+
* **Pricing**:
|
|
15
|
+
*
|
|
16
|
+
* - Base: 1.0 credit per post
|
|
17
|
+
* - AI Analysis feature: +0.5 credits (includes summary and transcript)
|
|
18
|
+
* - Brand Safety feature: +0.5 credits (includes rating and risk flags)
|
|
19
|
+
* - **Example**: 1 post with both features = 1.0 + 0.5 + 0.5 = 2.0 credits
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const postAnalysis = await client.posts.analyze({
|
|
24
|
+
* url: 'https://example.com',
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
analyze(body, options) {
|
|
29
|
+
return this._client.post('/v1/posts/analyze', { body, ...options });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Retrieve posts for a specific creator using cursor-based pagination.
|
|
33
|
+
*
|
|
34
|
+
* This endpoint allows you to fetch posts from a creator's social media accounts
|
|
35
|
+
* with optional analysis features and date filtering.
|
|
36
|
+
*
|
|
37
|
+
* **Pricing**:
|
|
38
|
+
*
|
|
39
|
+
* - Base: 0.01 credits per post returned
|
|
40
|
+
* - The more posts you request, the more you pay
|
|
41
|
+
* - Use the `limit` parameter to control costs
|
|
42
|
+
* - **Example**: 25 posts = 0.25 credits
|
|
43
|
+
* - **Example**: 100 posts = 1.0 credit
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const response = await client.posts.listByCreator();
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
listByCreator(query = {}, options) {
|
|
51
|
+
return this._client.get('/v1/posts/by-creator', { query, ...options });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.Posts = Posts;
|
|
55
|
+
//# sourceMappingURL=posts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../src/resources/posts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAK/C,MAAa,KAAM,SAAQ,sBAAW;IACpC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,IAAuB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,aAAa,CACX,QAAoD,EAAE,EACtD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;CACF;AAnDD,sBAmDC"}
|