primitive-functions 0.3.0-alpha.4 → 0.3.0-alpha.6

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 (2) hide show
  1. package/index.d.ts +22 -98
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -577,30 +577,14 @@ export interface FunctionApi {
577
577
  "dryRun"?: string | number | boolean;
578
578
  body: unknown;
579
579
  }): Promise<any>;
580
- /** `databaseTypeConfigs.createOperation` — POST /databases/types/{databaseType}/operations. Create an operation for a database type */
581
- "createOperation"(args: {
582
- "databaseType": string | number;
583
- "dryRun"?: string | number | boolean;
584
- body: unknown;
585
- }): Promise<any>;
586
580
  /** `databaseTypeConfigs.delete` — DELETE /databases/types/{databaseType}. Delete a database type */
587
581
  "delete"(args: {
588
582
  "databaseType": string | number;
589
583
  }): Promise<any>;
590
- /** `databaseTypeConfigs.deleteOperation` — DELETE /databases/types/{databaseType}/operations/{name}. Delete an operation for a database type */
591
- "deleteOperation"(args: {
592
- "databaseType": string | number;
593
- "name": string | number;
594
- }): Promise<any>;
595
584
  /** `databaseTypeConfigs.get` — GET /databases/types/{databaseType}. Get a database type */
596
585
  "get"(args: {
597
586
  "databaseType": string | number;
598
587
  }): Promise<any>;
599
- /** `databaseTypeConfigs.getOperation` — GET /databases/types/{databaseType}/operations/{name}. Get an operation for a database type */
600
- "getOperation"(args: {
601
- "databaseType": string | number;
602
- "name": string | number;
603
- }): Promise<any>;
604
588
  /** `databaseTypeConfigs.getReindexStatus` — GET /databases/types/{databaseType}/reindex-status. Status of the index back-provision fan-out for a type */
605
589
  "getReindexStatus"(args: {
606
590
  "databaseType": string | number;
@@ -608,54 +592,16 @@ export interface FunctionApi {
608
592
  }): Promise<any>;
609
593
  /** `databaseTypeConfigs.list` — GET /databases/types. List database types */
610
594
  "list"(args?: Record<string, never>): Promise<any>;
611
- /** `databaseTypeConfigs.listOperations` — GET /databases/types/{databaseType}/operations. List operations for a database type */
612
- "listOperations"(args: {
613
- "databaseType": string | number;
614
- }): Promise<any>;
615
595
  /** `databaseTypeConfigs.scaffoldSchema` — POST /databases/types/{databaseType}/schema:scaffold. Scaffold a starter schema for a database type */
616
596
  "scaffoldSchema"(args: {
617
597
  "databaseType": string | number;
618
598
  }): Promise<any>;
619
- "subscriptions": {
620
- /** `databaseTypeConfigs.subscriptions.create` — POST /databases/types/{databaseType}/subscriptions. Create a subscription for a database type */
621
- "create"(args: {
622
- "databaseType": string | number;
623
- body: unknown;
624
- }): Promise<any>;
625
- /** `databaseTypeConfigs.subscriptions.delete` — DELETE /databases/types/{databaseType}/subscriptions/{subscriptionKey}. Delete a database type subscription */
626
- "delete"(args: {
627
- "databaseType": string | number;
628
- "subscriptionKey": string | number;
629
- }): Promise<any>;
630
- /** `databaseTypeConfigs.subscriptions.get` — GET /databases/types/{databaseType}/subscriptions/{subscriptionKey}. Get a database type subscription */
631
- "get"(args: {
632
- "databaseType": string | number;
633
- "subscriptionKey": string | number;
634
- }): Promise<any>;
635
- /** `databaseTypeConfigs.subscriptions.list` — GET /databases/types/{databaseType}/subscriptions. List subscriptions for a database type */
636
- "list"(args: {
637
- "databaseType": string | number;
638
- }): Promise<any>;
639
- /** `databaseTypeConfigs.subscriptions.update` — PUT /databases/types/{databaseType}/subscriptions/{subscriptionKey}. Update a database type subscription */
640
- "update"(args: {
641
- "databaseType": string | number;
642
- "subscriptionKey": string | number;
643
- body: unknown;
644
- }): Promise<any>;
645
- };
646
599
  /** `databaseTypeConfigs.update` — PATCH /databases/types/{databaseType}. Update a database type */
647
600
  "update"(args: {
648
601
  "databaseType": string | number;
649
602
  "dryRun"?: string | number | boolean;
650
603
  body: unknown;
651
604
  }): Promise<any>;
652
- /** `databaseTypeConfigs.updateOperation` — PATCH /databases/types/{databaseType}/operations/{name}. Update an operation for a database type */
653
- "updateOperation"(args: {
654
- "databaseType": string | number;
655
- "name": string | number;
656
- "dryRun"?: string | number | boolean;
657
- body: unknown;
658
- }): Promise<any>;
659
605
  };
660
606
  "databases": {
661
607
  /** `databases.addManager` — PUT /databases/{databaseId}/permissions. Set a user's database permission */
@@ -671,19 +617,6 @@ export interface FunctionApi {
671
617
  "delete"(args: {
672
618
  "databaseId": string | number;
673
619
  }): Promise<any>;
674
- /** `databases.executeBatch` — POST /databases/{databaseId}/operations/{name}/batch. Execute a database operation in batch */
675
- "executeBatch"(args: {
676
- "databaseId": string | number;
677
- "name": string | number;
678
- body: unknown;
679
- }): Promise<any>;
680
- /** `databases.executeOperation` — POST /databases/{databaseId}/operations/{name}/execute. Execute a database operation */
681
- "executeOperation"(args: {
682
- "databaseId": string | number;
683
- "name": string | number;
684
- "dryRun"?: string | number | boolean;
685
- body?: unknown;
686
- }): Promise<any>;
687
620
  /** `databases.get` — GET /databases/{databaseId}. Get a database by id */
688
621
  "get"(args: {
689
622
  "databaseId": string | number;
@@ -699,106 +632,102 @@ export interface FunctionApi {
699
632
  "listGroupPermissions"(args: {
700
633
  "databaseId": string | number;
701
634
  }): Promise<any>;
702
- /** `databases.listOperations` — GET /databases/{databaseId}/operations. List operations runnable on a database */
703
- "listOperations"(args: {
704
- "databaseId": string | number;
705
- }): Promise<any>;
706
635
  /** `databases.listPermissions` — GET /databases/{databaseId}/permissions. List a database's user permissions */
707
636
  "listPermissions"(args: {
708
637
  "databaseId": string | number;
709
638
  }): Promise<any>;
710
639
  "records": {
711
- /** `databases.records.addToSet` — POST /databases/{databaseId}/records/stringset/add. Database records: stringset/add (requires manager-or-higher on the database, or an app-admin/owner role) */
640
+ /** `databases.records.addToSet` — POST /databases/{databaseId}/records/stringset/add. Database records: stringset/add (app admin or owner) */
712
641
  "addToSet"(args: {
713
642
  "databaseId": string | number;
714
643
  body: unknown;
715
644
  }): Promise<any>;
716
- /** `databases.records.aggregate` — POST /databases/{databaseId}/records/aggregate. Database records: aggregate (requires manager-or-higher on the database, or an app-admin/owner role) */
645
+ /** `databases.records.aggregate` — POST /databases/{databaseId}/records/aggregate. Database records: aggregate (app admin or owner) */
717
646
  "aggregate"(args: {
718
647
  "databaseId": string | number;
719
648
  body: unknown;
720
649
  }): Promise<any>;
721
- /** `databases.records.batch` — POST /databases/{databaseId}/records/batch. Database records: batch (requires manager-or-higher on the database, or an app-admin/owner role) */
650
+ /** `databases.records.batch` — POST /databases/{databaseId}/records/batch. Database records: batch (app admin or owner) */
722
651
  "batch"(args: {
723
652
  "databaseId": string | number;
724
653
  body: unknown;
725
654
  }): Promise<any>;
726
- /** `databases.records.count` — POST /databases/{databaseId}/records/count. Database records: count (requires manager-or-higher on the database, or an app-admin/owner role) */
655
+ /** `databases.records.count` — POST /databases/{databaseId}/records/count. Database records: count (app admin or owner) */
727
656
  "count"(args: {
728
657
  "databaseId": string | number;
729
658
  body: unknown;
730
659
  }): Promise<any>;
731
- /** `databases.records.delete` — POST /databases/{databaseId}/records/delete. Database records: delete (requires manager-or-higher on the database, or an app-admin/owner role) */
660
+ /** `databases.records.delete` — POST /databases/{databaseId}/records/delete. Database records: delete (app admin or owner) */
732
661
  "delete"(args: {
733
662
  "databaseId": string | number;
734
663
  body: unknown;
735
664
  }): Promise<any>;
736
- /** `databases.records.describe` — GET /databases/{databaseId}/records/describe. Database records: describe (requires manager-or-higher on the database, or an app-admin/owner role) */
665
+ /** `databases.records.describe` — GET /databases/{databaseId}/records/describe. Database records: describe (app admin or owner) */
737
666
  "describe"(args: {
738
667
  "databaseId": string | number;
739
668
  "modelName"?: string | number | boolean;
740
669
  }): Promise<any>;
741
- /** `databases.records.dropIndex` — POST /databases/{databaseId}/records/index/drop. Database records: index/drop (requires manager-or-higher on the database, or an app-admin/owner role) */
670
+ /** `databases.records.dropIndex` — POST /databases/{databaseId}/records/index/drop. Database records: index/drop (app admin or owner) */
742
671
  "dropIndex"(args: {
743
672
  "databaseId": string | number;
744
673
  body: unknown;
745
674
  }): Promise<any>;
746
- /** `databases.records.dropUniqueConstraint` — POST /databases/{databaseId}/records/unique-constraint/drop. Database records: unique-constraint/drop (requires manager-or-higher on the database, or an app-admin/owner role) */
675
+ /** `databases.records.dropUniqueConstraint` — POST /databases/{databaseId}/records/unique-constraint/drop. Database records: unique-constraint/drop (app admin or owner) */
747
676
  "dropUniqueConstraint"(args: {
748
677
  "databaseId": string | number;
749
678
  body: unknown;
750
679
  }): Promise<any>;
751
- /** `databases.records.increment` — POST /databases/{databaseId}/records/increment. Database records: increment (requires manager-or-higher on the database, or an app-admin/owner role) */
680
+ /** `databases.records.increment` — POST /databases/{databaseId}/records/increment. Database records: increment (app admin or owner) */
752
681
  "increment"(args: {
753
682
  "databaseId": string | number;
754
683
  body: unknown;
755
684
  }): Promise<any>;
756
- /** `databases.records.listIndexes` — GET /databases/{databaseId}/records/indexes. Database records: indexes (requires manager-or-higher on the database, or an app-admin/owner role) */
685
+ /** `databases.records.listIndexes` — GET /databases/{databaseId}/records/indexes. Database records: indexes (app admin or owner) */
757
686
  "listIndexes"(args: {
758
687
  "databaseId": string | number;
759
688
  "modelName"?: string | number | boolean;
760
689
  }): Promise<any>;
761
- /** `databases.records.listUniqueConstraints` — GET /databases/{databaseId}/records/unique-constraints. Database records: unique-constraints (requires manager-or-higher on the database, or an app-admin/owner role) */
690
+ /** `databases.records.listUniqueConstraints` — GET /databases/{databaseId}/records/unique-constraints. Database records: unique-constraints (app admin or owner) */
762
691
  "listUniqueConstraints"(args: {
763
692
  "databaseId": string | number;
764
693
  "modelName"?: string | number | boolean;
765
694
  }): Promise<any>;
766
- /** `databases.records.models` — GET /databases/{databaseId}/records/models. Database records: models (requires manager-or-higher on the database, or an app-admin/owner role) */
695
+ /** `databases.records.models` — GET /databases/{databaseId}/records/models. Database records: models (app admin or owner) */
767
696
  "models"(args: {
768
697
  "databaseId": string | number;
769
698
  "modelName"?: string | number | boolean;
770
699
  }): Promise<any>;
771
- /** `databases.records.patch` — POST /databases/{databaseId}/records/patch. Database records: patch (requires manager-or-higher on the database, or an app-admin/owner role) */
700
+ /** `databases.records.patch` — POST /databases/{databaseId}/records/patch. Database records: patch (app admin or owner) */
772
701
  "patch"(args: {
773
702
  "databaseId": string | number;
774
703
  body: unknown;
775
704
  }): Promise<any>;
776
- /** `databases.records.query` — POST /databases/{databaseId}/records/query. Database records: query (requires manager-or-higher on the database, or an app-admin/owner role) */
705
+ /** `databases.records.query` — POST /databases/{databaseId}/records/query. Database records: query (app admin or owner) */
777
706
  "query"(args: {
778
707
  "databaseId": string | number;
779
708
  body: unknown;
780
709
  }): Promise<{ items: any[]; hasMore: boolean; nextCursor?: string; prevCursor?: string }>;
781
- /** `databases.records.registerIndex` — POST /databases/{databaseId}/records/index/register. Database records: index/register (requires manager-or-higher on the database, or an app-admin/owner role) */
710
+ /** `databases.records.registerIndex` — POST /databases/{databaseId}/records/index/register. Database records: index/register (app admin or owner) */
782
711
  "registerIndex"(args: {
783
712
  "databaseId": string | number;
784
713
  body: unknown;
785
714
  }): Promise<any>;
786
- /** `databases.records.registerUniqueConstraint` — POST /databases/{databaseId}/records/unique-constraint/register. Database records: unique-constraint/register (requires manager-or-higher on the database, or an app-admin/owner role) */
715
+ /** `databases.records.registerUniqueConstraint` — POST /databases/{databaseId}/records/unique-constraint/register. Database records: unique-constraint/register (app admin or owner) */
787
716
  "registerUniqueConstraint"(args: {
788
717
  "databaseId": string | number;
789
718
  body: unknown;
790
719
  }): Promise<any>;
791
- /** `databases.records.removeFromSet` — POST /databases/{databaseId}/records/stringset/remove. Database records: stringset/remove (requires manager-or-higher on the database, or an app-admin/owner role) */
720
+ /** `databases.records.removeFromSet` — POST /databases/{databaseId}/records/stringset/remove. Database records: stringset/remove (app admin or owner) */
792
721
  "removeFromSet"(args: {
793
722
  "databaseId": string | number;
794
723
  body: unknown;
795
724
  }): Promise<any>;
796
- /** `databases.records.save` — POST /databases/{databaseId}/records/save. Database records: save (requires manager-or-higher on the database, or an app-admin/owner role) */
725
+ /** `databases.records.save` — POST /databases/{databaseId}/records/save. Database records: save (app admin or owner) */
797
726
  "save"(args: {
798
727
  "databaseId": string | number;
799
728
  body: unknown;
800
729
  }): Promise<any>;
801
- /** `databases.records.syncIndexes` — POST /databases/{databaseId}/records/indexes/sync. Database records: indexes/sync (requires manager-or-higher on the database, or an app-admin/owner role) */
730
+ /** `databases.records.syncIndexes` — POST /databases/{databaseId}/records/indexes/sync. Database records: indexes/sync (app admin or owner) */
802
731
  "syncIndexes"(args: {
803
732
  "databaseId": string | number;
804
733
  body: unknown;
@@ -819,12 +748,6 @@ export interface FunctionApi {
819
748
  "databaseId": string | number;
820
749
  "userId": string | number;
821
750
  }): Promise<any>;
822
- /** `databases.runOperation` — POST /databases/{databaseId}/operations/{name}/run. Run a database operation under a server function's grants */
823
- "runOperation"(args: {
824
- "databaseId": string | number;
825
- "name": string | number;
826
- body?: unknown;
827
- }): Promise<any>;
828
751
  /** `databases.transferOwnership` — POST /databases/{databaseId}/permissions/transfer. Transfer database ownership */
829
752
  "transferOwnership"(args: {
830
753
  "databaseId": string | number;
@@ -1177,6 +1100,9 @@ export interface FunctionApi {
1177
1100
  /** `documents.room` — GET /documents/{documentId}/room. Inspect a record-log document's room */
1178
1101
  "room"(args: {
1179
1102
  "documentId": string | number;
1103
+ "refused"?: string | number | boolean;
1104
+ "limit"?: string | number | boolean;
1105
+ "cursor"?: string | number | boolean;
1180
1106
  }): Promise<any>;
1181
1107
  /** `documents.setLinkAccess` — PUT /documents/{documentId}/link-access. Set the document's "anyone with the link" access level */
1182
1108
  "setLinkAccess"(args: {
@@ -1687,8 +1613,6 @@ export interface DatabaseHandle<TModels> {
1687
1613
  operations: Array<Record<string, unknown>>;
1688
1614
  atomic?: boolean;
1689
1615
  }): Promise<any>;
1690
- /** Run one of the database type's prepared operations under this function's grants. */
1691
- runOperation(name: string, params?: Record<string, unknown>): Promise<any>;
1692
1616
  }
1693
1617
 
1694
1618
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primitive-functions",
3
- "version": "0.3.0-alpha.4",
3
+ "version": "0.3.0-alpha.6",
4
4
  "description": "The module a Primitive server function imports. Supplied by the platform at invoke time; reserved here so the name is ours before the runtime lands.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Primitive LLC",