@primitivedotdev/sdk 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +3 -3
- package/dist/{api-JvyzQsXn.js → api-DacG4JSU.js} +191 -1
- package/dist/{index-DdSffRr0.d.ts → index-X7RsDaVi.d.ts} +311 -2
- package/dist/index.d.ts +183 -3
- package/dist/index.js +196 -3
- package/dist/openapi/index.js +1 -1
- package/dist/{operations.generated-CvXrZUzc.js → operations.generated-DSMTMcWh.js} +549 -0
- package/package.json +5 -4
|
@@ -385,6 +385,128 @@ const openapiDocument = {
|
|
|
385
385
|
"429": { "$ref": "#/components/responses/RateLimited" }
|
|
386
386
|
}
|
|
387
387
|
} },
|
|
388
|
+
"/agent/accounts": { "post": {
|
|
389
|
+
"operationId": "createAgentAccount",
|
|
390
|
+
"summary": "Create an emailless agent account",
|
|
391
|
+
"description": "Creates an emailless agent account without authentication and returns a\none-time API key (prefixed `prim_`) plus a provisioned managed inbox.\nThe account is on the `agent` plan: reply-only (it can send only to\naddresses that have already sent it authenticated mail) with tight send\nlimits. Use the returned `api_key` as a Bearer token on later calls. The\naccount can be upgraded to a full developer account by confirming an\nemail through the claim flow. This endpoint does not require an API key.\n",
|
|
392
|
+
"tags": ["Agent"],
|
|
393
|
+
"security": [],
|
|
394
|
+
"requestBody": {
|
|
395
|
+
"required": true,
|
|
396
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAgentAccountInput" } } }
|
|
397
|
+
},
|
|
398
|
+
"responses": {
|
|
399
|
+
"200": {
|
|
400
|
+
"description": "Agent account created; the API key is returned once",
|
|
401
|
+
"headers": { "Cache-Control": {
|
|
402
|
+
"schema": { "type": "string" },
|
|
403
|
+
"description": "Always `no-store`"
|
|
404
|
+
} },
|
|
405
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
406
|
+
"type": "object",
|
|
407
|
+
"properties": { "data": { "$ref": "#/components/schemas/AgentAccountResult" } }
|
|
408
|
+
}] } } }
|
|
409
|
+
},
|
|
410
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
411
|
+
"429": { "$ref": "#/components/responses/RateLimited" }
|
|
412
|
+
}
|
|
413
|
+
} },
|
|
414
|
+
"/agent/claim/start": { "post": {
|
|
415
|
+
"operationId": "startAgentClaim",
|
|
416
|
+
"summary": "Start an agent account email claim",
|
|
417
|
+
"description": "Begins upgrading an emailless `agent` account into a full `developer`\naccount by confirming an email address. Authenticated by the agent's own\nAPI key (the org is taken from the credential). Sends a verification\ncode to the supplied email and returns the claim session id plus resend\ntiming. Submit the code to `/agent/claim/verify` to complete the\nupgrade. Confirming an email that already belongs to a Primitive account\nis rejected.\n",
|
|
418
|
+
"tags": ["Agent"],
|
|
419
|
+
"requestBody": {
|
|
420
|
+
"required": true,
|
|
421
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/StartAgentClaimInput" } } }
|
|
422
|
+
},
|
|
423
|
+
"responses": {
|
|
424
|
+
"200": {
|
|
425
|
+
"description": "Claim started and verification email sent",
|
|
426
|
+
"headers": { "Cache-Control": {
|
|
427
|
+
"schema": { "type": "string" },
|
|
428
|
+
"description": "Always `no-store`"
|
|
429
|
+
} },
|
|
430
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
431
|
+
"type": "object",
|
|
432
|
+
"properties": { "data": { "$ref": "#/components/schemas/AgentClaimStartResult" } }
|
|
433
|
+
}] } } }
|
|
434
|
+
},
|
|
435
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
436
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
437
|
+
"404": { "$ref": "#/components/responses/NotFound" },
|
|
438
|
+
"409": {
|
|
439
|
+
"description": "The email is already in use, or the account is not claimable",
|
|
440
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
441
|
+
},
|
|
442
|
+
"429": { "$ref": "#/components/responses/RateLimited" }
|
|
443
|
+
}
|
|
444
|
+
} },
|
|
445
|
+
"/agent/claim/verify": { "post": {
|
|
446
|
+
"operationId": "verifyAgentClaim",
|
|
447
|
+
"summary": "Verify an agent account email claim",
|
|
448
|
+
"description": "Confirms the verification code emailed by `/agent/claim/start` and\nupgrades the account to the `developer` plan. The org id, API key, and\nmanaged inbox all carry over; the send cap lifts. Authenticated by the\nagent's own API key.\n",
|
|
449
|
+
"tags": ["Agent"],
|
|
450
|
+
"requestBody": {
|
|
451
|
+
"required": true,
|
|
452
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/VerifyAgentClaimInput" } } }
|
|
453
|
+
},
|
|
454
|
+
"responses": {
|
|
455
|
+
"200": {
|
|
456
|
+
"description": "Claim verified; account upgraded to developer",
|
|
457
|
+
"headers": { "Cache-Control": {
|
|
458
|
+
"schema": { "type": "string" },
|
|
459
|
+
"description": "Always `no-store`"
|
|
460
|
+
} },
|
|
461
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
462
|
+
"type": "object",
|
|
463
|
+
"properties": { "data": { "$ref": "#/components/schemas/AgentClaimResult" } }
|
|
464
|
+
}] } } }
|
|
465
|
+
},
|
|
466
|
+
"400": { "$ref": "#/components/responses/ValidationError" },
|
|
467
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
468
|
+
"404": { "$ref": "#/components/responses/NotFound" },
|
|
469
|
+
"409": {
|
|
470
|
+
"description": "The account is already claimed, or the email is in use",
|
|
471
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
472
|
+
},
|
|
473
|
+
"410": {
|
|
474
|
+
"description": "The claim or its verification code has expired",
|
|
475
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
476
|
+
},
|
|
477
|
+
"429": { "$ref": "#/components/responses/RateLimited" }
|
|
478
|
+
}
|
|
479
|
+
} },
|
|
480
|
+
"/agent/claim/link": { "post": {
|
|
481
|
+
"operationId": "createAgentClaimLink",
|
|
482
|
+
"summary": "Create a browser claim link",
|
|
483
|
+
"description": "Mints an opaque, single-use link an agent can hand to a human to\ncomplete the email-confirmation upgrade in a browser. Authenticated by\nthe agent's own API key. `claim_url` is null when the API host cannot\nresolve a web origin to build the link.\n",
|
|
484
|
+
"tags": ["Agent"],
|
|
485
|
+
"requestBody": {
|
|
486
|
+
"required": false,
|
|
487
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateAgentClaimLinkInput" } } }
|
|
488
|
+
},
|
|
489
|
+
"responses": {
|
|
490
|
+
"200": {
|
|
491
|
+
"description": "Claim link created",
|
|
492
|
+
"headers": { "Cache-Control": {
|
|
493
|
+
"schema": { "type": "string" },
|
|
494
|
+
"description": "Always `no-store`"
|
|
495
|
+
} },
|
|
496
|
+
"content": { "application/json": { "schema": { "allOf": [{ "$ref": "#/components/schemas/SuccessEnvelope" }, {
|
|
497
|
+
"type": "object",
|
|
498
|
+
"properties": { "data": { "$ref": "#/components/schemas/AgentClaimLinkResult" } }
|
|
499
|
+
}] } } }
|
|
500
|
+
},
|
|
501
|
+
"401": { "$ref": "#/components/responses/Unauthorized" },
|
|
502
|
+
"404": { "$ref": "#/components/responses/NotFound" },
|
|
503
|
+
"409": {
|
|
504
|
+
"description": "The account is not claimable (not an agent account, or already claimed)",
|
|
505
|
+
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } }
|
|
506
|
+
},
|
|
507
|
+
"429": { "$ref": "#/components/responses/RateLimited" }
|
|
508
|
+
}
|
|
509
|
+
} },
|
|
388
510
|
"/cli/logout": { "post": {
|
|
389
511
|
"operationId": "cliLogout",
|
|
390
512
|
"summary": "Revoke the current CLI OAuth session",
|
|
@@ -2979,6 +3101,177 @@ const openapiDocument = {
|
|
|
2979
3101
|
"orgs"
|
|
2980
3102
|
]
|
|
2981
3103
|
},
|
|
3104
|
+
"PlanLimits": {
|
|
3105
|
+
"type": "object",
|
|
3106
|
+
"description": "Plan-derived quota limits for an account.",
|
|
3107
|
+
"properties": {
|
|
3108
|
+
"storage_mb": { "type": "number" },
|
|
3109
|
+
"send_per_hour": { "type": "number" },
|
|
3110
|
+
"send_per_day": { "type": "number" },
|
|
3111
|
+
"api_per_minute": { "type": "number" },
|
|
3112
|
+
"webhooks_max_global": { "type": ["number", "null"] },
|
|
3113
|
+
"webhooks_per_domain": { "type": "boolean" },
|
|
3114
|
+
"filters_per_domain": { "type": "boolean" },
|
|
3115
|
+
"spam_thresholds_per_domain": { "type": "boolean" }
|
|
3116
|
+
},
|
|
3117
|
+
"required": [
|
|
3118
|
+
"storage_mb",
|
|
3119
|
+
"send_per_hour",
|
|
3120
|
+
"send_per_day",
|
|
3121
|
+
"api_per_minute",
|
|
3122
|
+
"webhooks_max_global",
|
|
3123
|
+
"webhooks_per_domain",
|
|
3124
|
+
"filters_per_domain",
|
|
3125
|
+
"spam_thresholds_per_domain"
|
|
3126
|
+
]
|
|
3127
|
+
},
|
|
3128
|
+
"CreateAgentAccountInput": {
|
|
3129
|
+
"type": "object",
|
|
3130
|
+
"additionalProperties": false,
|
|
3131
|
+
"properties": {
|
|
3132
|
+
"terms_accepted": {
|
|
3133
|
+
"type": "boolean",
|
|
3134
|
+
"enum": [true],
|
|
3135
|
+
"description": "Must be true to accept the Terms of Service and Privacy Policy."
|
|
3136
|
+
},
|
|
3137
|
+
"device_name": {
|
|
3138
|
+
"type": "string",
|
|
3139
|
+
"minLength": 1,
|
|
3140
|
+
"maxLength": 80,
|
|
3141
|
+
"description": "Optional label for the device or agent creating the account."
|
|
3142
|
+
}
|
|
3143
|
+
},
|
|
3144
|
+
"required": ["terms_accepted"]
|
|
3145
|
+
},
|
|
3146
|
+
"AgentAccountUpgradeHint": {
|
|
3147
|
+
"type": "object",
|
|
3148
|
+
"description": "In-band pointer to the upgrade path for an agent account.",
|
|
3149
|
+
"properties": {
|
|
3150
|
+
"plan": {
|
|
3151
|
+
"type": "string",
|
|
3152
|
+
"enum": ["developer"]
|
|
3153
|
+
},
|
|
3154
|
+
"description": { "type": "string" },
|
|
3155
|
+
"claim_path": { "type": "string" }
|
|
3156
|
+
},
|
|
3157
|
+
"required": [
|
|
3158
|
+
"plan",
|
|
3159
|
+
"description",
|
|
3160
|
+
"claim_path"
|
|
3161
|
+
]
|
|
3162
|
+
},
|
|
3163
|
+
"AgentAccountResult": {
|
|
3164
|
+
"type": "object",
|
|
3165
|
+
"properties": {
|
|
3166
|
+
"api_key": {
|
|
3167
|
+
"type": "string",
|
|
3168
|
+
"description": "One-time API key (prefixed `prim_`). Shown once; store it securely."
|
|
3169
|
+
},
|
|
3170
|
+
"org_id": {
|
|
3171
|
+
"type": "string",
|
|
3172
|
+
"format": "uuid"
|
|
3173
|
+
},
|
|
3174
|
+
"address": {
|
|
3175
|
+
"type": ["string", "null"],
|
|
3176
|
+
"description": "Provisioned managed inbox FQDN, or null if the inbox publish was deferred."
|
|
3177
|
+
},
|
|
3178
|
+
"plan": {
|
|
3179
|
+
"type": "string",
|
|
3180
|
+
"enum": ["agent"]
|
|
3181
|
+
},
|
|
3182
|
+
"limits": { "$ref": "#/components/schemas/PlanLimits" },
|
|
3183
|
+
"upgrade": { "$ref": "#/components/schemas/AgentAccountUpgradeHint" }
|
|
3184
|
+
},
|
|
3185
|
+
"required": [
|
|
3186
|
+
"api_key",
|
|
3187
|
+
"org_id",
|
|
3188
|
+
"address",
|
|
3189
|
+
"plan",
|
|
3190
|
+
"limits",
|
|
3191
|
+
"upgrade"
|
|
3192
|
+
]
|
|
3193
|
+
},
|
|
3194
|
+
"StartAgentClaimInput": {
|
|
3195
|
+
"type": "object",
|
|
3196
|
+
"additionalProperties": false,
|
|
3197
|
+
"properties": { "email": {
|
|
3198
|
+
"type": "string",
|
|
3199
|
+
"format": "email",
|
|
3200
|
+
"maxLength": 254,
|
|
3201
|
+
"description": "Email to confirm. Must not already belong to a Primitive account."
|
|
3202
|
+
} },
|
|
3203
|
+
"required": ["email"]
|
|
3204
|
+
},
|
|
3205
|
+
"AgentClaimStartResult": {
|
|
3206
|
+
"type": "object",
|
|
3207
|
+
"properties": {
|
|
3208
|
+
"claim_session_id": { "type": "string" },
|
|
3209
|
+
"resend_after_seconds": { "type": "integer" },
|
|
3210
|
+
"expires_in_seconds": { "type": "integer" }
|
|
3211
|
+
},
|
|
3212
|
+
"required": [
|
|
3213
|
+
"claim_session_id",
|
|
3214
|
+
"resend_after_seconds",
|
|
3215
|
+
"expires_in_seconds"
|
|
3216
|
+
]
|
|
3217
|
+
},
|
|
3218
|
+
"VerifyAgentClaimInput": {
|
|
3219
|
+
"type": "object",
|
|
3220
|
+
"additionalProperties": false,
|
|
3221
|
+
"properties": { "verification_code": {
|
|
3222
|
+
"type": "string",
|
|
3223
|
+
"minLength": 1,
|
|
3224
|
+
"maxLength": 32,
|
|
3225
|
+
"description": "The verification code emailed by the claim start step."
|
|
3226
|
+
} },
|
|
3227
|
+
"required": ["verification_code"]
|
|
3228
|
+
},
|
|
3229
|
+
"AgentClaimResult": {
|
|
3230
|
+
"type": "object",
|
|
3231
|
+
"properties": {
|
|
3232
|
+
"org_id": {
|
|
3233
|
+
"type": "string",
|
|
3234
|
+
"format": "uuid"
|
|
3235
|
+
},
|
|
3236
|
+
"plan": {
|
|
3237
|
+
"type": "string",
|
|
3238
|
+
"enum": ["developer"]
|
|
3239
|
+
},
|
|
3240
|
+
"email": {
|
|
3241
|
+
"type": "string",
|
|
3242
|
+
"format": "email"
|
|
3243
|
+
},
|
|
3244
|
+
"limits": { "$ref": "#/components/schemas/PlanLimits" }
|
|
3245
|
+
},
|
|
3246
|
+
"required": [
|
|
3247
|
+
"org_id",
|
|
3248
|
+
"plan",
|
|
3249
|
+
"email",
|
|
3250
|
+
"limits"
|
|
3251
|
+
]
|
|
3252
|
+
},
|
|
3253
|
+
"CreateAgentClaimLinkInput": {
|
|
3254
|
+
"type": "object",
|
|
3255
|
+
"additionalProperties": false,
|
|
3256
|
+
"description": "No fields; an empty object is accepted.",
|
|
3257
|
+
"properties": {}
|
|
3258
|
+
},
|
|
3259
|
+
"AgentClaimLinkResult": {
|
|
3260
|
+
"type": "object",
|
|
3261
|
+
"properties": {
|
|
3262
|
+
"claim_token": { "type": "string" },
|
|
3263
|
+
"claim_url": {
|
|
3264
|
+
"type": ["string", "null"],
|
|
3265
|
+
"description": "Browser URL to hand to a human, or null if no web origin is configured."
|
|
3266
|
+
},
|
|
3267
|
+
"expires_in_seconds": { "type": "integer" }
|
|
3268
|
+
},
|
|
3269
|
+
"required": [
|
|
3270
|
+
"claim_token",
|
|
3271
|
+
"claim_url",
|
|
3272
|
+
"expires_in_seconds"
|
|
3273
|
+
]
|
|
3274
|
+
},
|
|
2982
3275
|
"CliLogoutInput": {
|
|
2983
3276
|
"type": "object",
|
|
2984
3277
|
"additionalProperties": false,
|
|
@@ -6278,6 +6571,148 @@ const operationManifest = [
|
|
|
6278
6571
|
"tag": "Account",
|
|
6279
6572
|
"tagCommand": "account"
|
|
6280
6573
|
},
|
|
6574
|
+
{
|
|
6575
|
+
"binaryResponse": false,
|
|
6576
|
+
"bodyRequired": true,
|
|
6577
|
+
"command": "create-agent-account",
|
|
6578
|
+
"description": "Creates an emailless agent account without authentication and returns a\none-time API key (prefixed `prim_`) plus a provisioned managed inbox.\nThe account is on the `agent` plan: reply-only (it can send only to\naddresses that have already sent it authenticated mail) with tight send\nlimits. Use the returned `api_key` as a Bearer token on later calls. The\naccount can be upgraded to a full developer account by confirming an\nemail through the claim flow. This endpoint does not require an API key.\n",
|
|
6579
|
+
"hasJsonBody": true,
|
|
6580
|
+
"method": "POST",
|
|
6581
|
+
"operationId": "createAgentAccount",
|
|
6582
|
+
"path": "/agent/accounts",
|
|
6583
|
+
"pathParams": [],
|
|
6584
|
+
"queryParams": [],
|
|
6585
|
+
"requestSchema": {
|
|
6586
|
+
"type": "object",
|
|
6587
|
+
"additionalProperties": false,
|
|
6588
|
+
"properties": {
|
|
6589
|
+
"terms_accepted": {
|
|
6590
|
+
"type": "boolean",
|
|
6591
|
+
"enum": [true],
|
|
6592
|
+
"description": "Must be true to accept the Terms of Service and Privacy Policy."
|
|
6593
|
+
},
|
|
6594
|
+
"device_name": {
|
|
6595
|
+
"type": "string",
|
|
6596
|
+
"minLength": 1,
|
|
6597
|
+
"maxLength": 80,
|
|
6598
|
+
"description": "Optional label for the device or agent creating the account."
|
|
6599
|
+
}
|
|
6600
|
+
},
|
|
6601
|
+
"required": ["terms_accepted"]
|
|
6602
|
+
},
|
|
6603
|
+
"responseSchema": {
|
|
6604
|
+
"type": "object",
|
|
6605
|
+
"properties": {
|
|
6606
|
+
"api_key": {
|
|
6607
|
+
"type": "string",
|
|
6608
|
+
"description": "One-time API key (prefixed `prim_`). Shown once; store it securely."
|
|
6609
|
+
},
|
|
6610
|
+
"org_id": {
|
|
6611
|
+
"type": "string",
|
|
6612
|
+
"format": "uuid"
|
|
6613
|
+
},
|
|
6614
|
+
"address": {
|
|
6615
|
+
"type": ["string", "null"],
|
|
6616
|
+
"description": "Provisioned managed inbox FQDN, or null if the inbox publish was deferred."
|
|
6617
|
+
},
|
|
6618
|
+
"plan": {
|
|
6619
|
+
"type": "string",
|
|
6620
|
+
"enum": ["agent"]
|
|
6621
|
+
},
|
|
6622
|
+
"limits": {
|
|
6623
|
+
"type": "object",
|
|
6624
|
+
"description": "Plan-derived quota limits for an account.",
|
|
6625
|
+
"properties": {
|
|
6626
|
+
"storage_mb": { "type": "number" },
|
|
6627
|
+
"send_per_hour": { "type": "number" },
|
|
6628
|
+
"send_per_day": { "type": "number" },
|
|
6629
|
+
"api_per_minute": { "type": "number" },
|
|
6630
|
+
"webhooks_max_global": { "type": ["number", "null"] },
|
|
6631
|
+
"webhooks_per_domain": { "type": "boolean" },
|
|
6632
|
+
"filters_per_domain": { "type": "boolean" },
|
|
6633
|
+
"spam_thresholds_per_domain": { "type": "boolean" }
|
|
6634
|
+
},
|
|
6635
|
+
"required": [
|
|
6636
|
+
"storage_mb",
|
|
6637
|
+
"send_per_hour",
|
|
6638
|
+
"send_per_day",
|
|
6639
|
+
"api_per_minute",
|
|
6640
|
+
"webhooks_max_global",
|
|
6641
|
+
"webhooks_per_domain",
|
|
6642
|
+
"filters_per_domain",
|
|
6643
|
+
"spam_thresholds_per_domain"
|
|
6644
|
+
]
|
|
6645
|
+
},
|
|
6646
|
+
"upgrade": {
|
|
6647
|
+
"type": "object",
|
|
6648
|
+
"description": "In-band pointer to the upgrade path for an agent account.",
|
|
6649
|
+
"properties": {
|
|
6650
|
+
"plan": {
|
|
6651
|
+
"type": "string",
|
|
6652
|
+
"enum": ["developer"]
|
|
6653
|
+
},
|
|
6654
|
+
"description": { "type": "string" },
|
|
6655
|
+
"claim_path": { "type": "string" }
|
|
6656
|
+
},
|
|
6657
|
+
"required": [
|
|
6658
|
+
"plan",
|
|
6659
|
+
"description",
|
|
6660
|
+
"claim_path"
|
|
6661
|
+
]
|
|
6662
|
+
}
|
|
6663
|
+
},
|
|
6664
|
+
"required": [
|
|
6665
|
+
"api_key",
|
|
6666
|
+
"org_id",
|
|
6667
|
+
"address",
|
|
6668
|
+
"plan",
|
|
6669
|
+
"limits",
|
|
6670
|
+
"upgrade"
|
|
6671
|
+
]
|
|
6672
|
+
},
|
|
6673
|
+
"sdkName": "createAgentAccount",
|
|
6674
|
+
"summary": "Create an emailless agent account",
|
|
6675
|
+
"tag": "Agent",
|
|
6676
|
+
"tagCommand": "agent"
|
|
6677
|
+
},
|
|
6678
|
+
{
|
|
6679
|
+
"binaryResponse": false,
|
|
6680
|
+
"bodyRequired": false,
|
|
6681
|
+
"command": "create-agent-claim-link",
|
|
6682
|
+
"description": "Mints an opaque, single-use link an agent can hand to a human to\ncomplete the email-confirmation upgrade in a browser. Authenticated by\nthe agent's own API key. `claim_url` is null when the API host cannot\nresolve a web origin to build the link.\n",
|
|
6683
|
+
"hasJsonBody": true,
|
|
6684
|
+
"method": "POST",
|
|
6685
|
+
"operationId": "createAgentClaimLink",
|
|
6686
|
+
"path": "/agent/claim/link",
|
|
6687
|
+
"pathParams": [],
|
|
6688
|
+
"queryParams": [],
|
|
6689
|
+
"requestSchema": {
|
|
6690
|
+
"type": "object",
|
|
6691
|
+
"additionalProperties": false,
|
|
6692
|
+
"description": "No fields; an empty object is accepted.",
|
|
6693
|
+
"properties": {}
|
|
6694
|
+
},
|
|
6695
|
+
"responseSchema": {
|
|
6696
|
+
"type": "object",
|
|
6697
|
+
"properties": {
|
|
6698
|
+
"claim_token": { "type": "string" },
|
|
6699
|
+
"claim_url": {
|
|
6700
|
+
"type": ["string", "null"],
|
|
6701
|
+
"description": "Browser URL to hand to a human, or null if no web origin is configured."
|
|
6702
|
+
},
|
|
6703
|
+
"expires_in_seconds": { "type": "integer" }
|
|
6704
|
+
},
|
|
6705
|
+
"required": [
|
|
6706
|
+
"claim_token",
|
|
6707
|
+
"claim_url",
|
|
6708
|
+
"expires_in_seconds"
|
|
6709
|
+
]
|
|
6710
|
+
},
|
|
6711
|
+
"sdkName": "createAgentClaimLink",
|
|
6712
|
+
"summary": "Create a browser claim link",
|
|
6713
|
+
"tag": "Agent",
|
|
6714
|
+
"tagCommand": "agent"
|
|
6715
|
+
},
|
|
6281
6716
|
{
|
|
6282
6717
|
"binaryResponse": false,
|
|
6283
6718
|
"bodyRequired": true,
|
|
@@ -6330,6 +6765,46 @@ const operationManifest = [
|
|
|
6330
6765
|
"tag": "Agent",
|
|
6331
6766
|
"tagCommand": "agent"
|
|
6332
6767
|
},
|
|
6768
|
+
{
|
|
6769
|
+
"binaryResponse": false,
|
|
6770
|
+
"bodyRequired": true,
|
|
6771
|
+
"command": "start-agent-claim",
|
|
6772
|
+
"description": "Begins upgrading an emailless `agent` account into a full `developer`\naccount by confirming an email address. Authenticated by the agent's own\nAPI key (the org is taken from the credential). Sends a verification\ncode to the supplied email and returns the claim session id plus resend\ntiming. Submit the code to `/agent/claim/verify` to complete the\nupgrade. Confirming an email that already belongs to a Primitive account\nis rejected.\n",
|
|
6773
|
+
"hasJsonBody": true,
|
|
6774
|
+
"method": "POST",
|
|
6775
|
+
"operationId": "startAgentClaim",
|
|
6776
|
+
"path": "/agent/claim/start",
|
|
6777
|
+
"pathParams": [],
|
|
6778
|
+
"queryParams": [],
|
|
6779
|
+
"requestSchema": {
|
|
6780
|
+
"type": "object",
|
|
6781
|
+
"additionalProperties": false,
|
|
6782
|
+
"properties": { "email": {
|
|
6783
|
+
"type": "string",
|
|
6784
|
+
"format": "email",
|
|
6785
|
+
"maxLength": 254,
|
|
6786
|
+
"description": "Email to confirm. Must not already belong to a Primitive account."
|
|
6787
|
+
} },
|
|
6788
|
+
"required": ["email"]
|
|
6789
|
+
},
|
|
6790
|
+
"responseSchema": {
|
|
6791
|
+
"type": "object",
|
|
6792
|
+
"properties": {
|
|
6793
|
+
"claim_session_id": { "type": "string" },
|
|
6794
|
+
"resend_after_seconds": { "type": "integer" },
|
|
6795
|
+
"expires_in_seconds": { "type": "integer" }
|
|
6796
|
+
},
|
|
6797
|
+
"required": [
|
|
6798
|
+
"claim_session_id",
|
|
6799
|
+
"resend_after_seconds",
|
|
6800
|
+
"expires_in_seconds"
|
|
6801
|
+
]
|
|
6802
|
+
},
|
|
6803
|
+
"sdkName": "startAgentClaim",
|
|
6804
|
+
"summary": "Start an agent account email claim",
|
|
6805
|
+
"tag": "Agent",
|
|
6806
|
+
"tagCommand": "agent"
|
|
6807
|
+
},
|
|
6333
6808
|
{
|
|
6334
6809
|
"binaryResponse": false,
|
|
6335
6810
|
"bodyRequired": true,
|
|
@@ -6412,6 +6887,80 @@ const operationManifest = [
|
|
|
6412
6887
|
"tag": "Agent",
|
|
6413
6888
|
"tagCommand": "agent"
|
|
6414
6889
|
},
|
|
6890
|
+
{
|
|
6891
|
+
"binaryResponse": false,
|
|
6892
|
+
"bodyRequired": true,
|
|
6893
|
+
"command": "verify-agent-claim",
|
|
6894
|
+
"description": "Confirms the verification code emailed by `/agent/claim/start` and\nupgrades the account to the `developer` plan. The org id, API key, and\nmanaged inbox all carry over; the send cap lifts. Authenticated by the\nagent's own API key.\n",
|
|
6895
|
+
"hasJsonBody": true,
|
|
6896
|
+
"method": "POST",
|
|
6897
|
+
"operationId": "verifyAgentClaim",
|
|
6898
|
+
"path": "/agent/claim/verify",
|
|
6899
|
+
"pathParams": [],
|
|
6900
|
+
"queryParams": [],
|
|
6901
|
+
"requestSchema": {
|
|
6902
|
+
"type": "object",
|
|
6903
|
+
"additionalProperties": false,
|
|
6904
|
+
"properties": { "verification_code": {
|
|
6905
|
+
"type": "string",
|
|
6906
|
+
"minLength": 1,
|
|
6907
|
+
"maxLength": 32,
|
|
6908
|
+
"description": "The verification code emailed by the claim start step."
|
|
6909
|
+
} },
|
|
6910
|
+
"required": ["verification_code"]
|
|
6911
|
+
},
|
|
6912
|
+
"responseSchema": {
|
|
6913
|
+
"type": "object",
|
|
6914
|
+
"properties": {
|
|
6915
|
+
"org_id": {
|
|
6916
|
+
"type": "string",
|
|
6917
|
+
"format": "uuid"
|
|
6918
|
+
},
|
|
6919
|
+
"plan": {
|
|
6920
|
+
"type": "string",
|
|
6921
|
+
"enum": ["developer"]
|
|
6922
|
+
},
|
|
6923
|
+
"email": {
|
|
6924
|
+
"type": "string",
|
|
6925
|
+
"format": "email"
|
|
6926
|
+
},
|
|
6927
|
+
"limits": {
|
|
6928
|
+
"type": "object",
|
|
6929
|
+
"description": "Plan-derived quota limits for an account.",
|
|
6930
|
+
"properties": {
|
|
6931
|
+
"storage_mb": { "type": "number" },
|
|
6932
|
+
"send_per_hour": { "type": "number" },
|
|
6933
|
+
"send_per_day": { "type": "number" },
|
|
6934
|
+
"api_per_minute": { "type": "number" },
|
|
6935
|
+
"webhooks_max_global": { "type": ["number", "null"] },
|
|
6936
|
+
"webhooks_per_domain": { "type": "boolean" },
|
|
6937
|
+
"filters_per_domain": { "type": "boolean" },
|
|
6938
|
+
"spam_thresholds_per_domain": { "type": "boolean" }
|
|
6939
|
+
},
|
|
6940
|
+
"required": [
|
|
6941
|
+
"storage_mb",
|
|
6942
|
+
"send_per_hour",
|
|
6943
|
+
"send_per_day",
|
|
6944
|
+
"api_per_minute",
|
|
6945
|
+
"webhooks_max_global",
|
|
6946
|
+
"webhooks_per_domain",
|
|
6947
|
+
"filters_per_domain",
|
|
6948
|
+
"spam_thresholds_per_domain"
|
|
6949
|
+
]
|
|
6950
|
+
}
|
|
6951
|
+
},
|
|
6952
|
+
"required": [
|
|
6953
|
+
"org_id",
|
|
6954
|
+
"plan",
|
|
6955
|
+
"email",
|
|
6956
|
+
"limits"
|
|
6957
|
+
]
|
|
6958
|
+
},
|
|
6959
|
+
"sdkName": "verifyAgentClaim",
|
|
6960
|
+
"summary": "Verify an agent account email claim",
|
|
6961
|
+
"tag": "Agent",
|
|
6962
|
+
"tagCommand": "agent"
|
|
6963
|
+
},
|
|
6415
6964
|
{
|
|
6416
6965
|
"binaryResponse": false,
|
|
6417
6966
|
"bodyRequired": true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primitivedotdev/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Official Primitive Node.js SDK: webhook, api, openapi, contract, and parser runtime modules.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"test:coverage": "vitest run --coverage",
|
|
57
57
|
"test:watch": "vitest",
|
|
58
58
|
"typecheck": "pnpm generate && tsc --noEmit -p tsconfig.typecheck.json",
|
|
59
|
-
"lint": "biome check --error-on-warnings src/index.ts src/validation.ts src/types.ts src/webhook src/contract src/parser src/api/index.ts src/openapi/index.ts tests/",
|
|
60
|
-
"lint:fix": "biome check --write --error-on-warnings src/index.ts src/validation.ts src/types.ts src/webhook src/contract src/parser src/api/index.ts src/openapi/index.ts tests/",
|
|
59
|
+
"lint": "biome check --error-on-warnings src/index.ts src/validation.ts src/types.ts src/webhook src/contract src/parser src/api/index.ts src/x402 src/openapi/index.ts tests/",
|
|
60
|
+
"lint:fix": "biome check --write --error-on-warnings src/index.ts src/validation.ts src/types.ts src/webhook src/contract src/parser src/api/index.ts src/x402 src/openapi/index.ts tests/",
|
|
61
61
|
"prepublishOnly": "pnpm build"
|
|
62
62
|
},
|
|
63
63
|
"keywords": [
|
|
@@ -91,7 +91,8 @@
|
|
|
91
91
|
"nodemailer": "^8.0.7",
|
|
92
92
|
"sanitize-html": "^2.14.0",
|
|
93
93
|
"tar-stream": "^3.1.8",
|
|
94
|
-
"validator": "^13.15.35"
|
|
94
|
+
"validator": "^13.15.35",
|
|
95
|
+
"viem": "^2.21.0"
|
|
95
96
|
},
|
|
96
97
|
"devDependencies": {
|
|
97
98
|
"@biomejs/biome": "^2.4.10",
|