@eduzz/miau-client 0.0.21 → 1.0.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.
@@ -25,6 +25,7 @@ __export(index_exports, {
25
25
  SecretEnvValues: () => SecretEnvValues,
26
26
  UserPermissions: () => UserPermissions,
27
27
  envMap: () => envMap,
28
+ envs: () => envs,
28
29
  expirationOptions: () => expirationOptions,
29
30
  expirationOptionsValues: () => expirationOptionsValues,
30
31
  expirationTimeToDate: () => expirationTimeToDate,
@@ -139,10 +140,15 @@ var expirationTimeToDate = (option) => {
139
140
  };
140
141
 
141
142
  // src/types/Environments.ts
143
+ var envs = {
144
+ development: "Development",
145
+ test: "Testing",
146
+ production: "Production"
147
+ };
142
148
  var networks = {
143
- development: "10.11.0.0/16",
144
- test: "10.201.0.0/16",
145
- production: "10.150.0.0/16"
149
+ development: "127.0.0.0/8",
150
+ test: "127.0.0.0/8",
151
+ production: "127.0.0.0/8"
146
152
  };
147
153
  var SecretEnvValues = ["development", "test", "production"];
148
154
  var envMap = {
@@ -169,6 +175,7 @@ var UserPermissions = {
169
175
  SecretEnvValues,
170
176
  UserPermissions,
171
177
  envMap,
178
+ envs,
172
179
  expirationOptions,
173
180
  expirationOptionsValues,
174
181
  expirationTimeToDate,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/types/Resource.ts", "../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js", "../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js", "../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js", "../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addDays.js", "../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMilliseconds.js", "../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addHours.js", "../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMonths.js", "../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addYears.js", "../src/types/Secret.ts", "../src/types/Environments.ts", "../src/types/User.ts"],
4
- "sourcesContent": ["export * from './types/Application';\nexport * from './types/Resource';\nexport * from './types/Secret';\nexport * from './types/Permission';\nexport * from './types/Request';\nexport * from './types/Environments';\nexport * from './types/User';\n", "export const ResourceProtocols = ['http'] as const;\nexport type ResourceProtocol = (typeof ResourceProtocols)[number];\n\nexport const HttpMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS'] as const;\nexport type HttpMethod = (typeof HttpMethods)[number];\n\nexport type Resource = {\n id?: string;\n protocol: ResourceProtocol;\n method: HttpMethod;\n path: string;\n};\n", "/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n", "import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date>(date: DateType): DateType {\n * return constructFrom(\n * date, // Use constructor from the given date\n * date.getTime() // Use the date value to create a new date\n * );\n * }\n */\nexport function constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n\n if (date instanceof Date) return new date.constructor(value);\n\n return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n", "import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * Starting from v3.7.0, it clones a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument, context) {\n // [TODO] Get rid of `toDate` or `constructFrom`?\n return constructFrom(context || argument, argument);\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n", "import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addDays} function options.\n */\n\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be added.\n * @param options - An object with options\n *\n * @returns The new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n if (!amount) return _date;\n\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n", "import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMilliseconds} function options.\n */\n\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of milliseconds to be added.\n * @param options - The options object\n *\n * @returns The new date with the milliseconds added\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nexport function addMilliseconds(date, amount, options) {\n return constructFrom(options?.in || date, +toDate(date) + amount);\n}\n\n// Fallback for modularized imports:\nexport default addMilliseconds;\n", "import { addMilliseconds } from \"./addMilliseconds.js\";\nimport { millisecondsInHour } from \"./constants.js\";\n\n/**\n * The {@link addHours} function options.\n */\n\n/**\n * @name addHours\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of hours to be added\n * @param options - An object with options\n *\n * @returns The new date with the hours added\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\nexport function addHours(date, amount, options) {\n return addMilliseconds(date, amount * millisecondsInHour, options);\n}\n\n// Fallback for modularized imports:\nexport default addHours;\n", "import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMonths} function options.\n */\n\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be added.\n * @param options - The options object\n *\n * @returns The new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n *\n * // Add one month to 30 January 2023:\n * const result = addMonths(new Date(2023, 0, 30), 1)\n * //=> Tue Feb 28 2023 00:00:00\n */\nexport function addMonths(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n const dayOfMonth = _date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());\n endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n const daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n _date.setFullYear(\n endOfDesiredMonth.getFullYear(),\n endOfDesiredMonth.getMonth(),\n dayOfMonth,\n );\n return _date;\n }\n}\n\n// Fallback for modularized imports:\nexport default addMonths;\n", "import { addMonths } from \"./addMonths.js\";\n\n/**\n * The {@link addYears} function options.\n */\n\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be added.\n * @param options - The options\n *\n * @returns The new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport function addYears(date, amount, options) {\n return addMonths(date, amount * 12, options);\n}\n\n// Fallback for modularized imports:\nexport default addYears;\n", "import { addDays } from 'date-fns/addDays';\nimport { addHours } from 'date-fns/addHours';\nimport { addMonths } from 'date-fns/addMonths';\nimport { addYears } from 'date-fns/addYears';\n\nexport type Secret = {\n id?: string;\n applicationId: string;\n name: string;\n value: string;\n allowedNetwork: string;\n environment: string;\n expiresAt?: Date;\n createdAt: Date;\n updatedAt: Date;\n deletedAt?: Date;\n};\n\nexport const expirationOptions = {\n 'Forever': 'forever',\n 'One hour': 'oneHour',\n 'Six hours': 'sixHours',\n 'Twelve hours': 'twelveHours',\n 'One day': 'oneDay',\n 'One week': 'sevenDays',\n 'One month': 'oneMonth',\n 'Six months': 'sixMonths',\n 'One year': 'oneYear'\n} as const;\n\nexport const expirationOptionsValues = Object.values(expirationOptions);\nexport type ValidExpirationOption = (typeof expirationOptions)[keyof typeof expirationOptions];\n\nconst conversionMap = {\n forever: () => undefined,\n oneHour: () => addHours(new Date(), 1),\n sixHours: () => addHours(new Date(), 6),\n twelveHours: () => addHours(new Date(), 12),\n oneDay: () => addDays(new Date(), 1),\n sevenDays: () => addDays(new Date(), 7),\n oneMonth: () => addMonths(new Date(), 1),\n sixMonths: () => addMonths(new Date(), 6),\n oneYear: () => addYears(new Date(), 1)\n};\n\nexport const expirationTimeToDate = (option: ValidExpirationOption): Date | undefined => {\n return conversionMap[option]() ?? undefined;\n};\n", "export const networks = {\n development: '10.11.0.0/16',\n test: '10.201.0.0/16',\n production: '10.150.0.0/16'\n} as const;\n\nexport const SecretEnvValues = ['development', 'test', 'production'] as const;\nexport type SecretEnv = (typeof SecretEnvValues)[number];\n\nexport const envMap: Record<SecretEnv, string> = {\n development: 'd',\n test: 'q',\n production: 'p'\n};\n", "export const UserPermissions = {\n admin: 'Administrator',\n manageApplications: 'Manage Applications',\n deleteApplications: 'Delete Applications',\n managePermissions: 'Manage Permissions',\n manageResources: 'Manage Resources',\n manageMetadata: 'Manage Metadata',\n createSecrets: 'Create Secrets',\n deleteSecrets: 'Delete Secrets'\n} as const;\n\nexport type UserPermission = keyof typeof UserPermissions;\n\nexport type User = {\n id?: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S,oBAAI,KAAK,GAAG,CAAC;AAAA,EACtC,aAAa,MAAM,SAAS,oBAAI,KAAK,GAAG,EAAE;AAAA,EAC1C,QAAQ,MAAM,QAAQ,oBAAI,KAAK,GAAG,CAAC;AAAA,EACnC,WAAW,MAAM,QAAQ,oBAAI,KAAK,GAAG,CAAC;AAAA,EACtC,UAAU,MAAM,UAAU,oBAAI,KAAK,GAAG,CAAC;AAAA,EACvC,WAAW,MAAM,UAAU,oBAAI,KAAK,GAAG,CAAC;AAAA,EACxC,SAAS,MAAM,SAAS,oBAAI,KAAK,GAAG,CAAC;AACvC;AAEO,IAAM,uBAAuB,CAAC,WAAoD;AACvF,SAAO,cAAc,MAAM,EAAE,KAAK;AACpC;;;AC/CO,IAAM,WAAW;AAAA,EACtB,aAAa;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AACd;AAEO,IAAM,kBAAkB,CAAC,eAAe,QAAQ,YAAY;AAG5D,IAAM,SAAoC;AAAA,EAC/C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AACd;;;ACbO,IAAM,kBAAkB;AAAA,EAC7B,OAAO;AAAA,EACP,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,eAAe;AACjB;",
4
+ "sourcesContent": ["export * from './types/Application';\nexport * from './types/Resource';\nexport * from './types/Secret';\nexport * from './types/Permission';\nexport * from './types/Request';\nexport * from './types/Environments';\nexport * from './types/User';\n", "export const ResourceProtocols = ['http'] as const;\nexport type ResourceProtocol = (typeof ResourceProtocols)[number];\n\nexport const HttpMethods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS'] as const;\nexport type HttpMethod = (typeof HttpMethods)[number];\n\nexport type Resource = {\n id?: string;\n protocol: ResourceProtocol;\n method: HttpMethod;\n path: string;\n};\n", "/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n", "import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date>(date: DateType): DateType {\n * return constructFrom(\n * date, // Use constructor from the given date\n * date.getTime() // Use the date value to create a new date\n * );\n * }\n */\nexport function constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n\n if (date instanceof Date) return new date.constructor(value);\n\n return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n", "import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * Starting from v3.7.0, it clones a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument, context) {\n // [TODO] Get rid of `toDate` or `constructFrom`?\n return constructFrom(context || argument, argument);\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n", "import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addDays} function options.\n */\n\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of days to be added.\n * @param options - An object with options\n *\n * @returns The new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport function addDays(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n if (!amount) return _date;\n\n _date.setDate(_date.getDate() + amount);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default addDays;\n", "import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMilliseconds} function options.\n */\n\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of milliseconds to be added.\n * @param options - The options object\n *\n * @returns The new date with the milliseconds added\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nexport function addMilliseconds(date, amount, options) {\n return constructFrom(options?.in || date, +toDate(date) + amount);\n}\n\n// Fallback for modularized imports:\nexport default addMilliseconds;\n", "import { addMilliseconds } from \"./addMilliseconds.js\";\nimport { millisecondsInHour } from \"./constants.js\";\n\n/**\n * The {@link addHours} function options.\n */\n\n/**\n * @name addHours\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of hours to be added\n * @param options - An object with options\n *\n * @returns The new date with the hours added\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\nexport function addHours(date, amount, options) {\n return addMilliseconds(date, amount * millisecondsInHour, options);\n}\n\n// Fallback for modularized imports:\nexport default addHours;\n", "import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link addMonths} function options.\n */\n\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of months to be added.\n * @param options - The options object\n *\n * @returns The new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n *\n * // Add one month to 30 January 2023:\n * const result = addMonths(new Date(2023, 0, 30), 1)\n * //=> Tue Feb 28 2023 00:00:00\n */\nexport function addMonths(date, amount, options) {\n const _date = toDate(date, options?.in);\n if (isNaN(amount)) return constructFrom(options?.in || date, NaN);\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return _date;\n }\n const dayOfMonth = _date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());\n endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);\n const daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n _date.setFullYear(\n endOfDesiredMonth.getFullYear(),\n endOfDesiredMonth.getMonth(),\n dayOfMonth,\n );\n return _date;\n }\n}\n\n// Fallback for modularized imports:\nexport default addMonths;\n", "import { addMonths } from \"./addMonths.js\";\n\n/**\n * The {@link addYears} function options.\n */\n\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be added.\n * @param options - The options\n *\n * @returns The new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport function addYears(date, amount, options) {\n return addMonths(date, amount * 12, options);\n}\n\n// Fallback for modularized imports:\nexport default addYears;\n", "import { addDays } from 'date-fns/addDays';\nimport { addHours } from 'date-fns/addHours';\nimport { addMonths } from 'date-fns/addMonths';\nimport { addYears } from 'date-fns/addYears';\n\nexport type Secret = {\n id?: string;\n applicationId: string;\n name: string;\n value: string;\n allowedNetwork: string;\n environment: string;\n expiresAt?: Date;\n createdAt: Date;\n updatedAt: Date;\n deletedAt?: Date;\n};\n\nexport const expirationOptions = {\n 'Forever': 'forever',\n 'One hour': 'oneHour',\n 'Six hours': 'sixHours',\n 'Twelve hours': 'twelveHours',\n 'One day': 'oneDay',\n 'One week': 'sevenDays',\n 'One month': 'oneMonth',\n 'Six months': 'sixMonths',\n 'One year': 'oneYear'\n} as const;\n\nexport const expirationOptionsValues = Object.values(expirationOptions);\nexport type ValidExpirationOption = (typeof expirationOptions)[keyof typeof expirationOptions];\n\nconst conversionMap = {\n forever: () => undefined,\n oneHour: () => addHours(new Date(), 1),\n sixHours: () => addHours(new Date(), 6),\n twelveHours: () => addHours(new Date(), 12),\n oneDay: () => addDays(new Date(), 1),\n sevenDays: () => addDays(new Date(), 7),\n oneMonth: () => addMonths(new Date(), 1),\n sixMonths: () => addMonths(new Date(), 6),\n oneYear: () => addYears(new Date(), 1)\n};\n\nexport const expirationTimeToDate = (option: ValidExpirationOption): Date | undefined => {\n return conversionMap[option]() ?? undefined;\n};\n", "export const envs = {\n development: 'Development',\n test: 'Testing',\n production: 'Production'\n} as const;\n\nexport const networks = {\n development: '127.0.0.0/8',\n test: '127.0.0.0/8',\n production: '127.0.0.0/8'\n} as const;\n\nexport const SecretEnvValues = ['development', 'test', 'production'] as const;\nexport type SecretEnv = (typeof SecretEnvValues)[number];\n\nexport const envMap: Record<SecretEnv, string> = {\n development: 'd',\n test: 'q',\n production: 'p'\n};\n", "export const UserPermissions = {\n admin: 'Administrator',\n manageApplications: 'Manage Applications',\n deleteApplications: 'Delete Applications',\n managePermissions: 'Manage Permissions',\n manageResources: 'Manage Resources',\n manageMetadata: 'Manage Metadata',\n createSecrets: 'Create Secrets',\n deleteSecrets: 'Delete Secrets'\n} as const;\n\nexport type UserPermission = keyof typeof UserPermissions;\n\nexport type User = {\n id?: string;\n name: string;\n email: string;\n oauthIds: Record<string, string>;\n permissions: UserPermission[];\n createdAt: Date;\n updatedAt: Date;\n deletedAt?: Date;\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,oBAAoB,CAAC,MAAM;AAGjC,IAAM,cAAc,CAAC,OAAO,QAAQ,OAAO,UAAU,SAAS,QAAQ,SAAS;;;ACkC/E,IAAM,aAAa;AAgBnB,IAAM,UAAU,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,KAAK;AAgBjD,IAAM,UAAU,CAAC;AA4BjB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C;;;AC/CO,IAAM,OAAO;AAAA,EAClB,aAAa;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AACd;AAEO,IAAM,WAAW;AAAA,EACtB,aAAa;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AACd;AAEO,IAAM,kBAAkB,CAAC,eAAe,QAAQ,YAAY;AAG5D,IAAM,SAAoC;AAAA,EAC/C,aAAa;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AACd;;;ACnBO,IAAM,kBAAkB;AAAA,EAC7B,OAAO;AAAA,EACP,oBAAoB;AAAA,EACpB,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,eAAe;AACjB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,12 @@
1
+ export declare const envs: {
2
+ readonly development: "Development";
3
+ readonly test: "Testing";
4
+ readonly production: "Production";
5
+ };
1
6
  export declare const networks: {
2
- readonly development: "10.11.0.0/16";
3
- readonly test: "10.201.0.0/16";
4
- readonly production: "10.150.0.0/16";
7
+ readonly development: "127.0.0.0/8";
8
+ readonly test: "127.0.0.0/8";
9
+ readonly production: "127.0.0.0/8";
5
10
  };
6
11
  export declare const SecretEnvValues: readonly ["development", "test", "production"];
7
12
  export type SecretEnv = (typeof SecretEnvValues)[number];
@@ -1 +1 @@
1
- {"version":3,"file":"Environments.d.ts","sourceRoot":"","sources":["../../src/types/Environments.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AAEX,eAAO,MAAM,eAAe,gDAAiD,CAAC;AAC9E,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAI5C,CAAC"}
1
+ {"version":3,"file":"Environments.d.ts","sourceRoot":"","sources":["../../src/types/Environments.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI;;;;CAIP,CAAC;AAEX,eAAO,MAAM,QAAQ;;;;CAIX,CAAC;AAEX,eAAO,MAAM,eAAe,gDAAiD,CAAC;AAC9E,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAI5C,CAAC"}
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@eduzz/miau-client",
3
- "version": "0.0.21",
3
+ "version": "1.0.0",
4
4
  "description": "Eduzz Miau Client",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "scripts": {
8
8
  "lint": "eslint && tsc --noEmit",
9
9
  "build": "esbuild src/index.ts --bundle --sourcemap --platform=node --target=es2020 --outfile=dist/index.js",
10
- "build:types": "tsc --emitDeclarationOnly --outDir dist",
11
- "prepublish": "sh ./scripts/prepare-publish.sh"
10
+ "build:types": "tsc --emitDeclarationOnly --outDir dist"
12
11
  },
13
12
  "devDependencies": {
14
13
  "@eduzz/miau-types": "workspace:*",
@@ -1,7 +1,9 @@
1
1
  #!/bin/sh
2
2
  set -e
3
3
 
4
+ cd ./packages/client
4
5
  mkdir -p ./dist/miau-types
5
6
  cp -r ../types/dist/. dist/miau-types
6
7
  sed -i 's|from '\''@eduzz/miau-types'\''|from '\''./miau-types'\''|g' dist/index.d.ts
8
+
7
9
  # pnpm remove @eduzz/miau-types
@@ -0,0 +1,28 @@
1
+ #!/bin/bash
2
+
3
+ set -e
4
+
5
+ PACKAGE_JSON=$1
6
+
7
+ if [ -z "$PACKAGE_JSON" ]; then
8
+ echo "Usage: $0 <package-json-path>"
9
+ exit 1
10
+ fi
11
+
12
+ VERSION=$(jq -r .version "$PACKAGE_JSON")
13
+ NAME=$(jq -r .name "$PACKAGE_JSON")
14
+
15
+ echo "Checking if $PACKAGE_JSON should be released..."
16
+ echo "Build Version: $VERSION"
17
+
18
+ REMOTE_VERSION=$(npm view "$NAME" version 2>/dev/null || echo "")
19
+
20
+ echo "NPM Version: $REMOTE_VERSION"
21
+
22
+ if [ "$VERSION" = "$REMOTE_VERSION" ] || [ "$(printf '%s\n%s' "$REMOTE_VERSION" "$VERSION" | sort -V | tail -n1)" != "$VERSION" ]; then
23
+ echo "Version already published, skipping..."
24
+ exit 1
25
+ fi
26
+
27
+ echo "New version detected, proceeding with release..."
28
+ exit 0
package/src/middleware.ts CHANGED
@@ -76,6 +76,7 @@ export const miauMiddleware = <T>(
76
76
  }
77
77
 
78
78
  const resources = permission?.resources || [];
79
+
79
80
  const isAllowed = resources.some((resource: Resource) => {
80
81
  return (
81
82
  resource.method.toLowerCase() === req.method.toLowerCase() &&
@@ -1,4 +0,0 @@
1
-
2
- > @eduzz/miau-client@0.0.21 prepublish /home/runner/work/eduzz-miau/eduzz-miau/packages/client
3
- > sh ./scripts/prepare-publish.sh
4
-