@primitivedotdev/sdk 0.19.0 → 0.20.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/generated/index.js +1 -1
- package/dist/api/generated/sdk.gen.js +205 -0
- package/dist/api/index.d.ts +2 -2
- package/dist/{api-C5VR_Opg.js → api-DNF21MDo.js} +246 -1
- package/dist/{index-oRkCqj6u.d.ts → index-C6ObsYjq.d.ts} +732 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/oclif/api-command.js +13 -0
- package/dist/oclif/commands/functions-deploy.js +108 -0
- package/dist/oclif/commands/functions-redeploy.js +97 -0
- package/dist/oclif/index.js +10 -0
- package/dist/openapi/openapi.generated.js +872 -1
- package/dist/openapi/operations.generated.js +690 -0
- package/oclif.manifest.json +703 -1
- package/package.json +4 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
export { addDomain, cliLogout, createEndpoint, createFilter, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listSentEmails, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, startCliLogin, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain } from './sdk.gen.js';
|
|
2
|
+
export { addDomain, cliLogout, createEndpoint, createFilter, createFunction, createFunctionSecret, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, deleteFunction, deleteFunctionSecret, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getFunction, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listFunctions, listFunctionSecrets, listSentEmails, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, setFunctionSecret, startCliLogin, testEndpoint, testFunction, updateAccount, updateDomain, updateEndpoint, updateFilter, updateFunction, verifyDomain } from './sdk.gen.js';
|
|
@@ -607,3 +607,208 @@ export const getSentEmail = (options) => (options.client ?? client).get({
|
|
|
607
607
|
url: '/sent-emails/{id}',
|
|
608
608
|
...options
|
|
609
609
|
});
|
|
610
|
+
/**
|
|
611
|
+
* List functions
|
|
612
|
+
*
|
|
613
|
+
* Returns every active (non-deleted) function in the org, newest
|
|
614
|
+
* first. Each entry carries the deploy status and the gateway URL
|
|
615
|
+
* that the platform's webhook delivery loop posts to. To inspect
|
|
616
|
+
* the source code or deploy errors, use `GET /functions/{id}`.
|
|
617
|
+
*
|
|
618
|
+
*/
|
|
619
|
+
export const listFunctions = (options) => (options?.client ?? client).get({
|
|
620
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
621
|
+
url: '/functions',
|
|
622
|
+
...options
|
|
623
|
+
});
|
|
624
|
+
/**
|
|
625
|
+
* Deploy a function
|
|
626
|
+
*
|
|
627
|
+
* Creates and deploys a new function. The handler must be a single
|
|
628
|
+
* ESM module that exports a default async function receiving the
|
|
629
|
+
* `email.received` event (see the Webhook payload section for the
|
|
630
|
+
* full schema). Code is bundled before being uploaded; ship a
|
|
631
|
+
* single self-contained file rather than relying on external
|
|
632
|
+
* imports.
|
|
633
|
+
*
|
|
634
|
+
* **Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`
|
|
635
|
+
* (optional) is capped at 5 MiB UTF-8 and is stored only on the
|
|
636
|
+
* edge runtime side; it is not persisted in Primitive's database.
|
|
637
|
+
*
|
|
638
|
+
* **Auto-wiring.** On successful deploy, Primitive automatically
|
|
639
|
+
* creates a webhook endpoint that delivers inbound mail to the
|
|
640
|
+
* function. There is nothing to configure on the Endpoints API
|
|
641
|
+
* for this to work; the gateway URL returned here is for
|
|
642
|
+
* reference only and is not directly callable from outside.
|
|
643
|
+
*
|
|
644
|
+
* **Secrets.** New functions ship with the managed secrets
|
|
645
|
+
* (`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`) already
|
|
646
|
+
* bound. Add user-set secrets via
|
|
647
|
+
* `POST /functions/{id}/secrets`; secret writes only land in the
|
|
648
|
+
* running handler on the next redeploy.
|
|
649
|
+
*
|
|
650
|
+
*/
|
|
651
|
+
export const createFunction = (options) => (options.client ?? client).post({
|
|
652
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
653
|
+
url: '/functions',
|
|
654
|
+
...options,
|
|
655
|
+
headers: {
|
|
656
|
+
'Content-Type': 'application/json',
|
|
657
|
+
...options.headers
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
/**
|
|
661
|
+
* Delete a function
|
|
662
|
+
*
|
|
663
|
+
* Soft-deletes the function row, removes the script from the edge
|
|
664
|
+
* runtime, and deactivates the auto-wired webhook endpoint so no
|
|
665
|
+
* further inbound mail is delivered. Past deploy history,
|
|
666
|
+
* invocations, and logs are retained.
|
|
667
|
+
*
|
|
668
|
+
* Returns 502 if the runtime delete fails partway; the function
|
|
669
|
+
* row stays in place and the call is safe to retry until it
|
|
670
|
+
* succeeds.
|
|
671
|
+
*
|
|
672
|
+
*/
|
|
673
|
+
export const deleteFunction = (options) => (options.client ?? client).delete({
|
|
674
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
675
|
+
url: '/functions/{id}',
|
|
676
|
+
...options
|
|
677
|
+
});
|
|
678
|
+
/**
|
|
679
|
+
* Get a function
|
|
680
|
+
*
|
|
681
|
+
* Returns the full record for a function, including its current
|
|
682
|
+
* source code and the deploy status / error from the most recent
|
|
683
|
+
* deploy attempt.
|
|
684
|
+
*
|
|
685
|
+
*/
|
|
686
|
+
export const getFunction = (options) => (options.client ?? client).get({
|
|
687
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
688
|
+
url: '/functions/{id}',
|
|
689
|
+
...options
|
|
690
|
+
});
|
|
691
|
+
/**
|
|
692
|
+
* Update and redeploy a function
|
|
693
|
+
*
|
|
694
|
+
* Replaces the function's source code with the body's `code` and
|
|
695
|
+
* triggers a redeploy. Same size limits as `POST /functions`.
|
|
696
|
+
* Use this verb to push secret writes into the running handler:
|
|
697
|
+
* passing the same `code` re-runs the deploy and refreshes the
|
|
698
|
+
* binding set with the latest values from the secrets table.
|
|
699
|
+
*
|
|
700
|
+
* On a 502 deploy failure, the previously-deployed code stays
|
|
701
|
+
* live; the runtime never serves a half-built bundle. The
|
|
702
|
+
* `deploy_error` field on the returned record carries the error
|
|
703
|
+
* that came back from the runtime so you can surface it to users
|
|
704
|
+
* without polling.
|
|
705
|
+
*
|
|
706
|
+
*/
|
|
707
|
+
export const updateFunction = (options) => (options.client ?? client).put({
|
|
708
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
709
|
+
url: '/functions/{id}',
|
|
710
|
+
...options,
|
|
711
|
+
headers: {
|
|
712
|
+
'Content-Type': 'application/json',
|
|
713
|
+
...options.headers
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
/**
|
|
717
|
+
* Send a test invocation
|
|
718
|
+
*
|
|
719
|
+
* Sends a real test email from a Primitive-controlled sender to a
|
|
720
|
+
* synthetic local-part on one of the org's verified inbound
|
|
721
|
+
* domains. The function fires through the normal MX delivery
|
|
722
|
+
* path, so reply / send-mail calls from inside the handler
|
|
723
|
+
* against the inbound's `email.id` work the same as in
|
|
724
|
+
* production. Returns immediately after the send is queued; the
|
|
725
|
+
* invocation appears on the function's invocations list within a
|
|
726
|
+
* few seconds.
|
|
727
|
+
*
|
|
728
|
+
* Requires that the function is currently `deployed`. Returns 422
|
|
729
|
+
* if the function is in `pending` or `failed` state, or if the
|
|
730
|
+
* org has no verified inbound domain to receive the test mail.
|
|
731
|
+
*
|
|
732
|
+
*/
|
|
733
|
+
export const testFunction = (options) => (options.client ?? client).post({
|
|
734
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
735
|
+
url: '/functions/{id}/test',
|
|
736
|
+
...options
|
|
737
|
+
});
|
|
738
|
+
/**
|
|
739
|
+
* List a function's secrets
|
|
740
|
+
*
|
|
741
|
+
* Returns metadata for every secret bound to the function, with
|
|
742
|
+
* managed entries (provisioned by Primitive) listed first and
|
|
743
|
+
* user-set entries listed alphabetically after. **Values are
|
|
744
|
+
* never returned.** Secret writes are write-only.
|
|
745
|
+
*
|
|
746
|
+
* Managed entries (e.g. `PRIMITIVE_WEBHOOK_SECRET`,
|
|
747
|
+
* `PRIMITIVE_API_KEY`) carry a `description` instead of
|
|
748
|
+
* `created_at` / `updated_at`. They cannot be created, updated,
|
|
749
|
+
* or deleted via this API.
|
|
750
|
+
*
|
|
751
|
+
*/
|
|
752
|
+
export const listFunctionSecrets = (options) => (options.client ?? client).get({
|
|
753
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
754
|
+
url: '/functions/{id}/secrets',
|
|
755
|
+
...options
|
|
756
|
+
});
|
|
757
|
+
/**
|
|
758
|
+
* Create or update a secret
|
|
759
|
+
*
|
|
760
|
+
* Idempotent insert-or-update keyed on `(function_id, key)`.
|
|
761
|
+
* Returns 201 the first time the key is set, 200 on subsequent
|
|
762
|
+
* updates. Values are encrypted at rest and only become visible
|
|
763
|
+
* to the running handler on the next deploy (`PUT /functions/{id}`
|
|
764
|
+
* with the existing code is sufficient to refresh bindings).
|
|
765
|
+
*
|
|
766
|
+
* Keys must match `^[A-Z_][A-Z0-9_]*$` (uppercase letters,
|
|
767
|
+
* digits, underscores; first character is a letter or
|
|
768
|
+
* underscore). Values are at most 4096 UTF-8 bytes. System-
|
|
769
|
+
* managed keys are reserved and rejected.
|
|
770
|
+
*
|
|
771
|
+
*/
|
|
772
|
+
export const createFunctionSecret = (options) => (options.client ?? client).post({
|
|
773
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
774
|
+
url: '/functions/{id}/secrets',
|
|
775
|
+
...options,
|
|
776
|
+
headers: {
|
|
777
|
+
'Content-Type': 'application/json',
|
|
778
|
+
...options.headers
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
/**
|
|
782
|
+
* Delete a secret
|
|
783
|
+
*
|
|
784
|
+
* Removes the secret. The binding stays live in the running
|
|
785
|
+
* handler until the next deploy refreshes the binding set
|
|
786
|
+
* (`PUT /functions/{id}` with the existing code is sufficient).
|
|
787
|
+
* Returns 404 if the key did not exist. Managed system keys
|
|
788
|
+
* cannot be deleted.
|
|
789
|
+
*
|
|
790
|
+
*/
|
|
791
|
+
export const deleteFunctionSecret = (options) => (options.client ?? client).delete({
|
|
792
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
793
|
+
url: '/functions/{id}/secrets/{key}',
|
|
794
|
+
...options
|
|
795
|
+
});
|
|
796
|
+
/**
|
|
797
|
+
* Set a secret by key
|
|
798
|
+
*
|
|
799
|
+
* Path-keyed companion to `POST /functions/{id}/secrets`.
|
|
800
|
+
* Idempotent: returns 201 the first time the key is set, 200 on
|
|
801
|
+
* subsequent updates. Same validation rules and same write-only
|
|
802
|
+
* guarantees as the POST verb; the new value lands in the running
|
|
803
|
+
* handler on the next deploy.
|
|
804
|
+
*
|
|
805
|
+
*/
|
|
806
|
+
export const setFunctionSecret = (options) => (options.client ?? client).put({
|
|
807
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
808
|
+
url: '/functions/{id}/secrets/{key}',
|
|
809
|
+
...options,
|
|
810
|
+
headers: {
|
|
811
|
+
'Content-Type': 'application/json',
|
|
812
|
+
...options.headers
|
|
813
|
+
}
|
|
814
|
+
});
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { Account, AccountUpdated, AddDomainData, AddDomainError, AddDomainErrors, AddDomainInput, AddDomainResponse, AddDomainResponses, Auth, CliLoginPollResult, CliLoginStartResult, CliLogoutData, CliLogoutError, CliLogoutErrors, CliLogoutInput, CliLogoutResponse, CliLogoutResponses, CliLogoutResult, ClientOptions, CreateClientConfig, CreateEndpointData, CreateEndpointError, CreateEndpointErrors, CreateEndpointInput, CreateEndpointResponse, CreateEndpointResponses, CreateFilterData, CreateFilterError, CreateFilterErrors, CreateFilterInput, CreateFilterResponse, CreateFilterResponses, Cursor, DEFAULT_BASE_URL, DeleteDomainData, DeleteDomainError, DeleteDomainErrors, DeleteDomainResponse, DeleteDomainResponses, DeleteEmailData, DeleteEmailError, DeleteEmailErrors, DeleteEmailResponse, DeleteEmailResponses, DeleteEndpointData, DeleteEndpointError, DeleteEndpointErrors, DeleteEndpointResponse, DeleteEndpointResponses, DeleteFilterData, DeleteFilterError, DeleteFilterErrors, DeleteFilterResponse, DeleteFilterResponses, DeliveryStatus, DeliverySummary, DiscardContentResult, DiscardEmailContentData, DiscardEmailContentError, DiscardEmailContentErrors, DiscardEmailContentResponse, DiscardEmailContentResponses, Domain, DomainVerifyResult, DownloadAttachmentsData, DownloadAttachmentsError, DownloadAttachmentsErrors, DownloadAttachmentsResponse, DownloadAttachmentsResponses, DownloadRawEmailData, DownloadRawEmailError, DownloadRawEmailErrors, DownloadRawEmailResponse, DownloadRawEmailResponses, EmailDetail, EmailDetailReply, EmailStatus, EmailSummary, EmailWebhookStatus, Endpoint, ErrorResponse, Filter, ForwardInput, GateDenial, GateFix, GetAccountData, GetAccountError, GetAccountErrors, GetAccountResponse, GetAccountResponses, GetEmailData, GetEmailError, GetEmailErrors, GetEmailResponse, GetEmailResponses, GetSendPermissionsData, GetSendPermissionsError, GetSendPermissionsErrors, GetSendPermissionsResponse, GetSendPermissionsResponses, GetSentEmailData, GetSentEmailError, GetSentEmailErrors, GetSentEmailResponse, GetSentEmailResponses, GetStorageStatsData, GetStorageStatsError, GetStorageStatsErrors, GetStorageStatsResponse, GetStorageStatsResponses, GetWebhookSecretData, GetWebhookSecretError, GetWebhookSecretErrors, GetWebhookSecretResponse, GetWebhookSecretResponses, Limit, ListDeliveriesData, ListDeliveriesError, ListDeliveriesErrors, ListDeliveriesResponse, ListDeliveriesResponses, ListDomainsData, ListDomainsError, ListDomainsErrors, ListDomainsResponse, ListDomainsResponses, ListEmailsData, ListEmailsError, ListEmailsErrors, ListEmailsResponse, ListEmailsResponses, ListEndpointsData, ListEndpointsError, ListEndpointsErrors, ListEndpointsResponse, ListEndpointsResponses, ListEnvelope, ListFiltersData, ListFiltersError, ListFiltersErrors, ListFiltersResponse, ListFiltersResponses, ListSentEmailsData, ListSentEmailsError, ListSentEmailsErrors, ListSentEmailsResponse, ListSentEmailsResponses, Options, PaginationMeta, PollCliLoginData, PollCliLoginError, PollCliLoginErrors, PollCliLoginInput, PollCliLoginResponse, PollCliLoginResponses, PrimitiveApiClient, PrimitiveApiClientOptions, PrimitiveApiError, PrimitiveApiErrorDetails, PrimitiveClient, PrimitiveClientOptions, Client as PrimitiveGeneratedApiClient, ClientOptions$1 as PrimitiveGeneratedApiClientOptions, Config as PrimitiveGeneratedApiConfig, Options$1 as PrimitiveGeneratedApiOptions, RequestOptions as PrimitiveGeneratedApiRequestOptions, RequestResult as PrimitiveGeneratedApiRequestResult, ReplayDeliveryData, ReplayDeliveryError, ReplayDeliveryErrors, ReplayDeliveryResponse, ReplayDeliveryResponses, ReplayEmailWebhooksData, ReplayEmailWebhooksError, ReplayEmailWebhooksErrors, ReplayEmailWebhooksResponse, ReplayEmailWebhooksResponses, ReplayResult, ReplyInput, ReplyToEmailData, ReplyToEmailError, ReplyToEmailErrors, ReplyToEmailResponse, ReplyToEmailResponses, RequestOptions$1 as RequestOptions, ResourceId, ResponseStyle, RotateWebhookSecretData, RotateWebhookSecretError, RotateWebhookSecretErrors, RotateWebhookSecretResponse, RotateWebhookSecretResponses, SendEmailData, SendEmailError, SendEmailErrors, SendEmailResponse, SendEmailResponses, SendInput, SendMailInput, SendMailResult, SendPermissionAddress, SendPermissionAnyRecipient, SendPermissionManagedZone, SendPermissionRule, SendPermissionYourDomain, SendPermissionsMeta, SendResult, SendThreadInput, SentEmailDetail, SentEmailStatus, SentEmailSummary, StartCliLoginData, StartCliLoginError, StartCliLoginErrors, StartCliLoginInput, StartCliLoginResponse, StartCliLoginResponses, StorageStats, SuccessEnvelope, TestEndpointData, TestEndpointError, TestEndpointErrors, TestEndpointResponse, TestEndpointResponses, TestResult, UnverifiedDomain, UpdateAccountData, UpdateAccountError, UpdateAccountErrors, UpdateAccountInput, UpdateAccountResponse, UpdateAccountResponses, UpdateDomainData, UpdateDomainError, UpdateDomainErrors, UpdateDomainInput, UpdateDomainResponse, UpdateDomainResponses, UpdateEndpointData, UpdateEndpointError, UpdateEndpointErrors, UpdateEndpointInput, UpdateEndpointResponse, UpdateEndpointResponses, UpdateFilterData, UpdateFilterError, UpdateFilterErrors, UpdateFilterInput, UpdateFilterResponse, UpdateFilterResponses, VerifiedDomain, VerifyDomainData, VerifyDomainError, VerifyDomainErrors, VerifyDomainResponse, VerifyDomainResponses, WebhookSecret, addDomain, cliLogout, client, createEndpoint, createFilter, createPrimitiveApiClient, createPrimitiveClient, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listSentEmails, operations, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, startCliLogin, testEndpoint, updateAccount, updateDomain, updateEndpoint, updateFilter, verifyDomain };
|
|
1
|
+
import { $ as rotateWebhookSecret, $a as UpdateAccountData, $i as ReplyToEmailData, $n as EmailStatus, $r as ListDomainsData, $t as CreateFunctionSecretResponses, A as deleteFunctionSecret, Aa as SetFunctionSecretResponse, Ai as ListSentEmailsData, An as DeleteFunctionSecretResponses, Ao as VerifyDomainData, Ar as GetSendPermissionsResponse, At as CreateEndpointError, B as getWebhookSecret, Ba as TestEndpointData, Bi as PollCliLoginResponse, Bn as DomainVerifyResult, Bo as Options$1, Br as GetStorageStatsResponse, Bt as CreateFilterResponses, C as createFunction, Ca as SentEmailDetail, Ci as ListFunctionSecretsResponse, Cn as DeleteFunctionErrors, Co as UpdateFunctionData, Cr as GetFunctionError, Ct as CliLogoutErrors, D as deleteEndpoint, Da as SetFunctionSecretError, Di as ListFunctionsErrors, Dn as DeleteFunctionSecretError, Do as UpdateFunctionResponse, Dr as GetSendPermissionsData, Dt as CliLogoutResult, E as deleteEmail, Ea as SetFunctionSecretData, Ei as ListFunctionsError, En as DeleteFunctionSecretData, Eo as UpdateFunctionInput, Er as GetFunctionResponses, Et as CliLogoutResponses, F as getEmail, Fa as StartCliLoginInput, Fi as PaginationMeta, Fn as DiscardEmailContentError, Fo as WebhookSecret, Fr as GetSentEmailResponse, Ft as CreateFilterData, G as listFilters, Ga as TestFunctionData, Gi as ReplayDeliveryResponse, Gn as DownloadAttachmentsResponses, Gr as GetWebhookSecretResponse, Gt as CreateFunctionResponse, H as listDomains, Ha as TestEndpointErrors, Hi as ReplayDeliveryData, Hn as DownloadAttachmentsError, Ho as RequestResult, Hr as GetWebhookSecretData, Ht as CreateFunctionError, I as getFunction, Ia as StartCliLoginResponse, Ii as PollCliLoginData, In as DiscardEmailContentErrors, Io as Client, Ir as GetSentEmailResponses, It as CreateFilterError, J as listSentEmails, Ja as TestFunctionResponse, Ji as ReplayEmailWebhooksError, Jn as DownloadRawEmailErrors, Jr as ListDeliveriesData, Jt as CreateFunctionSecretData, K as listFunctionSecrets, Ka as TestFunctionError, Ki as ReplayDeliveryResponses, Kn as DownloadRawEmailData, Kr as GetWebhookSecretResponses, Kt as CreateFunctionResponses, L as getSendPermissions, La as StartCliLoginResponses, Li as PollCliLoginError, Ln as DiscardEmailContentResponse, Lo as ClientOptions$1, Lr as GetStorageStatsData, Lt as CreateFilterErrors, M as downloadAttachments, Ma as StartCliLoginData, Mi as ListSentEmailsErrors, Mn as DeliverySummary, Mo as VerifyDomainErrors, Mr as GetSentEmailData, Mt as CreateEndpointInput, N as downloadRawEmail, Na as StartCliLoginError, Ni as ListSentEmailsResponse, Nn as DiscardContentResult, No as VerifyDomainResponse, Nr as GetSentEmailError, Nt as CreateEndpointResponse, O as deleteFilter, Oa as SetFunctionSecretErrors, Oi as ListFunctionsResponse, On as DeleteFunctionSecretErrors, Oo as UpdateFunctionResponses, Or as GetSendPermissionsError, Ot as ClientOptions, P as getAccount, Pa as StartCliLoginErrors, Pi as ListSentEmailsResponses, Pn as DiscardEmailContentData, Po as VerifyDomainResponses, Pr as GetSentEmailErrors, Pt as CreateEndpointResponses, Q as replyToEmail, Qa as UnverifiedDomain, Qi as ReplayResult, Qn as EmailDetailReply, Qr as ListDeliveriesResponses, Qt as CreateFunctionSecretResponse, R as getSentEmail, Ra as StorageStats, Ri as PollCliLoginErrors, Rn as DiscardEmailContentResponses, Ro as Config, Rr as GetStorageStatsError, Rt as CreateFilterInput, S as createFilter, Sa as SendPermissionsMeta, Si as ListFunctionSecretsErrors, Sn as DeleteFunctionError, So as UpdateFilterResponses, Sr as GetFunctionData, St as CliLogoutError, T as deleteDomain, Ta as SentEmailSummary, Ti as ListFunctionsData, Tn as DeleteFunctionResponses, To as UpdateFunctionErrors, Tr as GetFunctionResponse, Tt as CliLogoutResponse, U as listEmails, Ua as TestEndpointResponse, Ui as ReplayDeliveryError, Un as DownloadAttachmentsErrors, Uo as ResponseStyle, Ur as GetWebhookSecretError, Ut as CreateFunctionErrors, V as listDeliveries, Va as TestEndpointError, Vi as PollCliLoginResponses, Vn as DownloadAttachmentsData, Vo as RequestOptions, Vr as GetStorageStatsResponses, Vt as CreateFunctionData, W as listEndpoints, Wa as TestEndpointResponses, Wi as ReplayDeliveryErrors, Wn as DownloadAttachmentsResponse, Wo as Auth, Wr as GetWebhookSecretErrors, Wt as CreateFunctionInput, X as replayDelivery, Xa as TestInvocationResult, Xi as ReplayEmailWebhooksResponse, Xn as DownloadRawEmailResponses, Xr as ListDeliveriesErrors, Xt as CreateFunctionSecretErrors, Y as pollCliLogin, Ya as TestFunctionResponses, Yi as ReplayEmailWebhooksErrors, Yn as DownloadRawEmailResponse, Yr as ListDeliveriesError, Yt as CreateFunctionSecretError, Z as replayEmailWebhooks, Za as TestResult, Zi as ReplayEmailWebhooksResponses, Zn as EmailDetail, Zr as ListDeliveriesResponse, Zt as CreateFunctionSecretInput, _ as operations, _a as SendPermissionAddress, _i as ListFiltersErrors, _n as DeleteFilterError, _o as UpdateFilterData, _r as GetEmailData, _t as AddDomainResponse, a as PrimitiveApiError, aa as RotateWebhookSecretData, ai as ListEmailsError, an as DeleteDomainResponses, ao as UpdateDomainData, ar as FunctionDeployStatus, at as updateAccount, b as cliLogout, ba as SendPermissionRule, bi as ListFunctionSecretsData, bn as DeleteFilterResponses, bo as UpdateFilterInput, br as GetEmailResponse, bt as CliLoginStartResult, c as PrimitiveClientOptions, ca as RotateWebhookSecretResponse, ci as ListEmailsResponses, cn as DeleteEmailErrors, co as UpdateDomainInput, cr as FunctionSecretListItem, ct as updateFilter, d as SendInput, da as SendEmailError, di as ListEndpointsErrors, dn as DeleteEndpointData, do as UpdateEndpointData, dr as GateFix, dt as Account, ea as ReplyToEmailError, ei as ListDomainsError, en as Cursor, eo as UpdateAccountError, er as EmailSummary, et as sendEmail, f as SendResult, fa as SendEmailErrors, fi as ListEndpointsResponse, fn as DeleteEndpointError, fo as UpdateEndpointError, fr as GetAccountData, ft as AccountUpdated, g as createPrimitiveClient, ga as SendMailResult, gi as ListFiltersError, gn as DeleteFilterData, go as UpdateEndpointResponses, gr as GetAccountResponses, gt as AddDomainInput, h as createPrimitiveApiClient, ha as SendMailInput, hi as ListFiltersData, hn as DeleteEndpointResponses, ho as UpdateEndpointResponse, hr as GetAccountResponse, ht as AddDomainErrors, i as PrimitiveApiClientOptions, ia as ResourceId, ii as ListEmailsData, in as DeleteDomainResponse, io as UpdateAccountResponses, ir as Filter, it as testFunction, j as discardEmailContent, ja as SetFunctionSecretResponses, ji as ListSentEmailsError, jn as DeliveryStatus, jo as VerifyDomainError, jr as GetSendPermissionsResponses, jt as CreateEndpointErrors, k as deleteFunction, ka as SetFunctionSecretInput, ki as ListFunctionsResponses, kn as DeleteFunctionSecretResponse, ko as VerifiedDomain, kr as GetSendPermissionsErrors, kt as CreateEndpointData, l as ReplyInput, la as RotateWebhookSecretResponses, li as ListEndpointsData, ln as DeleteEmailResponse, lo as UpdateDomainResponse, lr as FunctionSecretWriteResult, lt as updateFunction, m as client, ma as SendEmailResponses, mi as ListEnvelope, mn as DeleteEndpointResponse, mo as UpdateEndpointInput, mr as GetAccountErrors, mt as AddDomainError, n as ForwardInput, na as ReplyToEmailResponse, ni as ListDomainsResponse, nn as DeleteDomainError, no as UpdateAccountInput, nr as Endpoint, nt as startCliLogin, o as PrimitiveApiErrorDetails, oa as RotateWebhookSecretError, oi as ListEmailsErrors, on as DeleteEmailData, oo as UpdateDomainError, or as FunctionDetail, ot as updateDomain, p as SendThreadInput, pa as SendEmailResponse, pi as ListEndpointsResponses, pn as DeleteEndpointErrors, po as UpdateEndpointErrors, pr as GetAccountError, pt as AddDomainData, q as listFunctions, qa as TestFunctionErrors, qi as ReplayEmailWebhooksData, qn as DownloadRawEmailError, qr as Limit, qt as CreateFunctionResult, r as PrimitiveApiClient, ra as ReplyToEmailResponses, ri as ListDomainsResponses, rn as DeleteDomainErrors, ro as UpdateAccountResponse, rr as ErrorResponse, rt as testEndpoint, s as PrimitiveClient, sa as RotateWebhookSecretErrors, si as ListEmailsResponse, sn as DeleteEmailError, so as UpdateDomainErrors, sr as FunctionListItem, st as updateEndpoint, t as DEFAULT_BASE_URL, ta as ReplyToEmailErrors, ti as ListDomainsErrors, tn as DeleteDomainData, to as UpdateAccountErrors, tr as EmailWebhookStatus, tt as setFunctionSecret, u as RequestOptions$1, ua as SendEmailData, ui as ListEndpointsError, un as DeleteEmailResponses, uo as UpdateDomainResponses, ur as GateDenial, ut as verifyDomain, v as Options, va as SendPermissionAnyRecipient, vi as ListFiltersResponse, vn as DeleteFilterErrors, vo as UpdateFilterError, vr as GetEmailError, vt as AddDomainResponses, w as createFunctionSecret, wa as SentEmailStatus, wi as ListFunctionSecretsResponses, wn as DeleteFunctionResponse, wo as UpdateFunctionError, wr as GetFunctionErrors, wt as CliLogoutInput, x as createEndpoint, xa as SendPermissionYourDomain, xi as ListFunctionSecretsError, xn as DeleteFunctionData, xo as UpdateFilterResponse, xr as GetEmailResponses, xt as CliLogoutData, y as addDomain, ya as SendPermissionManagedZone, yi as ListFiltersResponses, yn as DeleteFilterResponse, yo as UpdateFilterErrors, yr as GetEmailErrors, yt as CliLoginPollResult, z as getStorageStats, za as SuccessEnvelope, zi as PollCliLoginInput, zn as Domain, zo as CreateClientConfig, zr as GetStorageStatsErrors, zt as CreateFilterResponse } from "../index-C6ObsYjq.js";
|
|
2
|
+
export { Account, AccountUpdated, AddDomainData, AddDomainError, AddDomainErrors, AddDomainInput, AddDomainResponse, AddDomainResponses, Auth, CliLoginPollResult, CliLoginStartResult, CliLogoutData, CliLogoutError, CliLogoutErrors, CliLogoutInput, CliLogoutResponse, CliLogoutResponses, CliLogoutResult, ClientOptions, CreateClientConfig, CreateEndpointData, CreateEndpointError, CreateEndpointErrors, CreateEndpointInput, CreateEndpointResponse, CreateEndpointResponses, CreateFilterData, CreateFilterError, CreateFilterErrors, CreateFilterInput, CreateFilterResponse, CreateFilterResponses, CreateFunctionData, CreateFunctionError, CreateFunctionErrors, CreateFunctionInput, CreateFunctionResponse, CreateFunctionResponses, CreateFunctionResult, CreateFunctionSecretData, CreateFunctionSecretError, CreateFunctionSecretErrors, CreateFunctionSecretInput, CreateFunctionSecretResponse, CreateFunctionSecretResponses, Cursor, DEFAULT_BASE_URL, DeleteDomainData, DeleteDomainError, DeleteDomainErrors, DeleteDomainResponse, DeleteDomainResponses, DeleteEmailData, DeleteEmailError, DeleteEmailErrors, DeleteEmailResponse, DeleteEmailResponses, DeleteEndpointData, DeleteEndpointError, DeleteEndpointErrors, DeleteEndpointResponse, DeleteEndpointResponses, DeleteFilterData, DeleteFilterError, DeleteFilterErrors, DeleteFilterResponse, DeleteFilterResponses, DeleteFunctionData, DeleteFunctionError, DeleteFunctionErrors, DeleteFunctionResponse, DeleteFunctionResponses, DeleteFunctionSecretData, DeleteFunctionSecretError, DeleteFunctionSecretErrors, DeleteFunctionSecretResponse, DeleteFunctionSecretResponses, DeliveryStatus, DeliverySummary, DiscardContentResult, DiscardEmailContentData, DiscardEmailContentError, DiscardEmailContentErrors, DiscardEmailContentResponse, DiscardEmailContentResponses, Domain, DomainVerifyResult, DownloadAttachmentsData, DownloadAttachmentsError, DownloadAttachmentsErrors, DownloadAttachmentsResponse, DownloadAttachmentsResponses, DownloadRawEmailData, DownloadRawEmailError, DownloadRawEmailErrors, DownloadRawEmailResponse, DownloadRawEmailResponses, EmailDetail, EmailDetailReply, EmailStatus, EmailSummary, EmailWebhookStatus, Endpoint, ErrorResponse, Filter, ForwardInput, FunctionDeployStatus, FunctionDetail, FunctionListItem, FunctionSecretListItem, FunctionSecretWriteResult, GateDenial, GateFix, GetAccountData, GetAccountError, GetAccountErrors, GetAccountResponse, GetAccountResponses, GetEmailData, GetEmailError, GetEmailErrors, GetEmailResponse, GetEmailResponses, GetFunctionData, GetFunctionError, GetFunctionErrors, GetFunctionResponse, GetFunctionResponses, GetSendPermissionsData, GetSendPermissionsError, GetSendPermissionsErrors, GetSendPermissionsResponse, GetSendPermissionsResponses, GetSentEmailData, GetSentEmailError, GetSentEmailErrors, GetSentEmailResponse, GetSentEmailResponses, GetStorageStatsData, GetStorageStatsError, GetStorageStatsErrors, GetStorageStatsResponse, GetStorageStatsResponses, GetWebhookSecretData, GetWebhookSecretError, GetWebhookSecretErrors, GetWebhookSecretResponse, GetWebhookSecretResponses, Limit, ListDeliveriesData, ListDeliveriesError, ListDeliveriesErrors, ListDeliveriesResponse, ListDeliveriesResponses, ListDomainsData, ListDomainsError, ListDomainsErrors, ListDomainsResponse, ListDomainsResponses, ListEmailsData, ListEmailsError, ListEmailsErrors, ListEmailsResponse, ListEmailsResponses, ListEndpointsData, ListEndpointsError, ListEndpointsErrors, ListEndpointsResponse, ListEndpointsResponses, ListEnvelope, ListFiltersData, ListFiltersError, ListFiltersErrors, ListFiltersResponse, ListFiltersResponses, ListFunctionSecretsData, ListFunctionSecretsError, ListFunctionSecretsErrors, ListFunctionSecretsResponse, ListFunctionSecretsResponses, ListFunctionsData, ListFunctionsError, ListFunctionsErrors, ListFunctionsResponse, ListFunctionsResponses, ListSentEmailsData, ListSentEmailsError, ListSentEmailsErrors, ListSentEmailsResponse, ListSentEmailsResponses, Options, PaginationMeta, PollCliLoginData, PollCliLoginError, PollCliLoginErrors, PollCliLoginInput, PollCliLoginResponse, PollCliLoginResponses, PrimitiveApiClient, PrimitiveApiClientOptions, PrimitiveApiError, PrimitiveApiErrorDetails, PrimitiveClient, PrimitiveClientOptions, Client as PrimitiveGeneratedApiClient, ClientOptions$1 as PrimitiveGeneratedApiClientOptions, Config as PrimitiveGeneratedApiConfig, Options$1 as PrimitiveGeneratedApiOptions, RequestOptions as PrimitiveGeneratedApiRequestOptions, RequestResult as PrimitiveGeneratedApiRequestResult, ReplayDeliveryData, ReplayDeliveryError, ReplayDeliveryErrors, ReplayDeliveryResponse, ReplayDeliveryResponses, ReplayEmailWebhooksData, ReplayEmailWebhooksError, ReplayEmailWebhooksErrors, ReplayEmailWebhooksResponse, ReplayEmailWebhooksResponses, ReplayResult, ReplyInput, ReplyToEmailData, ReplyToEmailError, ReplyToEmailErrors, ReplyToEmailResponse, ReplyToEmailResponses, RequestOptions$1 as RequestOptions, ResourceId, ResponseStyle, RotateWebhookSecretData, RotateWebhookSecretError, RotateWebhookSecretErrors, RotateWebhookSecretResponse, RotateWebhookSecretResponses, SendEmailData, SendEmailError, SendEmailErrors, SendEmailResponse, SendEmailResponses, SendInput, SendMailInput, SendMailResult, SendPermissionAddress, SendPermissionAnyRecipient, SendPermissionManagedZone, SendPermissionRule, SendPermissionYourDomain, SendPermissionsMeta, SendResult, SendThreadInput, SentEmailDetail, SentEmailStatus, SentEmailSummary, SetFunctionSecretData, SetFunctionSecretError, SetFunctionSecretErrors, SetFunctionSecretInput, SetFunctionSecretResponse, SetFunctionSecretResponses, StartCliLoginData, StartCliLoginError, StartCliLoginErrors, StartCliLoginInput, StartCliLoginResponse, StartCliLoginResponses, StorageStats, SuccessEnvelope, TestEndpointData, TestEndpointError, TestEndpointErrors, TestEndpointResponse, TestEndpointResponses, TestFunctionData, TestFunctionError, TestFunctionErrors, TestFunctionResponse, TestFunctionResponses, TestInvocationResult, TestResult, UnverifiedDomain, UpdateAccountData, UpdateAccountError, UpdateAccountErrors, UpdateAccountInput, UpdateAccountResponse, UpdateAccountResponses, UpdateDomainData, UpdateDomainError, UpdateDomainErrors, UpdateDomainInput, UpdateDomainResponse, UpdateDomainResponses, UpdateEndpointData, UpdateEndpointError, UpdateEndpointErrors, UpdateEndpointInput, UpdateEndpointResponse, UpdateEndpointResponses, UpdateFilterData, UpdateFilterError, UpdateFilterErrors, UpdateFilterInput, UpdateFilterResponse, UpdateFilterResponses, UpdateFunctionData, UpdateFunctionError, UpdateFunctionErrors, UpdateFunctionInput, UpdateFunctionResponse, UpdateFunctionResponses, VerifiedDomain, VerifyDomainData, VerifyDomainError, VerifyDomainErrors, VerifyDomainResponse, VerifyDomainResponses, WebhookSecret, addDomain, cliLogout, client, createEndpoint, createFilter, createFunction, createFunctionSecret, createPrimitiveApiClient, createPrimitiveClient, deleteDomain, deleteEmail, deleteEndpoint, deleteFilter, deleteFunction, deleteFunctionSecret, discardEmailContent, downloadAttachments, downloadRawEmail, getAccount, getEmail, getFunction, getSendPermissions, getSentEmail, getStorageStats, getWebhookSecret, listDeliveries, listDomains, listEmails, listEndpoints, listFilters, listFunctionSecrets, listFunctions, listSentEmails, operations, pollCliLogin, replayDelivery, replayEmailWebhooks, replyToEmail, rotateWebhookSecret, sendEmail, setFunctionSecret, startCliLogin, testEndpoint, testFunction, updateAccount, updateDomain, updateEndpoint, updateFilter, updateFunction, verifyDomain };
|
|
@@ -617,15 +617,20 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
617
617
|
cliLogout: () => cliLogout,
|
|
618
618
|
createEndpoint: () => createEndpoint,
|
|
619
619
|
createFilter: () => createFilter,
|
|
620
|
+
createFunction: () => createFunction,
|
|
621
|
+
createFunctionSecret: () => createFunctionSecret,
|
|
620
622
|
deleteDomain: () => deleteDomain,
|
|
621
623
|
deleteEmail: () => deleteEmail,
|
|
622
624
|
deleteEndpoint: () => deleteEndpoint,
|
|
623
625
|
deleteFilter: () => deleteFilter,
|
|
626
|
+
deleteFunction: () => deleteFunction,
|
|
627
|
+
deleteFunctionSecret: () => deleteFunctionSecret,
|
|
624
628
|
discardEmailContent: () => discardEmailContent,
|
|
625
629
|
downloadAttachments: () => downloadAttachments,
|
|
626
630
|
downloadRawEmail: () => downloadRawEmail,
|
|
627
631
|
getAccount: () => getAccount,
|
|
628
632
|
getEmail: () => getEmail,
|
|
633
|
+
getFunction: () => getFunction,
|
|
629
634
|
getSendPermissions: () => getSendPermissions,
|
|
630
635
|
getSentEmail: () => getSentEmail,
|
|
631
636
|
getStorageStats: () => getStorageStats,
|
|
@@ -635,6 +640,8 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
635
640
|
listEmails: () => listEmails,
|
|
636
641
|
listEndpoints: () => listEndpoints,
|
|
637
642
|
listFilters: () => listFilters,
|
|
643
|
+
listFunctionSecrets: () => listFunctionSecrets,
|
|
644
|
+
listFunctions: () => listFunctions,
|
|
638
645
|
listSentEmails: () => listSentEmails,
|
|
639
646
|
pollCliLogin: () => pollCliLogin,
|
|
640
647
|
replayDelivery: () => replayDelivery,
|
|
@@ -642,12 +649,15 @@ var sdk_gen_exports = /* @__PURE__ */ __exportAll({
|
|
|
642
649
|
replyToEmail: () => replyToEmail,
|
|
643
650
|
rotateWebhookSecret: () => rotateWebhookSecret,
|
|
644
651
|
sendEmail: () => sendEmail,
|
|
652
|
+
setFunctionSecret: () => setFunctionSecret,
|
|
645
653
|
startCliLogin: () => startCliLogin,
|
|
646
654
|
testEndpoint: () => testEndpoint,
|
|
655
|
+
testFunction: () => testFunction,
|
|
647
656
|
updateAccount: () => updateAccount,
|
|
648
657
|
updateDomain: () => updateDomain,
|
|
649
658
|
updateEndpoint: () => updateEndpoint,
|
|
650
659
|
updateFilter: () => updateFilter,
|
|
660
|
+
updateFunction: () => updateFunction,
|
|
651
661
|
verifyDomain: () => verifyDomain
|
|
652
662
|
});
|
|
653
663
|
/**
|
|
@@ -1359,6 +1369,241 @@ const getSentEmail = (options) => (options.client ?? client$1).get({
|
|
|
1359
1369
|
url: "/sent-emails/{id}",
|
|
1360
1370
|
...options
|
|
1361
1371
|
});
|
|
1372
|
+
/**
|
|
1373
|
+
* List functions
|
|
1374
|
+
*
|
|
1375
|
+
* Returns every active (non-deleted) function in the org, newest
|
|
1376
|
+
* first. Each entry carries the deploy status and the gateway URL
|
|
1377
|
+
* that the platform's webhook delivery loop posts to. To inspect
|
|
1378
|
+
* the source code or deploy errors, use `GET /functions/{id}`.
|
|
1379
|
+
*
|
|
1380
|
+
*/
|
|
1381
|
+
const listFunctions = (options) => (options?.client ?? client$1).get({
|
|
1382
|
+
security: [{
|
|
1383
|
+
scheme: "bearer",
|
|
1384
|
+
type: "http"
|
|
1385
|
+
}],
|
|
1386
|
+
url: "/functions",
|
|
1387
|
+
...options
|
|
1388
|
+
});
|
|
1389
|
+
/**
|
|
1390
|
+
* Deploy a function
|
|
1391
|
+
*
|
|
1392
|
+
* Creates and deploys a new function. The handler must be a single
|
|
1393
|
+
* ESM module that exports a default async function receiving the
|
|
1394
|
+
* `email.received` event (see the Webhook payload section for the
|
|
1395
|
+
* full schema). Code is bundled before being uploaded; ship a
|
|
1396
|
+
* single self-contained file rather than relying on external
|
|
1397
|
+
* imports.
|
|
1398
|
+
*
|
|
1399
|
+
* **Code limits.** `code` is capped at 1 MiB UTF-8. `sourceMap`
|
|
1400
|
+
* (optional) is capped at 5 MiB UTF-8 and is stored only on the
|
|
1401
|
+
* edge runtime side; it is not persisted in Primitive's database.
|
|
1402
|
+
*
|
|
1403
|
+
* **Auto-wiring.** On successful deploy, Primitive automatically
|
|
1404
|
+
* creates a webhook endpoint that delivers inbound mail to the
|
|
1405
|
+
* function. There is nothing to configure on the Endpoints API
|
|
1406
|
+
* for this to work; the gateway URL returned here is for
|
|
1407
|
+
* reference only and is not directly callable from outside.
|
|
1408
|
+
*
|
|
1409
|
+
* **Secrets.** New functions ship with the managed secrets
|
|
1410
|
+
* (`PRIMITIVE_WEBHOOK_SECRET`, `PRIMITIVE_API_KEY`) already
|
|
1411
|
+
* bound. Add user-set secrets via
|
|
1412
|
+
* `POST /functions/{id}/secrets`; secret writes only land in the
|
|
1413
|
+
* running handler on the next redeploy.
|
|
1414
|
+
*
|
|
1415
|
+
*/
|
|
1416
|
+
const createFunction = (options) => (options.client ?? client$1).post({
|
|
1417
|
+
security: [{
|
|
1418
|
+
scheme: "bearer",
|
|
1419
|
+
type: "http"
|
|
1420
|
+
}],
|
|
1421
|
+
url: "/functions",
|
|
1422
|
+
...options,
|
|
1423
|
+
headers: {
|
|
1424
|
+
"Content-Type": "application/json",
|
|
1425
|
+
...options.headers
|
|
1426
|
+
}
|
|
1427
|
+
});
|
|
1428
|
+
/**
|
|
1429
|
+
* Delete a function
|
|
1430
|
+
*
|
|
1431
|
+
* Soft-deletes the function row, removes the script from the edge
|
|
1432
|
+
* runtime, and deactivates the auto-wired webhook endpoint so no
|
|
1433
|
+
* further inbound mail is delivered. Past deploy history,
|
|
1434
|
+
* invocations, and logs are retained.
|
|
1435
|
+
*
|
|
1436
|
+
* Returns 502 if the runtime delete fails partway; the function
|
|
1437
|
+
* row stays in place and the call is safe to retry until it
|
|
1438
|
+
* succeeds.
|
|
1439
|
+
*
|
|
1440
|
+
*/
|
|
1441
|
+
const deleteFunction = (options) => (options.client ?? client$1).delete({
|
|
1442
|
+
security: [{
|
|
1443
|
+
scheme: "bearer",
|
|
1444
|
+
type: "http"
|
|
1445
|
+
}],
|
|
1446
|
+
url: "/functions/{id}",
|
|
1447
|
+
...options
|
|
1448
|
+
});
|
|
1449
|
+
/**
|
|
1450
|
+
* Get a function
|
|
1451
|
+
*
|
|
1452
|
+
* Returns the full record for a function, including its current
|
|
1453
|
+
* source code and the deploy status / error from the most recent
|
|
1454
|
+
* deploy attempt.
|
|
1455
|
+
*
|
|
1456
|
+
*/
|
|
1457
|
+
const getFunction = (options) => (options.client ?? client$1).get({
|
|
1458
|
+
security: [{
|
|
1459
|
+
scheme: "bearer",
|
|
1460
|
+
type: "http"
|
|
1461
|
+
}],
|
|
1462
|
+
url: "/functions/{id}",
|
|
1463
|
+
...options
|
|
1464
|
+
});
|
|
1465
|
+
/**
|
|
1466
|
+
* Update and redeploy a function
|
|
1467
|
+
*
|
|
1468
|
+
* Replaces the function's source code with the body's `code` and
|
|
1469
|
+
* triggers a redeploy. Same size limits as `POST /functions`.
|
|
1470
|
+
* Use this verb to push secret writes into the running handler:
|
|
1471
|
+
* passing the same `code` re-runs the deploy and refreshes the
|
|
1472
|
+
* binding set with the latest values from the secrets table.
|
|
1473
|
+
*
|
|
1474
|
+
* On a 502 deploy failure, the previously-deployed code stays
|
|
1475
|
+
* live; the runtime never serves a half-built bundle. The
|
|
1476
|
+
* `deploy_error` field on the returned record carries the error
|
|
1477
|
+
* that came back from the runtime so you can surface it to users
|
|
1478
|
+
* without polling.
|
|
1479
|
+
*
|
|
1480
|
+
*/
|
|
1481
|
+
const updateFunction = (options) => (options.client ?? client$1).put({
|
|
1482
|
+
security: [{
|
|
1483
|
+
scheme: "bearer",
|
|
1484
|
+
type: "http"
|
|
1485
|
+
}],
|
|
1486
|
+
url: "/functions/{id}",
|
|
1487
|
+
...options,
|
|
1488
|
+
headers: {
|
|
1489
|
+
"Content-Type": "application/json",
|
|
1490
|
+
...options.headers
|
|
1491
|
+
}
|
|
1492
|
+
});
|
|
1493
|
+
/**
|
|
1494
|
+
* Send a test invocation
|
|
1495
|
+
*
|
|
1496
|
+
* Sends a real test email from a Primitive-controlled sender to a
|
|
1497
|
+
* synthetic local-part on one of the org's verified inbound
|
|
1498
|
+
* domains. The function fires through the normal MX delivery
|
|
1499
|
+
* path, so reply / send-mail calls from inside the handler
|
|
1500
|
+
* against the inbound's `email.id` work the same as in
|
|
1501
|
+
* production. Returns immediately after the send is queued; the
|
|
1502
|
+
* invocation appears on the function's invocations list within a
|
|
1503
|
+
* few seconds.
|
|
1504
|
+
*
|
|
1505
|
+
* Requires that the function is currently `deployed`. Returns 422
|
|
1506
|
+
* if the function is in `pending` or `failed` state, or if the
|
|
1507
|
+
* org has no verified inbound domain to receive the test mail.
|
|
1508
|
+
*
|
|
1509
|
+
*/
|
|
1510
|
+
const testFunction = (options) => (options.client ?? client$1).post({
|
|
1511
|
+
security: [{
|
|
1512
|
+
scheme: "bearer",
|
|
1513
|
+
type: "http"
|
|
1514
|
+
}],
|
|
1515
|
+
url: "/functions/{id}/test",
|
|
1516
|
+
...options
|
|
1517
|
+
});
|
|
1518
|
+
/**
|
|
1519
|
+
* List a function's secrets
|
|
1520
|
+
*
|
|
1521
|
+
* Returns metadata for every secret bound to the function, with
|
|
1522
|
+
* managed entries (provisioned by Primitive) listed first and
|
|
1523
|
+
* user-set entries listed alphabetically after. **Values are
|
|
1524
|
+
* never returned.** Secret writes are write-only.
|
|
1525
|
+
*
|
|
1526
|
+
* Managed entries (e.g. `PRIMITIVE_WEBHOOK_SECRET`,
|
|
1527
|
+
* `PRIMITIVE_API_KEY`) carry a `description` instead of
|
|
1528
|
+
* `created_at` / `updated_at`. They cannot be created, updated,
|
|
1529
|
+
* or deleted via this API.
|
|
1530
|
+
*
|
|
1531
|
+
*/
|
|
1532
|
+
const listFunctionSecrets = (options) => (options.client ?? client$1).get({
|
|
1533
|
+
security: [{
|
|
1534
|
+
scheme: "bearer",
|
|
1535
|
+
type: "http"
|
|
1536
|
+
}],
|
|
1537
|
+
url: "/functions/{id}/secrets",
|
|
1538
|
+
...options
|
|
1539
|
+
});
|
|
1540
|
+
/**
|
|
1541
|
+
* Create or update a secret
|
|
1542
|
+
*
|
|
1543
|
+
* Idempotent insert-or-update keyed on `(function_id, key)`.
|
|
1544
|
+
* Returns 201 the first time the key is set, 200 on subsequent
|
|
1545
|
+
* updates. Values are encrypted at rest and only become visible
|
|
1546
|
+
* to the running handler on the next deploy (`PUT /functions/{id}`
|
|
1547
|
+
* with the existing code is sufficient to refresh bindings).
|
|
1548
|
+
*
|
|
1549
|
+
* Keys must match `^[A-Z_][A-Z0-9_]*$` (uppercase letters,
|
|
1550
|
+
* digits, underscores; first character is a letter or
|
|
1551
|
+
* underscore). Values are at most 4096 UTF-8 bytes. System-
|
|
1552
|
+
* managed keys are reserved and rejected.
|
|
1553
|
+
*
|
|
1554
|
+
*/
|
|
1555
|
+
const createFunctionSecret = (options) => (options.client ?? client$1).post({
|
|
1556
|
+
security: [{
|
|
1557
|
+
scheme: "bearer",
|
|
1558
|
+
type: "http"
|
|
1559
|
+
}],
|
|
1560
|
+
url: "/functions/{id}/secrets",
|
|
1561
|
+
...options,
|
|
1562
|
+
headers: {
|
|
1563
|
+
"Content-Type": "application/json",
|
|
1564
|
+
...options.headers
|
|
1565
|
+
}
|
|
1566
|
+
});
|
|
1567
|
+
/**
|
|
1568
|
+
* Delete a secret
|
|
1569
|
+
*
|
|
1570
|
+
* Removes the secret. The binding stays live in the running
|
|
1571
|
+
* handler until the next deploy refreshes the binding set
|
|
1572
|
+
* (`PUT /functions/{id}` with the existing code is sufficient).
|
|
1573
|
+
* Returns 404 if the key did not exist. Managed system keys
|
|
1574
|
+
* cannot be deleted.
|
|
1575
|
+
*
|
|
1576
|
+
*/
|
|
1577
|
+
const deleteFunctionSecret = (options) => (options.client ?? client$1).delete({
|
|
1578
|
+
security: [{
|
|
1579
|
+
scheme: "bearer",
|
|
1580
|
+
type: "http"
|
|
1581
|
+
}],
|
|
1582
|
+
url: "/functions/{id}/secrets/{key}",
|
|
1583
|
+
...options
|
|
1584
|
+
});
|
|
1585
|
+
/**
|
|
1586
|
+
* Set a secret by key
|
|
1587
|
+
*
|
|
1588
|
+
* Path-keyed companion to `POST /functions/{id}/secrets`.
|
|
1589
|
+
* Idempotent: returns 201 the first time the key is set, 200 on
|
|
1590
|
+
* subsequent updates. Same validation rules and same write-only
|
|
1591
|
+
* guarantees as the POST verb; the new value lands in the running
|
|
1592
|
+
* handler on the next deploy.
|
|
1593
|
+
*
|
|
1594
|
+
*/
|
|
1595
|
+
const setFunctionSecret = (options) => (options.client ?? client$1).put({
|
|
1596
|
+
security: [{
|
|
1597
|
+
scheme: "bearer",
|
|
1598
|
+
type: "http"
|
|
1599
|
+
}],
|
|
1600
|
+
url: "/functions/{id}/secrets/{key}",
|
|
1601
|
+
...options,
|
|
1602
|
+
headers: {
|
|
1603
|
+
"Content-Type": "application/json",
|
|
1604
|
+
...options.headers
|
|
1605
|
+
}
|
|
1606
|
+
});
|
|
1362
1607
|
//#endregion
|
|
1363
1608
|
//#region src/api/index.ts
|
|
1364
1609
|
const DEFAULT_BASE_URL = "https://www.primitive.dev/api/v1";
|
|
@@ -1625,4 +1870,4 @@ function client(options = {}) {
|
|
|
1625
1870
|
}
|
|
1626
1871
|
const operations = sdk_gen_exports;
|
|
1627
1872
|
//#endregion
|
|
1628
|
-
export {
|
|
1873
|
+
export { updateFunction as $, getWebhookSecret as A, replayDelivery as B, downloadRawEmail as C, getSendPermissions as D, getFunction as E, listFilters as F, setFunctionSecret as G, replyToEmail as H, listFunctionSecrets as I, testFunction as J, startCliLogin as K, listFunctions as L, listDomains as M, listEmails as N, getSentEmail as O, listEndpoints as P, updateFilter as Q, listSentEmails as R, downloadAttachments as S, getEmail as T, rotateWebhookSecret as U, replayEmailWebhooks as V, sendEmail as W, updateDomain as X, updateAccount as Y, updateEndpoint as Z, deleteEndpoint as _, client as a, deleteFunctionSecret as b, operations as c, createEndpoint as d, verifyDomain as et, createFilter as f, deleteEmail as g, deleteDomain as h, PrimitiveClient as i, listDeliveries as j, getStorageStats as k, addDomain as l, createFunctionSecret as m, PrimitiveApiClient as n, createPrimitiveApiClient as o, createFunction as p, testEndpoint as q, PrimitiveApiError as r, createPrimitiveClient as s, DEFAULT_BASE_URL as t, cliLogout as u, deleteFilter as v, getAccount as w, discardEmailContent as x, deleteFunction as y, pollCliLogin as z };
|