leash-integration-slite 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/leash/integration/slite.rb +112 -0
- metadata +57 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: e84879b35c183e603b9633cde1d9a9fb1057bf66a1b3e7878bbc5d67a4e34ab6
|
|
4
|
+
data.tar.gz: 4cc401767681ec0d0b365eea042ca533928f32cab4dbaa8d717619dcc1c75a84
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: df68d80192cf0b16b406beb9a329e84d33d8afbc5e56daf225c064eeffab5a8433f76cda99804fe1f188c1f8550c649f241b41345712c22048bda68dd62a1aa0
|
|
7
|
+
data.tar.gz: d8e7a41daa806be677d3767efd1ded6159bee4e2428839d10e9bea7747127bfe4bc700d0b2a9d046256c4a01bd378c9b60df06e65a9d0e14925eaf77cd351562
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Auto-generated by leash-codegen — do not edit manually
|
|
4
|
+
|
|
5
|
+
module Leash
|
|
6
|
+
module Integration
|
|
7
|
+
class SliteClient
|
|
8
|
+
# Create a new Slite integration client.
|
|
9
|
+
#
|
|
10
|
+
# @param leash [Leash::Client] the Leash SDK client
|
|
11
|
+
def initialize(leash)
|
|
12
|
+
@leash = leash
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Searches notes in Slite based on a query and returns the top search results.
|
|
16
|
+
#
|
|
17
|
+
# @param query [String] The search query to perform.
|
|
18
|
+
# @param parentnoteid [String, nil] Optional filter to only return notes under this parent note id.
|
|
19
|
+
# @param reviewstate [String, nil] Optional filter to return notes in a special review state.
|
|
20
|
+
# @param page [Float, nil] Used to perform pagination on search.
|
|
21
|
+
# @param hitsperpage [Float, nil] Specify how many notes to return per page.
|
|
22
|
+
# @param lasteditedafter [String, nil] Optional filter to only return notes edited after a specific date (ISO 8601 format).
|
|
23
|
+
# @param includearchived [Boolean, nil] Optional filter to also include archived notes in the search results (default to false).
|
|
24
|
+
# @return [Object]
|
|
25
|
+
def search_notes(query, parentnoteid: nil, reviewstate: nil, page: nil, hitsperpage: nil, lasteditedafter: nil, includearchived: nil)
|
|
26
|
+
params = {
|
|
27
|
+
'query' => query,
|
|
28
|
+
'parentNoteId' => parentnoteid,
|
|
29
|
+
'reviewState' => reviewstate,
|
|
30
|
+
'page' => page,
|
|
31
|
+
'hitsPerPage' => hitsperpage,
|
|
32
|
+
'lastEditedAfter' => lasteditedafter,
|
|
33
|
+
'includeArchived' => includearchived
|
|
34
|
+
}.compact
|
|
35
|
+
@leash.call('slite', 'search-notes', params)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Asks a question to Slite and returns an answer with sources.
|
|
39
|
+
#
|
|
40
|
+
# @param question [String] The question to ask Slite.
|
|
41
|
+
# @param parentnoteid [String, nil] Optional filter to only search within notes under this parent note id.
|
|
42
|
+
# @return [Object]
|
|
43
|
+
def ask_slite(question, parentnoteid: nil)
|
|
44
|
+
params = {
|
|
45
|
+
'question' => question,
|
|
46
|
+
'parentNoteId' => parentnoteid
|
|
47
|
+
}.compact
|
|
48
|
+
@leash.call('slite', 'ask-slite', params)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Retrieves a specific note from Slite by its ID.
|
|
52
|
+
#
|
|
53
|
+
# @param noteid [String] The ID of the note to retrieve.
|
|
54
|
+
# @param format [String, nil] Format of the content to return (md for Markdown or html for HTML). Defaults to md.
|
|
55
|
+
# @return [Object]
|
|
56
|
+
def get_note(noteid, format: nil)
|
|
57
|
+
params = {
|
|
58
|
+
'noteId' => noteid,
|
|
59
|
+
'format' => format
|
|
60
|
+
}.compact
|
|
61
|
+
@leash.call('slite', 'get-note', params)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Retrieves all child notes of a specific note from Slite.
|
|
65
|
+
#
|
|
66
|
+
# @param noteid [String] The ID of the parent note.
|
|
67
|
+
# @param cursor [String, nil] Cursor to use to continue fetching the note children (for pagination when there are more than 50 children).
|
|
68
|
+
# @return [Object]
|
|
69
|
+
def get_note_children(noteid, cursor: nil)
|
|
70
|
+
params = {
|
|
71
|
+
'noteId' => noteid,
|
|
72
|
+
'cursor' => cursor
|
|
73
|
+
}.compact
|
|
74
|
+
@leash.call('slite', 'get-note-children', params)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Creates a new note in Slite with the specified title and optional content.
|
|
78
|
+
#
|
|
79
|
+
# @param title [String] The title of the note to create.
|
|
80
|
+
# @param parentnoteid [String, nil] Optional ID of the parent note. If not specified, the note will be created in your personal channel.
|
|
81
|
+
# @param markdown [String, nil] Optional markdown content for the note.
|
|
82
|
+
# @param html [String, nil] Optional HTML content for the note.
|
|
83
|
+
# @return [Object]
|
|
84
|
+
def create_note(title, parentnoteid: nil, markdown: nil, html: nil)
|
|
85
|
+
params = {
|
|
86
|
+
'title' => title,
|
|
87
|
+
'parentNoteId' => parentnoteid,
|
|
88
|
+
'markdown' => markdown,
|
|
89
|
+
'html' => html
|
|
90
|
+
}.compact
|
|
91
|
+
@leash.call('slite', 'create-note', params)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Updates an existing note in Slite. Can update the title and/or content.
|
|
95
|
+
#
|
|
96
|
+
# @param noteid [String] The ID of the note to update.
|
|
97
|
+
# @param title [String, nil] New title for the note.
|
|
98
|
+
# @param markdown [String, nil] New markdown content for the note.
|
|
99
|
+
# @param html [String, nil] New HTML content for the note.
|
|
100
|
+
# @return [Object]
|
|
101
|
+
def update_note(noteid, title: nil, markdown: nil, html: nil)
|
|
102
|
+
params = {
|
|
103
|
+
'noteId' => noteid,
|
|
104
|
+
'title' => title,
|
|
105
|
+
'markdown' => markdown,
|
|
106
|
+
'html' => html
|
|
107
|
+
}.compact
|
|
108
|
+
@leash.call('slite', 'update-note', params)
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: leash-integration-slite
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Leash
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-04-14 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: leash-sdk
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 0.2.0
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 0.2.0
|
|
27
|
+
description: Auto-generated typed client for the Slite integration on Leash.
|
|
28
|
+
email:
|
|
29
|
+
executables: []
|
|
30
|
+
extensions: []
|
|
31
|
+
extra_rdoc_files: []
|
|
32
|
+
files:
|
|
33
|
+
- lib/leash/integration/slite.rb
|
|
34
|
+
homepage: https://github.com/leash-build/leash-codegen
|
|
35
|
+
licenses:
|
|
36
|
+
- Apache-2.0
|
|
37
|
+
metadata: {}
|
|
38
|
+
post_install_message:
|
|
39
|
+
rdoc_options: []
|
|
40
|
+
require_paths:
|
|
41
|
+
- lib
|
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: 2.7.0
|
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
|
+
requirements:
|
|
49
|
+
- - ">="
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: '0'
|
|
52
|
+
requirements: []
|
|
53
|
+
rubygems_version: 3.0.3.1
|
|
54
|
+
signing_key:
|
|
55
|
+
specification_version: 4
|
|
56
|
+
summary: Typed Slite integration for Leash
|
|
57
|
+
test_files: []
|