Skip to content

Productivity

Google Sheets, Notion, Airtable, and Stripe integrations.

10 modules

ModuleDescription
Đọc Google SheetsĐọc dữ liệu từ bảng tính Google Sheets
Ghi Google SheetsGhi dữ liệu vào bảng tính Google Sheets
Tạo trang NotionTạo trang mới trong cơ sở dữ liệu Notion
Truy vấn cơ sở dữ liệu NotionTruy vấn trang từ cơ sở dữ liệu Notion với bộ lọc và sắp xếp
Stripe Tạo thanh toánTạo payment intent với Stripe
Stripe Lấy khách hàngLấy thông tin khách hàng từ Stripe
Stripe Liệt kê giao dịchLiệt kê các giao dịch gần đây từ Stripe
Airtable Tạo bản ghiTạo bản ghi mới trong bảng Airtable
Airtable Đọc bản ghiĐọc bản ghi từ bảng Airtable
Airtable Cập nhật bản ghiCập nhật bản ghi hiện có trong bảng Airtable

Modules

Đọc Google Sheets

api.google_sheets.read

Đọc dữ liệu từ bảng tính Google Sheets

Parameters:

NameTypeRequiredDefaultDescription
credentialsobjectNo-Thông tin xác thực JSON tài khoản dịch vụ Google (mặc định là env.GOOGLE_CREDENTIALS_JSON)
spreadsheet_idstringYes-ID bảng tính Google Sheets (từ URL)
rangestringYes-Phạm vi ký hiệu A1 để đọc
include_headerbooleanNoTruePhân tích hàng đầu tiên làm tiêu đề cột

Output:

FieldTypeDescription
valuesarrayPhân tích hàng đầu tiên làm tiêu đề cột
dataarrayMảng các hàng (mỗi hàng là mảng các giá trị)
row_countnumberMảng các hàng (mỗi hàng là mảng các giá trị)

Example: Read with headers

yaml
spreadsheet_id: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
range: Sheet1!A1:D100
include_header: true

Ghi Google Sheets

api.google_sheets.write

Ghi dữ liệu vào bảng tính Google Sheets

Parameters:

NameTypeRequiredDefaultDescription
credentialsobjectNo-Thông tin xác thực JSON tài khoản dịch vụ Google (mặc định là env.GOOGLE_CREDENTIALS_JSON)
spreadsheet_idstringYes-ID bảng tính Google Sheets (từ URL)
rangestringYes-ID bảng tính Google Sheets (từ URL)
valuesarrayYes-Phạm vi ký hiệu A1 để ghi
value_input_optionstringNoUSER_ENTEREDCách diễn giải giá trị đầu vào

Output:

FieldTypeDescription
updated_rangestringPhạm vi đã cập nhật
updated_rowsnumberPhạm vi đã cập nhật
updated_columnsnumberPhạm vi đã cập nhật
updated_cellsnumberSố hàng đã cập nhật

Example: Write data with headers

yaml
spreadsheet_id: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
range: Sheet1!A1
values: [["Name", "Email", "Status"], ["John Doe", "john@example.com", "Active"], ["Jane Smith", "jane@example.com", "Active"]]

Tạo trang Notion

api.notion.create_page

Tạo trang mới trong cơ sở dữ liệu Notion

Parameters:

NameTypeRequiredDefaultDescription
api_keystringNo-Token tích hợp Notion (mặc định là env.NOTION_API_KEY)
database_idstringYes-ID cơ sở dữ liệu Notion (chuỗi hex 32 ký tự)
propertiesobjectYes-Thuộc tính trang (tiêu đề, văn bản, select, v.v.)
contentarrayNo-Thuộc tính trang (tiêu đề, văn bản, select, v.v.)

Output:

FieldTypeDescription
page_idstringNội dung trang dưới dạng blocks Notion
urlstringNội dung trang dưới dạng blocks Notion
created_timestringID trang đã tạo

Example: Create task page

yaml
database_id: your_database_id
properties: {"Name": {"title": [{"text": {"content": "New Task"}}]}, "Status": {"select": {"name": "In Progress"}}, "Priority": {"select": {"name": "High"}}}

Truy vấn cơ sở dữ liệu Notion

api.notion.query_database

Truy vấn trang từ cơ sở dữ liệu Notion với bộ lọc và sắp xếp

Parameters:

NameTypeRequiredDefaultDescription
api_keystringNo-Token tích hợp Notion (mặc định là env.NOTION_API_KEY)
database_idstringYes-ID cơ sở dữ liệu Notion
filterobjectNo-ID cơ sở dữ liệu Notion
sortsarrayNo-Điều kiện lọc cho truy vấn
page_sizenumberNo100Thứ tự sắp xếp kết quả

Output:

FieldTypeDescription
resultsarraySố kết quả trả về
countnumberMảng các đối tượng trang
has_morebooleanMảng các đối tượng trang

Example: Query all pages

yaml
database_id: your_database_id

Example: Query with filter

yaml
database_id: your_database_id
filter: {"property": "Status", "select": {"equals": "In Progress"}}
sorts: [{"property": "Created", "direction": "descending"}]

Stripe Tạo thanh toán

payment.stripe.create_payment

Tạo payment intent với Stripe

Parameters:

NameTypeRequiredDefaultDescription
api_keystringNo-Khóa bí mật Stripe (hoặc sử dụng biến env STRIPE_API_KEY)
amountnumberYes-Khóa bí mật Stripe (hoặc sử dụng biến env STRIPE_API_KEY)
currencystringNousdSố tiền tính bằng cent (ví dụ: 1000 cho $10.00)
descriptionstringNo-Mã tiền tệ ba chữ cái (ví dụ: usd, eur)
customerstringNo-Mô tả thanh toán

Output:

FieldTypeDescription
idstringID khách hàng Stripe (tùy chọn)
amountnumberID khách hàng Stripe (tùy chọn)
currencystringĐịnh danh duy nhất
statusstringSố tiền thanh toán
client_secretstringMã tiền tệ

Example: Create $50 payment

yaml
amount: 5000
currency: usd
description: Product purchase

Example: Create payment for customer

yaml
amount: 2999
currency: usd
customer: cus_XXXXXXXXXXXXXXX
description: Subscription payment

Stripe Lấy khách hàng

payment.stripe.get_customer

Lấy thông tin khách hàng từ Stripe

Parameters:

NameTypeRequiredDefaultDescription
api_keystringNo-Khóa bí mật Stripe (hoặc sử dụng biến env STRIPE_API_KEY)
customer_idstringYes-Khóa bí mật Stripe (hoặc sử dụng biến env STRIPE_API_KEY)

Output:

FieldTypeDescription
idstringUnique identifier
emailstringEmail address
namestringName of the item
creatednumberCreation timestamp
balancenumberAccount balance

Example: Get customer info

yaml
customer_id: cus_XXXXXXXXXXXXXXX

Stripe Liệt kê giao dịch

payment.stripe.list_charges

Liệt kê các giao dịch gần đây từ Stripe

Parameters:

NameTypeRequiredDefaultDescription
api_keystringNo-Khóa bí mật Stripe (hoặc sử dụng biến env STRIPE_API_KEY)
limitnumberNo10Khóa bí mật Stripe (hoặc sử dụng biến env STRIPE_API_KEY)
customerstringNo-Lọc theo ID khách hàng (tùy chọn)

Output:

FieldTypeDescription
chargesarrayThe charges
countnumberNumber of items
has_morebooleanThe has more

Example: List recent charges

yaml
limit: 20

Example: List customer charges

yaml
customer: cus_XXXXXXXXXXXXXXX
limit: 50

Airtable Tạo bản ghi

productivity.airtable.create

Tạo bản ghi mới trong bảng Airtable

Parameters:

NameTypeRequiredDefaultDescription
api_keystringNo-Khóa API Airtable (hoặc sử dụng biến env AIRTABLE_API_KEY)
base_idstringYes-Khóa API Airtable (hoặc sử dụng biến env AIRTABLE_API_KEY)
table_namestringYes-ID cơ sở Airtable
fieldsjsonYes-Tên bảng

Output:

FieldTypeDescription
idstringUnique identifier
createdTimestringRecord creation timestamp
fieldsjsonThe fields

Example: Create customer record

yaml
base_id: appXXXXXXXXXXXXXX
table_name: Customers
fields: {"Name": "John Doe", "Email": "john@example.com", "Status": "Active"}

Example: Create task

yaml
base_id: appXXXXXXXXXXXXXX
table_name: Tasks
fields: {"Title": "Review PR", "Assignee": "Alice", "Priority": "High"}

Airtable Đọc bản ghi

productivity.airtable.read

Đọc bản ghi từ bảng Airtable

Parameters:

NameTypeRequiredDefaultDescription
api_keystringNo-Khóa API Airtable (hoặc sử dụng biến env AIRTABLE_API_KEY)
base_idstringYes-Khóa API Airtable (hoặc sử dụng biến env AIRTABLE_API_KEY)
table_namestringYes-ID cơ sở Airtable
viewstringNo-Tên bảng
max_recordsnumberNo100Tên view để sử dụng (tùy chọn)

Output:

FieldTypeDescription
recordsarraySố bản ghi tối đa trả về
countnumberCác bản ghi

Example: Read all customers

yaml
base_id: appXXXXXXXXXXXXXX
table_name: Customers
max_records: 100

Example: Read from specific view

yaml
base_id: appXXXXXXXXXXXXXX
table_name: Tasks
view: Active Tasks
max_records: 50

Airtable Cập nhật bản ghi

productivity.airtable.update

Cập nhật bản ghi hiện có trong bảng Airtable

Parameters:

NameTypeRequiredDefaultDescription
api_keystringNo-Khóa API Airtable (hoặc sử dụng biến env AIRTABLE_API_KEY)
base_idstringYes-Khóa API Airtable (hoặc sử dụng biến env AIRTABLE_API_KEY)
table_namestringYes-ID cơ sở Airtable
record_idstringYes-Tên bảng
fieldsjsonYes-ID bản ghi cần cập nhật

Output:

FieldTypeDescription
idstringUnique identifier
fieldsjsonThe fields

Example: Update customer status

yaml
base_id: appXXXXXXXXXXXXXX
table_name: Customers
record_id: recXXXXXXXXXXXXXX
fields: {"Status": "Inactive"}

Example: Update task

yaml
base_id: appXXXXXXXXXXXXXX
table_name: Tasks
record_id: recYYYYYYYYYYYYYY
fields: {"Status": "Completed", "Completed Date": "2024-01-15"}

Released under the Apache 2.0 License.