~james/core

core/api/org_tangled/tempserverseedRepo.go -rw-r--r-- 2.7 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 16 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package org_tangled

// schema: org.tangled.temp.server.seedRepo

import (
	"context"

	"github.com/bluesky-social/indigo/lex/util"
)

const (
	TempServerSeedRepoNSID = "org.tangled.temp.server.seedRepo"
)

// TempServerSeedRepo_Input is the input argument to a org.tangled.temp.server.seedRepo call.
type TempServerSeedRepo_Input struct {
	// manifest: Raw `org.tangled.repo.manifest` record body
	Manifest *util.LexiconTypeDecoder `json:"manifest" cborgen:"manifest"`
	// records: Records to write besides the manifest. Max 200 per req.
	Records []*TempServerSeedRepo_SeedRecord `json:"records" cborgen:"records"`
	// repoDid: Existing repo DID which our COB records belong to. The foster knot will serve this DID as a shadow, and will give the record (authority) back to the principal knot once that given knot that *actually* owns the repo DID upgrades!
	RepoDid string `json:"repoDid" cborgen:"repoDid"`
}

// TempServerSeedRepo_Output is the output of a org.tangled.temp.server.seedRepo call.
type TempServerSeedRepo_Output struct {
	Did string `json:"did" cborgen:"did"`
	// key: Multibase-encoded public signing key that the knot has for this repo.
	Key     string                             `json:"key" cborgen:"key"`
	Results []*TempServerSeedRepo_RecordResult `json:"results" cborgen:"results"`
}

// TempServerSeedRepo_RecordResult is a "recordResult" in the org.tangled.temp.server.seedRepo schema.
type TempServerSeedRepo_RecordResult struct {
	Collection string `json:"collection" cborgen:"collection"`
	// error: Reason that a record wasn't written.
	Error *string `json:"error,omitempty" cborgen:"error,omitempty"`
	Rkey  string  `json:"rkey" cborgen:"rkey"`
}

// TempServerSeedRepo_SeedRecord is a "seedRecord" in the org.tangled.temp.server.seedRepo schema.
type TempServerSeedRepo_SeedRecord struct {
	// author: DID which will be attributed to the record as the author.
	Author     string `json:"author" cborgen:"author"`
	Collection string `json:"collection" cborgen:"collection"`
	// createdAt: Creation time in Unix seconds.
	CreatedAt int64 `json:"createdAt" cborgen:"createdAt"`
	// record: Record body, DAG-CBOR w/o lex validation. Max 1,000,000 bytes post-encode.
	Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"`
	Rkey   string                   `json:"rkey" cborgen:"rkey"`
}

// TempServerSeedRepo calls the XRPC method "org.tangled.temp.server.seedRepo".
func TempServerSeedRepo(ctx context.Context, c util.LexClient, input *TempServerSeedRepo_Input) (*TempServerSeedRepo_Output, error) {
	var out TempServerSeedRepo_Output
	if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.server.seedRepo", nil, input, &out); err != nil {
		return nil, err
	}

	return &out, nil
}