@meshery/schemas 1.3.84 → 1.3.85

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 (24) hide show
  1. package/dist/cloudApi.d.mts +10373 -13085
  2. package/dist/cloudApi.d.ts +10373 -13085
  3. package/dist/cloudApi.js +1 -1
  4. package/dist/cloudApi.mjs +1 -1
  5. package/dist/constructs/v1beta3/content_piece/ContentPiece.d.ts +2 -1
  6. package/dist/constructs/v1beta3/content_piece/ContentPieceSchema.js +1 -1
  7. package/dist/constructs/v1beta3/content_piece/ContentPieceSchema.mjs +1 -1
  8. package/dist/constructs/v1beta3/ledger/Ledger.d.ts +609 -0
  9. package/dist/constructs/v1beta3/ledger/LedgerSchema.d.ts +2 -0
  10. package/dist/constructs/v1beta3/ledger/LedgerSchema.js +22 -0
  11. package/dist/constructs/v1beta3/ledger/LedgerSchema.mjs +22 -0
  12. package/package.json +1 -1
  13. package/dist/constructs/v1beta3/blowhorn_binding/BlowhornBinding.d.ts +0 -462
  14. package/dist/constructs/v1beta3/blowhorn_binding/BlowhornBindingSchema.d.ts +0 -2
  15. package/dist/constructs/v1beta3/blowhorn_binding/BlowhornBindingSchema.js +0 -23
  16. package/dist/constructs/v1beta3/blowhorn_binding/BlowhornBindingSchema.mjs +0 -23
  17. package/dist/constructs/v1beta3/blowhorn_ledger/BlowhornLedger.d.ts +0 -1546
  18. package/dist/constructs/v1beta3/blowhorn_ledger/BlowhornLedger.js +0 -1
  19. package/dist/constructs/v1beta3/blowhorn_ledger/BlowhornLedger.mjs +0 -0
  20. package/dist/constructs/v1beta3/blowhorn_ledger/BlowhornLedgerSchema.d.ts +0 -2
  21. package/dist/constructs/v1beta3/blowhorn_ledger/BlowhornLedgerSchema.js +0 -69
  22. package/dist/constructs/v1beta3/blowhorn_ledger/BlowhornLedgerSchema.mjs +0 -69
  23. /package/dist/constructs/v1beta3/{blowhorn_binding/BlowhornBinding.js → ledger/Ledger.js} +0 -0
  24. /package/dist/constructs/v1beta3/{blowhorn_binding/BlowhornBinding.mjs → ledger/Ledger.mjs} +0 -0
@@ -0,0 +1,22 @@
1
+ 'use strict';var e={openapi:"3.0.0",info:{title:"Ledger",description:`OpenAPI schema for organization ledgers: named idempotent sets of keyed
2
+ entries that several workers share, so work done once (a record processed,
3
+ a contact reached) is never done twice. Recording is idempotent on
4
+ (ledger, entryKey), and claim-if-absent hands a key to exactly one
5
+ claimant atomically. Ledgers belong to the organization of the
6
+ authenticated session; any client-supplied organization is ignored.
7
+
8
+ Authorization: ledgers are organization-shared bookkeeping. Any member of
9
+ the organization may record, claim, 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":{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.
15
+ `,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.
16
+ `,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.
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}}}}}},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.
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}}}}}},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.
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}}}}}},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.
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}}}}}},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:{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.
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}}},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.
22
+ `,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;
@@ -0,0 +1,22 @@
1
+ var e={openapi:"3.0.0",info:{title:"Ledger",description:`OpenAPI schema for organization ledgers: named idempotent sets of keyed
2
+ entries that several workers share, so work done once (a record processed,
3
+ a contact reached) is never done twice. Recording is idempotent on
4
+ (ledger, entryKey), and claim-if-absent hands a key to exactly one
5
+ claimant atomically. Ledgers belong to the organization of the
6
+ authenticated session; any client-supplied organization is ignored.
7
+
8
+ Authorization: ledgers are organization-shared bookkeeping. Any member of
9
+ the organization may record, claim, 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":{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.
15
+ `,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.
16
+ `,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.
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}}}}}},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.
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}}}}}},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.
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}}}}}},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.
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}}}}}},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:{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.
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}}},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.
22
+ `,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;export{t as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshery/schemas",
3
- "version": "1.3.84",
3
+ "version": "1.3.85",
4
4
  "description": "<p style=\"text-align:center;\" align=\"center\"><a href=\"https://meshery.io\"><picture> <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/meshery/meshery/master/.github/assets/images/readme/meshery-logo-light-text-side.svg\"> <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/meshery/meshery/master/.github/assets/images/readme/meshery-logo-dark-text-side.svg\"> <img src=\"https://raw.githubusercontent.com/meshery/meshery/master/.github/assets/images/readme/meshery-logo-dark-text-side.svg\" alt=\"Meshery Logo\" width=\"70%\" /></picture></a><br /><br /></p> <p align=\"center\"> <a href=\"https://hub.docker.com/r/meshery/meshery\" alt=\"Docker pulls\"> <img src=\"https://img.shields.io/docker/pulls/meshery/meshery.svg\" /></a> <a href=\"https://github.com/issues?q=is%3Aopen+is%3Aissue+archived%3Afalse+org%meshery+org%3Ameshery+org%3Aservice-mesh-performance+org%3Aservice-mesh-patterns+org%3A+label%3A%22help+wanted%22+\" alt=\"GitHub issues by-label\"> <img src=\"https://img.shields.io/github/issues/meshery/meshery/help%20wanted.svg?color=informational\" /></a> <a href=\"https://github.com/meshery/meshery/blob/master/LICENSE\" alt=\"LICENSE\"> <img src=\"https://img.shields.io/github/license/meshery/meshery?color=brightgreen\" /></a> <a href=\"https://artifacthub.io/packages/helm/meshery/meshery\" alt=\"Artifact Hub Meshery\"> <img src=\"https://img.shields.io/endpoint?color=brightgreen&label=Helm%20Chart&style=plastic&url=https%3A%2F%2Fartifacthub.io%2Fbadge%2Frepository%2Fartifact-hub\" /></a> <a href=\"https://goreportcard.com/report/github.com/meshery/meshery\" alt=\"Go Report Card\"> <img src=\"https://goreportcard.com/badge/github.com/meshery/meshery\" /></a> <a href=\"https://github.com/meshery/meshery/actions\" alt=\"Build Status\"> <img src=\"https://img.shields.io/github/actions/workflow/status/meshery/meshery/release-drafter.yml\" /></a> <a href=\"https://bestpractices.coreinfrastructure.org/projects/3564\" alt=\"CLI Best Practices\"> <img src=\"https://bestpractices.coreinfrastructure.org/projects/3564/badge\" /></a> <a href=\"http://discuss.meshery.io\" alt=\"Discuss Users\"> <img src=\"https://img.shields.io/discourse/users?label=discuss&logo=discourse&server=https%3A%2F%2Fdiscuss.meshery.io\" /></a> <a href=\"https://slack.meshery.io\" alt=\"Join Slack\"> <img src=\"https://img.shields.io/badge/Slack-@meshery.svg?logo=slack\" /></a> <a href=\"https://twitter.com/intent/follow?screen_name=mesheryio\" alt=\"Twitter Follow\"> <img src=\"https://img.shields.io/twitter/follow/mesheryio.svg?label=Follow+Meshery&style=social\" /></a> <a href=\"https://github.com/meshery/meshery/releases\" alt=\"Meshery Downloads\"> <img src=\"https://img.shields.io/github/downloads/meshery/meshery/total\" /></a> <!-- <a href=\"https://app.fossa.com/projects/git%2Bgithub.com%2Fmeshery%2Fmeshery?ref=badge_shield\" alt=\"License Scan Report\"> <img src=\"https://app.fossa.com/api/projects/git%2Bgithub.com%2Fmeshery%2Fmeshery.svg?type=shield\"/></a> --> </p>",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",