@giaeulate/baas-sdk 1.0.4 → 1.0.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.
- package/dist/index.cjs +30 -0
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +30 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1079,6 +1079,24 @@ function createEnvironmentsModule(client) {
|
|
|
1079
1079
|
};
|
|
1080
1080
|
}
|
|
1081
1081
|
|
|
1082
|
+
// src/modules/cors-origins.ts
|
|
1083
|
+
function createCorsOriginsModule(client) {
|
|
1084
|
+
const get = (endpoint) => client.get(endpoint);
|
|
1085
|
+
const post = (endpoint, body) => client.post(endpoint, body);
|
|
1086
|
+
const del = (endpoint) => client.delete(endpoint);
|
|
1087
|
+
return {
|
|
1088
|
+
async list() {
|
|
1089
|
+
return get("/api/cors-origins");
|
|
1090
|
+
},
|
|
1091
|
+
async create(origin, description) {
|
|
1092
|
+
return post("/api/cors-origins", { origin, description: description || "" });
|
|
1093
|
+
},
|
|
1094
|
+
async delete(id) {
|
|
1095
|
+
return del(`/api/cors-origins/${id}`);
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1082
1100
|
// src/client.ts
|
|
1083
1101
|
var BaasClient = class extends HttpClient {
|
|
1084
1102
|
// Feature modules
|
|
@@ -1102,6 +1120,7 @@ var BaasClient = class extends HttpClient {
|
|
|
1102
1120
|
realtime;
|
|
1103
1121
|
apiKeys;
|
|
1104
1122
|
environments;
|
|
1123
|
+
corsOrigins;
|
|
1105
1124
|
constructor(url, apiKey) {
|
|
1106
1125
|
super(url, apiKey);
|
|
1107
1126
|
this.auth = createAuthModule(this);
|
|
@@ -1124,6 +1143,7 @@ var BaasClient = class extends HttpClient {
|
|
|
1124
1143
|
this.realtime = createRealtimeModule(this);
|
|
1125
1144
|
this.apiKeys = createApiKeysModule(this);
|
|
1126
1145
|
this.environments = createEnvironmentsModule(this);
|
|
1146
|
+
this.corsOrigins = createCorsOriginsModule(this);
|
|
1127
1147
|
}
|
|
1128
1148
|
/**
|
|
1129
1149
|
* Create a query builder for fluent data queries
|
|
@@ -1485,6 +1505,16 @@ var BaasClient = class extends HttpClient {
|
|
|
1485
1505
|
async revertTestEnvironment() {
|
|
1486
1506
|
return this.environments.revert();
|
|
1487
1507
|
}
|
|
1508
|
+
// CORS Origins shortcuts
|
|
1509
|
+
async listCorsOrigins() {
|
|
1510
|
+
return this.corsOrigins.list();
|
|
1511
|
+
}
|
|
1512
|
+
async addCorsOrigin(origin, description) {
|
|
1513
|
+
return this.corsOrigins.create(origin, description);
|
|
1514
|
+
}
|
|
1515
|
+
async deleteCorsOrigin(id) {
|
|
1516
|
+
return this.corsOrigins.delete(id);
|
|
1517
|
+
}
|
|
1488
1518
|
};
|
|
1489
1519
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1490
1520
|
0 && (module.exports = {
|
package/dist/index.d.cts
CHANGED
|
@@ -591,6 +591,16 @@ interface ApiKeysModule {
|
|
|
591
591
|
delete(keyId: string): Promise<any>;
|
|
592
592
|
}
|
|
593
593
|
|
|
594
|
+
/**
|
|
595
|
+
* CORS Origins Module
|
|
596
|
+
*/
|
|
597
|
+
|
|
598
|
+
interface CorsOriginsModule {
|
|
599
|
+
list(): Promise<any>;
|
|
600
|
+
create(origin: string, description?: string): Promise<any>;
|
|
601
|
+
delete(id: string): Promise<any>;
|
|
602
|
+
}
|
|
603
|
+
|
|
594
604
|
/**
|
|
595
605
|
* Main BaaS Client - Composes all feature modules
|
|
596
606
|
*
|
|
@@ -629,6 +639,7 @@ declare class BaasClient extends HttpClient {
|
|
|
629
639
|
readonly realtime: RealtimeModule;
|
|
630
640
|
readonly apiKeys: ApiKeysModule;
|
|
631
641
|
readonly environments: EnvironmentsModule;
|
|
642
|
+
readonly corsOrigins: CorsOriginsModule;
|
|
632
643
|
constructor(url?: string, apiKey?: string);
|
|
633
644
|
/**
|
|
634
645
|
* Create a query builder for fluent data queries
|
|
@@ -744,6 +755,9 @@ declare class BaasClient extends HttpClient {
|
|
|
744
755
|
initTestEnvironment(): Promise<any>;
|
|
745
756
|
promoteTestToProd(): Promise<PromoteResult>;
|
|
746
757
|
revertTestEnvironment(): Promise<any>;
|
|
758
|
+
listCorsOrigins(): Promise<any>;
|
|
759
|
+
addCorsOrigin(origin: string, description?: string): Promise<any>;
|
|
760
|
+
deleteCorsOrigin(id: string): Promise<any>;
|
|
747
761
|
}
|
|
748
762
|
|
|
749
|
-
export { type ApiKeysModule, type ApiResponse, type ApplicationLogsOptions, type AuditLogsOptions, type AuditModule, type AuthModule, BaasClient, type BackupsModule, type BranchesModule, type DatabaseModule, type EmailConfig, type EmailModule, type EmailTemplate, type EnvVarsModule, type FunctionsModule, type GraphQLModule, HttpClient, type HttpMethod, type JobInput, type JobUpdateInput, type JobsModule, type LogDrainInput, type LogDrainUpdateInput, type LogDrainsModule, type MetricsModule, type MigrationsModule, type PaginationOptions, QueryBuilder, type QueryFilter, type RealtimeModule, type RequestLogsOptions, type RequestOptions, type SearchModule, type SearchOptions, type SendEmailInput, type StorageModule, type Subscription, type TimeseriesOptions, type UsersModule, type WebhookInput, type WebhookUpdateInput, type WebhooksModule };
|
|
763
|
+
export { type ApiKeysModule, type ApiResponse, type ApplicationLogsOptions, type AuditLogsOptions, type AuditModule, type AuthModule, BaasClient, type BackupsModule, type BranchesModule, type CorsOriginsModule, type DatabaseModule, type EmailConfig, type EmailModule, type EmailTemplate, type EnvVarsModule, type FunctionsModule, type GraphQLModule, HttpClient, type HttpMethod, type JobInput, type JobUpdateInput, type JobsModule, type LogDrainInput, type LogDrainUpdateInput, type LogDrainsModule, type MetricsModule, type MigrationsModule, type PaginationOptions, QueryBuilder, type QueryFilter, type RealtimeModule, type RequestLogsOptions, type RequestOptions, type SearchModule, type SearchOptions, type SendEmailInput, type StorageModule, type Subscription, type TimeseriesOptions, type UsersModule, type WebhookInput, type WebhookUpdateInput, type WebhooksModule };
|
package/dist/index.d.ts
CHANGED
|
@@ -591,6 +591,16 @@ interface ApiKeysModule {
|
|
|
591
591
|
delete(keyId: string): Promise<any>;
|
|
592
592
|
}
|
|
593
593
|
|
|
594
|
+
/**
|
|
595
|
+
* CORS Origins Module
|
|
596
|
+
*/
|
|
597
|
+
|
|
598
|
+
interface CorsOriginsModule {
|
|
599
|
+
list(): Promise<any>;
|
|
600
|
+
create(origin: string, description?: string): Promise<any>;
|
|
601
|
+
delete(id: string): Promise<any>;
|
|
602
|
+
}
|
|
603
|
+
|
|
594
604
|
/**
|
|
595
605
|
* Main BaaS Client - Composes all feature modules
|
|
596
606
|
*
|
|
@@ -629,6 +639,7 @@ declare class BaasClient extends HttpClient {
|
|
|
629
639
|
readonly realtime: RealtimeModule;
|
|
630
640
|
readonly apiKeys: ApiKeysModule;
|
|
631
641
|
readonly environments: EnvironmentsModule;
|
|
642
|
+
readonly corsOrigins: CorsOriginsModule;
|
|
632
643
|
constructor(url?: string, apiKey?: string);
|
|
633
644
|
/**
|
|
634
645
|
* Create a query builder for fluent data queries
|
|
@@ -744,6 +755,9 @@ declare class BaasClient extends HttpClient {
|
|
|
744
755
|
initTestEnvironment(): Promise<any>;
|
|
745
756
|
promoteTestToProd(): Promise<PromoteResult>;
|
|
746
757
|
revertTestEnvironment(): Promise<any>;
|
|
758
|
+
listCorsOrigins(): Promise<any>;
|
|
759
|
+
addCorsOrigin(origin: string, description?: string): Promise<any>;
|
|
760
|
+
deleteCorsOrigin(id: string): Promise<any>;
|
|
747
761
|
}
|
|
748
762
|
|
|
749
|
-
export { type ApiKeysModule, type ApiResponse, type ApplicationLogsOptions, type AuditLogsOptions, type AuditModule, type AuthModule, BaasClient, type BackupsModule, type BranchesModule, type DatabaseModule, type EmailConfig, type EmailModule, type EmailTemplate, type EnvVarsModule, type FunctionsModule, type GraphQLModule, HttpClient, type HttpMethod, type JobInput, type JobUpdateInput, type JobsModule, type LogDrainInput, type LogDrainUpdateInput, type LogDrainsModule, type MetricsModule, type MigrationsModule, type PaginationOptions, QueryBuilder, type QueryFilter, type RealtimeModule, type RequestLogsOptions, type RequestOptions, type SearchModule, type SearchOptions, type SendEmailInput, type StorageModule, type Subscription, type TimeseriesOptions, type UsersModule, type WebhookInput, type WebhookUpdateInput, type WebhooksModule };
|
|
763
|
+
export { type ApiKeysModule, type ApiResponse, type ApplicationLogsOptions, type AuditLogsOptions, type AuditModule, type AuthModule, BaasClient, type BackupsModule, type BranchesModule, type CorsOriginsModule, type DatabaseModule, type EmailConfig, type EmailModule, type EmailTemplate, type EnvVarsModule, type FunctionsModule, type GraphQLModule, HttpClient, type HttpMethod, type JobInput, type JobUpdateInput, type JobsModule, type LogDrainInput, type LogDrainUpdateInput, type LogDrainsModule, type MetricsModule, type MigrationsModule, type PaginationOptions, QueryBuilder, type QueryFilter, type RealtimeModule, type RequestLogsOptions, type RequestOptions, type SearchModule, type SearchOptions, type SendEmailInput, type StorageModule, type Subscription, type TimeseriesOptions, type UsersModule, type WebhookInput, type WebhookUpdateInput, type WebhooksModule };
|
package/dist/index.js
CHANGED
|
@@ -1051,6 +1051,24 @@ function createEnvironmentsModule(client) {
|
|
|
1051
1051
|
};
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
|
+
// src/modules/cors-origins.ts
|
|
1055
|
+
function createCorsOriginsModule(client) {
|
|
1056
|
+
const get = (endpoint) => client.get(endpoint);
|
|
1057
|
+
const post = (endpoint, body) => client.post(endpoint, body);
|
|
1058
|
+
const del = (endpoint) => client.delete(endpoint);
|
|
1059
|
+
return {
|
|
1060
|
+
async list() {
|
|
1061
|
+
return get("/api/cors-origins");
|
|
1062
|
+
},
|
|
1063
|
+
async create(origin, description) {
|
|
1064
|
+
return post("/api/cors-origins", { origin, description: description || "" });
|
|
1065
|
+
},
|
|
1066
|
+
async delete(id) {
|
|
1067
|
+
return del(`/api/cors-origins/${id}`);
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1054
1072
|
// src/client.ts
|
|
1055
1073
|
var BaasClient = class extends HttpClient {
|
|
1056
1074
|
// Feature modules
|
|
@@ -1074,6 +1092,7 @@ var BaasClient = class extends HttpClient {
|
|
|
1074
1092
|
realtime;
|
|
1075
1093
|
apiKeys;
|
|
1076
1094
|
environments;
|
|
1095
|
+
corsOrigins;
|
|
1077
1096
|
constructor(url, apiKey) {
|
|
1078
1097
|
super(url, apiKey);
|
|
1079
1098
|
this.auth = createAuthModule(this);
|
|
@@ -1096,6 +1115,7 @@ var BaasClient = class extends HttpClient {
|
|
|
1096
1115
|
this.realtime = createRealtimeModule(this);
|
|
1097
1116
|
this.apiKeys = createApiKeysModule(this);
|
|
1098
1117
|
this.environments = createEnvironmentsModule(this);
|
|
1118
|
+
this.corsOrigins = createCorsOriginsModule(this);
|
|
1099
1119
|
}
|
|
1100
1120
|
/**
|
|
1101
1121
|
* Create a query builder for fluent data queries
|
|
@@ -1457,6 +1477,16 @@ var BaasClient = class extends HttpClient {
|
|
|
1457
1477
|
async revertTestEnvironment() {
|
|
1458
1478
|
return this.environments.revert();
|
|
1459
1479
|
}
|
|
1480
|
+
// CORS Origins shortcuts
|
|
1481
|
+
async listCorsOrigins() {
|
|
1482
|
+
return this.corsOrigins.list();
|
|
1483
|
+
}
|
|
1484
|
+
async addCorsOrigin(origin, description) {
|
|
1485
|
+
return this.corsOrigins.create(origin, description);
|
|
1486
|
+
}
|
|
1487
|
+
async deleteCorsOrigin(id) {
|
|
1488
|
+
return this.corsOrigins.delete(id);
|
|
1489
|
+
}
|
|
1460
1490
|
};
|
|
1461
1491
|
export {
|
|
1462
1492
|
BaasClient,
|