@sandvichxyz/pecans 1.1.2 → 1.1.3
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/generated/client.d.ts +38 -0
- package/dist/generated/client.d.ts.map +1 -0
- package/dist/generated/client.js +121 -0
- package/dist/generated/client.js.map +1 -0
- package/dist/generated/decoders.d.ts +14 -0
- package/dist/generated/decoders.d.ts.map +1 -0
- package/dist/generated/decoders.js +120 -0
- package/dist/generated/decoders.js.map +1 -0
- package/dist/generated/encoders.d.ts +4 -0
- package/dist/generated/encoders.d.ts.map +1 -0
- package/dist/generated/encoders.js +25 -0
- package/dist/generated/encoders.js.map +1 -0
- package/dist/generated/enums.d.ts +12 -0
- package/dist/generated/enums.d.ts.map +1 -0
- package/dist/generated/enums.js +18 -0
- package/dist/generated/enums.js.map +1 -0
- package/dist/generated/index.d.ts +22 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +39 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/modules/account.d.ts +7 -0
- package/dist/generated/modules/account.d.ts.map +1 -0
- package/dist/generated/modules/account.js +30 -0
- package/dist/generated/modules/account.js.map +1 -0
- package/dist/generated/modules/answer.d.ts +38 -0
- package/dist/generated/modules/answer.d.ts.map +1 -0
- package/dist/generated/modules/answer.js +89 -0
- package/dist/generated/modules/answer.js.map +1 -0
- package/dist/generated/modules/ask.d.ts +95 -0
- package/dist/generated/modules/ask.d.ts.map +1 -0
- package/dist/generated/modules/ask.js +226 -0
- package/dist/generated/modules/ask.js.map +1 -0
- package/dist/generated/modules/auth.d.ts +28 -0
- package/dist/generated/modules/auth.d.ts.map +1 -0
- package/dist/generated/modules/auth.js +53 -0
- package/dist/generated/modules/auth.js.map +1 -0
- package/dist/generated/modules/dashboard.d.ts +11 -0
- package/dist/generated/modules/dashboard.d.ts.map +1 -0
- package/dist/generated/modules/dashboard.js +20 -0
- package/dist/generated/modules/dashboard.js.map +1 -0
- package/dist/generated/modules/drawing.d.ts +33 -0
- package/dist/generated/modules/drawing.d.ts.map +1 -0
- package/dist/generated/modules/drawing.js +69 -0
- package/dist/generated/modules/drawing.js.map +1 -0
- package/dist/generated/modules/feed.d.ts +22 -0
- package/dist/generated/modules/feed.d.ts.map +1 -0
- package/dist/generated/modules/feed.js +43 -0
- package/dist/generated/modules/feed.js.map +1 -0
- package/dist/generated/modules/forum.d.ts +96 -0
- package/dist/generated/modules/forum.d.ts.map +1 -0
- package/dist/generated/modules/forum.js +193 -0
- package/dist/generated/modules/forum.js.map +1 -0
- package/dist/generated/modules/images.d.ts +27 -0
- package/dist/generated/modules/images.d.ts.map +1 -0
- package/dist/generated/modules/images.js +53 -0
- package/dist/generated/modules/images.js.map +1 -0
- package/dist/generated/modules/messages.d.ts +59 -0
- package/dist/generated/modules/messages.d.ts.map +1 -0
- package/dist/generated/modules/messages.js +119 -0
- package/dist/generated/modules/messages.js.map +1 -0
- package/dist/generated/modules/navbar.d.ts +11 -0
- package/dist/generated/modules/navbar.d.ts.map +1 -0
- package/dist/generated/modules/navbar.js +20 -0
- package/dist/generated/modules/navbar.js.map +1 -0
- package/dist/generated/modules/notify.d.ts +27 -0
- package/dist/generated/modules/notify.d.ts.map +1 -0
- package/dist/generated/modules/notify.js +51 -0
- package/dist/generated/modules/notify.js.map +1 -0
- package/dist/generated/modules/profile.d.ts +42 -0
- package/dist/generated/modules/profile.d.ts.map +1 -0
- package/dist/generated/modules/profile.js +87 -0
- package/dist/generated/modules/profile.js.map +1 -0
- package/dist/generated/modules/qa.d.ts +12 -0
- package/dist/generated/modules/qa.d.ts.map +1 -0
- package/dist/generated/modules/qa.js +23 -0
- package/dist/generated/modules/qa.js.map +1 -0
- package/dist/generated/modules/settings.d.ts +23 -0
- package/dist/generated/modules/settings.d.ts.map +1 -0
- package/dist/generated/modules/settings.js +44 -0
- package/dist/generated/modules/settings.js.map +1 -0
- package/dist/generated/modules/stories.d.ts +16 -0
- package/dist/generated/modules/stories.d.ts.map +1 -0
- package/dist/generated/modules/stories.js +35 -0
- package/dist/generated/modules/stories.js.map +1 -0
- package/dist/generated/types.d.ts +956 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +4 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/call.d.ts +19 -0
- package/dist/runtime/call.d.ts.map +1 -0
- package/dist/runtime/call.js +26 -0
- package/dist/runtime/call.js.map +1 -0
- package/dist/runtime/client.d.ts +27 -0
- package/dist/runtime/client.d.ts.map +1 -0
- package/dist/runtime/client.js +90 -0
- package/dist/runtime/client.js.map +1 -0
- package/dist/runtime/index.d.ts +6 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +22 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/join.d.ts +2 -0
- package/dist/runtime/join.d.ts.map +1 -0
- package/dist/runtime/join.js +14 -0
- package/dist/runtime/join.js.map +1 -0
- package/dist/runtime/module.d.ts +7 -0
- package/dist/runtime/module.d.ts.map +1 -0
- package/dist/runtime/module.js +27 -0
- package/dist/runtime/module.js.map +1 -0
- package/dist/runtime/transform.d.ts +19 -0
- package/dist/runtime/transform.d.ts.map +1 -0
- package/dist/runtime/transform.js +40 -0
- package/dist/runtime/transform.js.map +1 -0
- package/dist/runtime/types.d.ts +19 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +3 -0
- package/dist/runtime/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnswerModule = void 0;
|
|
4
|
+
/* Generated by pecans-spec. Do not edit. */
|
|
5
|
+
const runtime_1 = require("../../runtime");
|
|
6
|
+
class AnswerModule extends runtime_1.Module {
|
|
7
|
+
/**
|
|
8
|
+
* Get the next question to answer. `error` will `"END_REACHED"` if there are
|
|
9
|
+
* no questions to answer.
|
|
10
|
+
*/
|
|
11
|
+
fetchNext() {
|
|
12
|
+
return new runtime_1.Call(this.client, {
|
|
13
|
+
fn: "answer.getnext",
|
|
14
|
+
payload: {},
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get the list of questions the user has saved for later.
|
|
19
|
+
*/
|
|
20
|
+
listSavedQuestions() {
|
|
21
|
+
return new runtime_1.Call(this.client, {
|
|
22
|
+
fn: "answer.listsavedquestions",
|
|
23
|
+
payload: {},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Flag a question for review by the moderators.
|
|
28
|
+
*/
|
|
29
|
+
flagQuestion(questionId) {
|
|
30
|
+
return new runtime_1.Call(this.client, {
|
|
31
|
+
fn: "answer.flagquestion",
|
|
32
|
+
payload: {
|
|
33
|
+
questionId: questionId,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Dismiss a question from the answer queue. The `action` parameter
|
|
39
|
+
* determines whether the question is snoozed, discarded, or unsaved.
|
|
40
|
+
*/
|
|
41
|
+
dismissQuestion(questionId, action) {
|
|
42
|
+
return new runtime_1.Call(this.client, {
|
|
43
|
+
fn: "answer.dismissquestion",
|
|
44
|
+
payload: {
|
|
45
|
+
questionId: questionId,
|
|
46
|
+
action: action,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Vote on a poll question. The `optionNum` parameter is the index of the
|
|
52
|
+
* option to vote for, starting at 0.
|
|
53
|
+
*/
|
|
54
|
+
pollVote(questionId, optionNum) {
|
|
55
|
+
return new runtime_1.Call(this.client, {
|
|
56
|
+
fn: "answer.pollvote",
|
|
57
|
+
payload: {
|
|
58
|
+
questionId: questionId,
|
|
59
|
+
optionNum: optionNum,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Queue a question for answering. The question will queued to be answered by
|
|
65
|
+
* the user, and will be returned by the next call to `fetchNext()`.
|
|
66
|
+
*/
|
|
67
|
+
queueQuestion(questionId) {
|
|
68
|
+
return new runtime_1.Call(this.client, {
|
|
69
|
+
fn: "answer.queuequestion",
|
|
70
|
+
payload: {
|
|
71
|
+
questionId: questionId,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Reply to a question. The `text` parameter is the reply text (UCP markup).
|
|
77
|
+
*/
|
|
78
|
+
reply(questionId, text) {
|
|
79
|
+
return new runtime_1.Call(this.client, {
|
|
80
|
+
fn: "answer.reply",
|
|
81
|
+
payload: {
|
|
82
|
+
questionId: questionId,
|
|
83
|
+
text: text,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.AnswerModule = AnswerModule;
|
|
89
|
+
//# sourceMappingURL=answer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"answer.js","sourceRoot":"","sources":["../../../src/generated/modules/answer.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,2CAA6C;AAI7C,MAAa,YAAa,SAAQ,gBAAM;IACpC;;;OAGG;IACI,SAAS;QACZ,OAAO,IAAI,cAAI,CAAiB,IAAI,CAAC,MAAM,EAAE;YACzC,EAAE,EAAE,gBAAgB;YACpB,OAAO,EAAE,EAAE;SACd,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACI,kBAAkB;QACrB,OAAO,IAAI,cAAI,CAAyB,IAAI,CAAC,MAAM,EAAE;YACjD,EAAE,EAAE,2BAA2B;YAC/B,OAAO,EAAE,EAAE;SACd,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACI,YAAY,CAAC,UAAkB;QAClC,OAAO,IAAI,cAAI,CAAa,IAAI,CAAC,MAAM,EAAE;YACrC,EAAE,EAAE,qBAAqB;YACzB,OAAO,EAAE;gBACL,UAAU,EAAE,UAAU;aACzB;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACI,eAAe,CAAC,UAAkB,EAAE,MAAqB;QAC5D,OAAO,IAAI,cAAI,CAAa,IAAI,CAAC,MAAM,EAAE;YACrC,EAAE,EAAE,wBAAwB;YAC5B,OAAO,EAAE;gBACL,UAAU,EAAE,UAAU;gBACtB,MAAM,EAAE,MAAM;aACjB;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACI,QAAQ,CAAC,UAAkB,EAAE,SAAiB;QACjD,OAAO,IAAI,cAAI,CAAa,IAAI,CAAC,MAAM,EAAE;YACrC,EAAE,EAAE,iBAAiB;YACrB,OAAO,EAAE;gBACL,UAAU,EAAE,UAAU;gBACtB,SAAS,EAAE,SAAS;aACvB;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,UAAkB;QACnC,OAAO,IAAI,cAAI,CAAiB,IAAI,CAAC,MAAM,EAAE;YACzC,EAAE,EAAE,sBAAsB;YAC1B,OAAO,EAAE;gBACL,UAAU,EAAE,UAAU;aACzB;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,UAAkB,EAAE,IAAY;QACzC,OAAO,IAAI,cAAI,CAAsB,IAAI,CAAC,MAAM,EAAE;YAC9C,EAAE,EAAE,cAAc;YAClB,OAAO,EAAE;gBACL,UAAU,EAAE,UAAU;gBACtB,IAAI,EAAE,IAAI;aACb;SACJ,CAAC,CAAC;IACP,CAAC;CACJ;AAvFD,oCAuFC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Call, Module } from "../../runtime";
|
|
2
|
+
import { AnswersResponse, BumpQuestionResponse, GetResponseResponse, ListDataResponse, PinToggleResponse, PostQuestionBody, QuestionData, QuestionMetadata, QuestionTextResponse, TCResponse, ViewQuestionResponse } from "../types";
|
|
3
|
+
export declare class AskModule extends Module {
|
|
4
|
+
/**
|
|
5
|
+
* Ask a new question, optionally with a poll.
|
|
6
|
+
*
|
|
7
|
+
* @param body - The question text, visibility, and optional poll.
|
|
8
|
+
*/
|
|
9
|
+
postQuestion(body: PostQuestionBody): Call<TCResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* View a single question by id (its public view page).
|
|
12
|
+
*
|
|
13
|
+
* @param questionId - Id of the question to view.
|
|
14
|
+
*/
|
|
15
|
+
viewQuestion(questionId: number): Call<ViewQuestionResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* Fetch a single answer/response by its answer id.
|
|
18
|
+
*
|
|
19
|
+
* @param answerId - Id of the answer to fetch.
|
|
20
|
+
*/
|
|
21
|
+
getResponse(answerId: number): Call<GetResponseResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Reply to an answer, creating a new conversation/direct message thread.
|
|
24
|
+
*
|
|
25
|
+
* @param answerId - Id of the answer being replied to.
|
|
26
|
+
* @param content - Body text of the reply.
|
|
27
|
+
* @param unanonymize - Reveal your identity in the conversation.
|
|
28
|
+
*/
|
|
29
|
+
startConversation(answerId: number, content: string, unanonymize?: boolean): Call<TCResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Fetch a page of answers to a question you asked.
|
|
32
|
+
*
|
|
33
|
+
* @param questionId - Id of the question whose answers to fetch.
|
|
34
|
+
* @param mode - Paging mode: "expand" (initial), "expandmore" (older), or "inject" (newer than `refId`).
|
|
35
|
+
* @param refId - Cursor answer id the mode pages relative to (0 for none).
|
|
36
|
+
*/
|
|
37
|
+
getAnswers(questionId: number, mode: string, refId: number): Call<AnswersResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Pin or unpin a publicly-asked question to your profile.
|
|
40
|
+
*
|
|
41
|
+
* @param questionId - Id of the question to pin/unpin.
|
|
42
|
+
* @param pinned - True to pin, false to unpin.
|
|
43
|
+
*/
|
|
44
|
+
pinToggle(questionId: number, pinned: boolean): Call<PinToggleResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Bump a question from inactive to active.
|
|
47
|
+
*
|
|
48
|
+
* @param questionId - Id of the question to bump.
|
|
49
|
+
*/
|
|
50
|
+
bumpQuestion(questionId: number): Call<BumpQuestionResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Delete a question.
|
|
53
|
+
*
|
|
54
|
+
* @param questionId - Id of the question to delete.
|
|
55
|
+
*/
|
|
56
|
+
deleteQuestion(questionId: number): Call<TCResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* Delete an answer to a question.
|
|
59
|
+
*
|
|
60
|
+
* @param answerId - Id of the answer to delete.
|
|
61
|
+
*/
|
|
62
|
+
deleteAnswer(answerId: number): Call<TCResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* Mark an answer as read.
|
|
65
|
+
*
|
|
66
|
+
* @param answerId - Id of the answer to mark read.
|
|
67
|
+
*/
|
|
68
|
+
markAnswerRead(answerId: number): Call<TCResponse>;
|
|
69
|
+
/**
|
|
70
|
+
* List all question headers without body text.
|
|
71
|
+
*
|
|
72
|
+
* Use `fetchQuestions` to also pull the bodies in one step.
|
|
73
|
+
*
|
|
74
|
+
* @returns The question headers.
|
|
75
|
+
*/
|
|
76
|
+
listData(): Call<ListDataResponse>;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch the body text for a batch of questions by id.
|
|
79
|
+
*
|
|
80
|
+
* @param ids - Question ids to fetch bodies for.
|
|
81
|
+
* @returns The requested question bodies.
|
|
82
|
+
*/
|
|
83
|
+
qtext(ids: number[]): Call<QuestionTextResponse>;
|
|
84
|
+
/**
|
|
85
|
+
* Fetch each question's body and zip it onto its header, keyed by id.
|
|
86
|
+
*
|
|
87
|
+
* A convenience method for fetching a batch of questions in one step, rather
|
|
88
|
+
* than calling `listData` and then `qtext` separately.
|
|
89
|
+
*
|
|
90
|
+
* @param metadata - Question headers to hydrate, e.g. from `listData`.
|
|
91
|
+
* @returns Each header paired with its body text.
|
|
92
|
+
*/
|
|
93
|
+
fetchQuestions(metadata: QuestionMetadata[]): Promise<QuestionData[]>;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=ask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../../../src/generated/modules/ask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EACH,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACvB,MAAM,UAAU,CAAC;AASlB,qBAAa,SAAU,SAAQ,MAAM;IACjC;;;;OAIG;IACI,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC;IAa7D;;;;OAIG;IACI,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAanE;;;;OAIG;IACI,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC;IAS/D;;;;;;OAMG;IACI,iBAAiB,CACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,WAAW,GAAE,OAAe,GAC7B,IAAI,CAAC,UAAU,CAAC;IAWnB;;;;;;OAMG;IACI,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAiBzF;;;;;OAKG;IACI,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC;IAa9E;;;;OAIG;IACI,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAiBnE;;;;OAIG;IACI,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;IAa3D;;;;OAIG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;IAavD;;;;OAIG;IACI,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;IAazD;;;;;;OAMG;IACI,QAAQ,IAAI,IAAI,CAAC,gBAAgB,CAAC;IAiBzC;;;;;OAKG;IACI,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,oBAAoB,CAAC;IAiBvD;;;;;;;;OAQG;IACU,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAWrF"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AskModule = void 0;
|
|
4
|
+
/* Generated by pecans-spec. Do not edit. */
|
|
5
|
+
const runtime_1 = require("../../runtime");
|
|
6
|
+
const join_1 = require("../../runtime/join");
|
|
7
|
+
const decoders_1 = require("../decoders");
|
|
8
|
+
class AskModule extends runtime_1.Module {
|
|
9
|
+
/**
|
|
10
|
+
* Ask a new question, optionally with a poll.
|
|
11
|
+
*
|
|
12
|
+
* @param body - The question text, visibility, and optional poll.
|
|
13
|
+
*/
|
|
14
|
+
postQuestion(body) {
|
|
15
|
+
return new runtime_1.Call(this.client, {
|
|
16
|
+
fn: "legacy.askapi",
|
|
17
|
+
payload: {
|
|
18
|
+
rawEmbeddedJsonLolInternalTechDebt: JSON.stringify(body),
|
|
19
|
+
name: "postquestion",
|
|
20
|
+
arg1: "undefined",
|
|
21
|
+
arg2: "undefined",
|
|
22
|
+
arg3: "undefined",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* View a single question by id (its public view page).
|
|
28
|
+
*
|
|
29
|
+
* @param questionId - Id of the question to view.
|
|
30
|
+
*/
|
|
31
|
+
viewQuestion(questionId) {
|
|
32
|
+
return new runtime_1.Call(this.client, {
|
|
33
|
+
fn: "ask.viewquestion",
|
|
34
|
+
payload: {
|
|
35
|
+
questionId: questionId,
|
|
36
|
+
},
|
|
37
|
+
}, decoders_1.decodeViewQuestionResponse);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Fetch a single answer/response by its answer id.
|
|
41
|
+
*
|
|
42
|
+
* @param answerId - Id of the answer to fetch.
|
|
43
|
+
*/
|
|
44
|
+
getResponse(answerId) {
|
|
45
|
+
return new runtime_1.Call(this.client, {
|
|
46
|
+
fn: "ask.getresponse",
|
|
47
|
+
payload: {
|
|
48
|
+
answerId: answerId,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Reply to an answer, creating a new conversation/direct message thread.
|
|
54
|
+
*
|
|
55
|
+
* @param answerId - Id of the answer being replied to.
|
|
56
|
+
* @param content - Body text of the reply.
|
|
57
|
+
* @param unanonymize - Reveal your identity in the conversation.
|
|
58
|
+
*/
|
|
59
|
+
startConversation(answerId, content, unanonymize = false) {
|
|
60
|
+
return new runtime_1.Call(this.client, {
|
|
61
|
+
fn: "ask.startconversation",
|
|
62
|
+
payload: {
|
|
63
|
+
answerId: answerId,
|
|
64
|
+
content: content,
|
|
65
|
+
unanonymize: unanonymize,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Fetch a page of answers to a question you asked.
|
|
71
|
+
*
|
|
72
|
+
* @param questionId - Id of the question whose answers to fetch.
|
|
73
|
+
* @param mode - Paging mode: "expand" (initial), "expandmore" (older), or "inject" (newer than `refId`).
|
|
74
|
+
* @param refId - Cursor answer id the mode pages relative to (0 for none).
|
|
75
|
+
*/
|
|
76
|
+
getAnswers(questionId, mode, refId) {
|
|
77
|
+
return new runtime_1.Call(this.client, {
|
|
78
|
+
fn: "legacy.askapi",
|
|
79
|
+
payload: {
|
|
80
|
+
arg1: String(questionId),
|
|
81
|
+
arg2: mode,
|
|
82
|
+
arg3: String(refId),
|
|
83
|
+
rawEmbeddedJsonLolInternalTechDebt: null,
|
|
84
|
+
name: "getanswers",
|
|
85
|
+
},
|
|
86
|
+
}, decoders_1.decodeAnswersResponse);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Pin or unpin a publicly-asked question to your profile.
|
|
90
|
+
*
|
|
91
|
+
* @param questionId - Id of the question to pin/unpin.
|
|
92
|
+
* @param pinned - True to pin, false to unpin.
|
|
93
|
+
*/
|
|
94
|
+
pinToggle(questionId, pinned) {
|
|
95
|
+
return new runtime_1.Call(this.client, {
|
|
96
|
+
fn: "legacy.askapi",
|
|
97
|
+
payload: {
|
|
98
|
+
arg1: String(questionId),
|
|
99
|
+
arg2: pinned ? "1" : "0",
|
|
100
|
+
rawEmbeddedJsonLolInternalTechDebt: null,
|
|
101
|
+
name: "pintoggle",
|
|
102
|
+
arg3: "0",
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Bump a question from inactive to active.
|
|
108
|
+
*
|
|
109
|
+
* @param questionId - Id of the question to bump.
|
|
110
|
+
*/
|
|
111
|
+
bumpQuestion(questionId) {
|
|
112
|
+
return new runtime_1.Call(this.client, {
|
|
113
|
+
fn: "legacy.askapi",
|
|
114
|
+
payload: {
|
|
115
|
+
arg1: String(questionId),
|
|
116
|
+
arg2: "0",
|
|
117
|
+
arg3: "0",
|
|
118
|
+
rawEmbeddedJsonLolInternalTechDebt: null,
|
|
119
|
+
name: "bumpquestion",
|
|
120
|
+
},
|
|
121
|
+
}, decoders_1.decodeBumpQuestionResponse);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Delete a question.
|
|
125
|
+
*
|
|
126
|
+
* @param questionId - Id of the question to delete.
|
|
127
|
+
*/
|
|
128
|
+
deleteQuestion(questionId) {
|
|
129
|
+
return new runtime_1.Call(this.client, {
|
|
130
|
+
fn: "legacy.askapi",
|
|
131
|
+
payload: {
|
|
132
|
+
arg1: String(questionId),
|
|
133
|
+
arg2: "0",
|
|
134
|
+
arg3: "0",
|
|
135
|
+
rawEmbeddedJsonLolInternalTechDebt: null,
|
|
136
|
+
name: "deleteques",
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Delete an answer to a question.
|
|
142
|
+
*
|
|
143
|
+
* @param answerId - Id of the answer to delete.
|
|
144
|
+
*/
|
|
145
|
+
deleteAnswer(answerId) {
|
|
146
|
+
return new runtime_1.Call(this.client, {
|
|
147
|
+
fn: "legacy.askapi",
|
|
148
|
+
payload: {
|
|
149
|
+
arg1: String(answerId),
|
|
150
|
+
arg2: "0",
|
|
151
|
+
arg3: "0",
|
|
152
|
+
rawEmbeddedJsonLolInternalTechDebt: null,
|
|
153
|
+
name: "deleteanswer",
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Mark an answer as read.
|
|
159
|
+
*
|
|
160
|
+
* @param answerId - Id of the answer to mark read.
|
|
161
|
+
*/
|
|
162
|
+
markAnswerRead(answerId) {
|
|
163
|
+
return new runtime_1.Call(this.client, {
|
|
164
|
+
fn: "legacy.askapi",
|
|
165
|
+
payload: {
|
|
166
|
+
arg1: String(answerId),
|
|
167
|
+
arg2: "0",
|
|
168
|
+
arg3: "0",
|
|
169
|
+
rawEmbeddedJsonLolInternalTechDebt: null,
|
|
170
|
+
name: "markanswerread",
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* List all question headers without body text.
|
|
176
|
+
*
|
|
177
|
+
* Use `fetchQuestions` to also pull the bodies in one step.
|
|
178
|
+
*
|
|
179
|
+
* @returns The question headers.
|
|
180
|
+
*/
|
|
181
|
+
listData() {
|
|
182
|
+
return new runtime_1.Call(this.client, {
|
|
183
|
+
fn: "legacy.askapi",
|
|
184
|
+
payload: {
|
|
185
|
+
name: "listdata",
|
|
186
|
+
arg1: "0",
|
|
187
|
+
arg2: "none",
|
|
188
|
+
arg3: "0",
|
|
189
|
+
rawEmbeddedJsonLolInternalTechDebt: null,
|
|
190
|
+
},
|
|
191
|
+
}, decoders_1.decodeListDataResponse);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Fetch the body text for a batch of questions by id.
|
|
195
|
+
*
|
|
196
|
+
* @param ids - Question ids to fetch bodies for.
|
|
197
|
+
* @returns The requested question bodies.
|
|
198
|
+
*/
|
|
199
|
+
qtext(ids) {
|
|
200
|
+
return new runtime_1.Call(this.client, {
|
|
201
|
+
fn: "legacy.askapi",
|
|
202
|
+
payload: {
|
|
203
|
+
arg1: ids.join("x"),
|
|
204
|
+
name: "qtext",
|
|
205
|
+
arg2: "0",
|
|
206
|
+
arg3: "0",
|
|
207
|
+
rawEmbeddedJsonLolInternalTechDebt: null,
|
|
208
|
+
},
|
|
209
|
+
}, decoders_1.decodeQuestionTextResponse);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Fetch each question's body and zip it onto its header, keyed by id.
|
|
213
|
+
*
|
|
214
|
+
* A convenience method for fetching a batch of questions in one step, rather
|
|
215
|
+
* than calling `listData` and then `qtext` separately.
|
|
216
|
+
*
|
|
217
|
+
* @param metadata - Question headers to hydrate, e.g. from `listData`.
|
|
218
|
+
* @returns Each header paired with its body text.
|
|
219
|
+
*/
|
|
220
|
+
async fetchQuestions(metadata) {
|
|
221
|
+
const res = await this.qtext(metadata.map((x) => x.id));
|
|
222
|
+
return (0, join_1.joinBy)(metadata, res.questions ?? [], (input) => input.id, (r) => r.id, (r, input) => ({ body: r.text, header: input }));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
exports.AskModule = AskModule;
|
|
226
|
+
//# sourceMappingURL=ask.js.map
|
|
@@ -0,0 +1 @@
|
|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gBACnB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,GAAG;gBACT,kCAAkC,EAAE,IAAI;aAC3C;SACJ,EACD,qCAA0B,CAC7B,CAAC;IACN,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,cAAc,CAAC,QAA4B;QACpD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAExD,OAAO,IAAA,aAAM,EACT,QAAQ,EACR,GAAG,CAAC,SAAS,IAAI,EAAE,EACnB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,EACnB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EACX,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAClD,CAAC;IACN,CAAC;CACJ;AAnQD,8BAmQC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Call, Module } from "../../runtime";
|
|
2
|
+
import { ExistingCookieResponse, LoginResponse, LogoutResponse } from "../types";
|
|
3
|
+
export declare class AuthModule extends Module {
|
|
4
|
+
/**
|
|
5
|
+
* Log in to the Two Cans & String service.
|
|
6
|
+
*
|
|
7
|
+
* @param username - The username or email address of the user.
|
|
8
|
+
* @param password - The password of the user.
|
|
9
|
+
* @param client - The client type, defaulting to "web".
|
|
10
|
+
* @returns A LoginResponse object containing the result of the login attempt.
|
|
11
|
+
*/
|
|
12
|
+
login(username: string, password: string, client?: string): Call<LoginResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Check if an existing authentication cookie is valid and refresh it if
|
|
15
|
+
* necessary.
|
|
16
|
+
*
|
|
17
|
+
* @param cookie - The authentication cookie to check.
|
|
18
|
+
* @returns An ExistingCookieResponse object indicating whether the cookie is valid.
|
|
19
|
+
*/
|
|
20
|
+
existingCookie(cookie: string): Call<ExistingCookieResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Log out of the Two Cans & String service.
|
|
23
|
+
*
|
|
24
|
+
* @returns A LogoutResponse object indicating the result of the logout attempt.
|
|
25
|
+
*/
|
|
26
|
+
logout(): Call<LogoutResponse>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/generated/modules/auth.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEjF,qBAAa,UAAW,SAAQ,MAAM;IAClC;;;;;;;OAOG;IACI,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,MAAc,GAAG,IAAI,CAAC,aAAa,CAAC;IAW7F;;;;;;OAMG;IACI,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAC;IASnE;;;;OAIG;IACI,MAAM,IAAI,IAAI,CAAC,cAAc,CAAC;CAMxC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthModule = void 0;
|
|
4
|
+
/* Generated by pecans-spec. Do not edit. */
|
|
5
|
+
const runtime_1 = require("../../runtime");
|
|
6
|
+
class AuthModule extends runtime_1.Module {
|
|
7
|
+
/**
|
|
8
|
+
* Log in to the Two Cans & String service.
|
|
9
|
+
*
|
|
10
|
+
* @param username - The username or email address of the user.
|
|
11
|
+
* @param password - The password of the user.
|
|
12
|
+
* @param client - The client type, defaulting to "web".
|
|
13
|
+
* @returns A LoginResponse object containing the result of the login attempt.
|
|
14
|
+
*/
|
|
15
|
+
login(username, password, client = "web") {
|
|
16
|
+
return new runtime_1.Call(this.client, {
|
|
17
|
+
fn: "auth.login",
|
|
18
|
+
payload: {
|
|
19
|
+
nameOrEmail: username,
|
|
20
|
+
password: password,
|
|
21
|
+
client: client,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if an existing authentication cookie is valid and refresh it if
|
|
27
|
+
* necessary.
|
|
28
|
+
*
|
|
29
|
+
* @param cookie - The authentication cookie to check.
|
|
30
|
+
* @returns An ExistingCookieResponse object indicating whether the cookie is valid.
|
|
31
|
+
*/
|
|
32
|
+
existingCookie(cookie) {
|
|
33
|
+
return new runtime_1.Call(this.client, {
|
|
34
|
+
fn: "auth.existingcookie",
|
|
35
|
+
payload: {
|
|
36
|
+
cookie: cookie,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Log out of the Two Cans & String service.
|
|
42
|
+
*
|
|
43
|
+
* @returns A LogoutResponse object indicating the result of the logout attempt.
|
|
44
|
+
*/
|
|
45
|
+
logout() {
|
|
46
|
+
return new runtime_1.Call(this.client, {
|
|
47
|
+
fn: "auth.logout",
|
|
48
|
+
payload: {},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.AuthModule = AuthModule;
|
|
53
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/generated/modules/auth.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,2CAA6C;AAG7C,MAAa,UAAW,SAAQ,gBAAM;IAClC;;;;;;;OAOG;IACI,KAAK,CAAC,QAAgB,EAAE,QAAgB,EAAE,SAAiB,KAAK;QACnE,OAAO,IAAI,cAAI,CAAgB,IAAI,CAAC,MAAM,EAAE;YACxC,EAAE,EAAE,YAAY;YAChB,OAAO,EAAE;gBACL,WAAW,EAAE,QAAQ;gBACrB,QAAQ,EAAE,QAAQ;gBAClB,MAAM,EAAE,MAAM;aACjB;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;;;;OAMG;IACI,cAAc,CAAC,MAAc;QAChC,OAAO,IAAI,cAAI,CAAyB,IAAI,CAAC,MAAM,EAAE;YACjD,EAAE,EAAE,qBAAqB;YACzB,OAAO,EAAE;gBACL,MAAM,EAAE,MAAM;aACjB;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACI,MAAM;QACT,OAAO,IAAI,cAAI,CAAiB,IAAI,CAAC,MAAM,EAAE;YACzC,EAAE,EAAE,aAAa;YACjB,OAAO,EAAE,EAAE;SACd,CAAC,CAAC;IACP,CAAC;CACJ;AA/CD,gCA+CC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Call, Module } from "../../runtime";
|
|
2
|
+
import { DashboardResponse } from "../types";
|
|
3
|
+
export declare class DashboardModule extends Module {
|
|
4
|
+
/**
|
|
5
|
+
* Fetch the home dashboard summary, currently the most recent questions.
|
|
6
|
+
*
|
|
7
|
+
* @returns The recent-questions summary.
|
|
8
|
+
*/
|
|
9
|
+
get(): Call<DashboardResponse>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=dashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../src/generated/modules/dashboard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,qBAAa,eAAgB,SAAQ,MAAM;IACvC;;;;OAIG;IACI,GAAG,IAAI,IAAI,CAAC,iBAAiB,CAAC;CAMxC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DashboardModule = void 0;
|
|
4
|
+
/* Generated by pecans-spec. Do not edit. */
|
|
5
|
+
const runtime_1 = require("../../runtime");
|
|
6
|
+
class DashboardModule extends runtime_1.Module {
|
|
7
|
+
/**
|
|
8
|
+
* Fetch the home dashboard summary, currently the most recent questions.
|
|
9
|
+
*
|
|
10
|
+
* @returns The recent-questions summary.
|
|
11
|
+
*/
|
|
12
|
+
get() {
|
|
13
|
+
return new runtime_1.Call(this.client, {
|
|
14
|
+
fn: "legacy.dashboard",
|
|
15
|
+
payload: {},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.DashboardModule = DashboardModule;
|
|
20
|
+
//# sourceMappingURL=dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../../src/generated/modules/dashboard.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,2CAA6C;AAG7C,MAAa,eAAgB,SAAQ,gBAAM;IACvC;;;;OAIG;IACI,GAAG;QACN,OAAO,IAAI,cAAI,CAAoB,IAAI,CAAC,MAAM,EAAE;YAC5C,EAAE,EAAE,kBAAkB;YACtB,OAAO,EAAE,EAAE;SACd,CAAC,CAAC;IACP,CAAC;CACJ;AAZD,0CAYC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Call, Module } from "../../runtime";
|
|
2
|
+
import { SaveDrawingResponse, TCResponse, ViewDrawingDataResponse } from "../types";
|
|
3
|
+
export declare class DrawingModule extends Module {
|
|
4
|
+
/**
|
|
5
|
+
* Save a drawing and return its image id.
|
|
6
|
+
*
|
|
7
|
+
* @param data - Flat hex pixel string: 32×32, RGB, 6 hex chars per pixel, row-major (1024 pixels = 6144 chars), left-to-right then top-to-bottom.
|
|
8
|
+
* @param makeActive - Set this drawing as your active image immediately on save.
|
|
9
|
+
* @returns The id of the newly-created image.
|
|
10
|
+
*/
|
|
11
|
+
saveDrawing(data: string, makeActive?: boolean): Call<SaveDrawingResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Fetch the raw pixel data for an existing image, for editing or inspection.
|
|
14
|
+
*
|
|
15
|
+
* @param imageId - The image to load, e.g. `img45790`.
|
|
16
|
+
* @returns The image's flat hex pixel data.
|
|
17
|
+
*/
|
|
18
|
+
viewDrawingData(imageId: string): Call<ViewDrawingDataResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Send one of your drawings to another user.
|
|
21
|
+
*
|
|
22
|
+
* @param imageId - The image to send.
|
|
23
|
+
* @param receiver - Username of the recipient.
|
|
24
|
+
*/
|
|
25
|
+
sendDrawing(imageId: string, receiver: string): Call<TCResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Set which of your saved images is the active one.
|
|
28
|
+
*
|
|
29
|
+
* @param imageId - The image to make active.
|
|
30
|
+
*/
|
|
31
|
+
setActive(imageId: string): Call<TCResponse>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=drawing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawing.d.ts","sourceRoot":"","sources":["../../../src/generated/modules/drawing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAEpF,qBAAa,aAAc,SAAQ,MAAM;IACrC;;;;;;OAMG;IACI,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,IAAI,CAAC,mBAAmB,CAAC;IAWxF;;;;;OAKG;IACI,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC,uBAAuB,CAAC;IAUtE;;;;;OAKG;IACI,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;IAUvE;;;;OAIG;IACI,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC;CAQtD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DrawingModule = void 0;
|
|
4
|
+
/* Generated by pecans-spec. Do not edit. */
|
|
5
|
+
const runtime_1 = require("../../runtime");
|
|
6
|
+
class DrawingModule extends runtime_1.Module {
|
|
7
|
+
/**
|
|
8
|
+
* Save a drawing and return its image id.
|
|
9
|
+
*
|
|
10
|
+
* @param data - Flat hex pixel string: 32×32, RGB, 6 hex chars per pixel, row-major (1024 pixels = 6144 chars), left-to-right then top-to-bottom.
|
|
11
|
+
* @param makeActive - Set this drawing as your active image immediately on save.
|
|
12
|
+
* @returns The id of the newly-created image.
|
|
13
|
+
*/
|
|
14
|
+
saveDrawing(data, makeActive = false) {
|
|
15
|
+
return new runtime_1.Call(this.client, {
|
|
16
|
+
fn: "legacy.drawing",
|
|
17
|
+
payload: {
|
|
18
|
+
data: data,
|
|
19
|
+
makeActive: makeActive,
|
|
20
|
+
action: "save",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Fetch the raw pixel data for an existing image, for editing or inspection.
|
|
26
|
+
*
|
|
27
|
+
* @param imageId - The image to load, e.g. `img45790`.
|
|
28
|
+
* @returns The image's flat hex pixel data.
|
|
29
|
+
*/
|
|
30
|
+
viewDrawingData(imageId) {
|
|
31
|
+
return new runtime_1.Call(this.client, {
|
|
32
|
+
fn: "legacy.drawing",
|
|
33
|
+
payload: {
|
|
34
|
+
imageId: imageId,
|
|
35
|
+
action: "initial-image-data",
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Send one of your drawings to another user.
|
|
41
|
+
*
|
|
42
|
+
* @param imageId - The image to send.
|
|
43
|
+
* @param receiver - Username of the recipient.
|
|
44
|
+
*/
|
|
45
|
+
sendDrawing(imageId, receiver) {
|
|
46
|
+
return new runtime_1.Call(this.client, {
|
|
47
|
+
fn: "drawing.send",
|
|
48
|
+
payload: {
|
|
49
|
+
imageId: imageId,
|
|
50
|
+
receiver: receiver,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Set which of your saved images is the active one.
|
|
56
|
+
*
|
|
57
|
+
* @param imageId - The image to make active.
|
|
58
|
+
*/
|
|
59
|
+
setActive(imageId) {
|
|
60
|
+
return new runtime_1.Call(this.client, {
|
|
61
|
+
fn: "drawing.setactive",
|
|
62
|
+
payload: {
|
|
63
|
+
imageId: imageId,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.DrawingModule = DrawingModule;
|
|
69
|
+
//# sourceMappingURL=drawing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawing.js","sourceRoot":"","sources":["../../../src/generated/modules/drawing.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,2CAA6C;AAG7C,MAAa,aAAc,SAAQ,gBAAM;IACrC;;;;;;OAMG;IACI,WAAW,CAAC,IAAY,EAAE,aAAsB,KAAK;QACxD,OAAO,IAAI,cAAI,CAAsB,IAAI,CAAC,MAAM,EAAE;YAC9C,EAAE,EAAE,gBAAgB;YACpB,OAAO,EAAE;gBACL,IAAI,EAAE,IAAI;gBACV,UAAU,EAAE,UAAU;gBACtB,MAAM,EAAE,MAAM;aACjB;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;;;OAKG;IACI,eAAe,CAAC,OAAe;QAClC,OAAO,IAAI,cAAI,CAA0B,IAAI,CAAC,MAAM,EAAE;YAClD,EAAE,EAAE,gBAAgB;YACpB,OAAO,EAAE;gBACL,OAAO,EAAE,OAAO;gBAChB,MAAM,EAAE,oBAAoB;aAC/B;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;;;OAKG;IACI,WAAW,CAAC,OAAe,EAAE,QAAgB;QAChD,OAAO,IAAI,cAAI,CAAa,IAAI,CAAC,MAAM,EAAE;YACrC,EAAE,EAAE,cAAc;YAClB,OAAO,EAAE;gBACL,OAAO,EAAE,OAAO;gBAChB,QAAQ,EAAE,QAAQ;aACrB;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACI,SAAS,CAAC,OAAe;QAC5B,OAAO,IAAI,cAAI,CAAa,IAAI,CAAC,MAAM,EAAE;YACrC,EAAE,EAAE,mBAAmB;YACvB,OAAO,EAAE;gBACL,OAAO,EAAE,OAAO;aACnB;SACJ,CAAC,CAAC;IACP,CAAC;CACJ;AAhED,sCAgEC"}
|