@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,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Posts = void 0;
|
|
38
|
+
const resource_1 = require("../../core/resource");
|
|
39
|
+
const LogsAPI = __importStar(require("./logs"));
|
|
40
|
+
const logs_1 = require("./logs");
|
|
41
|
+
const headers_1 = require("../../internal/headers");
|
|
42
|
+
const path_1 = require("../../internal/utils/path");
|
|
43
|
+
class Posts extends resource_1.APIResource {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
this.logs = new LogsAPI.Logs(this._client);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a post. Use scheduled_at: "now" to publish immediately, "draft" to save
|
|
50
|
+
* as draft, or an ISO timestamp to schedule.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const post = await client.posts.create({
|
|
55
|
+
* scheduled_at: 'now',
|
|
56
|
+
* targets: ['string'],
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
create(body, options) {
|
|
61
|
+
return this._client.post('/v1/posts', { body, ...options });
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get a post
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const post = await client.posts.retrieve('id');
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
retrieve(id, options) {
|
|
72
|
+
return this._client.get((0, path_1.path) `/v1/posts/${id}`, options);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Update a draft or scheduled post.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const post = await client.posts.update('id');
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
update(id, body = {}, options) {
|
|
83
|
+
return this._client.patch((0, path_1.path) `/v1/posts/${id}`, { body, ...options });
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* List posts
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const posts = await client.posts.list();
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
list(query = {}, options) {
|
|
94
|
+
return this._client.get('/v1/posts', { query, ...options });
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Delete a draft or scheduled post.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* await client.posts.delete('id');
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
delete(id, options) {
|
|
105
|
+
return this._client.delete((0, path_1.path) `/v1/posts/${id}`, {
|
|
106
|
+
...options,
|
|
107
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Create multiple posts in a single request. Each item follows the same schema as
|
|
112
|
+
* single post creation.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* const response = await client.posts.bulkCreate({
|
|
117
|
+
* posts: [{ scheduled_at: 'now', targets: ['string'] }],
|
|
118
|
+
* });
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
bulkCreate(body, options) {
|
|
122
|
+
return this._client.post('/v1/posts/bulk', { body, ...options });
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Retry publishing for failed targets on a post.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* const response = await client.posts.retry('id');
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
retry(id, options) {
|
|
133
|
+
return this._client.post((0, path_1.path) `/v1/posts/${id}/retry`, options);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Attempt to delete the post from each platform and set the post status to
|
|
137
|
+
* cancelled.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```ts
|
|
141
|
+
* const response = await client.posts.unpublish('id');
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
unpublish(id, options) {
|
|
145
|
+
return this._client.post((0, path_1.path) `/v1/posts/${id}/unpublish`, options);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.Posts = Posts;
|
|
149
|
+
Posts.Logs = logs_1.Logs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './posts/index';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./posts/index"), exports);
|
|
@@ -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.Slots = exports.Queue = void 0;
|
|
5
|
+
var queue_1 = require("./queue");
|
|
6
|
+
Object.defineProperty(exports, "Queue", { enumerable: true, get: function () { return queue_1.Queue; } });
|
|
7
|
+
var slots_1 = require("./slots");
|
|
8
|
+
Object.defineProperty(exports, "Slots", { enumerable: true, get: function () { return slots_1.Slots; } });
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { APIResource } from '../../core/resource';
|
|
2
|
+
import * as SlotsAPI from './slots';
|
|
3
|
+
import { SlotCreateParams, SlotCreateResponse, SlotListResponse, SlotUpdateParams, SlotUpdateResponse, Slots } from './slots';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
export declare class Queue extends APIResource {
|
|
7
|
+
slots: SlotsAPI.Slots;
|
|
8
|
+
/**
|
|
9
|
+
* Get next available queue slot
|
|
10
|
+
*/
|
|
11
|
+
getNextSlot(options?: RequestOptions): APIPromise<QueueGetNextSlotResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Preview upcoming queue slots
|
|
14
|
+
*/
|
|
15
|
+
preview(query?: QueuePreviewParams | null | undefined, options?: RequestOptions): APIPromise<QueuePreviewResponse>;
|
|
16
|
+
}
|
|
17
|
+
export interface QueueGetNextSlotResponse {
|
|
18
|
+
/**
|
|
19
|
+
* Next available slot (ISO 8601)
|
|
20
|
+
*/
|
|
21
|
+
next_slot_at: string;
|
|
22
|
+
/**
|
|
23
|
+
* Queue schedule ID
|
|
24
|
+
*/
|
|
25
|
+
queue_id: string;
|
|
26
|
+
}
|
|
27
|
+
export interface QueuePreviewResponse {
|
|
28
|
+
/**
|
|
29
|
+
* Upcoming slot timestamps (ISO 8601)
|
|
30
|
+
*/
|
|
31
|
+
slots: Array<string>;
|
|
32
|
+
}
|
|
33
|
+
export interface QueuePreviewParams {
|
|
34
|
+
/**
|
|
35
|
+
* Number of upcoming slots to preview
|
|
36
|
+
*/
|
|
37
|
+
count?: number;
|
|
38
|
+
}
|
|
39
|
+
export declare namespace Queue {
|
|
40
|
+
export { type QueueGetNextSlotResponse as QueueGetNextSlotResponse, type QueuePreviewResponse as QueuePreviewResponse, type QueuePreviewParams as QueuePreviewParams, };
|
|
41
|
+
export { Slots as Slots, type SlotCreateResponse as SlotCreateResponse, type SlotUpdateResponse as SlotUpdateResponse, type SlotListResponse as SlotListResponse, type SlotCreateParams as SlotCreateParams, type SlotUpdateParams as SlotUpdateParams, };
|
|
42
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Queue = void 0;
|
|
38
|
+
const resource_1 = require("../../core/resource");
|
|
39
|
+
const SlotsAPI = __importStar(require("./slots"));
|
|
40
|
+
const slots_1 = require("./slots");
|
|
41
|
+
class Queue extends resource_1.APIResource {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments);
|
|
44
|
+
this.slots = new SlotsAPI.Slots(this._client);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get next available queue slot
|
|
48
|
+
*/
|
|
49
|
+
getNextSlot(options) {
|
|
50
|
+
return this._client.get('/v1/queue/next-slot', options);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Preview upcoming queue slots
|
|
54
|
+
*/
|
|
55
|
+
preview(query = {}, options) {
|
|
56
|
+
return this._client.get('/v1/queue/preview', { query, ...options });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.Queue = Queue;
|
|
60
|
+
Queue.Slots = slots_1.Slots;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { APIResource } from '../../core/resource';
|
|
2
|
+
import { APIPromise } from '../../core/api-promise';
|
|
3
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
4
|
+
export declare class Slots extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create a queue schedule
|
|
7
|
+
*/
|
|
8
|
+
create(body: SlotCreateParams, options?: RequestOptions): APIPromise<SlotCreateResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Update queue schedule
|
|
11
|
+
*/
|
|
12
|
+
update(body?: SlotUpdateParams | null | undefined, options?: RequestOptions): APIPromise<SlotUpdateResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* List queue schedules
|
|
15
|
+
*/
|
|
16
|
+
list(options?: RequestOptions): APIPromise<SlotListResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* Delete queue schedule
|
|
19
|
+
*/
|
|
20
|
+
delete(options?: RequestOptions): APIPromise<void>;
|
|
21
|
+
}
|
|
22
|
+
export interface SlotCreateResponse {
|
|
23
|
+
/**
|
|
24
|
+
* Queue schedule ID
|
|
25
|
+
*/
|
|
26
|
+
id: string;
|
|
27
|
+
/**
|
|
28
|
+
* Created timestamp
|
|
29
|
+
*/
|
|
30
|
+
created_at: string;
|
|
31
|
+
/**
|
|
32
|
+
* Whether this is the default schedule
|
|
33
|
+
*/
|
|
34
|
+
is_default: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Time slots
|
|
37
|
+
*/
|
|
38
|
+
slots: Array<SlotCreateResponse.Slot>;
|
|
39
|
+
/**
|
|
40
|
+
* Updated timestamp
|
|
41
|
+
*/
|
|
42
|
+
updated_at: string;
|
|
43
|
+
/**
|
|
44
|
+
* Schedule name
|
|
45
|
+
*/
|
|
46
|
+
name?: string | null;
|
|
47
|
+
}
|
|
48
|
+
export declare namespace SlotCreateResponse {
|
|
49
|
+
interface Slot {
|
|
50
|
+
/**
|
|
51
|
+
* Day of week (0=Sunday, 6=Saturday)
|
|
52
|
+
*/
|
|
53
|
+
day_of_week: number;
|
|
54
|
+
/**
|
|
55
|
+
* Time in HH:MM format
|
|
56
|
+
*/
|
|
57
|
+
time: string;
|
|
58
|
+
/**
|
|
59
|
+
* IANA timezone (e.g. America/New_York)
|
|
60
|
+
*/
|
|
61
|
+
timezone: string;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export interface SlotUpdateResponse {
|
|
65
|
+
/**
|
|
66
|
+
* Queue schedule ID
|
|
67
|
+
*/
|
|
68
|
+
id: string;
|
|
69
|
+
/**
|
|
70
|
+
* Created timestamp
|
|
71
|
+
*/
|
|
72
|
+
created_at: string;
|
|
73
|
+
/**
|
|
74
|
+
* Whether this is the default schedule
|
|
75
|
+
*/
|
|
76
|
+
is_default: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Time slots
|
|
79
|
+
*/
|
|
80
|
+
slots: Array<SlotUpdateResponse.Slot>;
|
|
81
|
+
/**
|
|
82
|
+
* Updated timestamp
|
|
83
|
+
*/
|
|
84
|
+
updated_at: string;
|
|
85
|
+
/**
|
|
86
|
+
* Schedule name
|
|
87
|
+
*/
|
|
88
|
+
name?: string | null;
|
|
89
|
+
}
|
|
90
|
+
export declare namespace SlotUpdateResponse {
|
|
91
|
+
interface Slot {
|
|
92
|
+
/**
|
|
93
|
+
* Day of week (0=Sunday, 6=Saturday)
|
|
94
|
+
*/
|
|
95
|
+
day_of_week: number;
|
|
96
|
+
/**
|
|
97
|
+
* Time in HH:MM format
|
|
98
|
+
*/
|
|
99
|
+
time: string;
|
|
100
|
+
/**
|
|
101
|
+
* IANA timezone (e.g. America/New_York)
|
|
102
|
+
*/
|
|
103
|
+
timezone: string;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
export interface SlotListResponse {
|
|
107
|
+
data: Array<SlotListResponse.Data>;
|
|
108
|
+
}
|
|
109
|
+
export declare namespace SlotListResponse {
|
|
110
|
+
interface Data {
|
|
111
|
+
/**
|
|
112
|
+
* Queue schedule ID
|
|
113
|
+
*/
|
|
114
|
+
id: string;
|
|
115
|
+
/**
|
|
116
|
+
* Created timestamp
|
|
117
|
+
*/
|
|
118
|
+
created_at: string;
|
|
119
|
+
/**
|
|
120
|
+
* Whether this is the default schedule
|
|
121
|
+
*/
|
|
122
|
+
is_default: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Time slots
|
|
125
|
+
*/
|
|
126
|
+
slots: Array<Data.Slot>;
|
|
127
|
+
/**
|
|
128
|
+
* Updated timestamp
|
|
129
|
+
*/
|
|
130
|
+
updated_at: string;
|
|
131
|
+
/**
|
|
132
|
+
* Schedule name
|
|
133
|
+
*/
|
|
134
|
+
name?: string | null;
|
|
135
|
+
}
|
|
136
|
+
namespace Data {
|
|
137
|
+
interface Slot {
|
|
138
|
+
/**
|
|
139
|
+
* Day of week (0=Sunday, 6=Saturday)
|
|
140
|
+
*/
|
|
141
|
+
day_of_week: number;
|
|
142
|
+
/**
|
|
143
|
+
* Time in HH:MM format
|
|
144
|
+
*/
|
|
145
|
+
time: string;
|
|
146
|
+
/**
|
|
147
|
+
* IANA timezone (e.g. America/New_York)
|
|
148
|
+
*/
|
|
149
|
+
timezone: string;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export interface SlotCreateParams {
|
|
154
|
+
/**
|
|
155
|
+
* Time slots
|
|
156
|
+
*/
|
|
157
|
+
slots: Array<SlotCreateParams.Slot>;
|
|
158
|
+
/**
|
|
159
|
+
* Default timezone for slots
|
|
160
|
+
*/
|
|
161
|
+
timezone: string;
|
|
162
|
+
/**
|
|
163
|
+
* Schedule name
|
|
164
|
+
*/
|
|
165
|
+
name?: string;
|
|
166
|
+
}
|
|
167
|
+
export declare namespace SlotCreateParams {
|
|
168
|
+
interface Slot {
|
|
169
|
+
/**
|
|
170
|
+
* Day of week (0=Sunday, 6=Saturday)
|
|
171
|
+
*/
|
|
172
|
+
day_of_week: number;
|
|
173
|
+
/**
|
|
174
|
+
* Time in HH:MM format
|
|
175
|
+
*/
|
|
176
|
+
time: string;
|
|
177
|
+
/**
|
|
178
|
+
* IANA timezone (e.g. America/New_York)
|
|
179
|
+
*/
|
|
180
|
+
timezone: string;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
export interface SlotUpdateParams {
|
|
184
|
+
/**
|
|
185
|
+
* Schedule name
|
|
186
|
+
*/
|
|
187
|
+
name?: string;
|
|
188
|
+
/**
|
|
189
|
+
* Set this schedule as the default
|
|
190
|
+
*/
|
|
191
|
+
set_as_default?: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Updated time slots
|
|
194
|
+
*/
|
|
195
|
+
slots?: Array<SlotUpdateParams.Slot>;
|
|
196
|
+
}
|
|
197
|
+
export declare namespace SlotUpdateParams {
|
|
198
|
+
interface Slot {
|
|
199
|
+
/**
|
|
200
|
+
* Day of week (0=Sunday, 6=Saturday)
|
|
201
|
+
*/
|
|
202
|
+
day_of_week: number;
|
|
203
|
+
/**
|
|
204
|
+
* Time in HH:MM format
|
|
205
|
+
*/
|
|
206
|
+
time: string;
|
|
207
|
+
/**
|
|
208
|
+
* IANA timezone (e.g. America/New_York)
|
|
209
|
+
*/
|
|
210
|
+
timezone: string;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
export declare namespace Slots {
|
|
214
|
+
export { type SlotCreateResponse as SlotCreateResponse, type SlotUpdateResponse as SlotUpdateResponse, type SlotListResponse as SlotListResponse, type SlotCreateParams as SlotCreateParams, type SlotUpdateParams as SlotUpdateParams, };
|
|
215
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.Slots = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource");
|
|
6
|
+
const headers_1 = require("../../internal/headers");
|
|
7
|
+
class Slots extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create a queue schedule
|
|
10
|
+
*/
|
|
11
|
+
create(body, options) {
|
|
12
|
+
return this._client.post('/v1/queue/slots', { body, ...options });
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Update queue schedule
|
|
16
|
+
*/
|
|
17
|
+
update(body = {}, options) {
|
|
18
|
+
return this._client.put('/v1/queue/slots', { body, ...options });
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* List queue schedules
|
|
22
|
+
*/
|
|
23
|
+
list(options) {
|
|
24
|
+
return this._client.get('/v1/queue/slots', options);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Delete queue schedule
|
|
28
|
+
*/
|
|
29
|
+
delete(options) {
|
|
30
|
+
return this._client.delete('/v1/queue/slots', {
|
|
31
|
+
...options,
|
|
32
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.Slots = Slots;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './queue/index';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
__exportStar(require("./queue/index"), exports);
|