primcli 1.12.0 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -102,7 +102,9 @@ primitive payments create-email-challenge --from payee@your-domain.example \
102
102
  # locally with your wallet key AND sends the signed interaction.json as an
103
103
  # in-thread reply, so you skip the manual sign-then-reply dance. --in-reply-to
104
104
  # is the inbound challenge email you received; the reply is threaded to it and
105
- # addressed to the payee, and From defaults to the payer it was sent to.
105
+ # addressed to the payee, and From defaults to the payer it was sent to. The
106
+ # reply carries a short default note alongside the attachment; pass --body to
107
+ # customize it.
106
108
  primitive payments pay-email --challenge-file challenge.json \
107
109
  --in-reply-to <inbound-challenge-email-id> --wait
108
110
 
@@ -8945,6 +8945,20 @@ const openapiDocument = {
8945
8945
  "deactivated_at": {
8946
8946
  "type": ["string", "null"],
8947
8947
  "format": "date-time"
8948
+ },
8949
+ "kind": {
8950
+ "type": "string",
8951
+ "enum": ["http", "function"],
8952
+ "description": "http: deliver to the webhook URL. function: invoke a Primitive Function."
8953
+ },
8954
+ "function_id": {
8955
+ "type": ["string", "null"],
8956
+ "format": "uuid",
8957
+ "description": "The Function this endpoint invokes, when kind is function."
8958
+ },
8959
+ "is_route_target": {
8960
+ "type": "boolean",
8961
+ "description": "When true, this endpoint is reachable only via an explicit recipient\nroute, never as a domain's default destination, and is exempt from\nthe one-endpoint-per-domain rule (so many can share a domain).\n"
8948
8962
  }
8949
8963
  },
8950
8964
  "required": [
@@ -8960,14 +8974,20 @@ const openapiDocument = {
8960
8974
  "consecutive_fails"
8961
8975
  ]
8962
8976
  },
8963
- "CreateEndpointInput": {
8977
+ "CreateHttpEndpointInput": {
8964
8978
  "type": "object",
8965
8979
  "additionalProperties": false,
8966
8980
  "properties": {
8981
+ "kind": {
8982
+ "type": "string",
8983
+ "enum": ["http"],
8984
+ "default": "http",
8985
+ "description": "Deliver to a webhook URL."
8986
+ },
8967
8987
  "url": {
8968
8988
  "type": "string",
8969
8989
  "minLength": 1,
8970
- "description": "The webhook URL to deliver events to"
8990
+ "description": "The webhook URL to deliver events to."
8971
8991
  },
8972
8992
  "enabled": {
8973
8993
  "type": "boolean",
@@ -8982,10 +9002,61 @@ const openapiDocument = {
8982
9002
  "rules": {
8983
9003
  "type": "object",
8984
9004
  "description": "Endpoint-specific filtering rules"
9005
+ },
9006
+ "is_route_target": {
9007
+ "type": "boolean",
9008
+ "default": false,
9009
+ "description": "Create this endpoint as a route-target: reachable only via an\nexplicit recipient route, never a domain's default destination, and\nexempt from the one-endpoint-per-domain rule.\n"
8985
9010
  }
8986
9011
  },
8987
9012
  "required": ["url"]
8988
9013
  },
9014
+ "CreateFunctionEndpointInput": {
9015
+ "type": "object",
9016
+ "additionalProperties": false,
9017
+ "properties": {
9018
+ "kind": {
9019
+ "type": "string",
9020
+ "enum": ["function"],
9021
+ "description": "Invoke a Primitive Function."
9022
+ },
9023
+ "function_id": {
9024
+ "type": "string",
9025
+ "format": "uuid",
9026
+ "description": "The Function to invoke."
9027
+ },
9028
+ "enabled": {
9029
+ "type": "boolean",
9030
+ "default": true,
9031
+ "description": "Whether the endpoint is active"
9032
+ },
9033
+ "domain_id": {
9034
+ "type": ["string", "null"],
9035
+ "format": "uuid",
9036
+ "description": "Restrict to emails from a specific domain"
9037
+ },
9038
+ "rules": {
9039
+ "type": "object",
9040
+ "description": "Endpoint-specific filtering rules"
9041
+ },
9042
+ "is_route_target": {
9043
+ "type": "boolean",
9044
+ "default": false,
9045
+ "description": "Create this endpoint as a route-target: reachable only via an\nexplicit recipient route, never a domain's default destination, and\nexempt from the one-endpoint-per-domain rule.\n"
9046
+ }
9047
+ },
9048
+ "required": ["kind", "function_id"]
9049
+ },
9050
+ "CreateEndpointInput": {
9051
+ "oneOf": [{ "$ref": "#/components/schemas/CreateHttpEndpointInput" }, { "$ref": "#/components/schemas/CreateFunctionEndpointInput" }],
9052
+ "discriminator": {
9053
+ "propertyName": "kind",
9054
+ "mapping": {
9055
+ "http": "#/components/schemas/CreateHttpEndpointInput",
9056
+ "function": "#/components/schemas/CreateFunctionEndpointInput"
9057
+ }
9058
+ }
9059
+ },
8989
9060
  "UpdateEndpointInput": {
8990
9061
  "type": "object",
8991
9062
  "additionalProperties": false,
@@ -13298,30 +13369,85 @@ const operationManifest = [
13298
13369
  "pathParams": [],
13299
13370
  "queryParams": [],
13300
13371
  "requestSchema": {
13301
- "type": "object",
13302
- "additionalProperties": false,
13303
- "properties": {
13304
- "url": {
13305
- "type": "string",
13306
- "minLength": 1,
13307
- "description": "The webhook URL to deliver events to"
13308
- },
13309
- "enabled": {
13310
- "type": "boolean",
13311
- "default": true,
13312
- "description": "Whether the endpoint is active"
13372
+ "oneOf": [{
13373
+ "type": "object",
13374
+ "additionalProperties": false,
13375
+ "properties": {
13376
+ "kind": {
13377
+ "type": "string",
13378
+ "enum": ["http"],
13379
+ "default": "http",
13380
+ "description": "Deliver to a webhook URL."
13381
+ },
13382
+ "url": {
13383
+ "type": "string",
13384
+ "minLength": 1,
13385
+ "description": "The webhook URL to deliver events to."
13386
+ },
13387
+ "enabled": {
13388
+ "type": "boolean",
13389
+ "default": true,
13390
+ "description": "Whether the endpoint is active"
13391
+ },
13392
+ "domain_id": {
13393
+ "type": ["string", "null"],
13394
+ "format": "uuid",
13395
+ "description": "Restrict to emails from a specific domain"
13396
+ },
13397
+ "rules": {
13398
+ "type": "object",
13399
+ "description": "Endpoint-specific filtering rules"
13400
+ },
13401
+ "is_route_target": {
13402
+ "type": "boolean",
13403
+ "default": false,
13404
+ "description": "Create this endpoint as a route-target: reachable only via an\nexplicit recipient route, never a domain's default destination, and\nexempt from the one-endpoint-per-domain rule.\n"
13405
+ }
13313
13406
  },
13314
- "domain_id": {
13315
- "type": ["string", "null"],
13316
- "format": "uuid",
13317
- "description": "Restrict to emails from a specific domain"
13407
+ "required": ["url"]
13408
+ }, {
13409
+ "type": "object",
13410
+ "additionalProperties": false,
13411
+ "properties": {
13412
+ "kind": {
13413
+ "type": "string",
13414
+ "enum": ["function"],
13415
+ "description": "Invoke a Primitive Function."
13416
+ },
13417
+ "function_id": {
13418
+ "type": "string",
13419
+ "format": "uuid",
13420
+ "description": "The Function to invoke."
13421
+ },
13422
+ "enabled": {
13423
+ "type": "boolean",
13424
+ "default": true,
13425
+ "description": "Whether the endpoint is active"
13426
+ },
13427
+ "domain_id": {
13428
+ "type": ["string", "null"],
13429
+ "format": "uuid",
13430
+ "description": "Restrict to emails from a specific domain"
13431
+ },
13432
+ "rules": {
13433
+ "type": "object",
13434
+ "description": "Endpoint-specific filtering rules"
13435
+ },
13436
+ "is_route_target": {
13437
+ "type": "boolean",
13438
+ "default": false,
13439
+ "description": "Create this endpoint as a route-target: reachable only via an\nexplicit recipient route, never a domain's default destination, and\nexempt from the one-endpoint-per-domain rule.\n"
13440
+ }
13318
13441
  },
13319
- "rules": {
13320
- "type": "object",
13321
- "description": "Endpoint-specific filtering rules"
13442
+ "required": ["kind", "function_id"]
13443
+ }],
13444
+ "discriminator": {
13445
+ "propertyName": "kind",
13446
+ "mapping": {
13447
+ "http": "#/components/schemas/CreateHttpEndpointInput",
13448
+ "function": "#/components/schemas/CreateFunctionEndpointInput"
13322
13449
  }
13323
- },
13324
- "required": ["url"]
13450
+ }
13325
13451
  },
13326
13452
  "responseSchema": {
13327
13453
  "type": "object",
@@ -13384,6 +13510,20 @@ const operationManifest = [
13384
13510
  "deactivated_at": {
13385
13511
  "type": ["string", "null"],
13386
13512
  "format": "date-time"
13513
+ },
13514
+ "kind": {
13515
+ "type": "string",
13516
+ "enum": ["http", "function"],
13517
+ "description": "http: deliver to the webhook URL. function: invoke a Primitive Function."
13518
+ },
13519
+ "function_id": {
13520
+ "type": ["string", "null"],
13521
+ "format": "uuid",
13522
+ "description": "The Function this endpoint invokes, when kind is function."
13523
+ },
13524
+ "is_route_target": {
13525
+ "type": "boolean",
13526
+ "description": "When true, this endpoint is reachable only via an explicit recipient\nroute, never as a domain's default destination, and is exempt from\nthe one-endpoint-per-domain rule (so many can share a domain).\n"
13387
13527
  }
13388
13528
  },
13389
13529
  "required": [
@@ -13503,6 +13643,20 @@ const operationManifest = [
13503
13643
  "deactivated_at": {
13504
13644
  "type": ["string", "null"],
13505
13645
  "format": "date-time"
13646
+ },
13647
+ "kind": {
13648
+ "type": "string",
13649
+ "enum": ["http", "function"],
13650
+ "description": "http: deliver to the webhook URL. function: invoke a Primitive Function."
13651
+ },
13652
+ "function_id": {
13653
+ "type": ["string", "null"],
13654
+ "format": "uuid",
13655
+ "description": "The Function this endpoint invokes, when kind is function."
13656
+ },
13657
+ "is_route_target": {
13658
+ "type": "boolean",
13659
+ "description": "When true, this endpoint is reachable only via an explicit recipient\nroute, never as a domain's default destination, and is exempt from\nthe one-endpoint-per-domain rule (so many can share a domain).\n"
13506
13660
  }
13507
13661
  },
13508
13662
  "required": [
@@ -13661,6 +13815,20 @@ const operationManifest = [
13661
13815
  "deactivated_at": {
13662
13816
  "type": ["string", "null"],
13663
13817
  "format": "date-time"
13818
+ },
13819
+ "kind": {
13820
+ "type": "string",
13821
+ "enum": ["http", "function"],
13822
+ "description": "http: deliver to the webhook URL. function: invoke a Primitive Function."
13823
+ },
13824
+ "function_id": {
13825
+ "type": ["string", "null"],
13826
+ "format": "uuid",
13827
+ "description": "The Function this endpoint invokes, when kind is function."
13828
+ },
13829
+ "is_route_target": {
13830
+ "type": "boolean",
13831
+ "description": "When true, this endpoint is reachable only via an explicit recipient\nroute, never as a domain's default destination, and is exempt from\nthe one-endpoint-per-domain rule (so many can share a domain).\n"
13664
13832
  }
13665
13833
  },
13666
13834
  "required": [
@@ -23696,8 +23864,8 @@ const PRIMITIVE_TEAM_AUTHOR = {
23696
23864
  name: "Primitive Team",
23697
23865
  url: "https://primitive.dev"
23698
23866
  };
23699
- const SDK_VERSION_RANGE = "^1.12.0";
23700
- const CLI_VERSION_RANGE = "^1.12.0";
23867
+ const SDK_VERSION_RANGE = "^1.13.1";
23868
+ const CLI_VERSION_RANGE = "^1.13.1";
23701
23869
  const ESBUILD_VERSION_RANGE = "^0.27.0";
23702
23870
  function renderHandler() {
23703
23871
  return `// env.PRIMITIVE_API_KEY, env.PRIMITIVE_WEBHOOK_SECRET, and
@@ -28125,6 +28293,7 @@ var PaymentsPayEmailStepCommand = class PaymentsPayEmailStepCommand extends Comm
28125
28293
  /** The exact part name + content type the inbound matcher requires. */
28126
28294
  const INTERACTION_PART_FILENAME = "interaction.json";
28127
28295
  const INTERACTION_PART_CONTENT_TYPE = "application/json";
28296
+ const DEFAULT_REPLY_BODY_TEXT = "x402 payment authorization attached (interaction.json).";
28128
28297
  /** Build the `interaction.json` attachment from a signed payment step. */
28129
28298
  function interactionAttachment(built) {
28130
28299
  return {
@@ -28188,6 +28357,7 @@ var PaymentsPayEmailCommand = class PaymentsPayEmailCommand extends Command {
28188
28357
  required: true
28189
28358
  }),
28190
28359
  from: Flags.string({ description: "Optional From header override. Defaults to the inbound's recipient (the payer the challenge was addressed to)." }),
28360
+ body: Flags.string({ description: `Plain-text reply body. The signed authorization travels in the interaction.json attachment; this is the human-readable accompanying note. Defaults to "${DEFAULT_REPLY_BODY_TEXT}".` }),
28191
28361
  wait: Flags.boolean({ description: "Block until the receiving MTA returns an outcome. Without --wait, the call returns once Primitive has accepted the reply for delivery." }),
28192
28362
  json: Flags.boolean({ description: "Print a JSON object with the signed interaction step and the send result." }),
28193
28363
  time: Flags.boolean({ description: TIME_FLAG_DESCRIPTION })
@@ -28223,6 +28393,7 @@ var PaymentsPayEmailCommand = class PaymentsPayEmailCommand extends Command {
28223
28393
  }
28224
28394
  const result = await replyToEmail({
28225
28395
  body: {
28396
+ body_text: flags.body?.trim() ? flags.body : DEFAULT_REPLY_BODY_TEXT,
28226
28397
  attachments: [interactionAttachment(built)],
28227
28398
  ...flags.from !== void 0 ? { from: flags.from } : {},
28228
28399
  ...flags.wait !== void 0 ? { wait: flags.wait } : {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primcli",
3
- "version": "1.12.0",
3
+ "version": "1.13.1",
4
4
  "description": "Official Primitive CLI: deploy Primitive Functions, send and inspect mail, manage endpoints, all from the terminal. Wraps the @primitivedotdev/sdk runtime client with one-shot commands.",
5
5
  "type": "module",
6
6
  "sideEffects": false,