@meshery/schemas 1.3.91 → 1.3.93

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.
Files changed (26) hide show
  1. package/dist/cloudApi.d.mts +71 -64
  2. package/dist/cloudApi.d.ts +71 -64
  3. package/dist/constructs/v1beta1/organization_smtp/OrganizationSmtp.d.ts +3 -3
  4. package/dist/constructs/v1beta1/organization_smtp/OrganizationSmtpSchema.js +1 -1
  5. package/dist/constructs/v1beta1/organization_smtp/OrganizationSmtpSchema.mjs +1 -1
  6. package/dist/constructs/v1beta1/registry/Registry.d.ts +9 -9
  7. package/dist/constructs/v1beta1/registry/RegistrySchema.js +3 -3
  8. package/dist/constructs/v1beta1/registry/RegistrySchema.mjs +3 -3
  9. package/dist/constructs/v1beta3/connection/Connection.d.ts +27 -27
  10. package/dist/constructs/v1beta3/connection/ConnectionSchema.js +3 -3
  11. package/dist/constructs/v1beta3/connection/ConnectionSchema.mjs +3 -3
  12. package/dist/constructs/v1beta3/environment/Environment.d.ts +29 -29
  13. package/dist/constructs/v1beta3/environment/EnvironmentSchema.js +1 -1
  14. package/dist/constructs/v1beta3/environment/EnvironmentSchema.mjs +1 -1
  15. package/dist/constructs/v1beta3/ledger/Ledger.d.ts +74 -35
  16. package/dist/constructs/v1beta3/ledger/LedgerSchema.js +20 -16
  17. package/dist/constructs/v1beta3/ledger/LedgerSchema.mjs +20 -16
  18. package/dist/constructs/v1beta3/profile/Profile.d.ts +3 -3
  19. package/dist/constructs/v1beta3/profile/ProfileSchema.js +1 -1
  20. package/dist/constructs/v1beta3/profile/ProfileSchema.mjs +1 -1
  21. package/dist/constructs/v1beta3/workspace/Workspace.d.ts +3 -3
  22. package/dist/constructs/v1beta3/workspace/WorkspaceSchema.js +1 -1
  23. package/dist/constructs/v1beta3/workspace/WorkspaceSchema.mjs +1 -1
  24. package/dist/mesheryApi.d.mts +44 -44
  25. package/dist/mesheryApi.d.ts +44 -44
  26. package/package.json +1 -1
@@ -19,7 +19,7 @@ export interface paths {
19
19
  put?: never;
20
20
  /**
21
21
  * Record a ledger entry
22
- * @description Records `entryKey` in the ledger. A new key creates the entry and returns `201`. An existing key never creates a second entry and is not changed: the stored entry is returned unchanged with `200`, and the supplied `value` is ignored. Recording never changes `claimedBy` or `claimedAt`.
22
+ * @description Records `entryKey` in the ledger. A new key creates the entry and returns `201`. An existing key never creates a second entry and is not changed: the stored entry is returned unchanged with `200`, and the supplied `value` is ignored. Recording never changes `claimedByConnectionId` or `claimedAt`.
23
23
  */
24
24
  post: operations["recordLedgerEntry"];
25
25
  delete?: never;
@@ -39,7 +39,7 @@ export interface paths {
39
39
  put?: never;
40
40
  /**
41
41
  * Claim a ledger key if absent
42
- * @description Atomically gives `entryKey` to `claimant`. When the key is not in the ledger, the entry is created already claimed and returned with `201`. When it is recorded but unclaimed, it is claimed and returned with `200`. When `claimant` already holds it, the call is a replay and returns the entry with `200`. When another claimant holds it, the call is refused with `409` and nothing changes. A claim is permanent: it ends only when the entry is deleted.
42
+ * @description Atomically gives `entryKey` to the connection `connectionId`, which must be the caller's own live connection in the session organization; any other connection is `404`. When the key is not in the ledger, the entry is created already claimed and returned with `201`. When it is recorded but unclaimed, it is claimed and returned with `200`. When `connectionId` already holds it, the call is a replay and returns the entry with `200`. When another live connection holds it, the call is refused with `409` and nothing changes. A claim ends when the entry is deleted or when the holding connection is deleted; a key whose holder was deleted can be claimed again.
43
43
  */
44
44
  post: operations["claimLedgerEntry"];
45
45
  delete?: never;
@@ -78,7 +78,7 @@ export interface components {
78
78
  schemas: {
79
79
  /**
80
80
  * Ledger Entry Schema
81
- * @description Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claimant, so two workers never both act on it. Any organization member may read, claim and delete entries; claimedBy is an advisory label, not an authorization principal.
81
+ * @description Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claiming connection, so two workers never both act on it. Any organization member may read and delete entries; a claim names the connection that holds it, which must be the caller's own live connection in the organization.
82
82
  */
83
83
  LedgerEntry: {
84
84
  /**
@@ -97,11 +97,14 @@ export interface components {
97
97
  entryKey: string;
98
98
  /** @description Entry value, stored as a JSON blob. */
99
99
  value?: Record<string, never>;
100
- /** @description Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. */
101
- claimedBy?: string;
100
+ /**
101
+ * Format: uuid
102
+ * @description ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.
103
+ */
104
+ claimedByConnectionId?: string;
102
105
  /**
103
106
  * Format: date-time
104
- * @description Time the entry was claimed, if any. Set only by claim-if-absent.
107
+ * @description Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.
105
108
  */
106
109
  claimedAt?: string | null;
107
110
  /**
@@ -141,11 +144,14 @@ export interface components {
141
144
  entryKey: string;
142
145
  /** @description Entry value, stored as a JSON blob. */
143
146
  value?: Record<string, never>;
144
- /** @description Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. */
145
- claimedBy?: string;
147
+ /**
148
+ * Format: uuid
149
+ * @description ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.
150
+ */
151
+ claimedByConnectionId?: string;
146
152
  /**
147
153
  * Format: date-time
148
- * @description Time the entry was claimed, if any. Set only by claim-if-absent.
154
+ * @description Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.
149
155
  */
150
156
  claimedAt?: string | null;
151
157
  /**
@@ -167,12 +173,15 @@ export interface components {
167
173
  /** @description Entry value, stored as a JSON object. */
168
174
  value?: Record<string, never>;
169
175
  };
170
- /** @description Claim-if-absent payload giving a key to one claimant. */
176
+ /** @description Claim-if-absent payload giving a key to one connection. */
171
177
  LedgerClaimPayload: {
172
178
  /** @description Key to claim. */
173
179
  entryKey: string;
174
- /** @description Advisory label naming the worker taking the key, for example a worker name. It is not bound to the caller. */
175
- claimant: string;
180
+ /**
181
+ * Format: uuid
182
+ * @description ID of the connection taking the key: the caller's own live connection in the session organization (for example the connection a desktop client registered for its machine).
183
+ */
184
+ connectionId: string;
176
185
  /** @description Value stored when the claim creates the entry; ignored when the entry already exists. */
177
186
  value?: Record<string, never>;
178
187
  };
@@ -205,7 +214,7 @@ export interface components {
205
214
  "text/plain": string;
206
215
  };
207
216
  };
208
- /** @description Conflict - another claimant holds the ledger entry */
217
+ /** @description Conflict - another connection holds the ledger entry */
209
218
  409: {
210
219
  headers: {
211
220
  [name: string]: unknown;
@@ -296,11 +305,14 @@ export interface operations {
296
305
  entryKey: string;
297
306
  /** @description Entry value, stored as a JSON blob. */
298
307
  value?: Record<string, never>;
299
- /** @description Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. */
300
- claimedBy?: string;
308
+ /**
309
+ * Format: uuid
310
+ * @description ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.
311
+ */
312
+ claimedByConnectionId?: string;
301
313
  /**
302
314
  * Format: date-time
303
- * @description Time the entry was claimed, if any. Set only by claim-if-absent.
315
+ * @description Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.
304
316
  */
305
317
  claimedAt?: string | null;
306
318
  /**
@@ -399,11 +411,14 @@ export interface operations {
399
411
  entryKey: string;
400
412
  /** @description Entry value, stored as a JSON blob. */
401
413
  value?: Record<string, never>;
402
- /** @description Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. */
403
- claimedBy?: string;
414
+ /**
415
+ * Format: uuid
416
+ * @description ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.
417
+ */
418
+ claimedByConnectionId?: string;
404
419
  /**
405
420
  * Format: date-time
406
- * @description Time the entry was claimed, if any. Set only by claim-if-absent.
421
+ * @description Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.
407
422
  */
408
423
  claimedAt?: string | null;
409
424
  /**
@@ -442,11 +457,14 @@ export interface operations {
442
457
  entryKey: string;
443
458
  /** @description Entry value, stored as a JSON blob. */
444
459
  value?: Record<string, never>;
445
- /** @description Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. */
446
- claimedBy?: string;
460
+ /**
461
+ * Format: uuid
462
+ * @description ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.
463
+ */
464
+ claimedByConnectionId?: string;
447
465
  /**
448
466
  * Format: date-time
449
- * @description Time the entry was claimed, if any. Set only by claim-if-absent.
467
+ * @description Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.
450
468
  */
451
469
  claimedAt?: string | null;
452
470
  /**
@@ -506,15 +524,18 @@ export interface operations {
506
524
  "application/json": {
507
525
  /** @description Key to claim. */
508
526
  entryKey: string;
509
- /** @description Advisory label naming the worker taking the key, for example a worker name. It is not bound to the caller. */
510
- claimant: string;
527
+ /**
528
+ * Format: uuid
529
+ * @description ID of the connection taking the key: the caller's own live connection in the session organization (for example the connection a desktop client registered for its machine).
530
+ */
531
+ connectionId: string;
511
532
  /** @description Value stored when the claim creates the entry; ignored when the entry already exists. */
512
533
  value?: Record<string, never>;
513
534
  };
514
535
  };
515
536
  };
516
537
  responses: {
517
- /** @description The caller's claimant now holds the existing entry */
538
+ /** @description The caller's connection now holds the existing entry */
518
539
  200: {
519
540
  headers: {
520
541
  [name: string]: unknown;
@@ -537,11 +558,14 @@ export interface operations {
537
558
  entryKey: string;
538
559
  /** @description Entry value, stored as a JSON blob. */
539
560
  value?: Record<string, never>;
540
- /** @description Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. */
541
- claimedBy?: string;
561
+ /**
562
+ * Format: uuid
563
+ * @description ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.
564
+ */
565
+ claimedByConnectionId?: string;
542
566
  /**
543
567
  * Format: date-time
544
- * @description Time the entry was claimed, if any. Set only by claim-if-absent.
568
+ * @description Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.
545
569
  */
546
570
  claimedAt?: string | null;
547
571
  /**
@@ -580,11 +604,14 @@ export interface operations {
580
604
  entryKey: string;
581
605
  /** @description Entry value, stored as a JSON blob. */
582
606
  value?: Record<string, never>;
583
- /** @description Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. */
584
- claimedBy?: string;
607
+ /**
608
+ * Format: uuid
609
+ * @description ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.
610
+ */
611
+ claimedByConnectionId?: string;
585
612
  /**
586
613
  * Format: date-time
587
- * @description Time the entry was claimed, if any. Set only by claim-if-absent.
614
+ * @description Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.
588
615
  */
589
616
  claimedAt?: string | null;
590
617
  /**
@@ -618,7 +645,16 @@ export interface operations {
618
645
  "text/plain": string;
619
646
  };
620
647
  };
621
- /** @description Conflict - another claimant holds the ledger entry */
648
+ /** @description Result not found */
649
+ 404: {
650
+ headers: {
651
+ [name: string]: unknown;
652
+ };
653
+ content: {
654
+ "text/plain": string;
655
+ };
656
+ };
657
+ /** @description Conflict - another connection holds the ledger entry */
622
658
  409: {
623
659
  headers: {
624
660
  [name: string]: unknown;
@@ -675,11 +711,14 @@ export interface operations {
675
711
  entryKey: string;
676
712
  /** @description Entry value, stored as a JSON blob. */
677
713
  value?: Record<string, never>;
678
- /** @description Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. */
679
- claimedBy?: string;
714
+ /**
715
+ * Format: uuid
716
+ * @description ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.
717
+ */
718
+ claimedByConnectionId?: string;
680
719
  /**
681
720
  * Format: date-time
682
- * @description Time the entry was claimed, if any. Set only by claim-if-absent.
721
+ * @description Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.
683
722
  */
684
723
  claimedAt?: string | null;
685
724
  /**
@@ -2,23 +2,27 @@
2
2
  entries that several workers share, so work done once (a record processed,
3
3
  a contact reached) is never done twice. Recording is idempotent on
4
4
  (ledger, entryKey), and claim-if-absent hands a key to exactly one
5
- claimant atomically. Ledgers belong to the organization of the
5
+ claiming connection atomically. Ledgers belong to the organization of the
6
6
  authenticated session; any client-supplied organization is ignored.
7
7
 
8
8
  Authorization: ledgers are organization-shared bookkeeping. Any member of
9
9
  the organization may record, claim, list, read and delete entries in that
10
- organization's ledgers. \`claimant\` is an advisory worker label, not an
11
- authorization principal: it is not bound to the caller, and a claim or
12
- delete never checks who holds the key. A key is scoped to (organization,
13
- ledger), so an entry in another ledger is \`404\`.
14
- `,version:"v1beta3",contact:{name:"Meshery Maintainers",email:"maintainers@meshery.io",url:"https://meshery.io"},license:{name:"Apache 2.0",url:"https://www.apache.org/licenses/LICENSE-2.0.html"}},security:[{jwt:[]}],tags:[{name:"ledgers",description:"Operations related to organization ledgers and their entries."}],paths:{"/api/ledgers/{ledger}/entries":{get:{"x-internal":["cloud"],tags:["ledgers"],summary:"List ledger entries",operationId:"listLedgerEntries",description:"Returns a paginated list of the entries in the ledger, in the organization of the authenticated session. `search` matches entry keys that contain the term, ignoring case. `order` sorts by `entryKey`, `createdAt` or `updatedAt` (`asc` or `desc`); the default is `entryKey asc`. A ledger with no entries returns an empty page, and a caller who is not a member of the session organization gets `404`.\n",parameters:[{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}},{name:"page",in:"query",description:"Get responses by page",schema:{type:"integer",minimum:0}},{name:"pageSize",in:"query",description:"Number of responses to return per page. Canonical camelCase pagination parameter; prefer this over the deprecated all-lowercase `pagesize`.",schema:{type:"integer",minimum:1}},{name:"search",in:"query",description:"Get responses that match search param value",schema:{type:"string"}},{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}}],responses:{200:{description:"Ledger entries page",content:{"application/json":{schema:{type:"object",description:"Paginated collection of ledger entries.",required:["page","pageSize","totalCount","ledgerEntries"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0},pageSize:{type:"integer",description:"Number of items per page.",minimum:1},totalCount:{type:"integer",description:"Total number of items available.",minimum:0},ledgerEntries:{type:"array",items:{"x-go-type":"LedgerEntry",$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claimant, so two workers never both act on it. Any organization member may read, claim and delete entries; claimedBy is an advisory label, not an authorization principal.
15
- `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedBy:{type:"string",description:"Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards.",maxLength:255,"x-oapi-codegen-extra-tags":{db:"claimed_by"},"x-order":6},claimedAt:{type:"string",format:"date-time",description:"Time the entry was claimed, if any. Set only by claim-if-absent.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}},description:"Ledger entries included on this page of results."}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}},post:{"x-internal":["cloud"],tags:["ledgers"],summary:"Record a ledger entry",operationId:"recordLedgerEntry",description:"Records `entryKey` in the ledger. A new key creates the entry and returns `201`. An existing key never creates a second entry and is not changed: the stored entry is returned unchanged with `200`, and the supplied `value` is ignored. Recording never changes `claimedBy` or `claimedAt`.\n",parameters:[{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:`Payload for recording a ledger entry. The ledger comes from the path and the organization from the session; claim fields and timestamps are server-owned.
16
- `,required:["entryKey"],properties:{entryKey:{type:"string",description:"Key within the ledger.",minLength:1,maxLength:1024,"x-go-name":"EntryKey"},value:{type:"object",description:"Entry value, stored as a JSON object.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true}}}}}},responses:{200:{description:"The key was already recorded; the stored entry, unchanged",content:{"application/json":{schema:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claimant, so two workers never both act on it. Any organization member may read, claim and delete entries; claimedBy is an advisory label, not an authorization principal.
17
- `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedBy:{type:"string",description:"Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards.",maxLength:255,"x-oapi-codegen-extra-tags":{db:"claimed_by"},"x-order":6},claimedAt:{type:"string",format:"date-time",description:"Time the entry was claimed, if any. Set only by claim-if-absent.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}}}}},201:{description:"The key was recorded",content:{"application/json":{schema:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claimant, so two workers never both act on it. Any organization member may read, claim and delete entries; claimedBy is an advisory label, not an authorization principal.
18
- `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedBy:{type:"string",description:"Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards.",maxLength:255,"x-oapi-codegen-extra-tags":{db:"claimed_by"},"x-order":6},claimedAt:{type:"string",format:"date-time",description:"Time the entry was claimed, if any. Set only by claim-if-absent.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/ledgers/{ledger}/claims":{post:{"x-internal":["cloud"],tags:["ledgers"],summary:"Claim a ledger key if absent",operationId:"claimLedgerEntry",description:"Atomically gives `entryKey` to `claimant`. When the key is not in the ledger, the entry is created already claimed and returned with `201`. When it is recorded but unclaimed, it is claimed and returned with `200`. When `claimant` already holds it, the call is a replay and returns the entry with `200`. When another claimant holds it, the call is refused with `409` and nothing changes. A claim is permanent: it ends only when the entry is deleted.\n",parameters:[{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Claim-if-absent payload giving a key to one claimant.",required:["entryKey","claimant"],properties:{entryKey:{type:"string",description:"Key to claim.",minLength:1,maxLength:1024,"x-go-name":"EntryKey"},claimant:{type:"string",description:"Advisory label naming the worker taking the key, for example a worker name. It is not bound to the caller.",minLength:1,maxLength:255},value:{type:"object",description:"Value stored when the claim creates the entry; ignored when the entry already exists.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true}}}}}},responses:{200:{description:"The caller's claimant now holds the existing entry",content:{"application/json":{schema:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claimant, so two workers never both act on it. Any organization member may read, claim and delete entries; claimedBy is an advisory label, not an authorization principal.
19
- `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedBy:{type:"string",description:"Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards.",maxLength:255,"x-oapi-codegen-extra-tags":{db:"claimed_by"},"x-order":6},claimedAt:{type:"string",format:"date-time",description:"Time the entry was claimed, if any. Set only by claim-if-absent.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}}}}},201:{description:"The key was absent; it was recorded and claimed",content:{"application/json":{schema:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claimant, so two workers never both act on it. Any organization member may read, claim and delete entries; claimedBy is an advisory label, not an authorization principal.
20
- `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedBy:{type:"string",description:"Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards.",maxLength:255,"x-oapi-codegen-extra-tags":{db:"claimed_by"},"x-order":6},claimedAt:{type:"string",format:"date-time",description:"Time the entry was claimed, if any. Set only by claim-if-absent.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},409:{description:"Conflict - another claimant holds the ledger entry",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/ledgers/{ledger}/entries/{entryKey}":{get:{"x-internal":["cloud"],tags:["ledgers"],summary:"Get a ledger entry",operationId:"getLedgerEntry",description:"Returns the entry recorded under `entryKey` in the ledger, or `404` when the key is not in this ledger.",parameters:[{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}},{name:"entryKey",in:"path",description:"Key within the ledger. URL-encode keys that contain reserved characters such as `/`.",required:true,schema:{type:"string",minLength:1,maxLength:1024,not:{enum:[".",".."]}}}],responses:{200:{description:"Ledger entry",content:{"application/json":{schema:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claimant, so two workers never both act on it. Any organization member may read, claim and delete entries; claimedBy is an advisory label, not an authorization principal.
21
- `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedBy:{type:"string",description:"Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards.",maxLength:255,"x-oapi-codegen-extra-tags":{db:"claimed_by"},"x-order":6},claimedAt:{type:"string",format:"date-time",description:"Time the entry was claimed, if any. Set only by claim-if-absent.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}},delete:{"x-internal":["cloud"],tags:["ledgers"],summary:"Delete a ledger entry",operationId:"deleteLedgerEntry",description:"Removes the entry, and with it any claim, so its key can be recorded or claimed again. Returns `404` when the key is not in this ledger.",parameters:[{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}},{name:"entryKey",in:"path",description:"Key within the ledger. URL-encode keys that contain reserved characters such as `/`.",required:true,schema:{type:"string",minLength:1,maxLength:1024,not:{enum:[".",".."]}}}],responses:{204:{description:"Ledger entry deleted"},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}}},components:{securitySchemes:{jwt:{type:"http",scheme:"bearer",bearerFormat:"JWT"}},responses:{400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},409:{description:"Conflict - another claimant holds the ledger entry",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}},parameters:{page:{name:"page",in:"query",description:"Get responses by page",schema:{type:"integer",minimum:0}},pageSize:{name:"pageSize",in:"query",description:"Number of responses to return per page. Canonical camelCase pagination parameter; prefer this over the deprecated all-lowercase `pagesize`.",schema:{type:"integer",minimum:1}},search:{name:"search",in:"query",description:"Get responses that match search param value",schema:{type:"string"}},order:{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}},ledger:{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}},entryKey:{name:"entryKey",in:"path",description:"Key within the ledger. URL-encode keys that contain reserved characters such as `/`.",required:true,schema:{type:"string",minLength:1,maxLength:1024,not:{enum:[".",".."]}}}},schemas:{LedgerEntry:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claimant, so two workers never both act on it. Any organization member may read, claim and delete entries; claimedBy is an advisory label, not an authorization principal.
22
- `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedBy:{type:"string",description:"Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards.",maxLength:255,"x-oapi-codegen-extra-tags":{db:"claimed_by"},"x-order":6},claimedAt:{type:"string",format:"date-time",description:"Time the entry was claimed, if any. Set only by claim-if-absent.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}},LedgerEntryPage:{type:"object",description:"Paginated collection of ledger entries.",required:["page","pageSize","totalCount","ledgerEntries"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0},pageSize:{type:"integer",description:"Number of items per page.",minimum:1},totalCount:{type:"integer",description:"Total number of items available.",minimum:0},ledgerEntries:{type:"array",items:{"x-go-type":"LedgerEntry",$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claimant, so two workers never both act on it. Any organization member may read, claim and delete entries; claimedBy is an advisory label, not an authorization principal.
23
- `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedBy:{type:"string",description:"Claimant that holds the entry, if any. Set only by claim-if-absent and never changed afterwards.",maxLength:255,"x-oapi-codegen-extra-tags":{db:"claimed_by"},"x-order":6},claimedAt:{type:"string",format:"date-time",description:"Time the entry was claimed, if any. Set only by claim-if-absent.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}},description:"Ledger entries included on this page of results."}}},LedgerEntryPayload:{type:"object",description:`Payload for recording a ledger entry. The ledger comes from the path and the organization from the session; claim fields and timestamps are server-owned.
24
- `,required:["entryKey"],properties:{entryKey:{type:"string",description:"Key within the ledger.",minLength:1,maxLength:1024,"x-go-name":"EntryKey"},value:{type:"object",description:"Entry value, stored as a JSON object.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true}}},LedgerClaimPayload:{type:"object",description:"Claim-if-absent payload giving a key to one claimant.",required:["entryKey","claimant"],properties:{entryKey:{type:"string",description:"Key to claim.",minLength:1,maxLength:1024,"x-go-name":"EntryKey"},claimant:{type:"string",description:"Advisory label naming the worker taking the key, for example a worker name. It is not bound to the caller.",minLength:1,maxLength:255},value:{type:"object",description:"Value stored when the claim creates the entry; ignored when the entry already exists.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true}}}}}},t=e;module.exports=t;
10
+ organization's ledgers. A claim names the connection that takes the key
11
+ (\`connectionId\`), which must be the caller's own live connection in the
12
+ session organization; any other connection, including one that does not
13
+ exist, is \`404\`, the same answer as a missing ledger. A delete never
14
+ checks who holds the key. A key is scoped to (organization, ledger), so an
15
+ entry in another ledger is \`404\`.
16
+ `,version:"v1beta3",contact:{name:"Meshery Maintainers",email:"maintainers@meshery.io",url:"https://meshery.io"},license:{name:"Apache 2.0",url:"https://www.apache.org/licenses/LICENSE-2.0.html"}},security:[{jwt:[]}],tags:[{name:"ledgers",description:"Operations related to organization ledgers and their entries."}],paths:{"/api/ledgers/{ledger}/entries":{get:{"x-internal":["cloud"],tags:["ledgers"],summary:"List ledger entries",operationId:"listLedgerEntries",description:"Returns a paginated list of the entries in the ledger, in the organization of the authenticated session. `search` matches entry keys that contain the term, ignoring case. `order` sorts by `entryKey`, `createdAt` or `updatedAt` (`asc` or `desc`); the default is `entryKey asc`. A ledger with no entries returns an empty page, and a caller who is not a member of the session organization gets `404`.\n",parameters:[{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}},{name:"page",in:"query",description:"Get responses by page",schema:{type:"integer",minimum:0}},{name:"pageSize",in:"query",description:"Number of responses to return per page. Canonical camelCase pagination parameter; prefer this over the deprecated all-lowercase `pagesize`.",schema:{type:"integer",minimum:1}},{name:"search",in:"query",description:"Get responses that match search param value",schema:{type:"string"}},{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}}],responses:{200:{description:"Ledger entries page",content:{"application/json":{schema:{type:"object",description:"Paginated collection of ledger entries.",required:["page","pageSize","totalCount","ledgerEntries"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0},pageSize:{type:"integer",description:"Number of items per page.",minimum:1},totalCount:{type:"integer",description:"Total number of items available.",minimum:0},ledgerEntries:{type:"array",items:{"x-go-type":"LedgerEntry",$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claiming connection, so two workers never both act on it. Any organization member may read and delete entries; a claim names the connection that holds it, which must be the caller's own live connection in the organization.
17
+ `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedByConnectionId:{description:"ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.\n","x-go-name":"ClaimedByConnectionID","x-oapi-codegen-extra-tags":{db:"claimed_by_connection_id",json:"claimedByConnectionId,omitempty"},"x-order":6,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},claimedAt:{type:"string",format:"date-time",description:"Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}},description:"Ledger entries included on this page of results."}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}},post:{"x-internal":["cloud"],tags:["ledgers"],summary:"Record a ledger entry",operationId:"recordLedgerEntry",description:"Records `entryKey` in the ledger. A new key creates the entry and returns `201`. An existing key never creates a second entry and is not changed: the stored entry is returned unchanged with `200`, and the supplied `value` is ignored. Recording never changes `claimedByConnectionId` or `claimedAt`.\n",parameters:[{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:`Payload for recording a ledger entry. The ledger comes from the path and the organization from the session; claim fields and timestamps are server-owned.
18
+ `,required:["entryKey"],properties:{entryKey:{type:"string",description:"Key within the ledger.",minLength:1,maxLength:1024,"x-go-name":"EntryKey"},value:{type:"object",description:"Entry value, stored as a JSON object.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true}}}}}},responses:{200:{description:"The key was already recorded; the stored entry, unchanged",content:{"application/json":{schema:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claiming connection, so two workers never both act on it. Any organization member may read and delete entries; a claim names the connection that holds it, which must be the caller's own live connection in the organization.
19
+ `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedByConnectionId:{description:"ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.\n","x-go-name":"ClaimedByConnectionID","x-oapi-codegen-extra-tags":{db:"claimed_by_connection_id",json:"claimedByConnectionId,omitempty"},"x-order":6,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},claimedAt:{type:"string",format:"date-time",description:"Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}}}}},201:{description:"The key was recorded",content:{"application/json":{schema:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claiming connection, so two workers never both act on it. Any organization member may read and delete entries; a claim names the connection that holds it, which must be the caller's own live connection in the organization.
20
+ `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedByConnectionId:{description:"ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.\n","x-go-name":"ClaimedByConnectionID","x-oapi-codegen-extra-tags":{db:"claimed_by_connection_id",json:"claimedByConnectionId,omitempty"},"x-order":6,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},claimedAt:{type:"string",format:"date-time",description:"Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/ledgers/{ledger}/claims":{post:{"x-internal":["cloud"],tags:["ledgers"],summary:"Claim a ledger key if absent",operationId:"claimLedgerEntry",description:"Atomically gives `entryKey` to the connection `connectionId`, which must be the caller's own live connection in the session organization; any other connection is `404`. When the key is not in the ledger, the entry is created already claimed and returned with `201`. When it is recorded but unclaimed, it is claimed and returned with `200`. When `connectionId` already holds it, the call is a replay and returns the entry with `200`. When another live connection holds it, the call is refused with `409` and nothing changes. A claim ends when the entry is deleted or when the holding connection is deleted; a key whose holder was deleted can be claimed again.\n",parameters:[{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}}],requestBody:{required:true,content:{"application/json":{schema:{type:"object",description:"Claim-if-absent payload giving a key to one connection.",required:["entryKey","connectionId"],properties:{entryKey:{type:"string",description:"Key to claim.",minLength:1,maxLength:1024,"x-go-name":"EntryKey"},connectionId:{description:`ID of the connection taking the key: the caller's own live connection in the session organization (for example the connection a desktop client registered for its machine).
21
+ `,"x-go-name":"ConnectionID","x-go-type-skip-optional-pointer":true,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},value:{type:"object",description:"Value stored when the claim creates the entry; ignored when the entry already exists.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true}}}}}},responses:{200:{description:"The caller's connection now holds the existing entry",content:{"application/json":{schema:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claiming connection, so two workers never both act on it. Any organization member may read and delete entries; a claim names the connection that holds it, which must be the caller's own live connection in the organization.
22
+ `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedByConnectionId:{description:"ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.\n","x-go-name":"ClaimedByConnectionID","x-oapi-codegen-extra-tags":{db:"claimed_by_connection_id",json:"claimedByConnectionId,omitempty"},"x-order":6,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},claimedAt:{type:"string",format:"date-time",description:"Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}}}}},201:{description:"The key was absent; it was recorded and claimed",content:{"application/json":{schema:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claiming connection, so two workers never both act on it. Any organization member may read and delete entries; a claim names the connection that holds it, which must be the caller's own live connection in the organization.
23
+ `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedByConnectionId:{description:"ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.\n","x-go-name":"ClaimedByConnectionID","x-oapi-codegen-extra-tags":{db:"claimed_by_connection_id",json:"claimedByConnectionId,omitempty"},"x-order":6,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},claimedAt:{type:"string",format:"date-time",description:"Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}}}}},400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},409:{description:"Conflict - another connection holds the ledger entry",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}},"/api/ledgers/{ledger}/entries/{entryKey}":{get:{"x-internal":["cloud"],tags:["ledgers"],summary:"Get a ledger entry",operationId:"getLedgerEntry",description:"Returns the entry recorded under `entryKey` in the ledger, or `404` when the key is not in this ledger.",parameters:[{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}},{name:"entryKey",in:"path",description:"Key within the ledger. URL-encode keys that contain reserved characters such as `/`.",required:true,schema:{type:"string",minLength:1,maxLength:1024,not:{enum:[".",".."]}}}],responses:{200:{description:"Ledger entry",content:{"application/json":{schema:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claiming connection, so two workers never both act on it. Any organization member may read and delete entries; a claim names the connection that holds it, which must be the caller's own live connection in the organization.
24
+ `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedByConnectionId:{description:"ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.\n","x-go-name":"ClaimedByConnectionID","x-oapi-codegen-extra-tags":{db:"claimed_by_connection_id",json:"claimedByConnectionId,omitempty"},"x-order":6,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},claimedAt:{type:"string",format:"date-time",description:"Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}},delete:{"x-internal":["cloud"],tags:["ledgers"],summary:"Delete a ledger entry",operationId:"deleteLedgerEntry",description:"Removes the entry, and with it any claim, so its key can be recorded or claimed again. Returns `404` when the key is not in this ledger.",parameters:[{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}},{name:"entryKey",in:"path",description:"Key within the ledger. URL-encode keys that contain reserved characters such as `/`.",required:true,schema:{type:"string",minLength:1,maxLength:1024,not:{enum:[".",".."]}}}],responses:{204:{description:"Ledger entry deleted"},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}}}}},components:{securitySchemes:{jwt:{type:"http",scheme:"bearer",bearerFormat:"JWT"}},responses:{400:{description:"Invalid request body or request param",content:{"text/plain":{schema:{type:"string"}}}},401:{description:"Expired JWT token used or insufficient privilege",content:{"text/plain":{schema:{type:"string"}}}},404:{description:"Result not found",content:{"text/plain":{schema:{type:"string"}}}},409:{description:"Conflict - another connection holds the ledger entry",content:{"text/plain":{schema:{type:"string"}}}},500:{description:"Internal server error",content:{"text/plain":{schema:{type:"string"}}}}},parameters:{page:{name:"page",in:"query",description:"Get responses by page",schema:{type:"integer",minimum:0}},pageSize:{name:"pageSize",in:"query",description:"Number of responses to return per page. Canonical camelCase pagination parameter; prefer this over the deprecated all-lowercase `pagesize`.",schema:{type:"integer",minimum:1}},search:{name:"search",in:"query",description:"Get responses that match search param value",schema:{type:"string"}},order:{name:"order",in:"query",description:"Get ordered responses",schema:{type:"string"}},ledger:{name:"ledger",in:"path",description:"Name of the ledger, for example `processed-profiles`.",required:true,schema:{type:"string",pattern:"^[a-z0-9][a-z0-9._-]*$",minLength:1,maxLength:255}},entryKey:{name:"entryKey",in:"path",description:"Key within the ledger. URL-encode keys that contain reserved characters such as `/`.",required:true,schema:{type:"string",minLength:1,maxLength:1024,not:{enum:[".",".."]}}}},schemas:{LedgerEntry:{$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claiming connection, so two workers never both act on it. Any organization member may read and delete entries; a claim names the connection that holds it, which must be the caller's own live connection in the organization.
25
+ `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedByConnectionId:{description:"ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.\n","x-go-name":"ClaimedByConnectionID","x-oapi-codegen-extra-tags":{db:"claimed_by_connection_id",json:"claimedByConnectionId,omitempty"},"x-order":6,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},claimedAt:{type:"string",format:"date-time",description:"Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}},LedgerEntryPage:{type:"object",description:"Paginated collection of ledger entries.",required:["page","pageSize","totalCount","ledgerEntries"],properties:{page:{type:"integer",description:"Current page number of the result set.",minimum:0},pageSize:{type:"integer",description:"Number of items per page.",minimum:1},totalCount:{type:"integer",description:"Total number of items available.",minimum:0},ledgerEntries:{type:"array",items:{"x-go-type":"LedgerEntry",$schema:"http://json-schema.org/draft-07/schema#",title:"Ledger Entry Schema",description:`Server-returned ledger entry. An organization keeps any number of named ledgers, each an idempotent set keyed by entryKey: recording an existing key never creates a second entry and returns the stored entry unchanged, and claim-if-absent gives a key to exactly one claiming connection, so two workers never both act on it. Any organization member may read and delete entries; a claim names the connection that holds it, which must be the caller's own live connection in the organization.
26
+ `,type:"object",additionalProperties:false,required:["id","organizationId","ledger","entryKey","createdAt","updatedAt"],properties:{id:{description:"Server-generated ledger entry ID.","x-order":1,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},organizationId:{description:"Owning organization ID. Derived from the authenticated session, never client-settable.","x-go-name":"OrganizationID","x-oapi-codegen-extra-tags":{db:"organization_id"},"x-order":2,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},ledger:{type:"string",description:"Name of the ledger (the idempotent set) the entry belongs to.",minLength:1,maxLength:255,"x-oapi-codegen-extra-tags":{db:"ledger"},"x-order":3},entryKey:{type:"string",description:"Key within the ledger. Unique per (organization, ledger).",minLength:1,maxLength:1024,"x-go-name":"EntryKey","x-oapi-codegen-extra-tags":{db:"entry_key"},"x-order":4},value:{type:"object",description:"Entry value, stored as a JSON blob.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true,"x-oapi-codegen-extra-tags":{db:"value"},"x-order":5},claimedByConnectionId:{description:"ID of the connection that holds the entry, if any. Set only by claim-if-absent and never changed afterwards. References a connection (`connections.id`); a claim held by a connection that is later deleted is released, so the key may be claimed again. Omitted when the entry is unclaimed.\n","x-go-name":"ClaimedByConnectionID","x-oapi-codegen-extra-tags":{db:"claimed_by_connection_id",json:"claimedByConnectionId,omitempty"},"x-order":6,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},claimedAt:{type:"string",format:"date-time",description:"Time the current or most recent claim was taken. Set only by claim-if-absent; null when the entry was never claimed. An entry whose claimedByConnectionId is omitted is unclaimed whatever this holds.",nullable:true,"x-go-type":"core.NullTime","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-oapi-codegen-extra-tags":{db:"claimed_at"},"x-order":7},createdAt:{description:"Timestamp of ledger entry creation.","x-oapi-codegen-extra-tags":{db:"created_at"},"x-order":8,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true},updatedAt:{description:"Timestamp of last ledger entry modification.","x-oapi-codegen-extra-tags":{db:"updated_at"},"x-order":9,type:"string",format:"date-time","x-go-type-skip-optional-pointer":true}}},description:"Ledger entries included on this page of results."}}},LedgerEntryPayload:{type:"object",description:`Payload for recording a ledger entry. The ledger comes from the path and the organization from the session; claim fields and timestamps are server-owned.
27
+ `,required:["entryKey"],properties:{entryKey:{type:"string",description:"Key within the ledger.",minLength:1,maxLength:1024,"x-go-name":"EntryKey"},value:{type:"object",description:"Entry value, stored as a JSON object.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true}}},LedgerClaimPayload:{type:"object",description:"Claim-if-absent payload giving a key to one connection.",required:["entryKey","connectionId"],properties:{entryKey:{type:"string",description:"Key to claim.",minLength:1,maxLength:1024,"x-go-name":"EntryKey"},connectionId:{description:`ID of the connection taking the key: the caller's own live connection in the session organization (for example the connection a desktop client registered for its machine).
28
+ `,"x-go-name":"ConnectionID","x-go-type-skip-optional-pointer":true,type:"string",format:"uuid","x-go-type":"uuid.UUID","x-go-type-import":{path:"github.com/gofrs/uuid"}},value:{type:"object",description:"Value stored when the claim creates the entry; ignored when the entry already exists.","x-go-type":"core.Map","x-go-type-import":{path:"github.com/meshery/schemas/models/core",name:"core"},"x-go-type-skip-optional-pointer":true}}}}}},t=e;module.exports=t;