@develit-io/backend-sdk 5.21.1 → 5.21.3

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 CHANGED
@@ -130,6 +130,12 @@ const composeBindingName = ({
130
130
  const convertedBindingName = bindingName ? text.toSnakeCase(bindingName) : `${text.toSnakeCase(resourceName)}_${resource}`;
131
131
  return convertedBindingName.toUpperCase();
132
132
  };
133
+ const composeIdentifierName = ({
134
+ resource,
135
+ resourceName
136
+ }) => {
137
+ return `${resourceName}-${resource}`;
138
+ };
133
139
  const composeResourceName = ({
134
140
  project,
135
141
  environment,
@@ -154,7 +160,7 @@ class Infrastructure {
154
160
  async kv(options) {
155
161
  const { resourceName } = options;
156
162
  return await cloudflare.KVNamespace(
157
- resourceName,
163
+ composeIdentifierName({ resourceName, resource: "kv" }),
158
164
  composeKvArguments({
159
165
  resourceName: composeResourceName({
160
166
  project: this.project,
@@ -170,7 +176,7 @@ class Infrastructure {
170
176
  async d1(options) {
171
177
  const { resourceName } = options;
172
178
  return await cloudflare.D1Database(
173
- resourceName,
179
+ composeIdentifierName({ resourceName, resource: "d1" }),
174
180
  composeD1Arguments({
175
181
  resourceName: composeResourceName({
176
182
  project: this.project,
@@ -186,7 +192,7 @@ class Infrastructure {
186
192
  async queue(options) {
187
193
  const { resourceName, deliveryDelay, messageRetentionPeriod } = options;
188
194
  return await cloudflare.Queue(
189
- resourceName,
195
+ composeIdentifierName({ resourceName, resource: "queue" }),
190
196
  composeQueueArguments({
191
197
  resourceName: composeResourceName({
192
198
  project: this.project,
@@ -204,7 +210,7 @@ class Infrastructure {
204
210
  async r2(options) {
205
211
  const { resourceName, storageClass } = options;
206
212
  return await cloudflare.R2Bucket(
207
- resourceName,
213
+ composeIdentifierName({ resourceName, resource: "r2" }),
208
214
  composeR2Arguments({
209
215
  resourceName: composeResourceName({
210
216
  project: this.project,
package/dist/index.mjs CHANGED
@@ -108,6 +108,12 @@ const composeBindingName = ({
108
108
  const convertedBindingName = bindingName ? toSnakeCase(bindingName) : `${toSnakeCase(resourceName)}_${resource}`;
109
109
  return convertedBindingName.toUpperCase();
110
110
  };
111
+ const composeIdentifierName = ({
112
+ resource,
113
+ resourceName
114
+ }) => {
115
+ return `${resourceName}-${resource}`;
116
+ };
111
117
  const composeResourceName = ({
112
118
  project,
113
119
  environment,
@@ -132,7 +138,7 @@ class Infrastructure {
132
138
  async kv(options) {
133
139
  const { resourceName } = options;
134
140
  return await KVNamespace(
135
- resourceName,
141
+ composeIdentifierName({ resourceName, resource: "kv" }),
136
142
  composeKvArguments({
137
143
  resourceName: composeResourceName({
138
144
  project: this.project,
@@ -148,7 +154,7 @@ class Infrastructure {
148
154
  async d1(options) {
149
155
  const { resourceName } = options;
150
156
  return await D1Database(
151
- resourceName,
157
+ composeIdentifierName({ resourceName, resource: "d1" }),
152
158
  composeD1Arguments({
153
159
  resourceName: composeResourceName({
154
160
  project: this.project,
@@ -164,7 +170,7 @@ class Infrastructure {
164
170
  async queue(options) {
165
171
  const { resourceName, deliveryDelay, messageRetentionPeriod } = options;
166
172
  return await Queue(
167
- resourceName,
173
+ composeIdentifierName({ resourceName, resource: "queue" }),
168
174
  composeQueueArguments({
169
175
  resourceName: composeResourceName({
170
176
  project: this.project,
@@ -182,7 +188,7 @@ class Infrastructure {
182
188
  async r2(options) {
183
189
  const { resourceName, storageClass } = options;
184
190
  return await R2Bucket(
185
- resourceName,
191
+ composeIdentifierName({ resourceName, resource: "r2" }),
186
192
  composeR2Arguments({
187
193
  resourceName: composeResourceName({
188
194
  project: this.project,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "5.21.1",
3
+ "version": "5.21.3",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",