@loams/client 0.0.0-stage → 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.
- package/LICENSE +202 -0
- package/README.md +137 -2
- package/dist/gen/facade.d.ts +446 -0
- package/dist/gen/facade.js +441 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +32 -0
- package/dist/loams.d.ts +110 -0
- package/dist/loams.js +203 -0
- package/dist/node.d.ts +12 -0
- package/dist/node.js +43 -0
- package/dist/runtime/call.d.ts +132 -0
- package/dist/runtime/call.js +273 -0
- package/dist/runtime/consistency.d.ts +22 -0
- package/dist/runtime/consistency.js +68 -0
- package/dist/runtime/errors.d.ts +100 -0
- package/dist/runtime/errors.js +165 -0
- package/dist/runtime/pagination.d.ts +25 -0
- package/dist/runtime/pagination.js +47 -0
- package/dist/runtime/retry.d.ts +30 -0
- package/dist/runtime/retry.js +75 -0
- package/dist/runtime/streams.d.ts +30 -0
- package/dist/runtime/streams.js +61 -0
- package/dist/runtime/token-source.d.ts +57 -0
- package/dist/runtime/token-source.js +117 -0
- package/dist/runtime/transports.d.ts +58 -0
- package/dist/runtime/transports.js +66 -0
- package/dist/runtime/uuidv7.d.ts +10 -0
- package/dist/runtime/uuidv7.js +57 -0
- package/dist/system.d.ts +87 -0
- package/dist/system.js +152 -0
- package/dist/vendor/proto/admin.d.ts +6 -0
- package/dist/vendor/proto/admin.js +12 -0
- package/dist/vendor/proto/gen/loams/admin/v1/agent_pb.d.ts +902 -0
- package/dist/vendor/proto/gen/loams/admin/v1/agent_pb.js +215 -0
- package/dist/vendor/proto/gen/loams/admin/v1/audit_pb.d.ts +289 -0
- package/dist/vendor/proto/gen/loams/admin/v1/audit_pb.js +76 -0
- package/dist/vendor/proto/gen/loams/admin/v1/common_pb.d.ts +203 -0
- package/dist/vendor/proto/gen/loams/admin/v1/common_pb.js +118 -0
- package/dist/vendor/proto/gen/loams/admin/v1/key_pb.d.ts +284 -0
- package/dist/vendor/proto/gen/loams/admin/v1/key_pb.js +62 -0
- package/dist/vendor/proto/gen/loams/admin/v1/org_pb.d.ts +634 -0
- package/dist/vendor/proto/gen/loams/admin/v1/org_pb.js +142 -0
- package/dist/vendor/proto/gen/loams/admin/v1/project_pb.d.ts +662 -0
- package/dist/vendor/proto/gen/loams/admin/v1/project_pb.js +132 -0
- package/dist/vendor/proto/gen/loams/auth/v1/auth_pb.d.ts +435 -0
- package/dist/vendor/proto/gen/loams/auth/v1/auth_pb.js +156 -0
- package/dist/vendor/proto/gen/loams/errors/v1/errors_pb.d.ts +45 -0
- package/dist/vendor/proto/gen/loams/errors/v1/errors_pb.js +17 -0
- package/dist/vendor/proto/gen/loams/instance/v1/instance_pb.d.ts +501 -0
- package/dist/vendor/proto/gen/loams/instance/v1/instance_pb.js +170 -0
- package/dist/vendor/proto/gen/loams/options/v1/options_pb.d.ts +97 -0
- package/dist/vendor/proto/gen/loams/options/v1/options_pb.js +47 -0
- package/package.json +49 -4
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
// @generated by protoc-gen-loams-facade from proto/. Do not edit.
|
|
2
|
+
//
|
|
3
|
+
// The SDK facade of design §44 §7.3: one typed interface per service
|
|
4
|
+
// annotated with `loams.options.v1.module`, one method per
|
|
5
|
+
// `loams.options.v1.facade` call, and the binding table the hand-written
|
|
6
|
+
// runtime dispatches through. Regenerate with `pnpm --filter @loams/client
|
|
7
|
+
// generate`; the drift check in CI fails if this file is stale.
|
|
8
|
+
/* eslint-disable */
|
|
9
|
+
/**
|
|
10
|
+
* The proto revision this SDK was generated from (`LOAMS_PROTO_REV`,
|
|
11
|
+
* design §44 §10.3). `loams.system.version()` checks it against the
|
|
12
|
+
* server's `GetInstance.api_versions`.
|
|
13
|
+
*/
|
|
14
|
+
export const PROTO_REV = 'v1';
|
|
15
|
+
import { AgentService, AuditService, KeyService, OrgService, ProjectService } from '../vendor/proto/admin.js';
|
|
16
|
+
import { AuthService } from '../vendor/proto/gen/loams/auth/v1/auth_pb.js';
|
|
17
|
+
import { InstanceService } from '../vendor/proto/gen/loams/instance/v1/instance_pb.js';
|
|
18
|
+
import { LiveAdminService, LiveService } from '@loams/live/live';
|
|
19
|
+
/** Every annotated service, as the module catalogue. Order is by module name. */
|
|
20
|
+
export const MODULES = [
|
|
21
|
+
{
|
|
22
|
+
name: 'admin.agents',
|
|
23
|
+
summary: 'Agents, their tokens and trust policies, and service accounts.',
|
|
24
|
+
service: 'loams.admin.v1.AgentService',
|
|
25
|
+
package: 'loams.admin.v1',
|
|
26
|
+
unstable: false,
|
|
27
|
+
derived: false,
|
|
28
|
+
calls: [
|
|
29
|
+
{ module: 'admin.agents', name: 'create', protoName: 'create', method: 'CreateAgent', rpc: 'loams.admin.v1.AgentService/CreateAgent', service: 'loams.admin.v1.AgentService', package: 'loams.admin.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
30
|
+
{ module: 'admin.agents', name: 'createServiceAccount', protoName: 'createServiceAccount', method: 'CreateServiceAccount', rpc: 'loams.admin.v1.AgentService/CreateServiceAccount', service: 'loams.admin.v1.AgentService', package: 'loams.admin.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
31
|
+
{ module: 'admin.agents', name: 'createTrustPolicy', protoName: 'createTrustPolicy', method: 'CreateTrustPolicy', rpc: 'loams.admin.v1.AgentService/CreateTrustPolicy', service: 'loams.admin.v1.AgentService', package: 'loams.admin.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
32
|
+
{ module: 'admin.agents', name: 'get', protoName: 'get', method: 'GetAgent', rpc: 'loams.admin.v1.AgentService/GetAgent', service: 'loams.admin.v1.AgentService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: null },
|
|
33
|
+
{ module: 'admin.agents', name: 'list', protoName: 'list', method: 'ListAgents', rpc: 'loams.admin.v1.AgentService/ListAgents', service: 'loams.admin.v1.AgentService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'agents', nextPageToken: 'nextPageToken' } },
|
|
34
|
+
{ module: 'admin.agents', name: 'listServiceAccounts', protoName: 'listServiceAccounts', method: 'ListServiceAccounts', rpc: 'loams.admin.v1.AgentService/ListServiceAccounts', service: 'loams.admin.v1.AgentService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'service_accounts', nextPageToken: 'nextPageToken' } },
|
|
35
|
+
{ module: 'admin.agents', name: 'listTokens', protoName: 'listTokens', method: 'ListAgentTokens', rpc: 'loams.admin.v1.AgentService/ListAgentTokens', service: 'loams.admin.v1.AgentService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'tokens', nextPageToken: 'nextPageToken' } },
|
|
36
|
+
{ module: 'admin.agents', name: 'listTrustPolicies', protoName: 'listTrustPolicies', method: 'ListTrustPolicies', rpc: 'loams.admin.v1.AgentService/ListTrustPolicies', service: 'loams.admin.v1.AgentService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'trust_policies', nextPageToken: 'nextPageToken' } },
|
|
37
|
+
{ module: 'admin.agents', name: 'resume', protoName: 'resume', method: 'ResumeAgent', rpc: 'loams.admin.v1.AgentService/ResumeAgent', service: 'loams.admin.v1.AgentService', package: 'loams.admin.v1', idempotency: 'idempotent', retry: 'safe', streaming: 'unary', pagination: null },
|
|
38
|
+
{ module: 'admin.agents', name: 'suspend', protoName: 'suspend', method: 'SuspendAgent', rpc: 'loams.admin.v1.AgentService/SuspendAgent', service: 'loams.admin.v1.AgentService', package: 'loams.admin.v1', idempotency: 'idempotent', retry: 'safe', streaming: 'unary', pagination: null },
|
|
39
|
+
{ module: 'admin.agents', name: 'update', protoName: 'update', method: 'UpdateAgent', rpc: 'loams.admin.v1.AgentService/UpdateAgent', service: 'loams.admin.v1.AgentService', package: 'loams.admin.v1', idempotency: 'idempotent', retry: 'safe', streaming: 'unary', pagination: null },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'admin.audit',
|
|
44
|
+
summary: 'The audit log: who did what, to what, and whether it was allowed.',
|
|
45
|
+
service: 'loams.admin.v1.AuditService',
|
|
46
|
+
package: 'loams.admin.v1',
|
|
47
|
+
unstable: false,
|
|
48
|
+
derived: false,
|
|
49
|
+
calls: [
|
|
50
|
+
{ module: 'admin.audit', name: 'list', protoName: 'list', method: 'ListAuditEvents', rpc: 'loams.admin.v1.AuditService/ListAuditEvents', service: 'loams.admin.v1.AuditService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'events', nextPageToken: 'nextPageToken' } },
|
|
51
|
+
{ module: 'admin.audit', name: 'watch', protoName: 'watch', method: 'WatchAuditEvents', rpc: 'loams.admin.v1.AuditService/WatchAuditEvents', service: 'loams.admin.v1.AuditService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'server', pagination: null },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'admin.keys',
|
|
56
|
+
summary: 'API keys, and revoking agent tokens.',
|
|
57
|
+
service: 'loams.admin.v1.KeyService',
|
|
58
|
+
package: 'loams.admin.v1',
|
|
59
|
+
unstable: false,
|
|
60
|
+
derived: false,
|
|
61
|
+
calls: [
|
|
62
|
+
{ module: 'admin.keys', name: 'create', protoName: 'create', method: 'CreateKey', rpc: 'loams.admin.v1.KeyService/CreateKey', service: 'loams.admin.v1.KeyService', package: 'loams.admin.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
63
|
+
{ module: 'admin.keys', name: 'list', protoName: 'list', method: 'ListKeys', rpc: 'loams.admin.v1.KeyService/ListKeys', service: 'loams.admin.v1.KeyService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'keys', nextPageToken: 'nextPageToken' } },
|
|
64
|
+
{ module: 'admin.keys', name: 'revoke', protoName: 'revoke', method: 'RevokeKey', rpc: 'loams.admin.v1.KeyService/RevokeKey', service: 'loams.admin.v1.KeyService', package: 'loams.admin.v1', idempotency: 'idempotent', retry: 'safe', streaming: 'unary', pagination: null },
|
|
65
|
+
{ module: 'admin.keys', name: 'revokeToken', protoName: 'revokeToken', method: 'RevokeToken', rpc: 'loams.admin.v1.KeyService/RevokeToken', service: 'loams.admin.v1.KeyService', package: 'loams.admin.v1', idempotency: 'idempotent', retry: 'safe', streaming: 'unary', pagination: null },
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'admin.org',
|
|
70
|
+
summary: 'The org: settings, members, invitations and teams.',
|
|
71
|
+
service: 'loams.admin.v1.OrgService',
|
|
72
|
+
package: 'loams.admin.v1',
|
|
73
|
+
unstable: false,
|
|
74
|
+
derived: false,
|
|
75
|
+
calls: [
|
|
76
|
+
{ module: 'admin.org', name: 'addTeamMember', protoName: 'addTeamMember', method: 'AddTeamMember', rpc: 'loams.admin.v1.OrgService/AddTeamMember', service: 'loams.admin.v1.OrgService', package: 'loams.admin.v1', idempotency: 'idempotent', retry: 'safe', streaming: 'unary', pagination: null },
|
|
77
|
+
{ module: 'admin.org', name: 'createInvitation', protoName: 'createInvitation', method: 'CreateInvitation', rpc: 'loams.admin.v1.OrgService/CreateInvitation', service: 'loams.admin.v1.OrgService', package: 'loams.admin.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
78
|
+
{ module: 'admin.org', name: 'createTeam', protoName: 'createTeam', method: 'CreateTeam', rpc: 'loams.admin.v1.OrgService/CreateTeam', service: 'loams.admin.v1.OrgService', package: 'loams.admin.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
79
|
+
{ module: 'admin.org', name: 'get', protoName: 'get', method: 'GetOrg', rpc: 'loams.admin.v1.OrgService/GetOrg', service: 'loams.admin.v1.OrgService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: null },
|
|
80
|
+
{ module: 'admin.org', name: 'getTeam', protoName: 'getTeam', method: 'GetTeam', rpc: 'loams.admin.v1.OrgService/GetTeam', service: 'loams.admin.v1.OrgService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: null },
|
|
81
|
+
{ module: 'admin.org', name: 'listInvitations', protoName: 'listInvitations', method: 'ListInvitations', rpc: 'loams.admin.v1.OrgService/ListInvitations', service: 'loams.admin.v1.OrgService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'invitations', nextPageToken: 'nextPageToken' } },
|
|
82
|
+
{ module: 'admin.org', name: 'listMembers', protoName: 'listMembers', method: 'ListMembers', rpc: 'loams.admin.v1.OrgService/ListMembers', service: 'loams.admin.v1.OrgService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'members', nextPageToken: 'nextPageToken' } },
|
|
83
|
+
{ module: 'admin.org', name: 'listTeams', protoName: 'listTeams', method: 'ListTeams', rpc: 'loams.admin.v1.OrgService/ListTeams', service: 'loams.admin.v1.OrgService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'teams', nextPageToken: 'nextPageToken' } },
|
|
84
|
+
{ module: 'admin.org', name: 'removeMember', protoName: 'removeMember', method: 'RemoveMember', rpc: 'loams.admin.v1.OrgService/RemoveMember', service: 'loams.admin.v1.OrgService', package: 'loams.admin.v1', idempotency: 'idempotent', retry: 'safe', streaming: 'unary', pagination: null },
|
|
85
|
+
{ module: 'admin.org', name: 'update', protoName: 'update', method: 'UpdateOrg', rpc: 'loams.admin.v1.OrgService/UpdateOrg', service: 'loams.admin.v1.OrgService', package: 'loams.admin.v1', idempotency: 'idempotent', retry: 'safe', streaming: 'unary', pagination: null },
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'admin.projects',
|
|
90
|
+
summary: 'Projects, project access and environments.',
|
|
91
|
+
service: 'loams.admin.v1.ProjectService',
|
|
92
|
+
package: 'loams.admin.v1',
|
|
93
|
+
unstable: false,
|
|
94
|
+
derived: false,
|
|
95
|
+
calls: [
|
|
96
|
+
{ module: 'admin.projects', name: 'create', protoName: 'create', method: 'CreateProject', rpc: 'loams.admin.v1.ProjectService/CreateProject', service: 'loams.admin.v1.ProjectService', package: 'loams.admin.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
97
|
+
{ module: 'admin.projects', name: 'createEnvironment', protoName: 'createEnvironment', method: 'CreateEnvironment', rpc: 'loams.admin.v1.ProjectService/CreateEnvironment', service: 'loams.admin.v1.ProjectService', package: 'loams.admin.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
98
|
+
{ module: 'admin.projects', name: 'get', protoName: 'get', method: 'GetProject', rpc: 'loams.admin.v1.ProjectService/GetProject', service: 'loams.admin.v1.ProjectService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: null },
|
|
99
|
+
{ module: 'admin.projects', name: 'getEnvironment', protoName: 'getEnvironment', method: 'GetEnvironment', rpc: 'loams.admin.v1.ProjectService/GetEnvironment', service: 'loams.admin.v1.ProjectService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: null },
|
|
100
|
+
{ module: 'admin.projects', name: 'getEnvironmentActivity', protoName: 'getEnvironmentActivity', method: 'GetEnvironmentActivity', rpc: 'loams.admin.v1.ProjectService/GetEnvironmentActivity', service: 'loams.admin.v1.ProjectService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: null },
|
|
101
|
+
{ module: 'admin.projects', name: 'grantAccess', protoName: 'grantAccess', method: 'GrantAccess', rpc: 'loams.admin.v1.ProjectService/GrantAccess', service: 'loams.admin.v1.ProjectService', package: 'loams.admin.v1', idempotency: 'idempotent', retry: 'safe', streaming: 'unary', pagination: null },
|
|
102
|
+
{ module: 'admin.projects', name: 'list', protoName: 'list', method: 'ListProjects', rpc: 'loams.admin.v1.ProjectService/ListProjects', service: 'loams.admin.v1.ProjectService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'projects', nextPageToken: 'nextPageToken' } },
|
|
103
|
+
{ module: 'admin.projects', name: 'listAccess', protoName: 'listAccess', method: 'ListAccess', rpc: 'loams.admin.v1.ProjectService/ListAccess', service: 'loams.admin.v1.ProjectService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'grants', nextPageToken: 'nextPageToken' } },
|
|
104
|
+
{ module: 'admin.projects', name: 'listEnvironments', protoName: 'listEnvironments', method: 'ListEnvironments', rpc: 'loams.admin.v1.ProjectService/ListEnvironments', service: 'loams.admin.v1.ProjectService', package: 'loams.admin.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: { items: 'environments', nextPageToken: 'nextPageToken' } },
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'auth',
|
|
109
|
+
summary: 'Sign-in providers, first-run setup, sessions and OAuth consent.',
|
|
110
|
+
service: 'loams.auth.v1.AuthService',
|
|
111
|
+
package: 'loams.auth.v1',
|
|
112
|
+
unstable: false,
|
|
113
|
+
derived: false,
|
|
114
|
+
calls: [
|
|
115
|
+
{ module: 'auth', name: 'completeSetup', protoName: 'completeSetup', method: 'CompleteSetup', rpc: 'loams.auth.v1.AuthService/CompleteSetup', service: 'loams.auth.v1.AuthService', package: 'loams.auth.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
116
|
+
{ module: 'auth', name: 'createSession', protoName: 'createSession', method: 'CreateSession', rpc: 'loams.auth.v1.AuthService/CreateSession', service: 'loams.auth.v1.AuthService', package: 'loams.auth.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
117
|
+
{ module: 'auth', name: 'decideConsent', protoName: 'decideConsent', method: 'DecideConsent', rpc: 'loams.auth.v1.AuthService/DecideConsent', service: 'loams.auth.v1.AuthService', package: 'loams.auth.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
118
|
+
{ module: 'auth', name: 'deleteSession', protoName: 'deleteSession', method: 'DeleteSession', rpc: 'loams.auth.v1.AuthService/DeleteSession', service: 'loams.auth.v1.AuthService', package: 'loams.auth.v1', idempotency: 'idempotent', retry: 'safe', streaming: 'unary', pagination: null },
|
|
119
|
+
{ module: 'auth', name: 'getSession', protoName: 'getSession', method: 'GetSession', rpc: 'loams.auth.v1.AuthService/GetSession', service: 'loams.auth.v1.AuthService', package: 'loams.auth.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: null },
|
|
120
|
+
{ module: 'auth', name: 'listProviders', protoName: 'listProviders', method: 'ListProviders', rpc: 'loams.auth.v1.AuthService/ListProviders', service: 'loams.auth.v1.AuthService', package: 'loams.auth.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: null },
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'instance',
|
|
125
|
+
summary: 'What this instance is, and who the caller is on it.',
|
|
126
|
+
service: 'loams.instance.v1.InstanceService',
|
|
127
|
+
package: 'loams.instance.v1',
|
|
128
|
+
unstable: false,
|
|
129
|
+
derived: false,
|
|
130
|
+
calls: [
|
|
131
|
+
{ module: 'instance', name: 'getInstance', protoName: 'getInstance', method: 'GetInstance', rpc: 'loams.instance.v1.InstanceService/GetInstance', service: 'loams.instance.v1.InstanceService', package: 'loams.instance.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: null },
|
|
132
|
+
{ module: 'instance', name: 'whoAmI', protoName: 'whoAmI', method: 'WhoAmI', rpc: 'loams.instance.v1.InstanceService/WhoAmI', service: 'loams.instance.v1.InstanceService', package: 'loams.instance.v1', idempotency: 'no_side_effects', retry: 'safe', streaming: 'unary', pagination: null },
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'live',
|
|
137
|
+
summary: 'Live sync: watch a query set over a server stream.',
|
|
138
|
+
service: 'loams.live.v1.LiveService',
|
|
139
|
+
package: 'loams.live.v1',
|
|
140
|
+
unstable: true,
|
|
141
|
+
derived: false,
|
|
142
|
+
calls: [
|
|
143
|
+
{ module: 'live', name: 'authenticate', protoName: 'authenticate', method: 'Authenticate', rpc: 'loams.live.v1.LiveService/Authenticate', service: 'loams.live.v1.LiveService', package: 'loams.live.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
144
|
+
{ module: 'live', name: 'modifyQuerySet', protoName: 'modifyQuerySet', method: 'ModifyQuerySet', rpc: 'loams.live.v1.LiveService/ModifyQuerySet', service: 'loams.live.v1.LiveService', package: 'loams.live.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
145
|
+
{ module: 'live', name: 'watch', protoName: 'watch', method: 'Watch', rpc: 'loams.live.v1.LiveService/Watch', service: 'loams.live.v1.LiveService', package: 'loams.live.v1', idempotency: 'none', retry: 'manual', streaming: 'server', pagination: null },
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: 'live.admin',
|
|
150
|
+
summary: 'Live administration: apps, deploy, roll back, index status and function logs.',
|
|
151
|
+
service: 'loams.live.v1.LiveAdminService',
|
|
152
|
+
package: 'loams.live.v1',
|
|
153
|
+
unstable: true,
|
|
154
|
+
derived: false,
|
|
155
|
+
calls: [
|
|
156
|
+
{ module: 'live.admin', name: 'activateDeployment', protoName: 'activateDeployment', method: 'ActivateDeployment', rpc: 'loams.live.v1.LiveAdminService/ActivateDeployment', service: 'loams.live.v1.LiveAdminService', package: 'loams.live.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
157
|
+
{ module: 'live.admin', name: 'createApp', protoName: 'createApp', method: 'CreateApp', rpc: 'loams.live.v1.LiveAdminService/CreateApp', service: 'loams.live.v1.LiveAdminService', package: 'loams.live.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
158
|
+
{ module: 'live.admin', name: 'deleteApp', protoName: 'deleteApp', method: 'DeleteApp', rpc: 'loams.live.v1.LiveAdminService/DeleteApp', service: 'loams.live.v1.LiveAdminService', package: 'loams.live.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
159
|
+
{ module: 'live.admin', name: 'deploy', protoName: 'deploy', method: 'Deploy', rpc: 'loams.live.v1.LiveAdminService/Deploy', service: 'loams.live.v1.LiveAdminService', package: 'loams.live.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
160
|
+
{ module: 'live.admin', name: 'getApp', protoName: 'getApp', method: 'GetApp', rpc: 'loams.live.v1.LiveAdminService/GetApp', service: 'loams.live.v1.LiveAdminService', package: 'loams.live.v1', idempotency: 'none', retry: 'safe', streaming: 'unary', pagination: null },
|
|
161
|
+
{ module: 'live.admin', name: 'getDeployment', protoName: 'getDeployment', method: 'GetDeployment', rpc: 'loams.live.v1.LiveAdminService/GetDeployment', service: 'loams.live.v1.LiveAdminService', package: 'loams.live.v1', idempotency: 'none', retry: 'safe', streaming: 'unary', pagination: null },
|
|
162
|
+
{ module: 'live.admin', name: 'getIndexStatus', protoName: 'getIndexStatus', method: 'GetIndexStatus', rpc: 'loams.live.v1.LiveAdminService/GetIndexStatus', service: 'loams.live.v1.LiveAdminService', package: 'loams.live.v1', idempotency: 'none', retry: 'safe', streaming: 'unary', pagination: null },
|
|
163
|
+
{ module: 'live.admin', name: 'listApps', protoName: 'listApps', method: 'ListApps', rpc: 'loams.live.v1.LiveAdminService/ListApps', service: 'loams.live.v1.LiveAdminService', package: 'loams.live.v1', idempotency: 'none', retry: 'safe', streaming: 'unary', pagination: { items: 'apps', nextPageToken: 'nextPageToken' } },
|
|
164
|
+
{ module: 'live.admin', name: 'listDeployments', protoName: 'listDeployments', method: 'ListDeployments', rpc: 'loams.live.v1.LiveAdminService/ListDeployments', service: 'loams.live.v1.LiveAdminService', package: 'loams.live.v1', idempotency: 'none', retry: 'safe', streaming: 'unary', pagination: { items: 'deployments', nextPageToken: 'nextPageToken' } },
|
|
165
|
+
{ module: 'live.admin', name: 'tailLogs', protoName: 'tailLogs', method: 'TailLogs', rpc: 'loams.live.v1.LiveAdminService/TailLogs', service: 'loams.live.v1.LiveAdminService', package: 'loams.live.v1', idempotency: 'none', retry: 'manual', streaming: 'server', pagination: null },
|
|
166
|
+
{ module: 'live.admin', name: 'updateApp', protoName: 'updateApp', method: 'UpdateApp', rpc: 'loams.live.v1.LiveAdminService/UpdateApp', service: 'loams.live.v1.LiveAdminService', package: 'loams.live.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'tables',
|
|
171
|
+
summary: '',
|
|
172
|
+
service: 'loams.live.v1.LiveService',
|
|
173
|
+
package: 'loams.live.v1',
|
|
174
|
+
unstable: true,
|
|
175
|
+
derived: true,
|
|
176
|
+
calls: [
|
|
177
|
+
{ module: 'tables', name: 'mutate', protoName: 'mutate', method: 'Mutate', rpc: 'loams.live.v1.LiveService/Mutate', service: 'loams.live.v1.LiveService', package: 'loams.live.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
178
|
+
{ module: 'tables', name: 'query', protoName: 'query', method: 'Query', rpc: 'loams.live.v1.LiveService/Query', service: 'loams.live.v1.LiveService', package: 'loams.live.v1', idempotency: 'none', retry: 'manual', streaming: 'unary', pagination: null },
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
];
|
|
182
|
+
/**
|
|
183
|
+
* The generated service descriptors, by fully qualified name. The runtime
|
|
184
|
+
* turns each into a Connect client with `createClient`, so a module is
|
|
185
|
+
* backed by the stubs `protoc-gen-es` wrote from the same protos rather
|
|
186
|
+
* than by a hand-written client.
|
|
187
|
+
*/
|
|
188
|
+
export const SERVICE_DESCRIPTORS = {
|
|
189
|
+
'loams.admin.v1.AgentService': AgentService,
|
|
190
|
+
'loams.admin.v1.AuditService': AuditService,
|
|
191
|
+
'loams.admin.v1.KeyService': KeyService,
|
|
192
|
+
'loams.admin.v1.OrgService': OrgService,
|
|
193
|
+
'loams.admin.v1.ProjectService': ProjectService,
|
|
194
|
+
'loams.auth.v1.AuthService': AuthService,
|
|
195
|
+
'loams.instance.v1.InstanceService': InstanceService,
|
|
196
|
+
'loams.live.v1.LiveAdminService': LiveAdminService,
|
|
197
|
+
'loams.live.v1.LiveService': LiveService,
|
|
198
|
+
};
|
|
199
|
+
/** The proto packages this SDK speaks, as `GetInstance.api_versions` names them. */
|
|
200
|
+
export const PROTO_PACKAGES = [
|
|
201
|
+
'google.protobuf',
|
|
202
|
+
'loams.admin.v1',
|
|
203
|
+
'loams.approvals.v1',
|
|
204
|
+
'loams.auth.v1',
|
|
205
|
+
'loams.collection.v1',
|
|
206
|
+
'loams.devices.v1',
|
|
207
|
+
'loams.errors.v1',
|
|
208
|
+
'loams.graph.v1',
|
|
209
|
+
'loams.house.v1',
|
|
210
|
+
'loams.instance.v1',
|
|
211
|
+
'loams.live.v1',
|
|
212
|
+
'loams.live.worker.v1',
|
|
213
|
+
'loams.notifications.v1',
|
|
214
|
+
'loams.operations.v1',
|
|
215
|
+
'loams.options.v1',
|
|
216
|
+
'loams.postgres.v1',
|
|
217
|
+
'loams.repos.v1',
|
|
218
|
+
];
|
|
219
|
+
/**
|
|
220
|
+
* Every `reason` in `docs/api/reasons.md` (design §44 §7.4, D611). Within
|
|
221
|
+
* an API major version a reason is never renamed and never removed, so
|
|
222
|
+
* this union only grows; a caller switching on it is exhaustive.
|
|
223
|
+
*/
|
|
224
|
+
export const REASONS = [
|
|
225
|
+
'approval_expired',
|
|
226
|
+
'approval_already_decided',
|
|
227
|
+
'approval_stale_revision',
|
|
228
|
+
'requester_cannot_approve',
|
|
229
|
+
'decision_proof_invalid',
|
|
230
|
+
'step_up_required',
|
|
231
|
+
'reason_required',
|
|
232
|
+
'invalid_decision',
|
|
233
|
+
'pairing_expired',
|
|
234
|
+
'pairing_used',
|
|
235
|
+
'device_revoked',
|
|
236
|
+
'push_target_unknown',
|
|
237
|
+
'not_implemented',
|
|
238
|
+
'feature_not_in_variant',
|
|
239
|
+
'house_not_configured',
|
|
240
|
+
'house_syntax_error',
|
|
241
|
+
'house_unknown_table',
|
|
242
|
+
'house_unknown_database',
|
|
243
|
+
'house_access_denied',
|
|
244
|
+
'house_read_only',
|
|
245
|
+
'house_timeout',
|
|
246
|
+
'house_memory_limit',
|
|
247
|
+
'house_too_many_queries',
|
|
248
|
+
'house_quota_exceeded',
|
|
249
|
+
'house_disabled_function',
|
|
250
|
+
'house_cancelled',
|
|
251
|
+
'house_query_not_found',
|
|
252
|
+
'house_query_failed',
|
|
253
|
+
'project_not_found',
|
|
254
|
+
'branch_has_children',
|
|
255
|
+
'branch_protected',
|
|
256
|
+
'lsn_out_of_retention',
|
|
257
|
+
'endpoint_exists_for_branch',
|
|
258
|
+
'compute_start_failed',
|
|
259
|
+
'quota_exceeded',
|
|
260
|
+
'storage_unavailable',
|
|
261
|
+
'secret_already_issued',
|
|
262
|
+
'repo_not_found',
|
|
263
|
+
'repo_already_exists',
|
|
264
|
+
'repo_deleting',
|
|
265
|
+
'ref_stale',
|
|
266
|
+
'ref_protected',
|
|
267
|
+
'out_of_scope',
|
|
268
|
+
'object_format_unsupported',
|
|
269
|
+
'fork_too_deep',
|
|
270
|
+
'sequencer_unavailable',
|
|
271
|
+
'idempotency_key_reused',
|
|
272
|
+
'workspace_not_found',
|
|
273
|
+
'workspace_fenced',
|
|
274
|
+
'workspace_read_only',
|
|
275
|
+
'workspace_name_taken',
|
|
276
|
+
'object_missing',
|
|
277
|
+
'secret_detected',
|
|
278
|
+
'env_unsealed',
|
|
279
|
+
'env_access_denied',
|
|
280
|
+
'env_foreign_reference',
|
|
281
|
+
'live_bad_cursor',
|
|
282
|
+
'live_worker_crashed',
|
|
283
|
+
'live_deploy_conflict',
|
|
284
|
+
'live_schema_violation',
|
|
285
|
+
'live_index_not_ready',
|
|
286
|
+
'live_app_disabled',
|
|
287
|
+
'live_app_exists',
|
|
288
|
+
'live_function_error',
|
|
289
|
+
'live_function_timeout',
|
|
290
|
+
'live_function_out_of_memory',
|
|
291
|
+
'live_limit_exceeded',
|
|
292
|
+
'live_app_mismatch',
|
|
293
|
+
'live_origin_not_allowed',
|
|
294
|
+
'session_rotate',
|
|
295
|
+
'session_gone',
|
|
296
|
+
'node_draining',
|
|
297
|
+
'role_required',
|
|
298
|
+
'setup_required',
|
|
299
|
+
'token_missing',
|
|
300
|
+
'token_malformed',
|
|
301
|
+
'token_revoked',
|
|
302
|
+
'token_not_yet_valid',
|
|
303
|
+
'token_bad_signature',
|
|
304
|
+
'token_wrong_audience',
|
|
305
|
+
'token_wrong_issuer',
|
|
306
|
+
'token_unknown_key',
|
|
307
|
+
'token_algorithm_not_allowed',
|
|
308
|
+
'api_key_invalid',
|
|
309
|
+
'credential_not_accepted',
|
|
310
|
+
'credential_in_query_string',
|
|
311
|
+
'csrf_token_invalid',
|
|
312
|
+
'principal_not_allowed',
|
|
313
|
+
'cors_origin_not_allowed',
|
|
314
|
+
'auth_unavailable',
|
|
315
|
+
'invalid_argument',
|
|
316
|
+
'not_found',
|
|
317
|
+
'already_exists',
|
|
318
|
+
'permission_denied',
|
|
319
|
+
'token_expired',
|
|
320
|
+
'unauthenticated',
|
|
321
|
+
'failed_precondition',
|
|
322
|
+
'resource_exhausted',
|
|
323
|
+
'unavailable',
|
|
324
|
+
'deadline_exceeded',
|
|
325
|
+
'aborted',
|
|
326
|
+
'internal',
|
|
327
|
+
];
|
|
328
|
+
/** The Connect code each reason is raised under, from the same registry. */
|
|
329
|
+
export const REASON_CODES = {
|
|
330
|
+
approval_expired: 'failed_precondition',
|
|
331
|
+
approval_already_decided: 'failed_precondition',
|
|
332
|
+
approval_stale_revision: 'failed_precondition',
|
|
333
|
+
requester_cannot_approve: 'permission_denied',
|
|
334
|
+
decision_proof_invalid: 'permission_denied',
|
|
335
|
+
step_up_required: 'unauthenticated',
|
|
336
|
+
reason_required: 'invalid_argument',
|
|
337
|
+
invalid_decision: 'invalid_argument',
|
|
338
|
+
pairing_expired: 'failed_precondition',
|
|
339
|
+
pairing_used: 'failed_precondition',
|
|
340
|
+
device_revoked: 'unauthenticated',
|
|
341
|
+
push_target_unknown: 'not_found',
|
|
342
|
+
not_implemented: 'unimplemented',
|
|
343
|
+
feature_not_in_variant: 'unimplemented',
|
|
344
|
+
house_not_configured: 'unimplemented',
|
|
345
|
+
house_syntax_error: 'invalid_argument',
|
|
346
|
+
house_unknown_table: 'not_found',
|
|
347
|
+
house_unknown_database: 'not_found',
|
|
348
|
+
house_access_denied: 'permission_denied',
|
|
349
|
+
house_read_only: 'failed_precondition',
|
|
350
|
+
house_timeout: 'deadline_exceeded',
|
|
351
|
+
house_memory_limit: 'resource_exhausted',
|
|
352
|
+
house_too_many_queries: 'resource_exhausted',
|
|
353
|
+
house_quota_exceeded: 'resource_exhausted',
|
|
354
|
+
house_disabled_function: 'permission_denied',
|
|
355
|
+
house_cancelled: 'canceled',
|
|
356
|
+
house_query_not_found: 'not_found',
|
|
357
|
+
house_query_failed: 'unknown',
|
|
358
|
+
project_not_found: 'not_found',
|
|
359
|
+
branch_has_children: 'failed_precondition',
|
|
360
|
+
branch_protected: 'failed_precondition',
|
|
361
|
+
lsn_out_of_retention: 'failed_precondition',
|
|
362
|
+
endpoint_exists_for_branch: 'already_exists',
|
|
363
|
+
compute_start_failed: 'unavailable',
|
|
364
|
+
quota_exceeded: 'resource_exhausted',
|
|
365
|
+
storage_unavailable: 'unavailable',
|
|
366
|
+
secret_already_issued: 'failed_precondition',
|
|
367
|
+
repo_not_found: 'not_found',
|
|
368
|
+
repo_already_exists: 'already_exists',
|
|
369
|
+
repo_deleting: 'failed_precondition',
|
|
370
|
+
ref_stale: 'aborted',
|
|
371
|
+
ref_protected: 'failed_precondition',
|
|
372
|
+
out_of_scope: 'permission_denied',
|
|
373
|
+
object_format_unsupported: 'unimplemented',
|
|
374
|
+
fork_too_deep: 'failed_precondition',
|
|
375
|
+
sequencer_unavailable: 'unavailable',
|
|
376
|
+
idempotency_key_reused: 'failed_precondition',
|
|
377
|
+
workspace_not_found: 'not_found',
|
|
378
|
+
workspace_fenced: 'aborted',
|
|
379
|
+
workspace_read_only: 'failed_precondition',
|
|
380
|
+
workspace_name_taken: 'already_exists',
|
|
381
|
+
object_missing: 'failed_precondition',
|
|
382
|
+
secret_detected: 'failed_precondition',
|
|
383
|
+
env_unsealed: 'invalid_argument',
|
|
384
|
+
env_access_denied: 'permission_denied',
|
|
385
|
+
env_foreign_reference: 'permission_denied',
|
|
386
|
+
live_bad_cursor: 'invalid_argument',
|
|
387
|
+
live_worker_crashed: 'internal',
|
|
388
|
+
live_deploy_conflict: 'failed_precondition',
|
|
389
|
+
live_schema_violation: 'invalid_argument',
|
|
390
|
+
live_index_not_ready: 'failed_precondition',
|
|
391
|
+
live_app_disabled: 'failed_precondition',
|
|
392
|
+
live_app_exists: 'failed_precondition',
|
|
393
|
+
live_function_error: 'unknown',
|
|
394
|
+
live_function_timeout: 'deadline_exceeded',
|
|
395
|
+
live_function_out_of_memory: 'resource_exhausted',
|
|
396
|
+
live_limit_exceeded: 'resource_exhausted',
|
|
397
|
+
live_app_mismatch: 'permission_denied',
|
|
398
|
+
live_origin_not_allowed: 'permission_denied',
|
|
399
|
+
session_rotate: 'unavailable',
|
|
400
|
+
session_gone: 'not_found',
|
|
401
|
+
node_draining: 'unavailable',
|
|
402
|
+
role_required: 'permission_denied',
|
|
403
|
+
setup_required: 'failed_precondition',
|
|
404
|
+
token_missing: 'unauthenticated',
|
|
405
|
+
token_malformed: 'unauthenticated',
|
|
406
|
+
token_revoked: 'unauthenticated',
|
|
407
|
+
token_not_yet_valid: 'unauthenticated',
|
|
408
|
+
token_bad_signature: 'unauthenticated',
|
|
409
|
+
token_wrong_audience: 'unauthenticated',
|
|
410
|
+
token_wrong_issuer: 'unauthenticated',
|
|
411
|
+
token_unknown_key: 'unauthenticated',
|
|
412
|
+
token_algorithm_not_allowed: 'unauthenticated',
|
|
413
|
+
api_key_invalid: 'unauthenticated',
|
|
414
|
+
credential_not_accepted: 'unauthenticated',
|
|
415
|
+
credential_in_query_string: 'unauthenticated',
|
|
416
|
+
csrf_token_invalid: 'permission_denied',
|
|
417
|
+
principal_not_allowed: 'permission_denied',
|
|
418
|
+
cors_origin_not_allowed: 'permission_denied',
|
|
419
|
+
auth_unavailable: 'unavailable',
|
|
420
|
+
invalid_argument: 'invalid_argument',
|
|
421
|
+
not_found: 'not_found',
|
|
422
|
+
already_exists: 'already_exists',
|
|
423
|
+
permission_denied: 'permission_denied',
|
|
424
|
+
token_expired: 'unauthenticated',
|
|
425
|
+
unauthenticated: 'unauthenticated',
|
|
426
|
+
failed_precondition: 'failed_precondition',
|
|
427
|
+
resource_exhausted: 'resource_exhausted',
|
|
428
|
+
unavailable: 'unavailable',
|
|
429
|
+
deadline_exceeded: 'deadline_exceeded',
|
|
430
|
+
aborted: 'aborted',
|
|
431
|
+
internal: 'internal',
|
|
432
|
+
};
|
|
433
|
+
/**
|
|
434
|
+
* The reason a package the build variant does not carry answers with
|
|
435
|
+
* (design §44 §4, D600). Every RPC of such a package refuses with it and
|
|
436
|
+
* names the variant in `metadata.variant`; the runtime turns that refusal
|
|
437
|
+
* into `FeatureNotInVariantError` so a caller can branch on it without
|
|
438
|
+
* calling first — `loams.system.available()` answers the same question from
|
|
439
|
+
* `GetInstance.services[]` without a failing call at all.
|
|
440
|
+
*/
|
|
441
|
+
export const FEATURE_NOT_IN_VARIANT = 'feature_not_in_variant';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { Loams, type AdminNamespace, type LiveNamespace, type LoamsModules, type LoamsOptions, } from './loams.js';
|
|
2
|
+
export { SystemApi, type Catalogue, type SystemConfig, type VersionReport, } from './system.js';
|
|
3
|
+
export { FEATURE_NOT_IN_VARIANT, MODULES, PROTO_PACKAGES, PROTO_REV, REASON_CODES, REASONS, SERVICE_DESCRIPTORS, type CallBinding, type InstanceModule, type LiveModule, type ModuleBinding, type Reason, type TablesModule, } from './gen/facade.js';
|
|
4
|
+
export { CallInvoker, callWithRetry, withIdempotencyKey, type Attempt, type CallOptions, type ConsistencyOptions, type ConsistencyTokenStore, type RetryPlan, type Send, } from './runtime/call.js';
|
|
5
|
+
export { ConsistencySession, TOKEN_PREFIX, isConsistencyToken } from './runtime/consistency.js';
|
|
6
|
+
export { AlreadyExistsError, AbortedError, DeadlineExceededError, FailedPreconditionError, FeatureNotInVariantError, InternalError, InvalidArgumentError, LoamsError, NotFoundError, PermissionDeniedError, ResourceExhaustedError, TokenExpiredError, UnauthenticatedError, UnavailableError, UnimplementedError, errorInfo, isLoamsError, toLoamsError, type ErrorInfoShape, } from './runtime/errors.js';
|
|
7
|
+
export { paginate, pageFields, type PageFetcher, type PageRequestOptions } from './runtime/pagination.js';
|
|
8
|
+
export { BASE_DELAY_MS, DEFAULT_MAX_RETRIES, MAX_DELAY_MS, MAX_SERVER_DELAY_MS, backoffMs, isRetryableCode, shouldRetry, sleep, } from './runtime/retry.js';
|
|
9
|
+
export { watch, type CursorOf, type ResumeOptions, type StreamOpener } from './runtime/streams.js';
|
|
10
|
+
export { apiKey, envToken, oidcExchange, refreshing, staticToken, type TokenSource, } from './runtime/token-source.js';
|
|
11
|
+
export { createLoamsTransport, headersInterceptor, type TransportOptions, } from './runtime/transports.js';
|
|
12
|
+
export { uuidv7, uuidv7Time } from './runtime/uuidv7.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// @loams/client: the Loams SDK for TypeScript and JavaScript.
|
|
2
|
+
//
|
|
3
|
+
// import { Loams, apiKey } from '@loams/client';
|
|
4
|
+
//
|
|
5
|
+
// const loams = new Loams({ endpoint: 'https://acme.loams.dev', auth: apiKey(key) });
|
|
6
|
+
// const info = await loams.instance.getInstance({});
|
|
7
|
+
// await loams.system.guard('live'); // no RPC once cached
|
|
8
|
+
// for await (const t of loams.live.watch(request, { resume })) {}
|
|
9
|
+
//
|
|
10
|
+
// Design §44 §7: one client object with namespaced modules, generated from the
|
|
11
|
+
// `loams.options.v1` annotations on the protos, over the unified Connect API
|
|
12
|
+
// on one port. `@loams/client/node` adds the HTTP/2 gRPC transport.
|
|
13
|
+
//
|
|
14
|
+
// What a caller imports from here: the `Loams` client, the module types the
|
|
15
|
+
// generator produced, the typed error hierarchy, the token sources, and the
|
|
16
|
+
// reason registry as a type.
|
|
17
|
+
export { Loams, } from './loams.js';
|
|
18
|
+
export { SystemApi, } from './system.js';
|
|
19
|
+
// The generated facade: the module interfaces, the binding table, the proto
|
|
20
|
+
// revision, and the reason registry as a type. Everything here is written by
|
|
21
|
+
// `buf generate`; do not hand-edit it.
|
|
22
|
+
export { FEATURE_NOT_IN_VARIANT, MODULES, PROTO_PACKAGES, PROTO_REV, REASON_CODES, REASONS, SERVICE_DESCRIPTORS, } from './gen/facade.js';
|
|
23
|
+
// The runtime, for a caller who composes rather than uses.
|
|
24
|
+
export { CallInvoker, callWithRetry, withIdempotencyKey, } from './runtime/call.js';
|
|
25
|
+
export { ConsistencySession, TOKEN_PREFIX, isConsistencyToken } from './runtime/consistency.js';
|
|
26
|
+
export { AlreadyExistsError, AbortedError, DeadlineExceededError, FailedPreconditionError, FeatureNotInVariantError, InternalError, InvalidArgumentError, LoamsError, NotFoundError, PermissionDeniedError, ResourceExhaustedError, TokenExpiredError, UnauthenticatedError, UnavailableError, UnimplementedError, errorInfo, isLoamsError, toLoamsError, } from './runtime/errors.js';
|
|
27
|
+
export { paginate, pageFields } from './runtime/pagination.js';
|
|
28
|
+
export { BASE_DELAY_MS, DEFAULT_MAX_RETRIES, MAX_DELAY_MS, MAX_SERVER_DELAY_MS, backoffMs, isRetryableCode, shouldRetry, sleep, } from './runtime/retry.js';
|
|
29
|
+
export { watch } from './runtime/streams.js';
|
|
30
|
+
export { apiKey, envToken, oidcExchange, refreshing, staticToken, } from './runtime/token-source.js';
|
|
31
|
+
export { createLoamsTransport, headersInterceptor, } from './runtime/transports.js';
|
|
32
|
+
export { uuidv7, uuidv7Time } from './runtime/uuidv7.js';
|
package/dist/loams.d.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { Transport } from '@connectrpc/connect';
|
|
2
|
+
import { type AdminAgentsModule, type AdminAuditModule, type AdminKeysModule, type AdminOrgModule, type AdminProjectsModule, type AuthModule, type CallBinding, type InstanceModule, type LiveAdminModule, type LiveModule, type ModuleBinding, type TablesModule } from './gen/facade.js';
|
|
3
|
+
import { type CallOptions, type ConsistencyTokenStore } from './runtime/call.js';
|
|
4
|
+
import { type PageRequestOptions } from './runtime/pagination.js';
|
|
5
|
+
import { SystemApi } from './system.js';
|
|
6
|
+
import { type TokenSource } from './runtime/token-source.js';
|
|
7
|
+
import { type TransportOptions } from './runtime/transports.js';
|
|
8
|
+
import { type ResumeOptions } from './runtime/streams.js';
|
|
9
|
+
/** How to build a `Loams`. */
|
|
10
|
+
export interface LoamsOptions {
|
|
11
|
+
/** The instance's base URL, for example `https://acme.loams.dev`. A
|
|
12
|
+
* loopback stack is `http://127.0.0.1:8080`. */
|
|
13
|
+
endpoint: string;
|
|
14
|
+
/**
|
|
15
|
+
* The bearer source. A string is taken as an API key, which is what a
|
|
16
|
+
* script or a CI job has; pass `envToken()` or `oidcExchange()` for the
|
|
17
|
+
* rest. Omitted means an unauthenticated client, which is what
|
|
18
|
+
* `loams.instance.getInstance` needs anyway.
|
|
19
|
+
*/
|
|
20
|
+
auth?: TokenSource | string;
|
|
21
|
+
/**
|
|
22
|
+
* The transport. Defaults to Connect over `fetch` pointed at `endpoint`,
|
|
23
|
+
* which is the browser, Node, Deno and Bun path (see `runtime/transports.ts`).
|
|
24
|
+
* `@loams/client/node` exports `createNodeTransport` for HTTP/2 gRPC.
|
|
25
|
+
*
|
|
26
|
+
* A transport carries its own base URL, so a transport passed here must be
|
|
27
|
+
* built for the same instance as `endpoint`.
|
|
28
|
+
*/
|
|
29
|
+
transport?: Transport;
|
|
30
|
+
/** Transport-level options, used when `transport` is not given. They win
|
|
31
|
+
* over `endpoint` where they overlap, so `baseUrl` here replaces it. */
|
|
32
|
+
transportOptions?: TransportOptions;
|
|
33
|
+
/** Retries after the first attempt, for every call. `0` disables them. */
|
|
34
|
+
maxRetries?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Hold a session consistency token across calls (D609). Off by default:
|
|
37
|
+
* every read is then `STRONG` on its own, which is correct but does not give
|
|
38
|
+
* read-your-writes across processes.
|
|
39
|
+
*/
|
|
40
|
+
sessionConsistency?: boolean;
|
|
41
|
+
/** The client's deadline, when the transport does not set one. */
|
|
42
|
+
timeoutMs?: number;
|
|
43
|
+
}
|
|
44
|
+
export type { Catalogue, VersionReport } from './system.js';
|
|
45
|
+
/** The generated modules, keyed by name. A module the generator has not seen
|
|
46
|
+
* does not appear, so `loams.vector` is absent until `QueryService/Search`
|
|
47
|
+
* carries its facade options (API1 Task 2). */
|
|
48
|
+
export interface LoamsModules {
|
|
49
|
+
readonly instance: InstanceModule;
|
|
50
|
+
readonly live: LiveModule;
|
|
51
|
+
readonly tables: TablesModule;
|
|
52
|
+
readonly [module: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
/** `loams.live`: the session calls, with `loams.live.admin` under it. */
|
|
55
|
+
export type LiveNamespace = LiveModule & {
|
|
56
|
+
/** `loams.live.admin` — apps, deploy, roll back, index status and logs. */
|
|
57
|
+
readonly admin: LiveAdminModule;
|
|
58
|
+
};
|
|
59
|
+
/** `loams.admin`: the console's administration modules (design §44 §7.2). */
|
|
60
|
+
export interface AdminNamespace {
|
|
61
|
+
readonly agents: AdminAgentsModule;
|
|
62
|
+
readonly audit: AdminAuditModule;
|
|
63
|
+
readonly keys: AdminKeysModule;
|
|
64
|
+
readonly org: AdminOrgModule;
|
|
65
|
+
readonly projects: AdminProjectsModule;
|
|
66
|
+
}
|
|
67
|
+
/** One SDK, over one instance. */
|
|
68
|
+
export declare class Loams {
|
|
69
|
+
#private;
|
|
70
|
+
/** `loams.instance` — what this instance is, and who the caller is. */
|
|
71
|
+
readonly instance: InstanceModule;
|
|
72
|
+
/** `loams.live` — the live sync session half, and `loams.live.admin`.
|
|
73
|
+
* Its package is `unstable`. */
|
|
74
|
+
readonly live: LiveNamespace;
|
|
75
|
+
/** `loams.tables` — the table half of the same service (design §44 §7.2). */
|
|
76
|
+
readonly tables: TablesModule;
|
|
77
|
+
/** `loams.admin` — org, projects, agents, keys and audit. */
|
|
78
|
+
readonly admin: AdminNamespace;
|
|
79
|
+
/** `loams.auth` — sessions and sign-in. */
|
|
80
|
+
readonly auth: AuthModule;
|
|
81
|
+
/** The module catalogue, feature detection and the version check. */
|
|
82
|
+
readonly system: SystemApi;
|
|
83
|
+
/** Every generated module, by its dotted name (`'live.admin'`): the
|
|
84
|
+
* catalogue a caller iterates. The same objects are reachable as
|
|
85
|
+
* properties, `loams.live.admin` for `'live.admin'`. */
|
|
86
|
+
readonly modules: Readonly<Record<string, unknown>>;
|
|
87
|
+
constructor(options: LoamsOptions);
|
|
88
|
+
/** The session consistency token store, when `sessionConsistency` is on. */
|
|
89
|
+
get consistency(): ConsistencyTokenStore | undefined;
|
|
90
|
+
/** The generated module bindings, as the SDK sees them. */
|
|
91
|
+
get bindings(): readonly ModuleBinding[];
|
|
92
|
+
/** Every item of a paged call (D617's iterator).
|
|
93
|
+
*
|
|
94
|
+
* `loams.paginate('collections', 'listCollections', { namespace })`. The
|
|
95
|
+
* per-call alias §44 §7.4 sketches (`loams.collections.listAll`) arrives with
|
|
96
|
+
* the first paged RPC, when there is a generated signature to hang it on;
|
|
97
|
+
* until then this is the same iterator under its module and call name.
|
|
98
|
+
*/
|
|
99
|
+
paginate<Request extends object, Response extends object, Item>(module: string, call: string, request: Request, options?: CallOptions & PageRequestOptions): AsyncGenerator<Item, void, undefined>;
|
|
100
|
+
/** A server stream that reconnects from its cursor (runtime contract R7). */
|
|
101
|
+
stream<Message, Request extends object>(module: string, call: string, request: Request, options: CallOptions & ResumeOptions<Message, Request>): AsyncGenerator<Message, void, undefined>;
|
|
102
|
+
/** The binding a module and call name identify, or a clear error. */
|
|
103
|
+
binding(module: string, call: string): CallBinding;
|
|
104
|
+
/** The proto revision this SDK declares (§44 §10.3). */
|
|
105
|
+
get protoRev(): string;
|
|
106
|
+
/** The proto packages this SDK speaks. */
|
|
107
|
+
get protoPackages(): readonly string[];
|
|
108
|
+
/** Forgets the cached service catalogue, so the next check calls again. */
|
|
109
|
+
invalidateCatalogue(): void;
|
|
110
|
+
}
|