@burdenoff/cli-sdk 2026.627.4 → 2026.628.1
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/modules/mybodyshield/index.cjs +281 -0
- package/dist/modules/mybodyshield/index.d.cts +7 -0
- package/dist/modules/mybodyshield/index.d.ts +7 -0
- package/dist/modules/mybodyshield/index.js +281 -0
- package/dist/modules/semanticfed/index.cjs +287 -0
- package/dist/modules/semanticfed/index.d.cts +7 -0
- package/dist/modules/semanticfed/index.d.ts +7 -0
- package/dist/modules/semanticfed/index.js +287 -0
- package/dist/modules/technospam/index.cjs +325 -0
- package/dist/modules/technospam/index.d.cts +7 -0
- package/dist/modules/technospam/index.d.ts +7 -0
- package/dist/modules/technospam/index.js +325 -0
- package/dist/modules/theculturepost/index.cjs +228 -0
- package/dist/modules/theculturepost/index.d.cts +7 -0
- package/dist/modules/theculturepost/index.d.ts +7 -0
- package/dist/modules/theculturepost/index.js +228 -0
- package/dist/modules/theglobalfuel/index.cjs +251 -0
- package/dist/modules/theglobalfuel/index.d.cts +7 -0
- package/dist/modules/theglobalfuel/index.d.ts +7 -0
- package/dist/modules/theglobalfuel/index.js +251 -0
- package/package.json +1 -1
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import {a,b as b$1,h as h$1,p,o,g,i,d as d$1}from'../../chunk-WXDQ3S5J.js';import {o as o$1}from'../../chunk-TCBALVP4.js';var h=`
|
|
2
|
+
query TcpGetStory($id: ID!) {
|
|
3
|
+
tcpStory(id: $id) {
|
|
4
|
+
id authorId editorId title slug summary body format status topicId
|
|
5
|
+
languages tags readingMins publishedAt createdAt updatedAt workspaceId
|
|
6
|
+
cover { id }
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
`,A=`
|
|
10
|
+
query TcpListStories($pagination: PaginationInput, $status: TcpStoryStatus, $topicId: ID) {
|
|
11
|
+
tcpListStories(pagination: $pagination, status: $status, topicId: $topicId) {
|
|
12
|
+
items {
|
|
13
|
+
id title slug status format topicId readingMins publishedAt createdAt
|
|
14
|
+
}
|
|
15
|
+
pageInfo { cursor hasMore }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`,O=`
|
|
19
|
+
mutation TcpCreateStory($input: TcpCreateStoryInput!) {
|
|
20
|
+
tcpCreateStory(input: $input) {
|
|
21
|
+
id authorId editorId title slug summary body format status topicId
|
|
22
|
+
languages tags readingMins createdAt
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`,R=`
|
|
26
|
+
mutation TcpUpdateStory($id: ID!, $input: TcpUpdateStoryInput!) {
|
|
27
|
+
tcpUpdateStory(id: $id, input: $input) {
|
|
28
|
+
id title slug summary body format status topicId languages tags
|
|
29
|
+
readingMins updatedAt
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`,v=`
|
|
33
|
+
mutation TcpTransitionStory($id: ID!, $status: TcpStoryStatus!) {
|
|
34
|
+
tcpTransitionStory(id: $id, status: $status) {
|
|
35
|
+
id title slug status publishedAt updatedAt
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`,D=`
|
|
39
|
+
query TcpGetTopic($id: ID!) {
|
|
40
|
+
tcpTopic(id: $id) {
|
|
41
|
+
id name slug description category tradition isFeatured createdAt
|
|
42
|
+
updatedAt workspaceId
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`,E=`
|
|
46
|
+
query TcpListTopics($category: TcpTopicCategory, $pagination: PaginationInput) {
|
|
47
|
+
tcpListTopics(category: $category, pagination: $pagination) {
|
|
48
|
+
items {
|
|
49
|
+
id name slug category tradition isFeatured createdAt
|
|
50
|
+
}
|
|
51
|
+
pageInfo { cursor hasMore }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`,S=`
|
|
55
|
+
mutation TcpCreateTopic($input: TcpCreateTopicInput!) {
|
|
56
|
+
tcpCreateTopic(input: $input) {
|
|
57
|
+
id name slug description category tradition isFeatured createdAt
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`,L=`
|
|
61
|
+
mutation TcpUpdateTopic($id: ID!, $input: TcpUpdateTopicInput!) {
|
|
62
|
+
tcpUpdateTopic(id: $id, input: $input) {
|
|
63
|
+
id name slug description category tradition isFeatured updatedAt
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`,P=`
|
|
67
|
+
mutation TcpArchiveTopic($id: ID!) {
|
|
68
|
+
tcpArchiveTopic(id: $id)
|
|
69
|
+
}
|
|
70
|
+
`,_=`
|
|
71
|
+
query TcpListCitations($storyId: ID!) {
|
|
72
|
+
tcpListCitations(storyId: $storyId) {
|
|
73
|
+
id storyId title author publisher publishedOn sourceType url excerpt
|
|
74
|
+
provenance verification createdAt updatedAt workspaceId
|
|
75
|
+
sourceFile { id }
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`,w=`
|
|
79
|
+
mutation TcpAddCitation($input: TcpCreateCitationInput!) {
|
|
80
|
+
tcpAddCitation(input: $input) {
|
|
81
|
+
id storyId title author publisher publishedOn sourceType url excerpt
|
|
82
|
+
provenance verification createdAt
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`,$=`
|
|
86
|
+
mutation TcpVerifyCitation($id: ID!, $verification: TcpVerificationStatus!) {
|
|
87
|
+
tcpVerifyCitation(id: $id, verification: $verification) {
|
|
88
|
+
id storyId title verification updatedAt
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
`,k=`
|
|
92
|
+
query TcpGetArchiveItem($id: ID!) {
|
|
93
|
+
tcpArchiveItem(id: $id) {
|
|
94
|
+
id title description kind accessLevel collectionId origin provenance
|
|
95
|
+
languages tags datedAt createdAt updatedAt workspaceId
|
|
96
|
+
file { id }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
`,b=`
|
|
100
|
+
query TcpListArchiveItems(
|
|
101
|
+
$accessLevel: TcpAccessLevel
|
|
102
|
+
$collectionId: ID
|
|
103
|
+
$kind: TcpArchiveItemKind
|
|
104
|
+
$pagination: PaginationInput
|
|
105
|
+
) {
|
|
106
|
+
tcpListArchiveItems(
|
|
107
|
+
accessLevel: $accessLevel
|
|
108
|
+
collectionId: $collectionId
|
|
109
|
+
kind: $kind
|
|
110
|
+
pagination: $pagination
|
|
111
|
+
) {
|
|
112
|
+
items {
|
|
113
|
+
id title kind accessLevel collectionId origin datedAt createdAt
|
|
114
|
+
}
|
|
115
|
+
pageInfo { cursor hasMore }
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
`,U=`
|
|
119
|
+
mutation TcpCreateArchiveItem($input: TcpCreateArchiveItemInput!) {
|
|
120
|
+
tcpCreateArchiveItem(input: $input) {
|
|
121
|
+
id title description kind accessLevel collectionId origin provenance
|
|
122
|
+
languages tags datedAt createdAt
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
`,M=`
|
|
126
|
+
mutation TcpUpdateArchiveItem($id: ID!, $input: TcpUpdateArchiveItemInput!) {
|
|
127
|
+
tcpUpdateArchiveItem(id: $id, input: $input) {
|
|
128
|
+
id title description kind accessLevel collectionId origin provenance
|
|
129
|
+
languages tags datedAt updatedAt
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
`,N=`
|
|
133
|
+
mutation TcpArchiveArchiveItem($id: ID!) {
|
|
134
|
+
tcpArchiveArchiveItem(id: $id)
|
|
135
|
+
}
|
|
136
|
+
`,x=`
|
|
137
|
+
query TcpGetCollection($id: ID!) {
|
|
138
|
+
tcpCollection(id: $id) {
|
|
139
|
+
id name slug description tradition itemCount createdAt updatedAt
|
|
140
|
+
workspaceId
|
|
141
|
+
cover { id }
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
`,H=`
|
|
145
|
+
query TcpListCollections($pagination: PaginationInput) {
|
|
146
|
+
tcpListCollections(pagination: $pagination) {
|
|
147
|
+
id name slug description tradition itemCount createdAt updatedAt
|
|
148
|
+
workspaceId
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`,F=`
|
|
152
|
+
mutation TcpCreateCollection($input: TcpCreateCollectionInput!) {
|
|
153
|
+
tcpCreateCollection(input: $input) {
|
|
154
|
+
id name slug description tradition itemCount createdAt
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
`,V=`
|
|
158
|
+
query TcpListOralHistories($collectionId: ID) {
|
|
159
|
+
tcpListOralHistories(collectionId: $collectionId) {
|
|
160
|
+
id title narratorName language summary transcript collectionId
|
|
161
|
+
accessLevel durationSecs recordedAt createdAt updatedAt workspaceId
|
|
162
|
+
recording { id }
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
`,G=`
|
|
166
|
+
mutation TcpRecordOralHistory($input: TcpCreateOralHistoryInput!) {
|
|
167
|
+
tcpRecordOralHistory(input: $input) {
|
|
168
|
+
id title narratorName language summary transcript collectionId
|
|
169
|
+
accessLevel durationSecs recordedAt createdAt
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
`,q=`
|
|
173
|
+
query TcpGetDiscussion($id: ID!) {
|
|
174
|
+
tcpDiscussion(id: $id) {
|
|
175
|
+
id title prompt storyId isInterfaith isLocked status replyCount tags
|
|
176
|
+
openedById createdAt updatedAt workspaceId
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
`,Y=`
|
|
180
|
+
query TcpListDiscussions(
|
|
181
|
+
$pagination: PaginationInput
|
|
182
|
+
$status: TcpModerationStatus
|
|
183
|
+
$storyId: ID
|
|
184
|
+
) {
|
|
185
|
+
tcpListDiscussions(pagination: $pagination, status: $status, storyId: $storyId) {
|
|
186
|
+
items {
|
|
187
|
+
id title storyId isInterfaith isLocked status replyCount createdAt
|
|
188
|
+
}
|
|
189
|
+
pageInfo { cursor hasMore }
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
`,B=`
|
|
193
|
+
mutation TcpOpenDiscussion($input: TcpCreateDiscussionInput!) {
|
|
194
|
+
tcpOpenDiscussion(input: $input) {
|
|
195
|
+
id title prompt storyId isInterfaith isLocked status replyCount tags
|
|
196
|
+
createdAt
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
`,W=`
|
|
200
|
+
mutation TcpLockDiscussion($id: ID!) {
|
|
201
|
+
tcpLockDiscussion(id: $id) {
|
|
202
|
+
id title isLocked status updatedAt
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
`,K=`
|
|
206
|
+
query TcpListReplies($discussionId: ID!, $status: TcpModerationStatus) {
|
|
207
|
+
tcpListReplies(discussionId: $discussionId, status: $status) {
|
|
208
|
+
id discussionId authorId body perspective status createdAt updatedAt
|
|
209
|
+
workspaceId
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
`,J=`
|
|
213
|
+
mutation TcpPostReply($input: TcpCreateReplyInput!) {
|
|
214
|
+
tcpPostReply(input: $input) {
|
|
215
|
+
id discussionId authorId body perspective status createdAt
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
`,j=`
|
|
219
|
+
mutation TcpModerateReply($id: ID!, $status: TcpModerationStatus!) {
|
|
220
|
+
tcpModerateReply(id: $id, status: $status) {
|
|
221
|
+
id discussionId body perspective status updatedAt
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
`,z=`
|
|
225
|
+
query TcpHealth {
|
|
226
|
+
tcpHealth
|
|
227
|
+
}
|
|
228
|
+
`;function d(c){let o=Number.parseInt(c,10);if(Number.isNaN(o))throw new o$1(`Expected an integer but got "${c}"`);return o}function m(c){return c.split(",").map(o=>o.trim()).filter(o=>o.length>0)}function X(c){let o$2=c.command("stories").description("TheCulturePost editorial stories");o$2.command("list").description("List stories").option("--status <s>","Filter by story status (IDEA|DRAFT|IN_REVIEW|PUBLISHED|ARCHIVED)").option("--topic <id>","Filter by topic ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let i=await b$1(A,{pagination:{limit:t.limit,offset:t.offset},status:t.status?t.status.toUpperCase():void 0,topicId:t.topic});h$1(t,i.tcpListStories.items,{headers:["ID","Title","Status","Format","Reading","Published"],rows:i.tcpListStories.items.map(e=>[p(e.id,12),e.title,e.status,e.format,e.readingMins!=null?`${e.readingMins}m`:"-",o(e.publishedAt)])});}catch(i){g(i);}}),o$2.command("get").description("Get a story by id").argument("<id>","Story ID").option("-f, --format <format>","Output format").action(async(t,i)=>{try{let e=await b$1(h,{id:t});if(!e.tcpStory)throw new o$1(`Story ${t} not found`);h$1(i,e.tcpStory);}catch(e){g(e);}}),o$2.command("create").description("Create a story").requiredOption("--title <t>","Title").requiredOption("--slug <slug>","URL slug").option("--summary <s>","Summary").option("--body <s>","Body").option("--topic <id>","Topic ID").option("--author <id>","Author user ID").option("--editor <id>","Editor user ID").option("--format-kind <k>","ARTICLE|ESSAY|EXPLAINER|ORAL_HISTORY|PHOTO_STORY|TIMELINE").option("--cover-file <id>","Cover file ID").option("--reading-mins <n>","Reading minutes",d).option("--languages <csv>","Comma-separated language codes").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let i$1={title:t.title,slug:t.slug};t.summary&&(i$1.summary=t.summary),t.body&&(i$1.body=t.body),t.topic&&(i$1.topicId=t.topic),t.author&&(i$1.authorId=t.author),t.editor&&(i$1.editorId=t.editor),t.formatKind&&(i$1.format=t.formatKind.toUpperCase()),t.coverFile&&(i$1.coverFileId=t.coverFile),t.readingMins!==void 0&&(i$1.readingMins=t.readingMins),t.languages&&(i$1.languages=m(t.languages)),t.tags&&(i$1.tags=m(t.tags));let e=await b$1(O,{input:i$1});i(`Story created: ${e.tcpCreateStory.title}`),h$1(t,e.tcpCreateStory);}catch(i){g(i);}}),o$2.command("update").description("Update a story").argument("<id>","Story ID").option("--title <t>","Title").option("--summary <s>","Summary").option("--body <s>","Body").option("--topic <id>","Topic ID").option("--author <id>","Author user ID").option("--editor <id>","Editor user ID").option("--format-kind <k>","ARTICLE|ESSAY|EXPLAINER|ORAL_HISTORY|PHOTO_STORY|TIMELINE").option("--cover-file <id>","Cover file ID").option("--reading-mins <n>","Reading minutes",d).option("--languages <csv>","Comma-separated language codes").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,i$1)=>{try{let e={};if(i$1.title&&(e.title=i$1.title),i$1.summary!==void 0&&(e.summary=i$1.summary),i$1.body!==void 0&&(e.body=i$1.body),i$1.topic&&(e.topicId=i$1.topic),i$1.author&&(e.authorId=i$1.author),i$1.editor&&(e.editorId=i$1.editor),i$1.formatKind&&(e.format=i$1.formatKind.toUpperCase()),i$1.coverFile&&(e.coverFileId=i$1.coverFile),i$1.readingMins!==void 0&&(e.readingMins=i$1.readingMins),i$1.languages&&(e.languages=m(i$1.languages)),i$1.tags&&(e.tags=m(i$1.tags)),!Object.keys(e).length)throw new o$1("No updates specified");let I=await b$1(R,{id:t,input:e});i("Story updated"),h$1(i$1,I.tcpUpdateStory);}catch(e){g(e);}}),o$2.command("transition").description("Advance a story through its editorial lifecycle").argument("<id>","Story ID").requiredOption("--status <s>","IDEA|DRAFT|IN_REVIEW|PUBLISHED|ARCHIVED").option("-f, --format <format>","Output format").action(async(t,i$1)=>{try{let e=await b$1(v,{id:t,status:i$1.status.toUpperCase()});i(`Story transitioned to ${e.tcpTransitionStory.status}`),h$1(i$1,e.tcpTransitionStory);}catch(e){g(e);}});}function Q(c){let o=c.command("topics").description("TheCulturePost topics");o.command("list").description("List topics").option("--category <c>","Filter by topic category").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let i=await b$1(E,{category:t.category?t.category.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});h$1(t,i.tcpListTopics.items,{headers:["ID","Name","Category","Tradition","Featured"],rows:i.tcpListTopics.items.map(e=>[p(e.id,12),e.name,e.category,e.tradition??"-",e.isFeatured?"yes":"no"])});}catch(i){g(i);}}),o.command("get").description("Get a topic by id").argument("<id>","Topic ID").option("-f, --format <format>","Output format").action(async(t,i)=>{try{let e=await b$1(D,{id:t});if(!e.tcpTopic)throw new o$1(`Topic ${t} not found`);h$1(i,e.tcpTopic);}catch(e){g(e);}}),o.command("create").description("Create a topic").requiredOption("--name <name>","Name").requiredOption("--slug <slug>","URL slug").option("--category <c>","Topic category").option("--description <s>","Description").option("--tradition <s>","Tradition").option("--featured","Mark as featured").option("-f, --format <format>","Output format").action(async t=>{try{let i$1={name:t.name,slug:t.slug};t.category&&(i$1.category=t.category.toUpperCase()),t.description&&(i$1.description=t.description),t.tradition&&(i$1.tradition=t.tradition),t.featured&&(i$1.isFeatured=!0);let e=await b$1(S,{input:i$1});i(`Topic created: ${e.tcpCreateTopic.name}`),h$1(t,e.tcpCreateTopic);}catch(i){g(i);}}),o.command("update").description("Update a topic").argument("<id>","Topic ID").option("--name <name>","Name").option("--category <c>","Topic category").option("--description <s>","Description").option("--tradition <s>","Tradition").option("--featured <bool>","true|false",t=>t==="true").option("-f, --format <format>","Output format").action(async(t,i$1)=>{try{let e={};if(i$1.name&&(e.name=i$1.name),i$1.category&&(e.category=i$1.category.toUpperCase()),i$1.description!==void 0&&(e.description=i$1.description),i$1.tradition!==void 0&&(e.tradition=i$1.tradition),i$1.featured!==void 0&&(e.isFeatured=i$1.featured),!Object.keys(e).length)throw new o$1("No updates specified");let I=await b$1(L,{id:t,input:e});i("Topic updated"),h$1(i$1,I.tcpUpdateTopic);}catch(e){g(e);}}),o.command("archive").description("Archive (delete) a topic").argument("<id>","Topic ID").option("-f, --format <format>","Output format").action(async(t,i$1)=>{try{let e=await b$1(P,{id:t});i(`Topic ${t} archived`),h$1(i$1,{archived:e.tcpArchiveTopic});}catch(e){g(e);}});}function Z(c){let o=c.command("citations").description("TheCulturePost story citations");o.command("list").description("List citations for a story").requiredOption("--story <id>","Story ID").option("-f, --format <format>","Output format").action(async t=>{try{let i=await b$1(_,{storyId:t.story});h$1(t,i.tcpListCitations,{headers:["ID","Title","Author","Source","Verification"],rows:i.tcpListCitations.map(e=>[p(e.id,12),p(e.title,30),e.author??"-",e.sourceType,e.verification])});}catch(i){g(i);}}),o.command("add").description("Add a citation to a story").requiredOption("--story <id>","Story ID").requiredOption("--title <t>","Citation title").option("--author <s>","Author").option("--publisher <s>","Publisher").option("--published-on <iso>","Published-on date (ISO)").option("--source-type <t>","ACADEMIC|ARCHIVAL_RECORD|ARTIFACT|BOOK|INTERVIEW|PERIODICAL|PRIMARY_DOCUMENT|WEB").option("--url <url>","Source URL").option("--excerpt <s>","Excerpt").option("--provenance <s>","Provenance").option("--source-file <id>","Source file ID").option("-f, --format <format>","Output format").action(async t=>{try{let i$1={storyId:t.story,title:t.title};t.author&&(i$1.author=t.author),t.publisher&&(i$1.publisher=t.publisher),t.publishedOn&&(i$1.publishedOn=t.publishedOn),t.sourceType&&(i$1.sourceType=t.sourceType.toUpperCase()),t.url&&(i$1.url=t.url),t.excerpt&&(i$1.excerpt=t.excerpt),t.provenance&&(i$1.provenance=t.provenance),t.sourceFile&&(i$1.sourceFileId=t.sourceFile);let e=await b$1(w,{input:i$1});i(`Citation added: ${e.tcpAddCitation.title}`),h$1(t,e.tcpAddCitation);}catch(i){g(i);}}),o.command("verify").description("Set a citation verification status").argument("<id>","Citation ID").requiredOption("--verification <v>","UNVERIFIED|CORROBORATED|DISPUTED|RETRACTED").option("-f, --format <format>","Output format").action(async(t,i$1)=>{try{let e=await b$1($,{id:t,verification:i$1.verification.toUpperCase()});i(`Citation verification set to ${e.tcpVerifyCitation.verification}`),h$1(i$1,e.tcpVerifyCitation);}catch(e){g(e);}});}function tt(c){let o$2=c.command("archive").description("TheCulturePost archive items");o$2.command("list").description("List archive items").option("--access-level <a>","PUBLIC|COMMUNITY|RESTRICTED|EMBARGOED").option("--collection <id>","Filter by collection ID").option("--kind <k>","AUDIO|DOCUMENT|MANUSCRIPT|MAP|OBJECT|PHOTOGRAPH|VIDEO").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let i=await b$1(b,{accessLevel:t.accessLevel?t.accessLevel.toUpperCase():void 0,collectionId:t.collection,kind:t.kind?t.kind.toUpperCase():void 0,pagination:{limit:t.limit,offset:t.offset}});h$1(t,i.tcpListArchiveItems.items,{headers:["ID","Title","Kind","Access","Origin","Dated"],rows:i.tcpListArchiveItems.items.map(e=>[p(e.id,12),e.title,e.kind,e.accessLevel,e.origin??"-",o(e.datedAt)])});}catch(i){g(i);}}),o$2.command("get").description("Get an archive item by id").argument("<id>","Archive item ID").option("-f, --format <format>","Output format").action(async(t,i)=>{try{let e=await b$1(k,{id:t});if(!e.tcpArchiveItem)throw new o$1(`Archive item ${t} not found`);h$1(i,e.tcpArchiveItem);}catch(e){g(e);}}),o$2.command("create").description("Create an archive item").requiredOption("--title <t>","Title").option("--description <s>","Description").option("--kind <k>","AUDIO|DOCUMENT|MANUSCRIPT|MAP|OBJECT|PHOTOGRAPH|VIDEO").option("--access-level <a>","PUBLIC|COMMUNITY|RESTRICTED|EMBARGOED").option("--collection <id>","Collection ID").option("--file <id>","File ID").option("--origin <s>","Origin").option("--provenance <s>","Provenance").option("--dated-at <iso>","Dated-at (ISO)").option("--languages <csv>","Comma-separated language codes").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let i$1={title:t.title};t.description&&(i$1.description=t.description),t.kind&&(i$1.kind=t.kind.toUpperCase()),t.accessLevel&&(i$1.accessLevel=t.accessLevel.toUpperCase()),t.collection&&(i$1.collectionId=t.collection),t.file&&(i$1.fileId=t.file),t.origin&&(i$1.origin=t.origin),t.provenance&&(i$1.provenance=t.provenance),t.datedAt&&(i$1.datedAt=t.datedAt),t.languages&&(i$1.languages=m(t.languages)),t.tags&&(i$1.tags=m(t.tags));let e=await b$1(U,{input:i$1});i(`Archive item created: ${e.tcpCreateArchiveItem.title}`),h$1(t,e.tcpCreateArchiveItem);}catch(i){g(i);}}),o$2.command("update").description("Update an archive item").argument("<id>","Archive item ID").option("--title <t>","Title").option("--description <s>","Description").option("--kind <k>","AUDIO|DOCUMENT|MANUSCRIPT|MAP|OBJECT|PHOTOGRAPH|VIDEO").option("--access-level <a>","PUBLIC|COMMUNITY|RESTRICTED|EMBARGOED").option("--collection <id>","Collection ID").option("--file <id>","File ID").option("--origin <s>","Origin").option("--provenance <s>","Provenance").option("--dated-at <iso>","Dated-at (ISO)").option("--languages <csv>","Comma-separated language codes").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,i$1)=>{try{let e={};if(i$1.title&&(e.title=i$1.title),i$1.description!==void 0&&(e.description=i$1.description),i$1.kind&&(e.kind=i$1.kind.toUpperCase()),i$1.accessLevel&&(e.accessLevel=i$1.accessLevel.toUpperCase()),i$1.collection&&(e.collectionId=i$1.collection),i$1.file&&(e.fileId=i$1.file),i$1.origin!==void 0&&(e.origin=i$1.origin),i$1.provenance!==void 0&&(e.provenance=i$1.provenance),i$1.datedAt&&(e.datedAt=i$1.datedAt),i$1.languages&&(e.languages=m(i$1.languages)),i$1.tags&&(e.tags=m(i$1.tags)),!Object.keys(e).length)throw new o$1("No updates specified");let I=await b$1(M,{id:t,input:e});i("Archive item updated"),h$1(i$1,I.tcpUpdateArchiveItem);}catch(e){g(e);}}),o$2.command("archive-item").description("Archive (delete) an archive item").argument("<id>","Archive item ID").option("-f, --format <format>","Output format").action(async(t,i$1)=>{try{let e=await b$1(N,{id:t});i(`Archive item ${t} archived`),h$1(i$1,{archived:e.tcpArchiveArchiveItem});}catch(e){g(e);}});}function it(c){let o=c.command("collections").description("TheCulturePost archive collections");o.command("list").description("List collections").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let i=await b$1(H,{pagination:{limit:t.limit,offset:t.offset}});h$1(t,i.tcpListCollections,{headers:["ID","Name","Slug","Tradition","Items"],rows:i.tcpListCollections.map(e=>[p(e.id,12),e.name,e.slug,e.tradition??"-",String(e.itemCount)])});}catch(i){g(i);}}),o.command("get").description("Get a collection by id").argument("<id>","Collection ID").option("-f, --format <format>","Output format").action(async(t,i)=>{try{let e=await b$1(x,{id:t});if(!e.tcpCollection)throw new o$1(`Collection ${t} not found`);h$1(i,e.tcpCollection);}catch(e){g(e);}}),o.command("create").description("Create a collection").requiredOption("--name <name>","Name").requiredOption("--slug <slug>","URL slug").option("--description <s>","Description").option("--tradition <s>","Tradition").option("--cover-file <id>","Cover file ID").option("-f, --format <format>","Output format").action(async t=>{try{let i$1={name:t.name,slug:t.slug};t.description&&(i$1.description=t.description),t.tradition&&(i$1.tradition=t.tradition),t.coverFile&&(i$1.coverFileId=t.coverFile);let e=await b$1(F,{input:i$1});i(`Collection created: ${e.tcpCreateCollection.name}`),h$1(t,e.tcpCreateCollection);}catch(i){g(i);}});}function et(c){let o=c.command("oral-histories").description("TheCulturePost oral histories");o.command("list").description("List oral histories").option("--collection <id>","Filter by collection ID").option("-f, --format <format>","Output format").action(async t=>{try{let i=await b$1(V,{collectionId:t.collection});h$1(t,i.tcpListOralHistories,{headers:["ID","Title","Narrator","Language","Access","Duration"],rows:i.tcpListOralHistories.map(e=>[p(e.id,12),e.title,e.narratorName??"-",e.language??"-",e.accessLevel,`${e.durationSecs}s`])});}catch(i){g(i);}}),o.command("record").description("Record an oral history").requiredOption("--title <t>","Title").option("--narrator <s>","Narrator name").option("--language <s>","Language").option("--summary <s>","Summary").option("--transcript <s>","Transcript").option("--collection <id>","Collection ID").option("--access-level <a>","PUBLIC|COMMUNITY|RESTRICTED|EMBARGOED").option("--duration-secs <n>","Duration (seconds)",d).option("--recorded-at <iso>","Recorded-at (ISO)").option("--recording-file <id>","Recording file ID").option("-f, --format <format>","Output format").action(async t=>{try{let i$1={title:t.title};t.narrator&&(i$1.narratorName=t.narrator),t.language&&(i$1.language=t.language),t.summary&&(i$1.summary=t.summary),t.transcript&&(i$1.transcript=t.transcript),t.collection&&(i$1.collectionId=t.collection),t.accessLevel&&(i$1.accessLevel=t.accessLevel.toUpperCase()),t.durationSecs!==void 0&&(i$1.durationSecs=t.durationSecs),t.recordedAt&&(i$1.recordedAt=t.recordedAt),t.recordingFile&&(i$1.recordingFileId=t.recordingFile);let e=await b$1(G,{input:i$1});i(`Oral history recorded: ${e.tcpRecordOralHistory.title}`),h$1(t,e.tcpRecordOralHistory);}catch(i){g(i);}});}function ot(c){let o=c.command("discussions").description("TheCulturePost respectful discussions");o.command("list").description("List discussions").option("--status <s>","PENDING|APPROVED|FLAGGED|REMOVED").option("--story <id>","Filter by story ID").option("--limit <n>","Page size",d,50).option("--offset <n>","Offset",d,0).option("-f, --format <format>","Output format").action(async t=>{try{let i=await b$1(Y,{pagination:{limit:t.limit,offset:t.offset},status:t.status?t.status.toUpperCase():void 0,storyId:t.story});h$1(t,i.tcpListDiscussions.items,{headers:["ID","Title","Status","Locked","Interfaith","Replies"],rows:i.tcpListDiscussions.items.map(e=>[p(e.id,12),e.title,e.status,e.isLocked?"yes":"no",e.isInterfaith?"yes":"no",String(e.replyCount??0)])});}catch(i){g(i);}}),o.command("get").description("Get a discussion by id").argument("<id>","Discussion ID").option("-f, --format <format>","Output format").action(async(t,i)=>{try{let e=await b$1(q,{id:t});if(!e.tcpDiscussion)throw new o$1(`Discussion ${t} not found`);h$1(i,e.tcpDiscussion);}catch(e){g(e);}}),o.command("open").description("Open a discussion").requiredOption("--title <t>","Title").option("--prompt <s>","Discussion prompt").option("--story <id>","Related story ID").option("--interfaith","Mark as interfaith").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let i$1={title:t.title};t.prompt&&(i$1.prompt=t.prompt),t.story&&(i$1.storyId=t.story),t.interfaith&&(i$1.isInterfaith=!0),t.tags&&(i$1.tags=m(t.tags));let e=await b$1(B,{input:i$1});i(`Discussion opened: ${e.tcpOpenDiscussion.title}`),h$1(t,e.tcpOpenDiscussion);}catch(i){g(i);}}),o.command("lock").description("Lock a discussion").argument("<id>","Discussion ID").option("-f, --format <format>","Output format").action(async(t,i$1)=>{try{let e=await b$1(W,{id:t});i(`Discussion ${t} locked`),h$1(i$1,e.tcpLockDiscussion);}catch(e){g(e);}});}function rt(c){let o=c.command("replies").description("TheCulturePost discussion replies");o.command("list").description("List replies for a discussion").requiredOption("--discussion <id>","Discussion ID").option("--status <s>","PENDING|APPROVED|FLAGGED|REMOVED").option("-f, --format <format>","Output format").action(async t=>{try{let i=await b$1(K,{discussionId:t.discussion,status:t.status?t.status.toUpperCase():void 0});h$1(t,i.tcpListReplies,{headers:["ID","Author","Perspective","Status","Body"],rows:i.tcpListReplies.map(e=>[p(e.id,12),p(e.authorId??"-",12),e.perspective??"-",e.status,p(e.body,40)])});}catch(i){g(i);}}),o.command("post").description("Post a reply to a discussion").requiredOption("--discussion <id>","Discussion ID").requiredOption("--body <s>","Reply body").option("--perspective <s>","Perspective").option("-f, --format <format>","Output format").action(async t=>{try{let i$1={discussionId:t.discussion,body:t.body};t.perspective&&(i$1.perspective=t.perspective);let e=await b$1(J,{input:i$1});i("Reply posted"),h$1(t,e.tcpPostReply);}catch(i){g(i);}}),o.command("moderate").description("Moderate a reply (approve / flag / remove)").argument("<id>","Reply ID").requiredOption("--status <s>","PENDING|APPROVED|FLAGGED|REMOVED").option("-f, --format <format>","Output format").action(async(t,i$1)=>{try{let e=await b$1(j,{id:t,status:i$1.status.toUpperCase()});i(`Reply moderated to ${e.tcpModerateReply.status}`),h$1(i$1,e.tcpModerateReply);}catch(e){g(e);}});}function nt(c){c.command("health").description("TheCulturePost service health check (public)").option("-f, --format <format>","Output format").action(async o=>{try{let t=await d$1(z);i(t.tcpHealth),h$1(o,{health:t.tcpHealth});}catch(t){g(t);}});}var st={id:"theculturepost",version:"1.0.0",displayName:"TheCulturePost",dependsOn:["auth","workspaces"],register(c,o){a(o);let t=c.command("theculturepost").description("TheCulturePost culture & heritage publishing");X(t),Q(t),Z(t),tt(t),it(t),et(t),ot(t),rt(t),nt(t);}},jt=st;export{jt as default};
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
'use strict';require('graphql-request'),require('cross-fetch'),require('commander');var m=class extends Error{exitCode;hint;constructor(o,t){super(o),this.name="CliUserError",this.exitCode=t?.exitCode??1,this.hint=t?.hint;}},E=class extends m{constructor(o,t){super(o,{exitCode:2,hint:t?.hint??"Run `<product> auth login` to authenticate."}),this.name="CliAuthError";}},h=class extends Error{cause;constructor(o,t){super(o),this.name="CliInternalError",this.cause=t;}};var A=null;function R(r){A=r;}function I(){if(!A)throw new h("vibecontrols module helpers used before setHelpersContext was called");return A}function At(){let r=I();if(!r.auth.isAuthenticated())throw new E(`Authentication required. Run \`${r.productName} auth login\`.`)}async function a(r,o){return At(),I().gql.workspace.request(r,o)}async function w(r,o){return I().gql.workspaceAuthOnly.request(r,o)}function i(r){let o=r instanceof Error?r.message:String(r);throw new m(o)}function s(r,o,t){I().output.formatAndOutput(r,o,t);}function d(r){I().output.printSuccess(r);}function C(r){return I().output.formatDate(r)}function p(r,o){return I().output.truncate(r,o)}var v=`
|
|
2
|
+
query TheGetAsset($id: ID!) {
|
|
3
|
+
theAsset(id: $id) {
|
|
4
|
+
id name code kind commodity status location latitude longitude
|
|
5
|
+
capacityPerDay capacityUnit workingInterestPct operatorLeadId tags
|
|
6
|
+
commissionedAt decommissionedAt createdAt updatedAt workspaceId
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
`,O=`
|
|
10
|
+
query TheListAssets(
|
|
11
|
+
$commodity: TheCommodityType
|
|
12
|
+
$kind: TheAssetKind
|
|
13
|
+
$status: TheAssetStatus
|
|
14
|
+
$pagination: PaginationInput
|
|
15
|
+
) {
|
|
16
|
+
theListAssets(
|
|
17
|
+
commodity: $commodity
|
|
18
|
+
kind: $kind
|
|
19
|
+
status: $status
|
|
20
|
+
pagination: $pagination
|
|
21
|
+
) {
|
|
22
|
+
items {
|
|
23
|
+
id name code kind commodity status location capacityPerDay
|
|
24
|
+
capacityUnit workingInterestPct createdAt
|
|
25
|
+
}
|
|
26
|
+
pageInfo { cursor hasMore }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`,x=`
|
|
30
|
+
mutation TheCreateAsset($input: TheCreateAssetInput!) {
|
|
31
|
+
theCreateAsset(input: $input) {
|
|
32
|
+
id name code kind commodity status location latitude longitude
|
|
33
|
+
capacityPerDay capacityUnit workingInterestPct operatorLeadId tags
|
|
34
|
+
commissionedAt createdAt workspaceId
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`,b=`
|
|
38
|
+
mutation TheUpdateAsset($id: ID!, $input: TheUpdateAssetInput!) {
|
|
39
|
+
theUpdateAsset(id: $id, input: $input) {
|
|
40
|
+
id name code kind commodity status location latitude longitude
|
|
41
|
+
capacityPerDay capacityUnit workingInterestPct operatorLeadId tags
|
|
42
|
+
commissionedAt decommissionedAt updatedAt
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`,D=`
|
|
46
|
+
mutation TheTransitionAsset($id: ID!, $status: TheAssetStatus!) {
|
|
47
|
+
theTransitionAsset(id: $id, status: $status) {
|
|
48
|
+
id name status updatedAt
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`,L=`
|
|
52
|
+
mutation TheRetireAsset($id: ID!) {
|
|
53
|
+
theRetireAsset(id: $id)
|
|
54
|
+
}
|
|
55
|
+
`,P=`
|
|
56
|
+
query TheGetContract($id: ID!) {
|
|
57
|
+
theContract(id: $id) {
|
|
58
|
+
id reference counterparty commodity side status pricingBasis
|
|
59
|
+
pricePerUnit priceIndex currency unit contractedVolume deliveredVolume
|
|
60
|
+
deliveryLocation startDate endDate signedAt notes tags
|
|
61
|
+
createdAt updatedAt workspaceId
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`,$=`
|
|
65
|
+
query TheListContracts(
|
|
66
|
+
$commodity: TheCommodityType
|
|
67
|
+
$side: TheContractSide
|
|
68
|
+
$status: TheContractStatus
|
|
69
|
+
$pagination: PaginationInput
|
|
70
|
+
) {
|
|
71
|
+
theListContracts(
|
|
72
|
+
commodity: $commodity
|
|
73
|
+
side: $side
|
|
74
|
+
status: $status
|
|
75
|
+
pagination: $pagination
|
|
76
|
+
) {
|
|
77
|
+
items {
|
|
78
|
+
id reference counterparty commodity side status pricingBasis
|
|
79
|
+
pricePerUnit currency unit contractedVolume deliveredVolume createdAt
|
|
80
|
+
}
|
|
81
|
+
pageInfo { cursor hasMore }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
`,N=`
|
|
85
|
+
mutation TheCreateContract($input: TheCreateOfftakeContractInput!) {
|
|
86
|
+
theCreateContract(input: $input) {
|
|
87
|
+
id reference counterparty commodity side status pricingBasis
|
|
88
|
+
pricePerUnit priceIndex currency unit contractedVolume deliveredVolume
|
|
89
|
+
deliveryLocation startDate endDate notes tags createdAt
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
`,_=`
|
|
93
|
+
mutation TheUpdateContract($id: ID!, $input: TheUpdateOfftakeContractInput!) {
|
|
94
|
+
theUpdateContract(id: $id, input: $input) {
|
|
95
|
+
id reference counterparty commodity side status pricingBasis
|
|
96
|
+
pricePerUnit priceIndex currency unit contractedVolume deliveredVolume
|
|
97
|
+
deliveryLocation startDate endDate notes tags updatedAt
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`,U=`
|
|
101
|
+
mutation TheTransitionContract($id: ID!, $status: TheContractStatus!) {
|
|
102
|
+
theTransitionContract(id: $id, status: $status) {
|
|
103
|
+
id reference status signedAt updatedAt
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`,q=`
|
|
107
|
+
query TheListShipments($contractId: ID, $status: TheShipmentStatus) {
|
|
108
|
+
theListShipments(contractId: $contractId, status: $status) {
|
|
109
|
+
id reference contractId status mode carrier origin destination
|
|
110
|
+
volume unit scheduledAt departedAt deliveredAt notes
|
|
111
|
+
createdAt updatedAt workspaceId
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
`,F=`
|
|
115
|
+
mutation TheScheduleShipment($input: TheCreateShipmentInput!) {
|
|
116
|
+
theScheduleShipment(input: $input) {
|
|
117
|
+
id reference contractId status mode carrier origin destination
|
|
118
|
+
volume unit scheduledAt notes createdAt workspaceId
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
`,V=`
|
|
122
|
+
mutation TheDeliverShipment($id: ID!) {
|
|
123
|
+
theDeliverShipment(id: $id) {
|
|
124
|
+
id reference contractId status mode volume unit deliveredAt updatedAt
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
`,M=`
|
|
128
|
+
query TheListInventoryLots(
|
|
129
|
+
$commodity: TheCommodityType
|
|
130
|
+
$status: TheInventoryStatus
|
|
131
|
+
$pagination: PaginationInput
|
|
132
|
+
) {
|
|
133
|
+
theListInventoryLots(
|
|
134
|
+
commodity: $commodity
|
|
135
|
+
status: $status
|
|
136
|
+
pagination: $pagination
|
|
137
|
+
) {
|
|
138
|
+
items {
|
|
139
|
+
id lotCode commodity status quantity unit unitValue currency
|
|
140
|
+
grade location assetId producedAt createdAt
|
|
141
|
+
}
|
|
142
|
+
pageInfo { cursor hasMore }
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
`,G=`
|
|
146
|
+
mutation TheCreateInventoryLot($input: TheCreateInventoryLotInput!) {
|
|
147
|
+
theCreateInventoryLot(input: $input) {
|
|
148
|
+
id lotCode commodity status quantity unit unitValue currency
|
|
149
|
+
grade location assetId producedAt notes createdAt workspaceId
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
`,W=`
|
|
153
|
+
mutation TheSetInventoryLotStatus($id: ID!, $status: TheInventoryStatus!) {
|
|
154
|
+
theSetInventoryLotStatus(id: $id, status: $status) {
|
|
155
|
+
id lotCode commodity status quantity unit updatedAt
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
`,B=`
|
|
159
|
+
query TheListProductionRecords($assetId: ID, $pagination: PaginationInput) {
|
|
160
|
+
theListProductionRecords(assetId: $assetId, pagination: $pagination) {
|
|
161
|
+
items {
|
|
162
|
+
id assetId volume unit grade downtimeHours periodStart periodEnd
|
|
163
|
+
notes createdAt
|
|
164
|
+
}
|
|
165
|
+
pageInfo { cursor hasMore }
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
`,H=`
|
|
169
|
+
mutation TheRecordProduction($input: TheRecordProductionInput!) {
|
|
170
|
+
theRecordProduction(input: $input) {
|
|
171
|
+
id assetId volume unit grade downtimeHours periodStart periodEnd
|
|
172
|
+
notes createdAt workspaceId
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
`,j=`
|
|
176
|
+
query TheListEmissionRecords(
|
|
177
|
+
$assetId: ID
|
|
178
|
+
$scope: TheEmissionScope
|
|
179
|
+
$pagination: PaginationInput
|
|
180
|
+
) {
|
|
181
|
+
theListEmissionRecords(assetId: $assetId, scope: $scope, pagination: $pagination) {
|
|
182
|
+
items {
|
|
183
|
+
id assetId scope co2eTonnes source methodology periodStart periodEnd
|
|
184
|
+
verified verifiedAt createdAt
|
|
185
|
+
}
|
|
186
|
+
pageInfo { cursor hasMore }
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
`,Y=`
|
|
190
|
+
mutation TheRecordEmission($input: TheRecordEmissionInput!) {
|
|
191
|
+
theRecordEmission(input: $input) {
|
|
192
|
+
id assetId scope co2eTonnes source methodology periodStart periodEnd
|
|
193
|
+
verified notes createdAt workspaceId
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
`,z=`
|
|
197
|
+
mutation TheVerifyEmission($id: ID!) {
|
|
198
|
+
theVerifyEmission(id: $id) {
|
|
199
|
+
id assetId scope co2eTonnes verified verifiedAt updatedAt
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
`,K=`
|
|
203
|
+
query TheListReserveEstimates($assetId: ID, $category: TheReserveCategory) {
|
|
204
|
+
theListReserveEstimates(assetId: $assetId, category: $category) {
|
|
205
|
+
id assetId category recoverable recoveryFactor unit asOfDate
|
|
206
|
+
methodology notes createdAt updatedAt workspaceId
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
`,J=`
|
|
210
|
+
mutation TheCreateReserveEstimate($input: TheCreateReserveEstimateInput!) {
|
|
211
|
+
theCreateReserveEstimate(input: $input) {
|
|
212
|
+
id assetId category recoverable recoveryFactor unit asOfDate
|
|
213
|
+
methodology notes createdAt workspaceId
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
`,X=`
|
|
217
|
+
query TheGetComplianceCert($id: ID!) {
|
|
218
|
+
theComplianceCert(id: $id) {
|
|
219
|
+
id title category status authority certNumber assetId ownerId
|
|
220
|
+
issuedAt expiresAt notes tags createdAt updatedAt workspaceId
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
`,Q=`
|
|
224
|
+
query TheListComplianceCerts(
|
|
225
|
+
$assetId: ID
|
|
226
|
+
$category: TheComplianceCategory
|
|
227
|
+
$status: TheComplianceStatus
|
|
228
|
+
) {
|
|
229
|
+
theListComplianceCerts(assetId: $assetId, category: $category, status: $status) {
|
|
230
|
+
id title category status authority certNumber assetId ownerId
|
|
231
|
+
issuedAt expiresAt createdAt
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
`,Z=`
|
|
235
|
+
mutation TheCreateComplianceCert($input: TheCreateComplianceCertInput!) {
|
|
236
|
+
theCreateComplianceCert(input: $input) {
|
|
237
|
+
id title category status authority certNumber assetId ownerId
|
|
238
|
+
issuedAt expiresAt notes tags createdAt workspaceId
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
`,tt=`
|
|
242
|
+
mutation TheTransitionComplianceCert($id: ID!, $status: TheComplianceStatus!) {
|
|
243
|
+
theTransitionComplianceCert(id: $id, status: $status) {
|
|
244
|
+
id title status updatedAt
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
`,et=`
|
|
248
|
+
query TheHealth {
|
|
249
|
+
theHealth
|
|
250
|
+
}
|
|
251
|
+
`;function l(r){let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new m(`Expected an integer but got "${r}"`);return o}function c(r){let o=Number.parseFloat(r);if(Number.isNaN(o))throw new m(`Expected a number but got "${r}"`);return o}function f(r,o){let t={};return r!==void 0&&(t.limit=r),o!==void 0&&(t.offset=o),t}function nt(r){let o=r.command("assets").description("Theglobalfuel upstream assets");o.command("list").description("List assets").option("--commodity <c>","Filter by commodity type").option("--kind <k>","Filter by asset kind").option("--status <s>","Filter by asset status").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(O,{commodity:t.commodity?t.commodity.toUpperCase():void 0,kind:t.kind?t.kind.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,pagination:f(t.limit,t.offset)});s(t,e.theListAssets.items,{headers:["ID","Name","Kind","Commodity","Status","Capacity/Day"],rows:e.theListAssets.items.map(n=>[p(n.id,12),n.name,n.kind,n.commodity,n.status,`${n.capacityPerDay??0} ${n.capacityUnit??""}`.trim()])});}catch(e){i(e);}}),o.command("get").description("Get an asset by id").argument("<id>","Asset ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(v,{id:t});if(!n.theAsset)throw new m(`Asset ${t} not found`);s(e,n.theAsset);}catch(n){i(n);}}),o.command("create").description("Create an asset").requiredOption("--name <name>","Asset name").requiredOption("--commodity <c>","Commodity type (e.g. CRUDE_OIL, NATURAL_GAS, LITHIUM)").option("--kind <k>","Asset kind (default WELL)").option("--code <code>","Asset code").option("--status <s>","Asset status (default EXPLORATION)").option("--location <s>","Location description").option("--latitude <n>","Latitude",c).option("--longitude <n>","Longitude",c).option("--capacity-per-day <n>","Capacity per day",c).option("--capacity-unit <u>","Capacity unit (default BARRELS)").option("--working-interest-pct <n>","Working interest %",c).option("--operator-lead <id>","Operator lead user ID").option("--commissioned-at <iso>","Commissioned date (ISO)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={name:t.name,commodity:t.commodity.toUpperCase()};t.kind&&(e.kind=t.kind.toUpperCase()),t.code&&(e.code=t.code),t.status&&(e.status=t.status.toUpperCase()),t.location&&(e.location=t.location),t.latitude!==void 0&&(e.latitude=t.latitude),t.longitude!==void 0&&(e.longitude=t.longitude),t.capacityPerDay!==void 0&&(e.capacityPerDay=t.capacityPerDay),t.capacityUnit&&(e.capacityUnit=t.capacityUnit.toUpperCase()),t.workingInterestPct!==void 0&&(e.workingInterestPct=t.workingInterestPct),t.operatorLead&&(e.operatorLeadId=t.operatorLead),t.commissionedAt&&(e.commissionedAt=t.commissionedAt),t.tags&&(e.tags=t.tags.split(",").map(g=>g.trim()));let n=await a(x,{input:e});d(`Asset created: ${n.theCreateAsset.name}`),s(t,n.theCreateAsset);}catch(e){i(e);}}),o.command("update").description("Update an asset").argument("<id>","Asset ID").option("--name <name>","Asset name").option("--commodity <c>","Commodity type").option("--kind <k>","Asset kind").option("--code <code>","Asset code").option("--location <s>","Location description").option("--latitude <n>","Latitude",c).option("--longitude <n>","Longitude",c).option("--capacity-per-day <n>","Capacity per day",c).option("--capacity-unit <u>","Capacity unit").option("--working-interest-pct <n>","Working interest %",c).option("--operator-lead <id>","Operator lead user ID").option("--commissioned-at <iso>","Commissioned date (ISO)").option("--decommissioned-at <iso>","Decommissioned date (ISO)").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.name&&(n.name=e.name),e.commodity&&(n.commodity=e.commodity.toUpperCase()),e.kind&&(n.kind=e.kind.toUpperCase()),e.code&&(n.code=e.code),e.location!==void 0&&(n.location=e.location),e.latitude!==void 0&&(n.latitude=e.latitude),e.longitude!==void 0&&(n.longitude=e.longitude),e.capacityPerDay!==void 0&&(n.capacityPerDay=e.capacityPerDay),e.capacityUnit&&(n.capacityUnit=e.capacityUnit.toUpperCase()),e.workingInterestPct!==void 0&&(n.workingInterestPct=e.workingInterestPct),e.operatorLead&&(n.operatorLeadId=e.operatorLead),e.commissionedAt&&(n.commissionedAt=e.commissionedAt),e.decommissionedAt&&(n.decommissionedAt=e.decommissionedAt),e.tags&&(n.tags=e.tags.split(",").map(T=>T.trim())),!Object.keys(n).length)throw new m("No updates specified");let g=await a(b,{id:t,input:n});d("Asset updated"),s(e,g.theUpdateAsset);}catch(n){i(n);}}),o.command("transition").description("Advance an asset through its lifecycle").argument("<id>","Asset ID").requiredOption("--status <s>","EXPLORATION|APPRAISAL|DEVELOPMENT|PRODUCING|SUSPENDED|DECOMMISSIONING|RETIRED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(D,{id:t,status:e.status.toUpperCase()});d(`Asset transitioned to ${n.theTransitionAsset.status}`),s(e,n.theTransitionAsset);}catch(n){i(n);}}),o.command("retire").description("Retire (delete) an asset").argument("<id>","Asset ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(L,{id:t});d(n.theRetireAsset?`Asset ${t} retired`:`Asset ${t} not retired`),s(e,{retired:n.theRetireAsset});}catch(n){i(n);}});}function ot(r){let o=r.command("contracts").description("Theglobalfuel offtake contracts");o.command("list").description("List offtake contracts").option("--commodity <c>","Filter by commodity type").option("--side <s>","BUY|SELL").option("--status <s>","Filter by contract status").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a($,{commodity:t.commodity?t.commodity.toUpperCase():void 0,side:t.side?t.side.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,pagination:f(t.limit,t.offset)});s(t,e.theListContracts.items,{headers:["ID","Reference","Counterparty","Commodity","Side","Status","Volume"],rows:e.theListContracts.items.map(n=>[p(n.id,12),n.reference,n.counterparty,n.commodity,n.side,n.status,`${n.deliveredVolume??0}/${n.contractedVolume??0}`])});}catch(e){i(e);}}),o.command("get").description("Get an offtake contract by id").argument("<id>","Contract ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(P,{id:t});if(!n.theContract)throw new m(`Contract ${t} not found`);s(e,n.theContract);}catch(n){i(n);}}),o.command("create").description("Create an offtake contract").requiredOption("--reference <r>","Contract reference").requiredOption("--counterparty <c>","Counterparty name").requiredOption("--commodity <c>","Commodity type").option("--side <s>","BUY|SELL (default SELL)").option("--pricing-basis <p>","FIXED|FORMULA|INDEX_LINKED|SPOT (default FIXED)").option("--price-per-unit <n>","Price per unit",c).option("--price-index <s>","Price index reference").option("--currency <s>","Currency code").option("--unit <u>","Unit (default BARRELS)").option("--contracted-volume <n>","Contracted volume",c).option("--delivery-location <s>","Delivery location").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={reference:t.reference,counterparty:t.counterparty,commodity:t.commodity.toUpperCase()};t.side&&(e.side=t.side.toUpperCase()),t.pricingBasis&&(e.pricingBasis=t.pricingBasis.toUpperCase()),t.pricePerUnit!==void 0&&(e.pricePerUnit=t.pricePerUnit),t.priceIndex&&(e.priceIndex=t.priceIndex),t.currency&&(e.currency=t.currency),t.unit&&(e.unit=t.unit.toUpperCase()),t.contractedVolume!==void 0&&(e.contractedVolume=t.contractedVolume),t.deliveryLocation&&(e.deliveryLocation=t.deliveryLocation),t.startDate&&(e.startDate=t.startDate),t.endDate&&(e.endDate=t.endDate),t.notes&&(e.notes=t.notes),t.tags&&(e.tags=t.tags.split(",").map(g=>g.trim()));let n=await a(N,{input:e});d(`Contract created: ${n.theCreateContract.reference}`),s(t,n.theCreateContract);}catch(e){i(e);}}),o.command("update").description("Update an offtake contract").argument("<id>","Contract ID").option("--counterparty <c>","Counterparty name").option("--pricing-basis <p>","FIXED|FORMULA|INDEX_LINKED|SPOT").option("--price-per-unit <n>","Price per unit",c).option("--price-index <s>","Price index reference").option("--currency <s>","Currency code").option("--unit <u>","Unit").option("--contracted-volume <n>","Contracted volume",c).option("--delivery-location <s>","Delivery location").option("--start-date <iso>","Start date (ISO)").option("--end-date <iso>","End date (ISO)").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n={};if(e.counterparty&&(n.counterparty=e.counterparty),e.pricingBasis&&(n.pricingBasis=e.pricingBasis.toUpperCase()),e.pricePerUnit!==void 0&&(n.pricePerUnit=e.pricePerUnit),e.priceIndex&&(n.priceIndex=e.priceIndex),e.currency&&(n.currency=e.currency),e.unit&&(n.unit=e.unit.toUpperCase()),e.contractedVolume!==void 0&&(n.contractedVolume=e.contractedVolume),e.deliveryLocation!==void 0&&(n.deliveryLocation=e.deliveryLocation),e.startDate&&(n.startDate=e.startDate),e.endDate&&(n.endDate=e.endDate),e.notes!==void 0&&(n.notes=e.notes),e.tags&&(n.tags=e.tags.split(",").map(T=>T.trim())),!Object.keys(n).length)throw new m("No updates specified");let g=await a(_,{id:t,input:n});d("Contract updated"),s(e,g.theUpdateContract);}catch(n){i(n);}}),o.command("transition").description("Advance an offtake contract through its lifecycle").argument("<id>","Contract ID").requiredOption("--status <s>","DRAFT|NEGOTIATION|SIGNED|ACTIVE|SUSPENDED|COMPLETED|TERMINATED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(U,{id:t,status:e.status.toUpperCase()});d(`Contract transitioned to ${n.theTransitionContract.status}`),s(e,n.theTransitionContract);}catch(n){i(n);}});}function rt(r){let o=r.command("shipments").description("Theglobalfuel shipments");o.command("list").description("List shipments").option("--contract <id>","Filter by contract ID").option("--status <s>","SCHEDULED|LOADING|IN_TRANSIT|DELIVERED|CANCELLED").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(q,{contractId:t.contract,status:t.status?t.status.toUpperCase():void 0});s(t,e.theListShipments,{headers:["ID","Reference","Contract","Status","Mode","Volume"],rows:e.theListShipments.map(n=>[p(n.id,12),n.reference,p(n.contractId,12),n.status,n.mode,`${n.volume} ${n.unit}`])});}catch(e){i(e);}}),o.command("schedule").description("Schedule a shipment against a contract").requiredOption("--contract <id>","Contract ID").requiredOption("--reference <r>","Shipment reference").requiredOption("--volume <n>","Volume",c).option("--mode <m>","PIPELINE|TANKER|RAIL|TRUCK|VESSEL_BULK|GRID (default PIPELINE)").option("--unit <u>","Unit (default BARRELS)").option("--carrier <s>","Carrier").option("--origin <s>","Origin").option("--destination <s>","Destination").option("--scheduled-at <iso>","Scheduled date (ISO)").option("--document-file <id>","Document file ID (bill of lading / certificate)").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={contractId:t.contract,reference:t.reference,volume:t.volume};t.mode&&(e.mode=t.mode.toUpperCase()),t.unit&&(e.unit=t.unit.toUpperCase()),t.carrier&&(e.carrier=t.carrier),t.origin&&(e.origin=t.origin),t.destination&&(e.destination=t.destination),t.scheduledAt&&(e.scheduledAt=t.scheduledAt),t.documentFile&&(e.documentFileId=t.documentFile),t.notes&&(e.notes=t.notes);let n=await a(F,{input:e});d(`Shipment scheduled: ${n.theScheduleShipment.reference}`),s(t,n.theScheduleShipment);}catch(e){i(e);}}),o.command("deliver").description("Mark a shipment delivered (rolls volume into the contract's delivered total)").argument("<id>","Shipment ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(V,{id:t});d(`Shipment delivered: ${n.theDeliverShipment.reference}`),s(e,n.theDeliverShipment);}catch(n){i(n);}});}function it(r){let o=r.command("inventory").description("Theglobalfuel inventory lots");o.command("list").description("List inventory lots").option("--commodity <c>","Filter by commodity type").option("--status <s>","AVAILABLE|RESERVED|IN_TRANSIT|CONSUMED|WRITTEN_OFF").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(M,{commodity:t.commodity?t.commodity.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0,pagination:f(t.limit,t.offset)});s(t,e.theListInventoryLots.items,{headers:["ID","Lot Code","Commodity","Status","Quantity","Unit Value"],rows:e.theListInventoryLots.items.map(n=>[p(n.id,12),n.lotCode,n.commodity,n.status,`${n.quantity} ${n.unit}`,String(n.unitValue??0)])});}catch(e){i(e);}}),o.command("create").description("Create an inventory lot").requiredOption("--lot-code <c>","Lot code").requiredOption("--commodity <c>","Commodity type").requiredOption("--quantity <n>","Quantity",c).option("--unit <u>","Unit (default BARRELS)").option("--unit-value <n>","Unit value",c).option("--currency <s>","Currency code").option("--grade <n>","Grade",c).option("--location <s>","Storage location").option("--asset <id>","Source asset ID").option("--produced-at <iso>","Produced date (ISO)").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={lotCode:t.lotCode,commodity:t.commodity.toUpperCase(),quantity:t.quantity};t.unit&&(e.unit=t.unit.toUpperCase()),t.unitValue!==void 0&&(e.unitValue=t.unitValue),t.currency&&(e.currency=t.currency),t.grade!==void 0&&(e.grade=t.grade),t.location&&(e.location=t.location),t.asset&&(e.assetId=t.asset),t.producedAt&&(e.producedAt=t.producedAt),t.notes&&(e.notes=t.notes);let n=await a(G,{input:e});d(`Inventory lot created: ${n.theCreateInventoryLot.lotCode}`),s(t,n.theCreateInventoryLot);}catch(e){i(e);}}),o.command("set-status").description("Set an inventory lot status").argument("<id>","Inventory lot ID").requiredOption("--status <s>","AVAILABLE|RESERVED|IN_TRANSIT|CONSUMED|WRITTEN_OFF").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(W,{id:t,status:e.status.toUpperCase()});d(`Inventory lot status set to ${n.theSetInventoryLotStatus.status}`),s(e,n.theSetInventoryLotStatus);}catch(n){i(n);}});}function st(r){let o=r.command("production").description("Theglobalfuel production records");o.command("list").description("List production records").option("--asset <id>","Filter by asset ID").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(B,{assetId:t.asset,pagination:f(t.limit,t.offset)});s(t,e.theListProductionRecords.items,{headers:["ID","Asset","Volume","Downtime (h)","Period Start","Period End"],rows:e.theListProductionRecords.items.map(n=>[p(n.id,12),p(n.assetId,12),`${n.volume} ${n.unit}`,String(n.downtimeHours??0),C(n.periodStart),C(n.periodEnd)])});}catch(e){i(e);}}),o.command("record").description("Record a production figure for an asset").requiredOption("--asset <id>","Asset ID").requiredOption("--volume <n>","Produced volume",c).requiredOption("--period-start <iso>","Period start (ISO)").requiredOption("--period-end <iso>","Period end (ISO)").option("--unit <u>","Unit (default BARRELS)").option("--grade <n>","Grade",c).option("--downtime-hours <n>","Downtime hours",c).option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={assetId:t.asset,volume:t.volume,periodStart:t.periodStart,periodEnd:t.periodEnd};t.unit&&(e.unit=t.unit.toUpperCase()),t.grade!==void 0&&(e.grade=t.grade),t.downtimeHours!==void 0&&(e.downtimeHours=t.downtimeHours),t.notes&&(e.notes=t.notes);let n=await a(H,{input:e});d(`Production recorded: ${n.theRecordProduction.volume} ${t.unit??""}`.trim()),s(t,n.theRecordProduction);}catch(e){i(e);}});}function at(r){let o=r.command("emissions").description("Theglobalfuel emission records");o.command("list").description("List emission records").option("--asset <id>","Filter by asset ID").option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3").option("--limit <n>","Page size",l,50).option("--offset <n>","Offset",l,0).option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(j,{assetId:t.asset,scope:t.scope?t.scope.toUpperCase():void 0,pagination:f(t.limit,t.offset)});s(t,e.theListEmissionRecords.items,{headers:["ID","Asset","Scope","CO2e (t)","Source","Verified"],rows:e.theListEmissionRecords.items.map(n=>[p(n.id,12),p(n.assetId??"-",12),n.scope,String(n.co2eTonnes),n.source??"-",n.verified?"yes":"no"])});}catch(e){i(e);}}),o.command("record").description("Record an emission figure").requiredOption("--co2e-tonnes <n>","CO2e tonnes",c).requiredOption("--period-start <iso>","Period start (ISO)").requiredOption("--period-end <iso>","Period end (ISO)").option("--asset <id>","Asset ID").option("--scope <s>","SCOPE_1|SCOPE_2|SCOPE_3 (default SCOPE_1)").option("--source <s>","Emission source").option("--methodology <s>","Methodology").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={co2eTonnes:t.co2eTonnes,periodStart:t.periodStart,periodEnd:t.periodEnd};t.asset&&(e.assetId=t.asset),t.scope&&(e.scope=t.scope.toUpperCase()),t.source&&(e.source=t.source),t.methodology&&(e.methodology=t.methodology),t.notes&&(e.notes=t.notes);let n=await a(Y,{input:e});d(`Emission recorded: ${n.theRecordEmission.co2eTonnes} tCO2e`),s(t,n.theRecordEmission);}catch(e){i(e);}}),o.command("verify").description("Mark an emission figure third-party verified").argument("<id>","Emission record ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(z,{id:t});d("Emission verified"),s(e,n.theVerifyEmission);}catch(n){i(n);}});}function ct(r){let o=r.command("reserves").description("Theglobalfuel reserve estimates");o.command("list").description("List reserve estimates").option("--asset <id>","Filter by asset ID").option("--category <c>","PROVED|PROBABLE|POSSIBLE|CONTINGENT|PROSPECTIVE").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(K,{assetId:t.asset,category:t.category?t.category.toUpperCase():void 0});s(t,e.theListReserveEstimates,{headers:["ID","Asset","Category","Recoverable","Factor","As Of"],rows:e.theListReserveEstimates.map(n=>[p(n.id,12),p(n.assetId,12),n.category,`${n.recoverable} ${n.unit}`,n.recoveryFactor!=null?String(n.recoveryFactor):"-",C(n.asOfDate)])});}catch(e){i(e);}}),o.command("create").description("Create a reserve estimate for an asset").requiredOption("--asset <id>","Asset ID").requiredOption("--recoverable <n>","Recoverable quantity",c).requiredOption("--as-of-date <iso>","As-of date (ISO)").option("--category <c>","PROVED|PROBABLE|POSSIBLE|CONTINGENT|PROSPECTIVE (default PROVED)").option("--recovery-factor <n>","Recovery factor",c).option("--unit <u>","Unit (default BARRELS)").option("--methodology <s>","Methodology").option("--notes <s>","Notes").option("-f, --format <format>","Output format").action(async t=>{try{let e={assetId:t.asset,recoverable:t.recoverable,asOfDate:t.asOfDate};t.category&&(e.category=t.category.toUpperCase()),t.recoveryFactor!==void 0&&(e.recoveryFactor=t.recoveryFactor),t.unit&&(e.unit=t.unit.toUpperCase()),t.methodology&&(e.methodology=t.methodology),t.notes&&(e.notes=t.notes);let n=await a(J,{input:e});d(`Reserve estimate created (${n.theCreateReserveEstimate.category})`),s(t,n.theCreateReserveEstimate);}catch(e){i(e);}});}function dt(r){let o=r.command("compliance").description("Theglobalfuel compliance certifications");o.command("list").description("List compliance certifications").option("--asset <id>","Filter by asset ID").option("--category <c>","EXTRACTION_LICENSE|ENVIRONMENTAL_PERMIT|EXPORT_LICENSE|SAFETY_AUDIT|EMISSIONS_REPORT|CARBON_CREDIT|CHAIN_OF_CUSTODY").option("--status <s>","PENDING|SUBMITTED|APPROVED|REJECTED|EXPIRED|REVOKED").option("-f, --format <format>","Output format").action(async t=>{try{let e=await a(Q,{assetId:t.asset,category:t.category?t.category.toUpperCase():void 0,status:t.status?t.status.toUpperCase():void 0});s(t,e.theListComplianceCerts,{headers:["ID","Title","Category","Status","Authority","Expires"],rows:e.theListComplianceCerts.map(n=>[p(n.id,12),n.title,n.category,n.status,n.authority??"-",C(n.expiresAt)])});}catch(e){i(e);}}),o.command("get").description("Get a compliance certification by id").argument("<id>","Compliance cert ID").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(X,{id:t});if(!n.theComplianceCert)throw new m(`Compliance cert ${t} not found`);s(e,n.theComplianceCert);}catch(n){i(n);}}),o.command("create").description("Create a compliance certification").requiredOption("--title <t>","Title").option("--category <c>","EXTRACTION_LICENSE|ENVIRONMENTAL_PERMIT|EXPORT_LICENSE|SAFETY_AUDIT|EMISSIONS_REPORT|CARBON_CREDIT|CHAIN_OF_CUSTODY (default ENVIRONMENTAL_PERMIT)").option("--asset <id>","Related asset ID").option("--authority <s>","Issuing authority").option("--cert-number <s>","Certificate number").option("--owner <id>","Owner user ID").option("--evidence-file <id>","Evidence file ID (certificate document)").option("--issued-at <iso>","Issued date (ISO)").option("--expires-at <iso>","Expiry date (ISO)").option("--notes <s>","Notes").option("--tags <csv>","Comma-separated tags").option("-f, --format <format>","Output format").action(async t=>{try{let e={title:t.title};t.category&&(e.category=t.category.toUpperCase()),t.asset&&(e.assetId=t.asset),t.authority&&(e.authority=t.authority),t.certNumber&&(e.certNumber=t.certNumber),t.owner&&(e.ownerId=t.owner),t.evidenceFile&&(e.evidenceFileId=t.evidenceFile),t.issuedAt&&(e.issuedAt=t.issuedAt),t.expiresAt&&(e.expiresAt=t.expiresAt),t.notes&&(e.notes=t.notes),t.tags&&(e.tags=t.tags.split(",").map(g=>g.trim()));let n=await a(Z,{input:e});d(`Compliance cert created: ${n.theCreateComplianceCert.title}`),s(t,n.theCreateComplianceCert);}catch(e){i(e);}}),o.command("transition").description("Advance a compliance certification through its lifecycle").argument("<id>","Compliance cert ID").requiredOption("--status <s>","PENDING|SUBMITTED|APPROVED|REJECTED|EXPIRED|REVOKED").option("-f, --format <format>","Output format").action(async(t,e)=>{try{let n=await a(tt,{id:t,status:e.status.toUpperCase()});d(`Compliance cert transitioned to ${n.theTransitionComplianceCert.status}`),s(e,n.theTransitionComplianceCert);}catch(n){i(n);}});}function ut(r){r.command("health").description("Theglobalfuel service health check (public)").option("-f, --format <format>","Output format").action(async o=>{try{let t=await w(et);d(t.theHealth),s(o,{health:t.theHealth});}catch(t){i(t);}});}var wt={id:"theglobalfuel",version:"1.0.0",displayName:"Theglobalfuel",dependsOn:["auth","workspaces"],register(r,o){R(o);let t=r.command("theglobalfuel").description("Theglobalfuel energy & commodities operations ledger");nt(t),ot(t),rt(t),it(t),st(t),at(t),ct(t),dt(t),ut(t);}},yn=wt;module.exports=yn;
|