@relayapi/sdk 0.2.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.
- package/dist/api-promise.d.ts +2 -0
- package/dist/api-promise.js +18 -0
- package/dist/client.d.ts +225 -0
- package/dist/client.js +552 -0
- package/dist/core/api-promise.d.ts +45 -0
- package/dist/core/api-promise.js +83 -0
- package/dist/core/error.d.ts +45 -0
- package/dist/core/error.js +112 -0
- package/dist/core/resource.d.ts +5 -0
- package/dist/core/resource.js +10 -0
- package/dist/core/uploads.d.ts +2 -0
- package/dist/core/uploads.js +5 -0
- package/dist/error.d.ts +2 -0
- package/dist/error.js +18 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +26 -0
- package/dist/internal/builtin-types.d.ts +72 -0
- package/dist/internal/builtin-types.js +3 -0
- package/dist/internal/detect-platform.d.ts +14 -0
- package/dist/internal/detect-platform.js +161 -0
- package/dist/internal/errors.d.ts +2 -0
- package/dist/internal/errors.js +40 -0
- package/dist/internal/headers.d.ts +19 -0
- package/dist/internal/headers.js +78 -0
- package/dist/internal/parse.d.ts +11 -0
- package/dist/internal/parse.js +39 -0
- package/dist/internal/request-options.d.ts +74 -0
- package/dist/internal/request-options.js +13 -0
- package/dist/internal/shim-types.d.ts +16 -0
- package/dist/internal/shim-types.js +3 -0
- package/dist/internal/shims.d.ts +23 -0
- package/dist/internal/shims.js +90 -0
- package/dist/internal/to-file.d.ts +44 -0
- package/dist/internal/to-file.js +90 -0
- package/dist/internal/types.d.ts +68 -0
- package/dist/internal/types.js +3 -0
- package/dist/internal/uploads.d.ts +41 -0
- package/dist/internal/uploads.js +140 -0
- package/dist/internal/utils/base64.d.ts +2 -0
- package/dist/internal/utils/base64.js +37 -0
- package/dist/internal/utils/bytes.d.ts +3 -0
- package/dist/internal/utils/bytes.js +30 -0
- package/dist/internal/utils/env.d.ts +8 -0
- package/dist/internal/utils/env.js +21 -0
- package/dist/internal/utils/log.d.ts +36 -0
- package/dist/internal/utils/log.js +84 -0
- package/dist/internal/utils/path.d.ts +14 -0
- package/dist/internal/utils/path.js +78 -0
- package/dist/internal/utils/query.d.ts +4 -0
- package/dist/internal/utils/query.js +22 -0
- package/dist/internal/utils/sleep.d.ts +1 -0
- package/dist/internal/utils/sleep.js +6 -0
- package/dist/internal/utils/uuid.d.ts +4 -0
- package/dist/internal/utils/uuid.js +18 -0
- package/dist/internal/utils/values.d.ts +17 -0
- package/dist/internal/utils/values.js +111 -0
- package/dist/internal/utils.d.ts +7 -0
- package/dist/internal/utils.js +24 -0
- package/dist/resource.d.ts +2 -0
- package/dist/resource.js +18 -0
- package/dist/resources/account-groups.d.ts +52 -0
- package/dist/resources/account-groups.js +37 -0
- package/dist/resources/accounts/accounts.d.ts +148 -0
- package/dist/resources/accounts/accounts.js +101 -0
- package/dist/resources/accounts/facebook-pages.d.ts +48 -0
- package/dist/resources/accounts/facebook-pages.js +21 -0
- package/dist/resources/accounts/gmb-locations.d.ts +48 -0
- package/dist/resources/accounts/gmb-locations.js +21 -0
- package/dist/resources/accounts/health.d.ts +49 -0
- package/dist/resources/accounts/health.js +21 -0
- package/dist/resources/accounts/index.d.ts +8 -0
- package/dist/resources/accounts/index.js +20 -0
- package/dist/resources/accounts/linkedin-organizations.d.ts +52 -0
- package/dist/resources/accounts/linkedin-organizations.js +21 -0
- package/dist/resources/accounts/pinterest-boards.d.ts +48 -0
- package/dist/resources/accounts/pinterest-boards.js +21 -0
- package/dist/resources/accounts/reddit-flairs.d.ts +27 -0
- package/dist/resources/accounts/reddit-flairs.js +15 -0
- package/dist/resources/accounts/reddit-subreddits.d.ts +48 -0
- package/dist/resources/accounts/reddit-subreddits.js +21 -0
- package/dist/resources/accounts.d.ts +1 -0
- package/dist/resources/accounts.js +18 -0
- package/dist/resources/analytics/analytics.d.ts +369 -0
- package/dist/resources/analytics/analytics.js +84 -0
- package/dist/resources/analytics/index.d.ts +2 -0
- package/dist/resources/analytics/index.js +8 -0
- package/dist/resources/analytics/youtube.d.ts +49 -0
- package/dist/resources/analytics/youtube.js +14 -0
- package/dist/resources/analytics.d.ts +1 -0
- package/dist/resources/analytics.js +18 -0
- package/dist/resources/api-keys.d.ts +110 -0
- package/dist/resources/api-keys.js +32 -0
- package/dist/resources/connect/connect.d.ts +188 -0
- package/dist/resources/connect/connect.js +97 -0
- package/dist/resources/connect/facebook/facebook.d.ts +9 -0
- package/dist/resources/connect/facebook/facebook.js +48 -0
- package/dist/resources/connect/facebook/index.d.ts +2 -0
- package/dist/resources/connect/facebook/index.js +8 -0
- package/dist/resources/connect/facebook/pages.d.ts +70 -0
- package/dist/resources/connect/facebook/pages.js +20 -0
- package/dist/resources/connect/facebook.d.ts +1 -0
- package/dist/resources/connect/facebook.js +18 -0
- package/dist/resources/connect/googlebusiness/googlebusiness.d.ts +9 -0
- package/dist/resources/connect/googlebusiness/googlebusiness.js +48 -0
- package/dist/resources/connect/googlebusiness/index.d.ts +2 -0
- package/dist/resources/connect/googlebusiness/index.js +8 -0
- package/dist/resources/connect/googlebusiness/locations.d.ts +70 -0
- package/dist/resources/connect/googlebusiness/locations.js +20 -0
- package/dist/resources/connect/googlebusiness.d.ts +1 -0
- package/dist/resources/connect/googlebusiness.js +18 -0
- package/dist/resources/connect/index.d.ts +8 -0
- package/dist/resources/connect/index.js +20 -0
- package/dist/resources/connect/linkedin/index.d.ts +2 -0
- package/dist/resources/connect/linkedin/index.js +8 -0
- package/dist/resources/connect/linkedin/linkedin.d.ts +9 -0
- package/dist/resources/connect/linkedin/linkedin.js +48 -0
- package/dist/resources/connect/linkedin/organizations.d.ts +85 -0
- package/dist/resources/connect/linkedin/organizations.js +20 -0
- package/dist/resources/connect/linkedin.d.ts +1 -0
- package/dist/resources/connect/linkedin.js +18 -0
- package/dist/resources/connect/pinterest/boards.d.ts +70 -0
- package/dist/resources/connect/pinterest/boards.js +20 -0
- package/dist/resources/connect/pinterest/index.d.ts +2 -0
- package/dist/resources/connect/pinterest/index.js +8 -0
- package/dist/resources/connect/pinterest/pinterest.d.ts +9 -0
- package/dist/resources/connect/pinterest/pinterest.js +48 -0
- package/dist/resources/connect/pinterest.d.ts +1 -0
- package/dist/resources/connect/pinterest.js +18 -0
- package/dist/resources/connect/snapchat/index.d.ts +2 -0
- package/dist/resources/connect/snapchat/index.js +8 -0
- package/dist/resources/connect/snapchat/profiles.d.ts +74 -0
- package/dist/resources/connect/snapchat/profiles.js +20 -0
- package/dist/resources/connect/snapchat/snapchat.d.ts +9 -0
- package/dist/resources/connect/snapchat/snapchat.js +48 -0
- package/dist/resources/connect/snapchat.d.ts +1 -0
- package/dist/resources/connect/snapchat.js +18 -0
- package/dist/resources/connect/telegram.d.ts +122 -0
- package/dist/resources/connect/telegram.js +26 -0
- package/dist/resources/connect/whatsapp.d.ts +92 -0
- package/dist/resources/connect/whatsapp.js +26 -0
- package/dist/resources/connect.d.ts +1 -0
- package/dist/resources/connect.js +18 -0
- package/dist/resources/connections.d.ts +55 -0
- package/dist/resources/connections.js +14 -0
- package/dist/resources/inbox/comments/comments.d.ts +220 -0
- package/dist/resources/inbox/comments/comments.js +83 -0
- package/dist/resources/inbox/comments/hide.d.ts +36 -0
- package/dist/resources/inbox/comments/hide.js +21 -0
- package/dist/resources/inbox/comments/index.d.ts +3 -0
- package/dist/resources/inbox/comments/index.js +10 -0
- package/dist/resources/inbox/comments/like.d.ts +36 -0
- package/dist/resources/inbox/comments/like.js +21 -0
- package/dist/resources/inbox/comments.d.ts +1 -0
- package/dist/resources/inbox/comments.js +18 -0
- package/dist/resources/inbox/inbox.d.ts +17 -0
- package/dist/resources/inbox/inbox.js +56 -0
- package/dist/resources/inbox/index.d.ts +4 -0
- package/dist/resources/inbox/index.js +12 -0
- package/dist/resources/inbox/messages.d.ts +205 -0
- package/dist/resources/inbox/messages.js +40 -0
- package/dist/resources/inbox/reviews/index.d.ts +2 -0
- package/dist/resources/inbox/reviews/index.js +8 -0
- package/dist/resources/inbox/reviews/reply.d.ts +38 -0
- package/dist/resources/inbox/reviews/reply.js +21 -0
- package/dist/resources/inbox/reviews/reviews.d.ts +76 -0
- package/dist/resources/inbox/reviews/reviews.js +54 -0
- package/dist/resources/inbox/reviews.d.ts +1 -0
- package/dist/resources/inbox/reviews.js +18 -0
- package/dist/resources/inbox.d.ts +1 -0
- package/dist/resources/inbox.js +18 -0
- package/dist/resources/index.d.ts +16 -0
- package/dist/resources/index.js +36 -0
- package/dist/resources/media.d.ts +177 -0
- package/dist/resources/media.js +51 -0
- package/dist/resources/posts/index.d.ts +2 -0
- package/dist/resources/posts/index.js +8 -0
- package/dist/resources/posts/logs.d.ts +134 -0
- package/dist/resources/posts/logs.js +31 -0
- package/dist/resources/posts/posts.d.ts +607 -0
- package/dist/resources/posts/posts.js +149 -0
- package/dist/resources/posts.d.ts +1 -0
- package/dist/resources/posts.js +18 -0
- package/dist/resources/queue/index.d.ts +2 -0
- package/dist/resources/queue/index.js +8 -0
- package/dist/resources/queue/queue.d.ts +42 -0
- package/dist/resources/queue/queue.js +60 -0
- package/dist/resources/queue/slots.d.ts +215 -0
- package/dist/resources/queue/slots.js +36 -0
- package/dist/resources/queue.d.ts +1 -0
- package/dist/resources/queue.js +18 -0
- package/dist/resources/reddit.d.ts +186 -0
- package/dist/resources/reddit.js +20 -0
- package/dist/resources/tools/index.d.ts +3 -0
- package/dist/resources/tools/index.js +10 -0
- package/dist/resources/tools/instagram.d.ts +41 -0
- package/dist/resources/tools/instagram.js +22 -0
- package/dist/resources/tools/tools.d.ts +13 -0
- package/dist/resources/tools/tools.js +52 -0
- package/dist/resources/tools/validate.d.ts +689 -0
- package/dist/resources/tools/validate.js +63 -0
- package/dist/resources/tools.d.ts +1 -0
- package/dist/resources/tools.js +18 -0
- package/dist/resources/twitter/bookmark.d.ts +48 -0
- package/dist/resources/twitter/bookmark.js +20 -0
- package/dist/resources/twitter/follow.d.ts +48 -0
- package/dist/resources/twitter/follow.js +20 -0
- package/dist/resources/twitter/index.d.ts +4 -0
- package/dist/resources/twitter/index.js +12 -0
- package/dist/resources/twitter/retweet.d.ts +48 -0
- package/dist/resources/twitter/retweet.js +20 -0
- package/dist/resources/twitter/twitter.d.ts +17 -0
- package/dist/resources/twitter/twitter.js +56 -0
- package/dist/resources/twitter.d.ts +1 -0
- package/dist/resources/twitter.js +18 -0
- package/dist/resources/usage.d.ts +97 -0
- package/dist/resources/usage.js +14 -0
- package/dist/resources/webhooks.d.ts +205 -0
- package/dist/resources/webhooks.js +50 -0
- package/dist/resources/whatsapp/broadcasts.d.ts +291 -0
- package/dist/resources/whatsapp/broadcasts.js +49 -0
- package/dist/resources/whatsapp/business-profile.d.ts +85 -0
- package/dist/resources/whatsapp/business-profile.js +20 -0
- package/dist/resources/whatsapp/contacts.d.ts +250 -0
- package/dist/resources/whatsapp/contacts.js +49 -0
- package/dist/resources/whatsapp/groups.d.ts +87 -0
- package/dist/resources/whatsapp/groups.js +31 -0
- package/dist/resources/whatsapp/index.d.ts +6 -0
- package/dist/resources/whatsapp/index.js +16 -0
- package/dist/resources/whatsapp/templates.d.ts +250 -0
- package/dist/resources/whatsapp/templates.js +39 -0
- package/dist/resources/whatsapp/whatsapp.d.ts +148 -0
- package/dist/resources/whatsapp/whatsapp.js +76 -0
- package/dist/resources/whatsapp.d.ts +1 -0
- package/dist/resources/whatsapp.js +18 -0
- package/dist/resources.d.ts +1 -0
- package/dist/resources.js +17 -0
- package/dist/uploads.d.ts +2 -0
- package/dist/uploads.js +18 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/package.json +28 -0
- package/src/index.ts +22 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { APIResource } from '../core/resource';
|
|
2
|
+
import { APIPromise } from '../core/api-promise';
|
|
3
|
+
import { RequestOptions } from '../internal/request-options';
|
|
4
|
+
export declare class Media extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* List media files
|
|
7
|
+
*/
|
|
8
|
+
list(query?: MediaListParams | null | undefined, options?: RequestOptions): APIPromise<MediaListResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Get media details
|
|
11
|
+
*/
|
|
12
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<MediaRetrieveResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Delete media
|
|
15
|
+
*/
|
|
16
|
+
delete(id: string, options?: RequestOptions): APIPromise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Generate a pre-signed URL for direct upload to R2. The client can PUT the file
|
|
19
|
+
* to the returned URL.
|
|
20
|
+
*/
|
|
21
|
+
getPresignURL(body: MediaGetPresignURLParams, options?: RequestOptions): APIPromise<MediaGetPresignURLResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Upload a raw file body. Pass the filename as a query parameter and set the
|
|
24
|
+
* Content-Type header.
|
|
25
|
+
*/
|
|
26
|
+
upload(body: string | ArrayBuffer | ArrayBufferView | Blob | DataView, params: MediaUploadParams, options?: RequestOptions): APIPromise<MediaUploadResponse>;
|
|
27
|
+
}
|
|
28
|
+
export interface MediaRetrieveResponse {
|
|
29
|
+
/**
|
|
30
|
+
* Media ID
|
|
31
|
+
*/
|
|
32
|
+
id: string;
|
|
33
|
+
/**
|
|
34
|
+
* Upload timestamp
|
|
35
|
+
*/
|
|
36
|
+
created_at: string;
|
|
37
|
+
/**
|
|
38
|
+
* Original filename
|
|
39
|
+
*/
|
|
40
|
+
filename: string;
|
|
41
|
+
/**
|
|
42
|
+
* MIME type
|
|
43
|
+
*/
|
|
44
|
+
mime_type: string;
|
|
45
|
+
/**
|
|
46
|
+
* File size in bytes
|
|
47
|
+
*/
|
|
48
|
+
size: number;
|
|
49
|
+
/**
|
|
50
|
+
* Public URL
|
|
51
|
+
*/
|
|
52
|
+
url: string | null;
|
|
53
|
+
/**
|
|
54
|
+
* Duration in seconds (video/audio)
|
|
55
|
+
*/
|
|
56
|
+
duration?: number | null;
|
|
57
|
+
/**
|
|
58
|
+
* Height in pixels
|
|
59
|
+
*/
|
|
60
|
+
height?: number | null;
|
|
61
|
+
/**
|
|
62
|
+
* Width in pixels
|
|
63
|
+
*/
|
|
64
|
+
width?: number | null;
|
|
65
|
+
}
|
|
66
|
+
export interface MediaGetPresignURLResponse {
|
|
67
|
+
/**
|
|
68
|
+
* Seconds until the upload URL expires
|
|
69
|
+
*/
|
|
70
|
+
expires_in: number;
|
|
71
|
+
/**
|
|
72
|
+
* Pre-signed PUT URL for uploading
|
|
73
|
+
*/
|
|
74
|
+
upload_url: string;
|
|
75
|
+
/**
|
|
76
|
+
* Public URL after upload completes
|
|
77
|
+
*/
|
|
78
|
+
url: string;
|
|
79
|
+
}
|
|
80
|
+
export interface MediaUploadResponse {
|
|
81
|
+
/**
|
|
82
|
+
* Original filename
|
|
83
|
+
*/
|
|
84
|
+
filename: string;
|
|
85
|
+
/**
|
|
86
|
+
* File size in bytes
|
|
87
|
+
*/
|
|
88
|
+
size: number;
|
|
89
|
+
/**
|
|
90
|
+
* MIME type of the uploaded file
|
|
91
|
+
*/
|
|
92
|
+
type: string;
|
|
93
|
+
/**
|
|
94
|
+
* Public URL of the uploaded file
|
|
95
|
+
*/
|
|
96
|
+
url: string;
|
|
97
|
+
}
|
|
98
|
+
export interface MediaGetPresignURLParams {
|
|
99
|
+
/**
|
|
100
|
+
* MIME type of the file to upload
|
|
101
|
+
*/
|
|
102
|
+
content_type: string;
|
|
103
|
+
/**
|
|
104
|
+
* Desired filename
|
|
105
|
+
*/
|
|
106
|
+
filename: string;
|
|
107
|
+
}
|
|
108
|
+
export interface MediaUploadParams {
|
|
109
|
+
/**
|
|
110
|
+
* Query param: Original filename
|
|
111
|
+
*/
|
|
112
|
+
filename: string;
|
|
113
|
+
}
|
|
114
|
+
export interface MediaListParams {
|
|
115
|
+
/**
|
|
116
|
+
* Pagination cursor
|
|
117
|
+
*/
|
|
118
|
+
cursor?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Number of items per page
|
|
121
|
+
*/
|
|
122
|
+
limit?: number;
|
|
123
|
+
}
|
|
124
|
+
export interface MediaListResponse {
|
|
125
|
+
data: Array<MediaListResponse.Data>;
|
|
126
|
+
/**
|
|
127
|
+
* Whether more items exist
|
|
128
|
+
*/
|
|
129
|
+
has_more: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Cursor for next page
|
|
132
|
+
*/
|
|
133
|
+
next_cursor: string | null;
|
|
134
|
+
}
|
|
135
|
+
export declare namespace MediaListResponse {
|
|
136
|
+
interface Data {
|
|
137
|
+
/**
|
|
138
|
+
* Media ID
|
|
139
|
+
*/
|
|
140
|
+
id: string;
|
|
141
|
+
/**
|
|
142
|
+
* Upload timestamp
|
|
143
|
+
*/
|
|
144
|
+
created_at: string;
|
|
145
|
+
/**
|
|
146
|
+
* Original filename
|
|
147
|
+
*/
|
|
148
|
+
filename: string;
|
|
149
|
+
/**
|
|
150
|
+
* MIME type
|
|
151
|
+
*/
|
|
152
|
+
mime_type: string;
|
|
153
|
+
/**
|
|
154
|
+
* File size in bytes
|
|
155
|
+
*/
|
|
156
|
+
size: number;
|
|
157
|
+
/**
|
|
158
|
+
* Public URL
|
|
159
|
+
*/
|
|
160
|
+
url: string | null;
|
|
161
|
+
/**
|
|
162
|
+
* Duration in seconds (video/audio)
|
|
163
|
+
*/
|
|
164
|
+
duration?: number | null;
|
|
165
|
+
/**
|
|
166
|
+
* Height in pixels
|
|
167
|
+
*/
|
|
168
|
+
height?: number | null;
|
|
169
|
+
/**
|
|
170
|
+
* Width in pixels
|
|
171
|
+
*/
|
|
172
|
+
width?: number | null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
export declare namespace Media {
|
|
176
|
+
export { type MediaListResponse as MediaListResponse, type MediaRetrieveResponse as MediaRetrieveResponse, type MediaGetPresignURLResponse as MediaGetPresignURLResponse, type MediaUploadResponse as MediaUploadResponse, type MediaListParams as MediaListParams, type MediaGetPresignURLParams as MediaGetPresignURLParams, type MediaUploadParams as MediaUploadParams, };
|
|
177
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.Media = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource");
|
|
6
|
+
const headers_1 = require("../internal/headers");
|
|
7
|
+
const path_1 = require("../internal/utils/path");
|
|
8
|
+
class Media extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* List media files
|
|
11
|
+
*/
|
|
12
|
+
list(query = {}, options) {
|
|
13
|
+
return this._client.get('/v1/media', { query, ...options });
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get media details
|
|
17
|
+
*/
|
|
18
|
+
retrieve(id, options) {
|
|
19
|
+
return this._client.get((0, path_1.path) `/v1/media/${id}`, options);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Delete media
|
|
23
|
+
*/
|
|
24
|
+
delete(id, options) {
|
|
25
|
+
return this._client.delete((0, path_1.path) `/v1/media/${id}`, {
|
|
26
|
+
...options,
|
|
27
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Generate a pre-signed URL for direct upload to R2. The client can PUT the file
|
|
32
|
+
* to the returned URL.
|
|
33
|
+
*/
|
|
34
|
+
getPresignURL(body, options) {
|
|
35
|
+
return this._client.post('/v1/media/presign', { body, ...options });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Upload a raw file body. Pass the filename as a query parameter and set the
|
|
39
|
+
* Content-Type header.
|
|
40
|
+
*/
|
|
41
|
+
upload(body, params, options) {
|
|
42
|
+
const { filename } = params;
|
|
43
|
+
return this._client.post('/v1/media/upload', {
|
|
44
|
+
body: body,
|
|
45
|
+
query: { filename },
|
|
46
|
+
...options,
|
|
47
|
+
headers: (0, headers_1.buildHeaders)([{ 'Content-Type': 'application/octet-stream' }, options?.headers]),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.Media = Media;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Logs, type LogRetrieveResponse, type LogListResponse, type LogListParams } from './logs';
|
|
2
|
+
export { Posts, type PostCreateResponse, type PostRetrieveResponse, type PostUpdateResponse, type PostListResponse, type PostBulkCreateResponse, type PostRetryResponse, type PostUnpublishResponse, type PostCreateParams, type PostUpdateParams, type PostListParams, type PostBulkCreateParams, } from './posts';
|
|
@@ -0,0 +1,8 @@
|
|
|
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 = exports.Logs = void 0;
|
|
5
|
+
var logs_1 = require("./logs");
|
|
6
|
+
Object.defineProperty(exports, "Logs", { enumerable: true, get: function () { return logs_1.Logs; } });
|
|
7
|
+
var posts_1 = require("./posts");
|
|
8
|
+
Object.defineProperty(exports, "Posts", { enumerable: true, get: function () { return posts_1.Posts; } });
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { APIResource } from '../../core/resource';
|
|
2
|
+
import { APIPromise } from '../../core/api-promise';
|
|
3
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
4
|
+
export declare class Logs extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get publishing logs for a post
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const log = await client.posts.logs.retrieve('id');
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<LogRetrieveResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Query publishing logs across all posts with pagination.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const logs = await client.posts.logs.list();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
list(query?: LogListParams | null | undefined, options?: RequestOptions): APIPromise<LogListResponse>;
|
|
23
|
+
}
|
|
24
|
+
export interface LogRetrieveResponse {
|
|
25
|
+
data: Array<LogRetrieveResponse.Data>;
|
|
26
|
+
has_more: boolean;
|
|
27
|
+
next_cursor: string | null;
|
|
28
|
+
}
|
|
29
|
+
export declare namespace LogRetrieveResponse {
|
|
30
|
+
interface Data {
|
|
31
|
+
/**
|
|
32
|
+
* Log entry ID (post target ID)
|
|
33
|
+
*/
|
|
34
|
+
id: string;
|
|
35
|
+
/**
|
|
36
|
+
* Error message if failed
|
|
37
|
+
*/
|
|
38
|
+
error: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Platform name
|
|
41
|
+
*/
|
|
42
|
+
platform: string;
|
|
43
|
+
/**
|
|
44
|
+
* Platform post ID
|
|
45
|
+
*/
|
|
46
|
+
platform_post_id: string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Published URL
|
|
49
|
+
*/
|
|
50
|
+
platform_url: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* Post ID
|
|
53
|
+
*/
|
|
54
|
+
post_id: string;
|
|
55
|
+
/**
|
|
56
|
+
* Published timestamp
|
|
57
|
+
*/
|
|
58
|
+
published_at: string | null;
|
|
59
|
+
/**
|
|
60
|
+
* Social account ID
|
|
61
|
+
*/
|
|
62
|
+
social_account_id: string;
|
|
63
|
+
/**
|
|
64
|
+
* Target status
|
|
65
|
+
*/
|
|
66
|
+
status: string;
|
|
67
|
+
/**
|
|
68
|
+
* Last updated
|
|
69
|
+
*/
|
|
70
|
+
updated_at: string;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export interface LogListResponse {
|
|
74
|
+
data: Array<LogListResponse.Data>;
|
|
75
|
+
has_more: boolean;
|
|
76
|
+
next_cursor: string | null;
|
|
77
|
+
}
|
|
78
|
+
export declare namespace LogListResponse {
|
|
79
|
+
interface Data {
|
|
80
|
+
/**
|
|
81
|
+
* Log entry ID (post target ID)
|
|
82
|
+
*/
|
|
83
|
+
id: string;
|
|
84
|
+
/**
|
|
85
|
+
* Error message if failed
|
|
86
|
+
*/
|
|
87
|
+
error: string | null;
|
|
88
|
+
/**
|
|
89
|
+
* Platform name
|
|
90
|
+
*/
|
|
91
|
+
platform: string;
|
|
92
|
+
/**
|
|
93
|
+
* Platform post ID
|
|
94
|
+
*/
|
|
95
|
+
platform_post_id: string | null;
|
|
96
|
+
/**
|
|
97
|
+
* Published URL
|
|
98
|
+
*/
|
|
99
|
+
platform_url: string | null;
|
|
100
|
+
/**
|
|
101
|
+
* Post ID
|
|
102
|
+
*/
|
|
103
|
+
post_id: string;
|
|
104
|
+
/**
|
|
105
|
+
* Published timestamp
|
|
106
|
+
*/
|
|
107
|
+
published_at: string | null;
|
|
108
|
+
/**
|
|
109
|
+
* Social account ID
|
|
110
|
+
*/
|
|
111
|
+
social_account_id: string;
|
|
112
|
+
/**
|
|
113
|
+
* Target status
|
|
114
|
+
*/
|
|
115
|
+
status: string;
|
|
116
|
+
/**
|
|
117
|
+
* Last updated
|
|
118
|
+
*/
|
|
119
|
+
updated_at: string;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export interface LogListParams {
|
|
123
|
+
/**
|
|
124
|
+
* Pagination cursor
|
|
125
|
+
*/
|
|
126
|
+
cursor?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Number of items per page
|
|
129
|
+
*/
|
|
130
|
+
limit?: number;
|
|
131
|
+
}
|
|
132
|
+
export declare namespace Logs {
|
|
133
|
+
export { type LogRetrieveResponse as LogRetrieveResponse, type LogListResponse as LogListResponse, type LogListParams as LogListParams, };
|
|
134
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.Logs = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource");
|
|
6
|
+
const path_1 = require("../../internal/utils/path");
|
|
7
|
+
class Logs extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get publishing logs for a post
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const log = await client.posts.logs.retrieve('id');
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
retrieve(id, options) {
|
|
17
|
+
return this._client.get((0, path_1.path) `/v1/posts/${id}/logs`, options);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Query publishing logs across all posts with pagination.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const logs = await client.posts.logs.list();
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
list(query = {}, options) {
|
|
28
|
+
return this._client.get('/v1/posts/logs', { query, ...options });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.Logs = Logs;
|