@appconda/nextjs 1.0.13 → 1.0.15

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 (125) hide show
  1. package/dist/cjs/sdk.js +74 -16
  2. package/dist/cjs/sdk.js.map +1 -1
  3. package/dist/esm/sdk.js +73 -17
  4. package/dist/esm/sdk.js.map +1 -1
  5. package/dist/iife/sdk.js +75 -18
  6. package/package.json +2 -1
  7. package/src/actions/actionClient.ts +42 -0
  8. package/src/actions/index.ts +1 -0
  9. package/src/actions/nodes.ts +12 -0
  10. package/src/index.ts +2 -0
  11. package/src/services/waitlist.ts +16 -0
  12. package/types/Cache/Adapter.d.ts +0 -10
  13. package/types/Cache/Adapters/Filesystem.d.ts +0 -16
  14. package/types/Cache/Adapters/Memory.d.ts +0 -18
  15. package/types/Cache/Adapters/None.d.ts +0 -12
  16. package/types/Cache/Adapters/Redis.d.ts +0 -14
  17. package/types/Cache/Adapters/Sharding.d.ts +0 -17
  18. package/types/Cache/Cache.d.ts +0 -16
  19. package/types/Cache/index.d.ts +0 -5
  20. package/types/Cache/test.d.ts +0 -0
  21. package/types/Services.d.ts +0 -6
  22. package/types/client.d.ts +0 -141
  23. package/types/decorators/Cache.d.ts +0 -1
  24. package/types/decorators/CacheKey.d.ts +0 -1
  25. package/types/decorators/Invalidate.d.ts +0 -1
  26. package/types/enums/api-service.d.ts +0 -13
  27. package/types/enums/api.d.ts +0 -5
  28. package/types/enums/auth-method.d.ts +0 -9
  29. package/types/enums/authentication-factor.d.ts +0 -6
  30. package/types/enums/authenticator-type.d.ts +0 -3
  31. package/types/enums/browser.d.ts +0 -16
  32. package/types/enums/compression.d.ts +0 -5
  33. package/types/enums/credit-card.d.ts +0 -18
  34. package/types/enums/database-usage-range.d.ts +0 -5
  35. package/types/enums/email-template-locale.d.ts +0 -133
  36. package/types/enums/email-template-type.d.ts +0 -9
  37. package/types/enums/entities/EntityLimitType.d.ts +0 -4
  38. package/types/enums/entities/PropertyAttributeName.d.ts +0 -27
  39. package/types/enums/entities/PropertyCondition.d.ts +0 -7
  40. package/types/enums/entities/PropertyType.d.ts +0 -12
  41. package/types/enums/entities/PropertyValueType.d.ts +0 -6
  42. package/types/enums/entities/RowAccess.d.ts +0 -2
  43. package/types/enums/entities/ViewFilterCondition.d.ts +0 -12
  44. package/types/enums/execution-method.d.ts +0 -8
  45. package/types/enums/flag.d.ts +0 -197
  46. package/types/enums/function-usage-range.d.ts +0 -5
  47. package/types/enums/image-format.d.ts +0 -7
  48. package/types/enums/image-gravity.d.ts +0 -11
  49. package/types/enums/index-type.d.ts +0 -5
  50. package/types/enums/messaging-provider-type.d.ts +0 -5
  51. package/types/enums/name.d.ts +0 -14
  52. package/types/enums/o-auth-provider copy.d.ts +0 -41
  53. package/types/enums/o-auth-provider.d.ts +0 -41
  54. package/types/enums/password-hash.d.ts +0 -13
  55. package/types/enums/platform-type.d.ts +0 -17
  56. package/types/enums/project-usage-range.d.ts +0 -4
  57. package/types/enums/region.d.ts +0 -4
  58. package/types/enums/relation-mutate.d.ts +0 -5
  59. package/types/enums/relationship-type.d.ts +0 -6
  60. package/types/enums/resource-type.d.ts +0 -4
  61. package/types/enums/runtime.d.ts +0 -48
  62. package/types/enums/s-m-t-p-secure.d.ts +0 -3
  63. package/types/enums/shared/ApplicationLayout.d.ts +0 -4
  64. package/types/enums/shared/Colors.d.ts +0 -24
  65. package/types/enums/shared/InputType.d.ts +0 -6
  66. package/types/enums/shared/Periodicity.d.ts +0 -7
  67. package/types/enums/shared/SvgIcon.d.ts +0 -37
  68. package/types/enums/shared/Theme.d.ts +0 -4
  69. package/types/enums/sms-template-locale.d.ts +0 -133
  70. package/types/enums/sms-template-type.d.ts +0 -6
  71. package/types/enums/smtp-encryption.d.ts +0 -5
  72. package/types/enums/storage-usage-range.d.ts +0 -5
  73. package/types/enums/subscriptions/PricingModel.d.ts +0 -11
  74. package/types/enums/subscriptions/SubscriptionBillingPeriod.d.ts +0 -10
  75. package/types/enums/subscriptions/SubscriptionFeatureLimitType.d.ts +0 -10
  76. package/types/enums/subscriptions/SubscriptionPriceType.d.ts +0 -7
  77. package/types/enums/tenants/LinkedAccountStatus.d.ts +0 -5
  78. package/types/enums/tenants/TenantUserJoined.d.ts +0 -6
  79. package/types/enums/tenants/TenantUserStatus.d.ts +0 -6
  80. package/types/enums/tenants/TenantUserType.d.ts +0 -5
  81. package/types/enums/user-usage-range.d.ts +0 -5
  82. package/types/getAppcondaClient.d.ts +0 -2
  83. package/types/getSDKForCurrentUser.d.ts +0 -33
  84. package/types/id.d.ts +0 -20
  85. package/types/index.d.ts +0 -37
  86. package/types/inputFile.d.ts +0 -6
  87. package/types/lib/Registry/Registry.d.ts +0 -38
  88. package/types/lib/Registry/index.d.ts +0 -1
  89. package/types/models.d.ts +0 -3272
  90. package/types/permission.d.ts +0 -43
  91. package/types/query.d.ts +0 -194
  92. package/types/role.d.ts +0 -70
  93. package/types/service-client.d.ts +0 -7
  94. package/types/service.d.ts +0 -11
  95. package/types/services/account.d.ts +0 -530
  96. package/types/services/acl.d.ts +0 -28
  97. package/types/services/applets.d.ts +0 -9
  98. package/types/services/assistant.d.ts +0 -14
  99. package/types/services/avatars.d.ts +0 -115
  100. package/types/services/community.d.ts +0 -19
  101. package/types/services/configuration.d.ts +0 -5
  102. package/types/services/console.d.ts +0 -15
  103. package/types/services/databases.d.ts +0 -613
  104. package/types/services/functions.d.ts +0 -319
  105. package/types/services/graphql.d.ts +0 -25
  106. package/types/services/health.d.ts +0 -231
  107. package/types/services/locale.d.ts +0 -80
  108. package/types/services/messaging.d.ts +0 -685
  109. package/types/services/migrations.d.ts +0 -185
  110. package/types/services/node.d.ts +0 -5
  111. package/types/services/permissions.d.ts +0 -20
  112. package/types/services/pricing.d.ts +0 -15
  113. package/types/services/project.d.ts +0 -70
  114. package/types/services/projects.d.ts +0 -542
  115. package/types/services/proxy.d.ts +0 -59
  116. package/types/services/roles.d.ts +0 -19
  117. package/types/services/schema.d.ts +0 -17
  118. package/types/services/storage.d.ts +0 -189
  119. package/types/services/subscription-product.d.ts +0 -77
  120. package/types/services/subscription.d.ts +0 -15
  121. package/types/services/teams.d.ts +0 -167
  122. package/types/services/tenant-subscription.d.ts +0 -12
  123. package/types/services/tenant.d.ts +0 -32
  124. package/types/services/users.d.ts +0 -499
  125. package/types/services/vcs.d.ts +0 -108
package/dist/esm/sdk.js CHANGED
@@ -2,6 +2,7 @@ import { FormData, File, fetch } from 'node-fetch-native-with-agent';
2
2
  import { createAgent } from 'node-fetch-native-with-agent/agent';
3
3
  import { cookies } from 'next/headers';
4
4
  import { createClient } from 'redis';
5
+ import { createSafeActionClient, DEFAULT_SERVER_ERROR_MESSAGE } from 'next-safe-action';
5
6
 
6
7
  /******************************************************************************
7
8
  Copyright (c) Microsoft Corporation.
@@ -9961,6 +9962,35 @@ If you want to generate a token for a custom authentication flow, use the [POST
9961
9962
  }
9962
9963
  }
9963
9964
 
9965
+ class ServiceClient {
9966
+ constructor(client) {
9967
+ this.client = client;
9968
+ }
9969
+ actionCall(actionName, payload) {
9970
+ return __awaiter(this, void 0, void 0, function* () {
9971
+ const apiPath = `/service/registry/${this.getServiceName()}/${actionName}`;
9972
+ const uri = new URL(this.client.config.endpoint + apiPath);
9973
+ const apiHeaders = {
9974
+ 'content-type': 'application/json',
9975
+ };
9976
+ return yield this.client.call('post', uri, apiHeaders, payload);
9977
+ });
9978
+ }
9979
+ }
9980
+
9981
+ class Waitlist extends ServiceClient {
9982
+ getServiceName() {
9983
+ return 'com.appconda.service.waitlist';
9984
+ }
9985
+ ListWiatlistSignups(waitlistId) {
9986
+ return __awaiter(this, void 0, void 0, function* () {
9987
+ const payload = {};
9988
+ payload['waitlistId'];
9989
+ return yield this.actionCall('ListWiatlistSignups', payload);
9990
+ });
9991
+ }
9992
+ }
9993
+
9964
9994
  /**
9965
9995
  * Helper class to generate permission strings for resources.
9966
9996
  */
@@ -10716,22 +10746,6 @@ class Community {
10716
10746
  }
10717
10747
  }
10718
10748
 
10719
- class ServiceClient {
10720
- constructor(client) {
10721
- this.client = client;
10722
- }
10723
- actionCall(actionName, payload) {
10724
- return __awaiter(this, void 0, void 0, function* () {
10725
- const apiPath = `/service/registry/${this.getServiceName()}/${actionName}`;
10726
- const uri = new URL(this.client.config.endpoint + apiPath);
10727
- const apiHeaders = {
10728
- 'content-type': 'application/json',
10729
- };
10730
- return yield this.client.call('post', uri, apiHeaders, payload);
10731
- });
10732
- }
10733
- }
10734
-
10735
10749
  class Configuration extends ServiceClient {
10736
10750
  getServiceName() {
10737
10751
  return 'com.appconda.service.configuration';
@@ -13218,5 +13232,47 @@ function getSDKForCurrentUser() {
13218
13232
  });
13219
13233
  }
13220
13234
 
13221
- export { Account, AppcondaException, Applets, AuthenticationFactor, AuthenticatorType, Avatars, Browser, Client, Compression, CreditCard, Databases, ExecutionMethod, Flag, Functions, Graphql, Health, ID, ImageFormat, ImageGravity, IndexType, Locale, Messaging, MessagingProviderType, Name, OAuthProvider, PasswordHash, Permission, Query, RelationMutate, RelationshipType, Role, Runtime, SmtpEncryption, Storage, Teams, Users, getSDKForCurrentUser };
13235
+ const actionClient = createSafeActionClient({
13236
+ handleServerError(e) {
13237
+ /* if (
13238
+ e instanceof ResourceNotFoundError ||
13239
+ e instanceof AuthorizationError ||
13240
+ e instanceof InvalidInputError ||
13241
+ e instanceof UnknownError ||
13242
+ e instanceof AuthenticationError ||
13243
+ e instanceof OperationNotAllowedError ||
13244
+ e instanceof AppcondaException
13245
+ ) {
13246
+ return e.message;
13247
+ } */
13248
+ // eslint-disable-next-line no-console -- This error needs to be logged for debugging server-side errors
13249
+ console.error("SERVER ERROR: ", e);
13250
+ return DEFAULT_SERVER_ERROR_MESSAGE;
13251
+ },
13252
+ });
13253
+ /* export const authenticatedActionClient = actionClient.use(async ({ next }) => {
13254
+ const session = await getServerSession(authOptions);
13255
+ if (!session?.user) {
13256
+ throw new AuthenticationError("Not authenticated");
13257
+ }
13258
+
13259
+ const userId = session.user.id;
13260
+
13261
+ const user = await getUser(userId);
13262
+ if (!user) {
13263
+ throw new AuthorizationError("User not found");
13264
+ }
13265
+
13266
+ return next({ ctx: { user } });
13267
+ });
13268
+ */
13269
+
13270
+ const getAllNodesAction = actionClient
13271
+ // .schema(listModelsSchema)
13272
+ .action((_a) => __awaiter(void 0, [_a], void 0, function* ({ parsedInput }) {
13273
+ const { node } = yield getSDKForCurrentUser();
13274
+ return yield node.GetAllNodes();
13275
+ }));
13276
+
13277
+ export { Account, AppcondaException, Applets, AuthenticationFactor, AuthenticatorType, Avatars, Browser, Client, Compression, CreditCard, Databases, ExecutionMethod, Flag, Functions, Graphql, Health, ID, ImageFormat, ImageGravity, IndexType, Locale, Messaging, MessagingProviderType, Name, OAuthProvider, PasswordHash, Permission, Query, RelationMutate, RelationshipType, Role, Runtime, SmtpEncryption, Storage, Teams, Users, Waitlist, getAllNodesAction, getSDKForCurrentUser };
13222
13278
  //# sourceMappingURL=sdk.js.map